You've already forked pokecrystal-board
mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-04-09 05:44:44 -07:00
More splitting of main.asm; remove unneeded rept 2
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user