Skip to content

fix: pokedex evo page navigation + tile corruption from summary path#148

Merged
resetes12 merged 1 commit into
resetes12:masterfrom
aloven:fix/pokedex-bugs
Jul 12, 2026
Merged

fix: pokedex evo page navigation + tile corruption from summary path#148
resetes12 merged 1 commit into
resetes12:masterfrom
aloven:fix/pokedex-bugs

Conversation

@aloven

@aloven aloven commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

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:

  • DPAD_UP didn't skip unseen entries (could land on entries with no page to view)
  • Arrow sometimes didn't appear (required numSeen != 0 which failed on fresh saves before battles)
  • Arrow started at index 0 regardless of whether that entry was seen
  • Could select unseen entries with A_BUTTON

New behavior:

  • Arrow always shows when evolutions exist AND at least one has been seen
  • Arrow starts on the first seen entry
  • UP/DOWN skip unseen entries (both directions use while(TRUE) wrap loop)
  • Only moves when numSeen > 1 (no movement if only 1 seen)
  • A_BUTTON only works on seen entries
  • Unseen entries display in gray text (no dash/ball prefix) — clearly "disabled" visually
  • Pre-evolution text also grayed when pre-evo is unseen (e.g. "Wartortle evolves from Squirtle")
image

Tile Corruption Fix (palette.c)

Why the previous fix (8e27909) wasn't sufficient:

The previous commit in OpenPokedexInfoScreen added 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 BeginTimeOfDayPaletteFade which sets gPaletteFade.mode = TIME_OF_DAY_FADE. When the battle ends and returns to the overworld, this mode persists. When the Pokedex is opened, it calls ResetPaletteFade()ResetPaletteFadeControl() — but ResetPaletteFadeControl never reset the mode field. It only reset active, y, targetY, blendColor, etc.

With mode stuck at TIME_OF_DAY_FADE, the Pokedex's UpdatePaletteFade() dispatched to UpdateTimeOfDayPaletteFade() instead of UpdateNormalPaletteFade(). The TOD fade path applies time-of-day tinting to palettes and uses bld0/bld1 pointers (which are stale/NULL), causing palette corruption that manifests as garbled tiles.

Fix: Added gPaletteFade.mode = NORMAL_FADE; to ResetPaletteFadeControl(). 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.).

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.
@resetes12 resetes12 merged commit 8266a44 into resetes12:master Jul 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants