-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Make the Pokedex Remember Your Position
Greetings, by following this short tutorial, you will be able to make your Pokédex load up in the exact position it was in the last time you used it.
There are many reasons you might want this kind of functionality, but for me, it was to help out in searching for a roaming Mew, that was implemented similar to the three legendary beasts in gen 2. This made it easy to keep checking Mew's Area page in the Pokédex.
Modify ram/wram.asm:
Find any two empty spaces and insert two new entries as follows:
...
wFossilMon:: db
- ds 2
+wPokedexPlace1:: db
+wPokedexPlace2:: db
; trainer classes start at OPP_ID_OFFSET
wEnemyMonOrTrainerClass:: db
...Modify engine/menus/pokedex.asm:
...
ldh [hJoy7], a
+ ld a, [wPokedexPlace1]
+ ld [wListScrollOffset], a
+ ld a, [wPokedexPlace2]
+ ld [wCurrentMenuItem], a
.setUpGraphics
ld b, SET_PAL_GENERIC
...This is responsible for loading the values stored in the two RAM addresses you allocated in wListScrollOffset, which is the number of the top Pokédex entry currently displayed on screen, and wCurrentMenuItem, which is the offset of the arrow cursor.
...
.exitPokedex
+ ld a, [wListScrollOffset]
+ ld [wPokedexPlace1], a
+ ld a, [wCurrentMenuItem]
+ ld [wPokedexPlace2], a
xor a
ld [wMenuWatchMovingOutOfBounds], a
...This saves those two aforementioned values into the two RAM addresses as you exit the Pokédex.
With this, your Pokédex should now remember it's location.