606b8d4f3a43 — Laurens Holst 7 years ago
SpanBuffer: Only use h to reference the span buffer.

Frees up the l register in the rasterisation loop.
2 files changed, 6 insertions(+), 7 deletions(-)

M src/RunLengthImage.asm
M src/SpanBuffer.asm
M src/RunLengthImage.asm +2 -1
@@ 73,11 73,12 @@ RunLengthImage_SetPage:
 	ld (ix + RunLengthImage.page),a
 	ret
 
-; hl = span buffer
+; h = span buffer
 ; ix = this
 RunLengthImage_PlotSpanBuffer: PROC
 	ld e,(ix + RunLengthImage.spansEnd)
 	ld d,(ix + RunLengthImage.spansEnd + 1)
+	ld l,0
 Loop:
 	dec l
 	ld a,(hl)

          
M src/SpanBuffer.asm +4 -6
@@ 22,10 22,10 @@ SpanBuffer: MACRO
 		ds 100H
 	ENDM
 
-; hl = this
-; hl <- this
+; h = this
+; h <- this
 SpanBuffer_Init:
-	dec l
+	ld l,-1
 	ld (hl),255
 	inc h
 	ld (hl),0FFH

          
@@ 33,14 33,13 @@ SpanBuffer_Init:
 	ld (hl),0
 	dec h
 	dec h
-	inc l
 	ret
 
 ; d = x
 ; e = end x
 ; b = z
 ; c = color
-; hl = this
+; h = this
 ; Modifies: af, d, e
 SpanBuffer_Insert: PROC
 	dec e

          
@@ 110,7 109,6 @@ FillLoopNext:
 	ld a,(hl)
 	cp e
 	jr nz,FillLoop
-	ld l,0
 	ret
 	ENDP