diff --git a/celeste.s b/celeste.s
index 79b3778..259ee3b 100644
--- a/celeste.s
+++ b/celeste.s
@@ -217,7 +217,10 @@ oamtrashheap:
ds 256
SECTION "Reserve",ROM0[$0]
- ds 256
+
+SECTION "Vblank", ROM0[$40]
+Vblank:
+ reti
SECTION "Header", ROM0[$100]
nop
@@ -242,7 +245,7 @@ ENDM
;
; TODO
-SECTION "Code", ROM0
+SECTION "Code", ROM0[$150]
entry:
ld a, 0
ld [rNR52], a
@@ -335,6 +338,10 @@ copyspritedma:
ld [rBGP], a
ld [rOBP0], a
+ ld a, IEF_VBLANK
+ ldh [rIE], a
+ ei
+
ld a, 2
call playsong
titleloop:
@@ -402,7 +409,7 @@ flashskip:
call gensprites
call adjustsprites
call updatetitleparticles
- call shakescroll
+ call titlescroll
call musstep
call musseq
jp titleloop
@@ -820,13 +827,8 @@ assertfailed:
jr assertfailed
wblank:
- ld a, [rLY]
- cp 144
- jr z, wblank
-wblank2:
- ld a, [rLY]
- cp 144
- jr nz, wblank2
+ halt
+ nop
ret
wblo:
@@ -982,6 +984,13 @@ noshake:
yesshake:
ret
+titlescroll:
+ ld a, -12
+ ld [rSCX], a
+ ld a, -8
+ ld [rSCY], a
+ ret
+
inittitleparticles:
ld hl, titleparticles
ld b, 12
@@ -3392,7 +3401,7 @@ loadborder:
ld hl, $9800
ld de, $0400
loadborderloop:
- ld a, $28
+ ld a, $00
ld [hli], a
dec de
ld a, d
I modified part of the code, mainly changing the border to black—similar to the effect of a GBA port—and to make it easier to center the image on the title screen. I also enabled interrupts to reduce CPU usage, which helps save some battery life when running on actual hardware.
