# HG changeset patch # User Laurens Holst # Date 1497127247 -7200 # Sat Jun 10 22:40:47 2017 +0200 # Node ID 606b8d4f3a43c0e80c3a0ea1827c92defe955db0 # Parent d15d2c64ec8da3ad48abbe3ea67c7882f5eb03f9 SpanBuffer: Only use h to reference the span buffer. Frees up the l register in the rasterisation loop. diff --git a/src/RunLengthImage.asm b/src/RunLengthImage.asm --- a/src/RunLengthImage.asm +++ b/src/RunLengthImage.asm @@ -73,11 +73,12 @@ 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) diff --git a/src/SpanBuffer.asm b/src/SpanBuffer.asm --- a/src/SpanBuffer.asm +++ b/src/SpanBuffer.asm @@ -22,10 +22,10 @@ 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 @@ 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 @@ ld a,(hl) cp e jr nz,FillLoop - ld l,0 ret ENDP