pokegold-spaceworld/engine/predef.asm
luckytyphlosion e1659ecd41 Introduce linkerscript.
Addresses of sections will now be added to the linkerscript via `org`, and the section name will be the path/to/file. If there is more than one section in the file, then add a @SectionName after the path/to/file to describe the section.
2018-07-03 17:07:05 -04:00

36 lines
503 B
NASM

INCLUDE "constants.asm"
; if DEBUG
SECTION "engine/predef.asm", ROMX
; else
; SECTION "Predef pointers", ROMX[$62AD], BANK[$01]
; endc
GetPredefPointer:: ; 1:62b0
ld a, h
ld [wPredefHL], a
ld a, l
ld [wPredefHL + 1], a
ld hl, wPredefDE
ld a, d
ld [hli], a
ld a, e
ld [hli], a
ld a, b
ld [hli], a
ld [hl], c
ld a, [wPredefID]
ld e, a
ld d, 0
ld hl, PredefPointers
add hl, de
add hl, de
add hl, de
ld a, [hli]
ld e, [hl]
inc hl
ld d, [hl]
ret
INCLUDE "data/predef_pointers.inc"