2018-06-24 07:09:41 -07:00
|
|
|
GetPredefPointer::
|
2018-01-23 14:39:09 -08:00
|
|
|
; Return the bank and address of wPredefID in a and wPredefAddress.
|
2015-07-20 08:28:05 -07:00
|
|
|
|
|
|
|
; Save hl for later (back in Predef)
|
|
|
|
ld a, h
|
2020-12-23 13:29:30 -08:00
|
|
|
ld [wPredefHL], a
|
2015-07-20 08:28:05 -07:00
|
|
|
ld a, l
|
2020-12-23 13:29:30 -08:00
|
|
|
ld [wPredefHL + 1], a
|
2015-07-20 08:28:05 -07:00
|
|
|
|
|
|
|
push de
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wPredefID]
|
2015-07-20 08:28:05 -07:00
|
|
|
ld e, a
|
|
|
|
ld d, 0
|
|
|
|
ld hl, PredefPointers
|
2016-05-10 09:31:49 -07:00
|
|
|
add hl, de
|
|
|
|
add hl, de
|
|
|
|
add hl, de
|
2015-07-20 08:28:05 -07:00
|
|
|
pop de
|
|
|
|
|
|
|
|
ld a, [hli]
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wPredefAddress + 1], a
|
2015-07-20 08:28:05 -07:00
|
|
|
ld a, [hli]
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wPredefAddress], a
|
2015-07-20 08:28:05 -07:00
|
|
|
ld a, [hl]
|
|
|
|
|
|
|
|
ret
|
|
|
|
|
2018-01-15 11:11:11 -08:00
|
|
|
INCLUDE "data/predef_pointers.asm"
|