fix: pokedex evo page navigation + tile corruption from summary path#148
Merged
Conversation
1. Evo page DPAD_UP now skips unseen entries (matching DPAD_DOWN behavior). Arrow starts on first seen entry instead of always position 0. 2. ResetPaletteFadeControl now resets gPaletteFade.mode to NORMAL_FADE. Previously, TIME_OF_DAY_FADE mode persisted after leaving the overworld, causing palette corruption when the Pokedex's UpdatePaletteFade ran the time-of-day blending path on non-overworld screens.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Noticed the tile corruption issue from Summary > Pokedex still happening rarely. this should resolve it.
Bigger fix here is the Pokedex evos screen. I noticed it was all messed up on Eevees page if you had seen only a couple Eeveelutions, not including the first (Vaporeon) the engine would start the cursor on Vaporeon (and let you see the page which is wrong) and then struggle to get to the entries you DID see, and then break on the way up and let you see more eevelutions that werent seen in the dex. this both takes care of the arrow placement/navigation bug, and adds a better UX by dimming the unseen pages and removing the '-' to reinforce they arent selectable, its just read-only text for reference.
Description:
Evo Page Navigation Fix
Fixes broken up/down navigation on the Pokedex EVO page:
Problems fixed:
numSeen != 0which failed on fresh saves before battles)New behavior:
while(TRUE)wrap loop)numSeen > 1(no movement if only 1 seen)Tile Corruption Fix (palette.c)
Why the previous fix (8e27909) wasn't sufficient:
The previous commit in
OpenPokedexInfoScreenadded VRAM clearing (DmaFillLarge16) and palette resets. This fixed corruption from leftover sprite/tile data. However, the corruption still occurred specifically after battles because:The battle system uses
BeginTimeOfDayPaletteFadewhich setsgPaletteFade.mode = TIME_OF_DAY_FADE. When the battle ends and returns to the overworld, this mode persists. When the Pokedex is opened, it callsResetPaletteFade()→ResetPaletteFadeControl()— butResetPaletteFadeControlnever reset themodefield. It only reset active, y, targetY, blendColor, etc.With
modestuck atTIME_OF_DAY_FADE, the Pokedex'sUpdatePaletteFade()dispatched toUpdateTimeOfDayPaletteFade()instead ofUpdateNormalPaletteFade(). The TOD fade path applies time-of-day tinting to palettes and usesbld0/bld1pointers (which are stale/NULL), causing palette corruption that manifests as garbled tiles.Fix: Added
gPaletteFade.mode = NORMAL_FADE;toResetPaletteFadeControl(). This ensures any screen that resets palette fade state also gets a clean fade mode, regardless of what mode was active before (overworld TOD, fast fade, hardware fade, etc.).