mirror of
https://github.com/pret/pokered.git
synced 2024-10-23 23:18:23 +00:00
4b853ad676
Each new file builds its own .o, along with separate main.o and home.o, which necessitates many more "exported::" labels.
52 lines
691 B
NASM
Executable file
52 lines
691 B
NASM
Executable file
GetPredefPointer::
|
|
; Store the contents of the register
|
|
; pairs (hl, de, bc) at wPredefRegisters.
|
|
; Then put the bank and address of predef
|
|
; wPredefID in [wPredefBank] and hl.
|
|
|
|
ld a, h
|
|
ld [wPredefRegisters], a
|
|
ld a, l
|
|
ld [wPredefRegisters + 1], a
|
|
|
|
ld hl, wPredefRegisters + 2
|
|
ld a, d
|
|
ld [hli], a
|
|
ld a, e
|
|
ld [hli], a
|
|
|
|
ld a, b
|
|
ld [hli], a
|
|
ld [hl], c
|
|
|
|
ld hl, PredefPointers
|
|
ld de, 0
|
|
|
|
ld a, [wPredefID]
|
|
ld e, a
|
|
add a
|
|
add e
|
|
ld e, a
|
|
jr nc, .nocarry
|
|
inc d
|
|
|
|
.nocarry
|
|
add hl, de
|
|
ld d, h
|
|
ld e, l
|
|
|
|
; get bank of predef routine
|
|
ld a, [de]
|
|
ld [wPredefBank], a
|
|
|
|
; get pointer
|
|
inc de
|
|
ld a, [de]
|
|
ld l, a
|
|
inc de
|
|
ld a, [de]
|
|
ld h, a
|
|
|
|
ret
|
|
|
|
INCLUDE "data/predef_pointers.asm"
|