summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLynn "Zhorken" Vaughan <zhorken@gmail.com>2012-05-14 16:16:20 -0400
committerLynn "Zhorken" Vaughan <zhorken@gmail.com>2012-05-14 16:17:18 -0400
commitbe7f9c18526cd14df0f2d7d4533c4261575dc399 (patch)
tree4345b4507ed2af98d2e9ce38d99c9485346777a6
parentd3ecd6d10c61775e2ad384d37f0bca45c4b0c6fa (diff)
Add a byte fill function.
-rw-r--r--main.asm16
1 files changed, 15 insertions, 1 deletions
diff --git a/main.asm b/main.asm
index 1d507d16f..285327f04 100644
--- a/main.asm
+++ b/main.asm
@@ -1,6 +1,20 @@
SECTION "bank0",HOME
-INCBIN "baserom.gbc",$0,$304d
+INCBIN "baserom.gbc",$0,$3041
+
+ByteFill: ; 0x3041
+; fill BC bytes with the value of A, starting at HL
+ inc b ; we bail *when* b hits 0, so include the last run
+ inc c ; same thing; include last byte
+ jr .HandleLoop
+.PutByte
+ ld [hli], a
+.HandleLoop
+ dec c
+ jr nz, .PutByte
+ dec b
+ jr nz, .PutByte
+ ret
GetFarByte: ; 0x304d
; retrieve a single byte from a:hl, and return it in a.