mirror of
https://github.com/pret/pokegold-spaceworld.git
synced 2026-09-29 22:10:13 -04:00
e1659ecd41
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.
47 lines
720 B
NASM
47 lines
720 B
NASM
INCLUDE "constants.asm"
|
|
|
|
; if DEBUG
|
|
SECTION "home/jumptable.asm", ROM0
|
|
; else
|
|
; SECTION "Jumptable functions", ROM0[$3591]
|
|
; endc
|
|
|
|
CallJumptable:: ; 35cd (0:35cd)
|
|
; CallJumptable
|
|
; Call function whose pointer is
|
|
; at index a in 2-byte pointer table
|
|
; pointed to by hl.
|
|
; Clobbers: a, hl
|
|
;
|
|
; This ultimately wound up at rst $28 in
|
|
; GSC
|
|
push de
|
|
ld d, $00
|
|
ld e, a
|
|
add hl, de
|
|
add hl, de
|
|
pop de
|
|
ld a, [hli]
|
|
ld h, [hl]
|
|
ld l, a
|
|
jp hl
|
|
|
|
CallFar_atHL::
|
|
; CallFar_atHL
|
|
; Call the function pointed to by
|
|
; the 3-byte pointer at hl
|
|
; Clobbers: a, hl
|
|
ldh a, [hROMBank]
|
|
push af
|
|
ld a, [hli]
|
|
call Bankswitch
|
|
ld a, [hli]
|
|
ld h, [hl]
|
|
ld l, a
|
|
call .jump
|
|
pop hl
|
|
ld a, h
|
|
call Bankswitch
|
|
ret
|
|
.jump: ; 35eb (0:35eb)
|
|
jp hl |