ref: fcfed136c6a0c094314bf75441af4d4b43cfc999
parent: a850331d313e0575c48af865eb62dc9c7a3850c6
author: yenatch <yenatch@gmail.com>
date: Wed Sep 17 09:16:34 EDT 2014
Don't define addresses for ROM0 sections in home.asm. Instead, occupy the space reserved for the rom header so there is no collision.
--- a/home.asm
+++ b/home.asm
@@ -1,35 +1,36 @@
+
; The rst vectors are unused.
-SECTION "rst00", ROM0[$00]
+SECTION "rst 00", ROM0 [$00]
rst $38
-SECTION "rst08", ROM0[$08]
+SECTION "rst 08", ROM0 [$08]
rst $38
-SECTION "rst10", ROM0[$10]
+SECTION "rst 10", ROM0 [$10]
rst $38
-SECTION "rst18", ROM0[$18]
+SECTION "rst 18", ROM0 [$18]
rst $38
-SECTION "rst20", ROM0[$20]
+SECTION "rst 20", ROM0 [$20]
rst $38
-SECTION "rst28", ROM0[$28]
+SECTION "rst 28", ROM0 [$28]
rst $38
-SECTION "rst30", ROM0[$30]
+SECTION "rst 30", ROM0 [$30]
rst $38
-SECTION "rst38", ROM0[$38]
+SECTION "rst 38", ROM0 [$38]
rst $38
-; interrupts
-SECTION "vblank", ROM0[$40]
+; Hardware interrupts
+SECTION "vblank", ROM0 [$40]
jp VBlank
-SECTION "lcdc", ROM0[$48]
+SECTION "hblank", ROM0 [$48]
rst $38
-SECTION "timer", ROM0[$50]
+SECTION "timer", ROM0 [$50]
jp Timer
-SECTION "serial", ROM0[$58]
+SECTION "serial", ROM0 [$58]
jp Serial
-SECTION "joypad", ROM0[$60]
+SECTION "joypad", ROM0 [$60]
reti
-SECTION "bank0",ROM0[$61]
+SECTION "Home", ROM0
DisableLCD::
xor a
@@ -82,12 +83,23 @@
INCLUDE "home/copy.asm"
-SECTION "Entry", ROM0[$100]
+
+SECTION "Entry", ROM0 [$100]
+
nop
jp Start
-SECTION "Start", ROM0[$150]
+SECTION "Header", ROM0 [$104]
+
+ ; The header is generated by rgbfix.
+ ; The space here is allocated to prevent code from being overwritten.
+
+ ds $150 - $104
+
+
+
+SECTION "Main", ROM0
Start::
cp GBC