shave some cycles (front load end-of-loop comparisons)

This commit is contained in:
4am 2020-11-22 00:50:43 -05:00
parent e3f65ff220
commit 7ce75c9092

View File

@ -48,18 +48,28 @@ counter = $FF
!source "src/fx/macros.a" !source "src/fx/macros.a"
!source "src/fx/fx.dhgr.common.a" !source "src/fx/fx.dhgr.common.a"
exit=*+3
+COPY_TO_AUXMEM $60, $07 +COPY_TO_AUXMEM $60, $07
lda #(40+24+7-1) ; columns + rows + blocks per row - 1 lda #(40+24+7) ; columns + rows + blocks per row
sta counter sta counter
lda #39 lda #40
sta col sta col
ColLoop ColLoop
lda #23 lda $c000
bmi exit
dec col
dec counter
beq exit
lda #24
sta row sta row
ldy col ldy col
RowLoop RowLoop
dec row
bmi ColLoop
ldx row ldx row
lda hgrrowlo, x lda hgrrowlo, x
sta src sta src
@ -189,14 +199,7 @@ RowLoop
sta $C002 sta $C002
sta $C004 sta $C004
iny iny
dec row jmp RowLoop
+LBPL RowLoop
lda $c000
bmi @exit
dec col
dec counter
+LBNE ColLoop
@exit rts
; next table can not cross a page boundary ; next table can not cross a page boundary
!if <* > $E8 { !if <* > $E8 {