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