pokecrystal-board/engine/predef.asm

30 lines
450 B
NASM
Raw Normal View History

GetPredefPointer:: ; 854b
2018-01-23 14:39:09 -08:00
; Return the bank and address of wPredefID in a and wPredefAddress.
; Save hl for later (back in Predef)
ld a, h
2018-01-23 14:39:09 -08:00
ld [wPredefTemp], a
ld a, l
2018-01-23 14:39:09 -08:00
ld [wPredefTemp + 1], a
push de
2018-01-23 14:39:09 -08:00
ld a, [wPredefID]
ld e, a
ld d, 0
ld hl, PredefPointers
add hl, de
add hl, de
add hl, de
pop de
ld a, [hli]
2018-01-23 14:39:09 -08:00
ld [wPredefAddress + 1], a
ld a, [hli]
2018-01-23 14:39:09 -08:00
ld [wPredefAddress], a
ld a, [hl]
ret
; 856b
INCLUDE "data/predef_pointers.asm"