mirror of
https://github.com/pret/pokegold-spaceworld.git
synced 2026-09-08 08:56:24 -05:00
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.
42 lines
599 B
NASM
42 lines
599 B
NASM
INCLUDE "constants.asm"
|
|
|
|
; if DEBUG
|
|
SECTION "home/farcall.asm", ROM0
|
|
; else
|
|
; SECTION "FarCall", ROM0[$2F6C]
|
|
; endc
|
|
|
|
FarCall_hl:: ; 2fa8
|
|
push af
|
|
ld a, b
|
|
ld [wFarCallBCBuffer], a
|
|
ld a, c
|
|
ld [wFarCallBCBuffer + 1], a
|
|
pop af
|
|
ld b, a
|
|
ldh a, [hROMBank]
|
|
push af
|
|
ld a, b
|
|
call Bankswitch
|
|
ld bc, .return
|
|
push bc
|
|
push hl
|
|
ld a, [wFarCallBCBuffer]
|
|
ld b, a
|
|
ld a, [wFarCallBCBuffer + 1]
|
|
ld c, a
|
|
ret
|
|
|
|
.return
|
|
ld a, b
|
|
ld [wFarCallBCBuffer], a
|
|
ld a, c
|
|
ld [wFarCallBCBuffer + 1], a
|
|
pop bc
|
|
ld a, b
|
|
call Bankswitch
|
|
ld a, [wFarCallBCBuffer]
|
|
ld b, a
|
|
ld a, [wFarCallBCBuffer + 1]
|
|
ld c, a
|
|
ret |