pokecrystal/engine/predef.asm

29 lines
432 B
NASM
Raw Permalink Normal View History

2018-06-24 14:09:41 +00:00
GetPredefPointer::
2018-01-23 22:39:09 +00:00
; Return the bank and address of wPredefID in a and wPredefAddress.
; Save hl for later (back in Predef)
ld a, h
ld [wPredefHL], a
ld a, l
ld [wPredefHL + 1], a
push de
2018-01-23 22:39:09 +00: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 22:39:09 +00:00
ld [wPredefAddress + 1], a
ld a, [hli]
2018-01-23 22:39:09 +00:00
ld [wPredefAddress], a
ld a, [hl]
ret
INCLUDE "data/predef_pointers.asm"