diff options
| author | NobodySociety <43542553+NobodySociety@users.noreply.github.com> | 2021-06-08 16:33:37 -0400 |
|---|---|---|
| committer | NobodySociety <43542553+NobodySociety@users.noreply.github.com> | 2021-06-08 16:33:37 -0400 |
| commit | e300f1d89c0d877ab0ed8af832a4070ff0bea002 (patch) | |
| tree | 627b8d8648c9aa3527a3478d9685b2a417305e3a /Customizable-Pokédex-Color.md | |
| parent | a06b0e381be9e97517ed9a6aa5c0bdd2d8ea1d87 (diff) | |
Updated with a slight optimization
Diffstat (limited to 'Customizable-Pokédex-Color.md')
| -rw-r--r-- | Customizable-Pokédex-Color.md | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/Customizable-Pokédex-Color.md b/Customizable-Pokédex-Color.md index 6290d37..7be8aef 100644 --- a/Customizable-Pokédex-Color.md +++ b/Customizable-Pokédex-Color.md @@ -168,7 +168,7 @@ Here we're adding the color option to the cursor jumptable. You may notice that + call Pokedex_BlackOutBG + ld a, DEXSTATE_COLOR_OPTION + ld [wJumptableIndex], a -+ ret ++ ret .MenuAction_UnownMode: call Pokedex_BlackOutBG @@ -368,7 +368,7 @@ Pokedex_UpdateColorOption: call Pokedex_BlackOutBG ld a, DEXSTATE_MAIN_SCR ld [wJumptableIndex], a - ret + ret .MenuActionJumptable: dw .MenuAction_Red @@ -500,7 +500,18 @@ Searching the file for the default Pokédex color (`PREDEFPAL_POKEDEX`) will sho ```diff _CGB_Pokedex: ld de, wBGPals1 -- ld a, PREDEFPAL_POKEDEX ++ call CheckPokedexColor + call GetPredefPal + call LoadHLPaletteIntoDE ; dex interface palette + ld a, [wCurPartySpecies] + cp $ff + jr nz, .is_pokemon + ld hl, PokedexQuestionMarkPalette + call LoadHLPaletteIntoDE ; green question mark palette + jr .got_palette + ... + ++CheckPokedexColor: + ld a, [wCurPokedexColor] + cp DEXCOLOR_BLUE + jr nz, .Purple @@ -538,28 +549,19 @@ _CGB_Pokedex: + jr .setColor +.Gray + cp DEXCOLOR_GRAY -+ jr nz, .Mewtwo ++ jr nz, .Red + ld a, PREDEFPAL_CGB_BADGE + jr .setColor -+.Mewtwo -+ cp DEXCOLOR_MEWTWO -+ jr nz, .Red -+ ld a, PREDEFPAL_DIPLOMA -+ jr .setColor +.Red + ld a, PREDEFPAL_POKEDEX +.setColor - call GetPredefPal - call LoadHLPaletteIntoDE ; dex interface palette - ld a, [wCurPartySpecies] - cp $ff - jr nz, .is_pokemon - ld hl, .PokedexQuestionMarkPalette - call LoadHLPaletteIntoDE ; green question mark palette - jr .got_palette ++ ret + +PokedexQuestionMarkPalette: +INCLUDE "gfx/pokedex/question_mark.pal" ``` -We replaced the inital load of `PREDEFPAL_POKEDEX` with a chain comparison that finds the correct color and sets it. Do this for the other two mentioned locations and your done. +We replaced the inital load of `PREDEFPAL_POKEDEX` with `CheckPokedexColor` that finds the correct color and sets it. Do this for the other two mentioned locations and your done. ## 5. Closing |
