2020-02-23 13:28:21 +00:00
|
|
|
; rst vectors (called through the rst instruction)
|
|
|
|
|
2020-02-23 19:11:54 +00:00
|
|
|
SECTION "rst0", ROM0[$0000]
|
2020-02-23 13:28:21 +00:00
|
|
|
di
|
|
|
|
jp Start
|
|
|
|
|
2020-04-04 18:42:31 +00:00
|
|
|
SECTION "rst8", ROM0[$0008]
|
|
|
|
FarCall::
|
2020-02-23 13:28:21 +00:00
|
|
|
jp FarCall_hl
|
|
|
|
|
2020-04-04 18:42:31 +00:00
|
|
|
SECTION "rst10", ROM0[$0010]
|
|
|
|
Bankswitch::
|
2020-02-23 13:28:21 +00:00
|
|
|
ldh [hROMBank], a
|
|
|
|
ld [MBC3RomBank], a
|
|
|
|
ret
|
|
|
|
|
2020-02-23 19:11:54 +00:00
|
|
|
SECTION "rst18", ROM0[$0018]
|
2020-02-23 13:28:21 +00:00
|
|
|
rst $38
|
|
|
|
|
2020-02-23 19:11:54 +00:00
|
|
|
SECTION "rst20", ROM0[$0020]
|
2020-02-23 13:28:21 +00:00
|
|
|
rst $38
|
|
|
|
|
2020-04-04 18:42:31 +00:00
|
|
|
SECTION "rst28", ROM0[$0028]
|
|
|
|
JumpTable::
|
2020-02-23 13:28:21 +00:00
|
|
|
push de
|
|
|
|
ld e, a
|
|
|
|
ld d, 0
|
|
|
|
add hl, de
|
|
|
|
add hl, de
|
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
2020-02-23 19:11:54 +00:00
|
|
|
; SECTION "rst30", ROM0[$0030]
|
2020-02-23 13:28:21 +00:00
|
|
|
ld l, a
|
|
|
|
pop de
|
|
|
|
jp hl
|
|
|
|
|
2020-02-23 19:11:54 +00:00
|
|
|
SECTION "rst38", ROM0[$0038]
|
2020-02-23 13:28:21 +00:00
|
|
|
rst $38
|
|
|
|
|
|
|
|
|
|
|
|
; Game Boy hardware interrupts
|
|
|
|
|
2020-02-23 19:11:54 +00:00
|
|
|
SECTION "vblank", ROM0[$0040]
|
2020-02-23 13:28:21 +00:00
|
|
|
jp VBlank
|
|
|
|
|
2020-02-23 19:11:54 +00:00
|
|
|
SECTION "lcd", ROM0[$0048]
|
2020-02-23 13:28:21 +00:00
|
|
|
jp LCD
|
|
|
|
|
2020-02-23 19:11:54 +00:00
|
|
|
SECTION "timer", ROM0[$0050]
|
2020-06-21 20:27:43 +00:00
|
|
|
jp MobileTimer
|
2020-02-23 13:28:21 +00:00
|
|
|
|
2020-02-23 19:11:54 +00:00
|
|
|
SECTION "serial", ROM0[$0058]
|
2020-02-23 13:28:21 +00:00
|
|
|
jp Serial
|
|
|
|
|
2020-02-23 19:11:54 +00:00
|
|
|
SECTION "joypad", ROM0[$0060]
|
2020-02-23 13:33:53 +00:00
|
|
|
jp Joypad
|
2020-02-23 13:28:21 +00:00
|
|
|
|
|
|
|
|
2020-02-23 19:11:54 +00:00
|
|
|
SECTION "Header", ROM0[$0100]
|
2020-02-23 13:28:21 +00:00
|
|
|
|
|
|
|
Start::
|
2020-04-06 17:35:38 +00:00
|
|
|
; Nintendo requires all Game Boy ROMs to begin with a nop ($00) and a jp ($C3)
|
|
|
|
; to the starting address.
|
2020-02-23 13:28:21 +00:00
|
|
|
nop
|
|
|
|
jp _Start
|
|
|
|
|
2020-04-06 17:35:38 +00:00
|
|
|
; The Game Boy cartridge header data is patched over by rgbfix.
|
|
|
|
; This makes sure it doesn't get used for anything else.
|
|
|
|
|
|
|
|
ds $0150 - @, $00
|
2024-01-03 15:58:53 +00:00
|
|
|
|
|
|
|
ENDSECTION
|