From 71bc1436876d72a38c4d69cc2b9ce9c94f82d376 Mon Sep 17 00:00:00 2001 From: yenatch Date: Wed, 30 Jan 2013 01:38:32 -0500 Subject: [PATCH] A couple more general functions --- main.asm | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) 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]