summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaverns4 <Caverns4@users.noreply.github.com>2019-04-13 16:15:48 -0400
committerCaverns4 <Caverns4@users.noreply.github.com>2019-04-13 16:15:48 -0400
commit5440735f7aa5b7582d4cb3ff2f5b28d5537a2140 (patch)
tree3453b80e7ee2b26cb307b82e137967957768e7cf
parent11b9496022939a5dc7eedca609ccbbdac1da5d01 (diff)
Updated Custom order for the Old Pokédex mode (markdown)
-rw-r--r--Custom-order-for-the-Old-Pokédex-mode.md40
1 files changed, 20 insertions, 20 deletions
diff --git a/Custom-order-for-the-Old-Pokédex-mode.md b/Custom-order-for-the-Old-Pokédex-mode.md
index f92a463..c532ed0 100644
--- a/Custom-order-for-the-Old-Pokédex-mode.md
+++ b/Custom-order-for-the-Old-Pokédex-mode.md
@@ -123,28 +123,28 @@ Pokedex_PrintNumberIfOldMode:
```
And add this code to any safe place in the file. I put it right before OldPokedexOrder:
-
-`Pokedex_GetDexNumber:`
-`; Get the intended number of the selected Pokémon.`
- `push bc`
- `push hl ;Store bc and hl to the stack`
+```
+Pokedex_GetDexNumber:
+; Get the intended number of the selected Pokémon.
+ push bc
+ push hl ;Store bc and hl to the stack
- `ld a, [wTempSpecies] ;a = current mon (internal number)`
- `ld b, a ;b = Needed mon (a and b must be matched)`
- `ld c, 0 ;c = index`
- `ld hl,OldPokedexOrder ;hl = OldDexOrder`
+ ld a, [wTempSpecies] ;a = current mon (internal number)
+ ld b, a ;b = Needed mon (a and b must be matched)
+ ld c, 0 ;c = index
+ ld hl,OldPokedexOrder ;hl = OldDexOrder
-`.loop`
- `inc c`
- `ld a, [hli] ;save index of hl to a`
- `cp b ;does a match b?`
- `jr nz, .loop ;if not, loop`
- `ld a, c`
- `ld [wc296], a`
- `pop hl ;Restore bc and hl in reverse order to keep the stack correct.`
- `pop bc`
- `ret`
-
+.loop
+ inc c
+ ld a, [hli] ;save index of hl to a
+ cp b ;does a match b?
+ jr nz, .loop ;if not, loop
+ ld a, c
+ ld [wc296], a
+ pop hl ;Restore bc and hl in reverse order to keep the stack correct.
+ pop bc
+ ret
+```
Before we move on, please note "wc296". This is a point in wRAM where the correct Pokedex number is stored. This variable is read from in some unused code, but never written too or read from otherwise, so it is safe to use in Crystal vanilla.
Edit [pokedex_2.asm](../blob/master/engine/pokedex/pokedex_2.asm):