mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-09-09 09:51:34 -07:00
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:
parent
7bd8d56ff9
commit
44128c5d98
16
home.asm
16
home.asm
@ -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
66
home/header.asm
Normal 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
|
@ -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
|
35
home/rst.asm
35
home/rst.asm
@ -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
|
Loading…
Reference in New Issue
Block a user