summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Bishop <kanzure@gmail.com>2012-05-30 20:47:32 -0500
committerBryan Bishop <kanzure@gmail.com>2012-05-30 20:47:32 -0500
commit4fe5dcee75bc77096c4b601beeff5b5a2113eed9 (patch)
treeb471e7221a929609abbaf6ba8d505fc1404eb5fc
parentda827e57af19684ce263d600428bea145be4ea7d (diff)
copy in DelayFrame from pokered
-rw-r--r--main.asm18
1 files changed, 17 insertions, 1 deletions
diff --git a/main.asm b/main.asm
index 43e4ee855..1eb0d4c23 100644
--- a/main.asm
+++ b/main.asm
@@ -8,7 +8,23 @@ SECTION "romheader",HOME[$100]
SECTION "start",HOME[$150]
-INCBIN "baserom.gbc",$150,$52f - $150
+INCBIN "baserom.gbc",$150,$45a - $150
+
+DelayFrame: ; 0x45a
+; delay for one frame
+ ld a, $1
+ ld [$cfb3], a ; was H_VBLANKOCCURRED
+
+; wait for the next Vblank, halting to conserve battery
+.halt\@
+ db $76, $00 ; XXX this is a hack--rgbasm adds a nop after this instr even when ints are enabled
+ ld a, [$cfb3]
+ and a
+ jr nz, .halt\@ ; 0x465 $f8
+ ret
+; 0x468
+
+INCBIN "baserom.gbc",$468,$52f - $468
IncGradGBPalTable_01: ; 0x52f
db %11111111 ;BG Pal