Create home/header.asm

Contains what was previously in:
- home/rst.asm
- home/interrupts.asm
- home.asm

All of this should be in a static location in the ROM so it kinda makes
sense together.
This commit is contained in:
mid-kid 2020-02-23 14:28:21 +01:00
parent 7bd8d56ff9
commit 44128c5d98
4 changed files with 67 additions and 66 deletions

View File

@ -1,23 +1,9 @@
INCLUDE "constants.asm"
SECTION "NULL", ROM0
NULL::
INCLUDE "home/rst.asm"
INCLUDE "home/interrupts.asm"
SECTION "Header", ROM0
Start::
nop
jp _Start
INCLUDE "home/header.asm"
SECTION "Home", ROM0

66
home/header.asm Normal file
View File

@ -0,0 +1,66 @@
; rst vectors (called through the rst instruction)
SECTION "rst0", ROM0
di
jp Start
SECTION "rst8", ROM0 ; rst FarCall
jp FarCall_hl
SECTION "rst10", ROM0 ; rst Bankswitch
ldh [hROMBank], a
ld [MBC3RomBank], a
ret
SECTION "rst18", ROM0
rst $38
SECTION "rst20", ROM0
rst $38
SECTION "rst28", ROM0 ; rst JumpTable
push de
ld e, a
ld d, 0
add hl, de
add hl, de
ld a, [hli]
ld h, [hl]
; SECTION "rst30", ROM0
ld l, a
pop de
jp hl
SECTION "rst38", ROM0
rst $38
; Game Boy hardware interrupts
SECTION "vblank", ROM0
jp VBlank
SECTION "lcd", ROM0
jp LCD
SECTION "timer", ROM0
jp Timer
SECTION "serial", ROM0
jp Serial
SECTION "joypad", ROM0
jp JoypadInt
; Game Boy cartridge header
SECTION "Header", ROM0
Start::
nop
jp _Start
; The cartridge header data is filled in by rgbfix.
; This makes sure it doesn't get used.
ds $0150 - $0104

View File

@ -1,16 +0,0 @@
; Game Boy hardware interrupts
SECTION "vblank", ROM0
jp VBlank
SECTION "lcd", ROM0
jp LCD
SECTION "timer", ROM0
jp Timer
SECTION "serial", ROM0
jp Serial
SECTION "joypad", ROM0
jp JoypadInt

View File

@ -1,35 +0,0 @@
; rst vectors
SECTION "rst0", ROM0
di
jp Start
SECTION "rst8", ROM0 ; rst FarCall
jp FarCall_hl
SECTION "rst10", ROM0 ; rst Bankswitch
ldh [hROMBank], a
ld [MBC3RomBank], a
ret
SECTION "rst18", ROM0
rst $38
SECTION "rst20", ROM0
rst $38
SECTION "rst28", ROM0 ; rst JumpTable
push de
ld e, a
ld d, 0
add hl, de
add hl, de
ld a, [hli]
ld h, [hl]
; SECTION "rst30", ROM0
ld l, a
pop de
jp hl
SECTION "rst38", ROM0
rst $38