diff --git a/constants/scgb_constants.asm b/constants/scgb_constants.asm index 247a987..f11b530 100644 --- a/constants/scgb_constants.asm +++ b/constants/scgb_constants.asm @@ -191,6 +191,8 @@ DEF SCGB_DEFAULT EQU $ff const PREDEFPAL_SUNGLOW_CITY_MORN const PREDEFPAL_OCHRE_TOWN const PREDEFPAL_OCHRE_TOWN_MORN + const PREDEFPAL_POKEGEAR_KRIS + const PREDEFPAL_POKEGEAR_TOPAZ DEF NUM_PREDEF_PALS EQU const_value ; SGB system command codes diff --git a/engine/gfx/cgb_layouts.asm b/engine/gfx/cgb_layouts.asm index 32e393f..ca27fb9 100644 --- a/engine/gfx/cgb_layouts.asm +++ b/engine/gfx/cgb_layouts.asm @@ -177,6 +177,9 @@ InitPartyMenuBGPal0: ret _CGB_PokegearPals: + ld a, [wOptions2] + and 1 << MENU_ACCOUNT + jr z, .SGBmode ld a, [wPlayerGender] and a ; MALE jr z, .male @@ -197,6 +200,41 @@ _CGB_PokegearPals: ld a, TRUE ldh [hCGBPalUpdate], a ret + +.SGBmode + ld a, [wPlayerGender] + and a ; MALE + jr z, .male2 + dec a ; FEMALE + jr z, .female + ld a, PREDEFPAL_POKEGEAR_TOPAZ ; topaz palette + jr .got_sgb_pal + +.male2 + ld a, PREDEFPAL_POKEGEAR ; default pokegear interface palette + jr .got_sgb_pal + +.female + ld a, PREDEFPAL_POKEGEAR_KRIS ; kris palette + +.got_sgb_pal + call GetPredefPal + ld de, wBGPals1 +; Copy 8 BG palettes + ld b, 8 +.bg_loop + push hl + call LoadHLPaletteIntoDE + pop hl + dec b + jr nz, .bg_loop +; Copy 6 OB palettes, should be pointing at code from loading the overworld object palettes + ld b, 6 +.ob_loop + call LoadHLOBPaletteIntoDE + dec b + jr nz, .ob_loop + ret _CGB_StatsScreenHPPals: ld de, wBGPals1 @@ -565,7 +603,7 @@ _CGB_MapPals: ; Copy PAL_BG_TEXT and 6 OB palettes ld b, 7 .ob_loop - call .LoadHLOBPaletteIntoDE + call LoadHLOBPaletteIntoDE dec b jr nz, .ob_loop ; Copy PAL_OW_TREE and PAL_OW_ROCK @@ -589,12 +627,12 @@ _CGB_MapPals: jr nc, .bg_darkness inc hl inc hl - call .LoadHLColorIntoDE - call .LoadHLColorIntoDE + call LoadHLColorIntoDE + call LoadHLColorIntoDE dec hl dec hl - call .LoadHLColorIntoDE - call .LoadHLColorIntoDE + call LoadHLColorIntoDE + call LoadHLColorIntoDE .bg_done pop hl ret @@ -602,50 +640,50 @@ _CGB_MapPals: .bg_darkness inc hl inc hl - call .LoadHLColorIntoDE + call LoadHLColorIntoDE inc hl inc hl - call .LoadHLColorIntoDE + call LoadHLColorIntoDE dec hl dec hl - call .LoadHLColorIntoDE + call LoadHLColorIntoDE dec hl dec hl - call .LoadHLColorIntoDE + call LoadHLColorIntoDE jr .bg_done .bg_morn_day ; Lot of commented out code for spaceworld-style mornings. ; ld a, [wTimeOfDayPal] ; cp MORN_F ; jr nz, .bg_day -; call .LoadHLColorIntoDE +; call LoadHLColorIntoDE ; inc hl ; inc hl -; call .LoadHLColorIntoDE +; call LoadHLColorIntoDE ; dec hl ; dec hl -; call .LoadHLColorIntoDE -; call .LoadHLColorIntoDE +; call LoadHLColorIntoDE +; call LoadHLColorIntoDE ; jr .bg_done ;.bg_day call LoadHLPaletteIntoDE jr .bg_done -.LoadHLOBPaletteIntoDE: +LoadHLOBPaletteIntoDE: ; shades 0, 1, 2, 3 -> 0, 0, 1, 3 push hl - call .LoadHLColorIntoDE + call LoadHLColorIntoDE dec hl dec hl - call .LoadHLColorIntoDE - call .LoadHLColorIntoDE + call LoadHLColorIntoDE + call LoadHLColorIntoDE inc hl inc hl - call .LoadHLColorIntoDE + call LoadHLColorIntoDE pop hl ret -.LoadHLColorIntoDE: +LoadHLColorIntoDE: ldh a, [rSVBK] push af ld a, BANK(wBGPals1) diff --git a/gfx/sgb/predef.pal b/gfx/sgb/predef.pal index 1fb9378..268ceb6 100644 --- a/gfx/sgb/predef.pal +++ b/gfx/sgb/predef.pal @@ -142,4 +142,6 @@ RGB 31,31,31, 27,23,01, 12,15,20, 00,00,00 ; PREDEFPAL_SUNGLOW_CITY_MORN # RGB 31,31,31, 31,20,00, 15,20,20, 00,00,00 ; PREDEFPAL_OCHRE_TOWN RGB 31,31,31, 28,17,00, 12,15,20, 00,00,00 ; PREDEFPAL_OCHRE_TOWN_MORN # + RGB 31,31,31, 26,28,31, 17,24,30, 00,00,00 ; PREDEFPAL_POKEGEAR_KRIS + RGB 31,31,31, 29,24,31, 23,17,31, 00,00,00 ; PREDEFPAL_POKEGEAR_TOPAZ \ No newline at end of file