More consistent data tables

This commit is contained in:
Remy Oukaour
2017-12-11 22:59:30 -05:00
parent f1f84743f7
commit 213dcc70d7
32 changed files with 653 additions and 583 deletions

View File

@@ -1,77 +1,5 @@
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.
; entries correspond to constants/pokemon_constants.asm
dw BulbasaurPokedexEntry
dw IvysaurPokedexEntry
dw VenusaurPokedexEntry
@@ -323,3 +251,4 @@ PokedexDataPointerTable: ; 0x44378
dw LugiaPokedexEntry
dw HoOhPokedexEntry
dw CelebiPokedexEntry
; 0x4456e