diff options
| author | pikalaxalt <PikalaxALT@gmail.com> | 2016-05-04 11:46:23 -0400 |
|---|---|---|
| committer | pikalaxalt <PikalaxALT@gmail.com> | 2016-05-04 11:46:23 -0400 |
| commit | 3713b71d9e3f3f1bc099d4704910cb9c1d172dcf (patch) | |
| tree | 03069bd1fb4576c16b773b23bab0071aabb7cabd /data | |
| parent | 82f1534925c5fe1f0d876ea88119b0121cfa65a6 (diff) | |
More splitting of main.asm; remove unneeded rept 2
Diffstat (limited to 'data')
| -rw-r--r-- | data/pokedex/entry_pointers.asm | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/data/pokedex/entry_pointers.asm b/data/pokedex/entry_pointers.asm index 4f0f8aff2..5a432e661 100644 --- a/data/pokedex/entry_pointers.asm +++ b/data/pokedex/entry_pointers.asm @@ -1,3 +1,75 @@ +GetDexEntryPointer: ; 44333 +; return dex entry pointer b:de + push hl + ld hl, PokedexDataPointerTable + ld a, b + dec a + ld d, 0 + ld e, a + add hl, de + add hl, de + ld e, [hl] + inc hl + ld d, [hl] + push de + rlca + rlca + and $3 + ld hl, .PokedexEntryBanks + ld d, 0 + ld e, a + add hl, de + ld b, [hl] + pop de + pop hl + ret + +.PokedexEntryBanks: ; 44351 + +GLOBAL PokedexEntries1 +GLOBAL PokedexEntries2 +GLOBAL PokedexEntries3 +GLOBAL PokedexEntries4 + + db BANK(PokedexEntries1) + db BANK(PokedexEntries2) + db BANK(PokedexEntries3) + db BANK(PokedexEntries4) + +GetDexEntryPagePointer: ; 44355 + call GetDexEntryPointer ; b:de + push hl + ld h, d + ld l, e +; skip species name +.loop1 + ld a, b + call GetFarByte + inc hl + cp "@" + jr nz, .loop1 +; skip height and weight +rept 4 + inc hl +endr +; if c != 1: skip entry + dec c + jr z, .done +; skip entry +.loop2 + ld a, b + call GetFarByte + inc hl + cp "@" + jr nz, .loop2 + +.done + ld d, h + ld e, l + pop hl + ret + +PokedexDataPointerTable: ; 0x44378 ; Pointers to all the Pokedex entries. dw BulbasaurPokedexEntry |
