shithub: pokecrystal

Download patch

ref: 9ea77b0ad8758f100a6577cd43910b2a08776575
parent: d3ecd6d10c61775e2ad384d37f0bca45c4b0c6fa
parent: be7f9c18526cd14df0f2d7d4533c4261575dc399
author: Bryan Bishop <[email protected]>
date: Mon May 14 09:26:57 EDT 2012

Merge pull request #5 from Zhorken/master

Byte fill function

--- 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.