mirror of
https://github.com/deater/dos33fsprogs.git
synced 2024-06-24 12:29:29 +00:00
rotoplasma: optimize some more
about 6fps theoretical max might be around 10fps
This commit is contained in:
parent
321e21d4d1
commit
278dfb9c3f
|
@ -1,5 +1,7 @@
|
||||||
|
|
||||||
lookup = $d00
|
texture = $d00
|
||||||
|
high_lookup = $e00
|
||||||
|
low_lookup = $f00
|
||||||
|
|
||||||
;col = ( 8.0 + (sintable[xx&0xf])
|
;col = ( 8.0 + (sintable[xx&0xf])
|
||||||
; + 8.0 + (sintable[yy&0xf])
|
; + 8.0 + (sintable[yy&0xf])
|
||||||
|
@ -17,7 +19,7 @@ create_xloop:
|
||||||
adc sinetable,Y
|
adc sinetable,Y
|
||||||
lsr
|
lsr
|
||||||
lookup_smc:
|
lookup_smc:
|
||||||
sta lookup ; always starts at $d00
|
sta texture ; always starts at $d00
|
||||||
|
|
||||||
inc lookup_smc+1
|
inc lookup_smc+1
|
||||||
|
|
||||||
|
@ -39,15 +41,34 @@ cycle_colors:
|
||||||
; cycle colors
|
; cycle colors
|
||||||
|
|
||||||
ldx #0
|
ldx #0
|
||||||
cycle_loop:
|
cycle_texture_loop:
|
||||||
inc lookup,X
|
inc texture,X
|
||||||
|
|
||||||
lda lookup,X ; slow here but faster than doing it
|
lda texture,X ; slow here but faster than doing it
|
||||||
and #$f ; in the draw routine
|
and #$f ; in the draw routine
|
||||||
sta lookup,X
|
sta texture,X
|
||||||
|
|
||||||
inx
|
inx
|
||||||
bne cycle_loop
|
bne cycle_texture_loop
|
||||||
|
|
||||||
|
; make lookup
|
||||||
|
|
||||||
|
ldx #0
|
||||||
|
cycle_lookup_loop:
|
||||||
|
lda texture,X
|
||||||
|
lsr
|
||||||
|
tay
|
||||||
|
color_lookup_smc:
|
||||||
|
lda green_lookup,Y
|
||||||
|
pha
|
||||||
|
and #$f0
|
||||||
|
sta high_lookup,X
|
||||||
|
pla
|
||||||
|
and #$0f
|
||||||
|
sta low_lookup,X
|
||||||
|
|
||||||
|
inx
|
||||||
|
bne cycle_lookup_loop
|
||||||
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
|
@ -94,11 +94,11 @@ refresh_color:
|
||||||
tay
|
tay
|
||||||
|
|
||||||
lda colorlookup,Y
|
lda colorlookup,Y
|
||||||
sta colorlookup_smc+1
|
sta color_lookup_smc+1
|
||||||
sta colorlookup2_smc+1
|
; sta colorlookup2_smc+1
|
||||||
lda colorlookup+1,Y
|
lda colorlookup+1,Y
|
||||||
sta colorlookup_smc+2
|
sta color_lookup_smc+2
|
||||||
sta colorlookup2_smc+2
|
; sta colorlookup2_smc+2
|
||||||
|
|
||||||
at_far_end:
|
at_far_end:
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,9 @@
|
||||||
|
|
||||||
; $2E7CF = 190,415 = 5.25fps first merging
|
; $2E7CF = 190,415 = 5.25fps first merging
|
||||||
; $2D8CF = 186,575 = 5.35fps move mask to rotate not draw
|
; $2D8CF = 186,575 = 5.35fps move mask to rotate not draw
|
||||||
|
; $29CCF = 171,215 = 5.84fps do color conversion outside of loop
|
||||||
|
; $28DCF = 167,375 = 5.97fps two lookup tables for hi/low
|
||||||
|
; $26FCF = 159,695 = 6.26fps remove carry set/clear for fixed point adds
|
||||||
|
|
||||||
CAL = $B0
|
CAL = $B0
|
||||||
CAH = $B1
|
CAH = $B1
|
||||||
|
@ -221,16 +224,10 @@ rotozoom_xloop:
|
||||||
adc CTEMP ; 3
|
adc CTEMP ; 3
|
||||||
tay ; 2
|
tay ; 2
|
||||||
|
|
||||||
lda lookup,Y ; 4
|
lda low_lookup,Y ; 4
|
||||||
; and #$f ; 2
|
|
||||||
lsr ; 2
|
|
||||||
tay ; 2
|
|
||||||
|
|
||||||
colorlookup2_smc:
|
|
||||||
lda green_lookup,Y ; 4
|
|
||||||
and #$0f ; 2
|
|
||||||
;============
|
;============
|
||||||
; 40
|
; 30
|
||||||
rscrn_done:
|
rscrn_done:
|
||||||
|
|
||||||
|
|
||||||
|
@ -270,7 +267,8 @@ rplot2_smc:
|
||||||
|
|
||||||
; xp=xp+ca; fixed point 8.8
|
; xp=xp+ca; fixed point 8.8
|
||||||
|
|
||||||
clc ; 2
|
; always set? also low importance LSB
|
||||||
|
; clc ; 2
|
||||||
lda CAL ; 3
|
lda CAL ; 3
|
||||||
adc XPL ; 3
|
adc XPL ; 3
|
||||||
sta XPL ; 3
|
sta XPL ; 3
|
||||||
|
@ -280,7 +278,8 @@ rplot2_smc:
|
||||||
|
|
||||||
; yp=yp-sa; fixed point 8.8
|
; yp=yp-sa; fixed point 8.8
|
||||||
|
|
||||||
sec ; 2
|
; low importance LSB?
|
||||||
|
; sec ; 2
|
||||||
lda YPL ; 3
|
lda YPL ; 3
|
||||||
sbc SAL ; 3
|
sbc SAL ; 3
|
||||||
sta YPL ; 3
|
sta YPL ; 3
|
||||||
|
@ -385,13 +384,8 @@ rotozoom_xloop2:
|
||||||
adc CTEMP
|
adc CTEMP
|
||||||
tay
|
tay
|
||||||
|
|
||||||
lda lookup,Y
|
lda high_lookup,Y
|
||||||
; and #$f
|
; and #$f0
|
||||||
lsr
|
|
||||||
tay
|
|
||||||
colorlookup_smc:
|
|
||||||
lda green_lookup,Y
|
|
||||||
and #$f0
|
|
||||||
|
|
||||||
;=============================================
|
;=============================================
|
||||||
|
|
||||||
|
@ -426,7 +420,7 @@ rplot22_smc:
|
||||||
|
|
||||||
; xp=xp+ca; 8.8 fixed point
|
; xp=xp+ca; 8.8 fixed point
|
||||||
|
|
||||||
clc ; 2
|
; clc ; 2
|
||||||
lda CAL ; 3
|
lda CAL ; 3
|
||||||
adc XPL ; 3
|
adc XPL ; 3
|
||||||
sta XPL ; 3
|
sta XPL ; 3
|
||||||
|
@ -436,7 +430,7 @@ rplot22_smc:
|
||||||
|
|
||||||
; yp=yp-sa; 8.8 fixed point
|
; yp=yp-sa; 8.8 fixed point
|
||||||
|
|
||||||
sec ; 2
|
; sec ; 2
|
||||||
lda YPL ; 3
|
lda YPL ; 3
|
||||||
sbc SAL ; 3
|
sbc SAL ; 3
|
||||||
sta YPL ; 3
|
sta YPL ; 3
|
||||||
|
|
Loading…
Reference in New Issue
Block a user