summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIIMarckus <iimarckus@gmail.com>2010-11-19 23:30:32 -0700
committerIIMarckus <iimarckus@gmail.com>2010-11-19 23:30:32 -0700
commitda200058da4717eaca09b979aeb43e1612ac6180 (patch)
tree1636d1e2e2a6ff8a2fd37fce68aa2a9b08f1c165
parent46337960bfe3aa82dcd51cada5b646ee42e2005f (diff)
add ClearScreen function
hg-commit-id: 4f32cac305e9
-rw-r--r--pokered.asm19
1 files changed, 18 insertions, 1 deletions
diff --git a/pokered.asm b/pokered.asm
index 2ccf98a0..c524b2ec 100644
--- a/pokered.asm
+++ b/pokered.asm
@@ -337,7 +337,24 @@ incbin "baserom.gbc",$39E,$1627 - $39E
.GotBank\@
jp $24FD
-INCBIN "baserom.gbc",$1665,$20AF - $1665
+INCBIN "baserom.gbc",$1665,$190F - $1665
+
+ClearScreen: ; 190F
+; clears all tiles in the tilemap,
+; then (writes 1 to $FFD3, waits for it to become 0) three times (XXX why?)
+ ld bc,$0168 ; tilemap size
+ inc b
+ ld hl,$C3A0 ; TILEMAP_START
+ ld a,$7F ; $7F is blank tile
+.loop\@
+ ld [hli],a
+ dec c
+ jr nz,.loop\@
+ dec b
+ jr nz,.loop\@
+ jp Delay3
+
+INCBIN "baserom.gbc",$1922,$20AF - $1922
ConserveBattery: ; 20AF
; loads 1 into $FFD6 and returns when $FFD6 == 0