summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2013-01-30 01:38:32 -0500
committeryenatch <yenatch@gmail.com>2013-01-30 01:38:32 -0500
commit71bc1436876d72a38c4d69cc2b9ce9c94f82d376 (patch)
tree374392f449759d298319666c989e67862160bf02
parent73c374a366dc41c56ca6572fdc0784c84011b8f5 (diff)
A couple more general functions
-rw-r--r--main.asm34
1 files changed, 33 insertions, 1 deletions
diff --git a/main.asm b/main.asm
index 18144c630..193830db7 100644
--- a/main.asm
+++ b/main.asm
@@ -2686,7 +2686,39 @@ CopyData: ; 0x9a52
ret
; 0x9a5b
-INCBIN "baserom.gbc",$9a5b,$c000 - $9a5b
+ClearBytes: ; 0x9a5b
+; clear bc bytes of data starting from de
+ xor a
+ ld [de], a
+ inc de
+ dec bc
+ ld a, c
+ or b
+ jr nz, ClearBytes
+ ret
+; 0x9a64
+
+DrawDefaultTiles: ; 0x9a64
+; Draw 240 tiles (2/3 of the screen) from tiles in VRAM
+ ld hl, $9800 ; BG Map 0
+ ld de, 32 - 20
+ ld a, $80 ; starting tile
+ ld c, 12 + 1
+.line
+ ld b, 20
+.tile
+ ld [hli], a
+ inc a
+ dec b
+ jr nz, .tile
+; next line
+ add hl, de
+ dec c
+ jr nz, .line
+ ret
+; 0x9a7a
+
+INCBIN "baserom.gbc",$9a7a,$c000 - $9a7a
SECTION "bank3",DATA,BANK[$3]