rotoplasma: some optimization

This commit is contained in:
Vince Weaver 2021-01-11 11:02:13 -05:00
parent 70c9c75f01
commit 926d5db11b
2 changed files with 34 additions and 21 deletions

View File

@ -41,6 +41,11 @@ cycle_colors:
ldx #0 ldx #0
cycle_loop: cycle_loop:
inc lookup,X inc lookup,X
lda lookup,X ; slow here but faster than doing it
and #$f ; in the draw routine
sta lookup,X
inx inx
bne cycle_loop bne cycle_loop
@ -121,7 +126,9 @@ plot_lookup_smc:
which_color: .byte $0 which_color: .byte $0
colorlookup: colorlookup:
.word blue_lookup,red_lookup,green_lookup,yellow_lookup .word green_lookup,yellow_lookup,blue_lookup,red_lookup
; blue ; blue
blue_lookup: blue_lookup:

View File

@ -9,6 +9,10 @@
; ANGLE in our case is 0..31 ; ANGLE in our case is 0..31
; SCALE_I/SCALE_F is 8.8 fixed point scale multiplier ; SCALE_I/SCALE_F is 8.8 fixed point scale multiplier
; $2E7CF = 190,415 = 5.25fps first merging
; $2D8CF = 186,575 = 5.35fps move mask to rotate not draw
CAL = $B0 CAL = $B0
CAH = $B1 CAH = $B1
SAL = $B2 SAL = $B2
@ -204,27 +208,29 @@ rotozoom_xloop:
;=================================================================== ;===================================================================
lda XPH lda XPH ; 3
and #$f and #$f ; 2
sta CTEMP sta CTEMP ; 3
lda YPH lda YPH ; 3
asl asl ; 2
asl asl ; 2
asl asl ; 2
asl asl ; 2
clc clc ; 2
adc CTEMP adc CTEMP ; 3
tay tay ; 2
lda lookup,Y ; 4
; and #$f ; 2
lsr ; 2
tay ; 2
lda lookup,Y
and #$f
lsr
tay
colorlookup2_smc: colorlookup2_smc:
lda blue_lookup,Y lda green_lookup,Y ; 4
and #$0f and #$0f ; 2
;============
; 40
rscrn_done: rscrn_done:
@ -380,11 +386,11 @@ rotozoom_xloop2:
tay tay
lda lookup,Y lda lookup,Y
and #$f ; and #$f
lsr lsr
tay tay
colorlookup_smc: colorlookup_smc:
lda blue_lookup,Y lda green_lookup,Y
and #$f0 and #$f0
;============================================= ;=============================================