mirror of
https://github.com/deater/dos33fsprogs.git
synced 2024-06-27 07:29:29 +00:00
plasma: more opt
This commit is contained in:
parent
944b3d4255
commit
d62dba27ec
|
@ -10,6 +10,7 @@
|
||||||
; 173 bytes = assume constants on same page
|
; 173 bytes = assume constants on same page
|
||||||
; 171 bytes = optimize save/load of loop index
|
; 171 bytes = optimize save/load of loop index
|
||||||
; 169 bytes = optimize multiply by 8
|
; 169 bytes = optimize multiply by 8
|
||||||
|
; 166 bytes = separate common sin code
|
||||||
|
|
||||||
qint = $EBF2 ; convert FAC to 32-bit int?
|
qint = $EBF2 ; convert FAC to 32-bit int?
|
||||||
fadd = $E7BE ; FAC = (Y:A)+FAC
|
fadd = $E7BE ; FAC = (Y:A)+FAC
|
||||||
|
@ -120,14 +121,10 @@ sin_loop:
|
||||||
sin_table_input1_smc:
|
sin_table_input1_smc:
|
||||||
lda #<one_input
|
lda #<one_input
|
||||||
|
|
||||||
ldy #>one_input
|
jsr sin_common
|
||||||
jsr fmult ; FAC=FAC*(constant from RAM)
|
|
||||||
|
|
||||||
jsr sin ; FAC=sin(FAC)
|
; thirtytwo or twentyfour
|
||||||
|
|
||||||
; 32 or 24
|
|
||||||
lda #<thirty_two
|
lda #<thirty_two
|
||||||
ldy #>thirty_two
|
|
||||||
jsr fmult ; FAC=constant*FAC
|
jsr fmult ; FAC=constant*FAC
|
||||||
|
|
||||||
|
|
||||||
|
@ -140,14 +137,11 @@ sin_table_input1_smc:
|
||||||
|
|
||||||
sin_table_input3_smc:
|
sin_table_input3_smc:
|
||||||
lda #<two_input
|
lda #<two_input
|
||||||
ldy #>two_input
|
|
||||||
jsr fmult ; FAC=FAC*(constant from RAM)
|
|
||||||
|
|
||||||
jsr sin ; FAC=sin(FAC)
|
jsr sin_common
|
||||||
|
|
||||||
; always 16
|
; always 16
|
||||||
lda #<sixteen
|
lda #<sixteen
|
||||||
ldy #>sixteen
|
|
||||||
jsr fmult ; FAC=constant*FAC
|
jsr fmult ; FAC=constant*FAC
|
||||||
|
|
||||||
; add first sine
|
; add first sine
|
||||||
|
@ -177,29 +171,23 @@ sin_table_dest_smc:
|
||||||
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.if 0
|
|
||||||
sin_common:
|
|
||||||
lda OURX
|
|
||||||
jsr float ; FAC = float(OURX)
|
|
||||||
|
|
||||||
; 1, 2, 4, 3, 3, 8
|
;==============================
|
||||||
sin_table_input1_smc:
|
; sin_common
|
||||||
lda #<one_input
|
;==============================
|
||||||
sin_table_input2_smc:
|
; A = low byte for input multiplier
|
||||||
|
sin_common:
|
||||||
|
|
||||||
ldy #>one_input
|
ldy #>one_input
|
||||||
jsr fmult ; FAC=FAC*(constant from RAM)
|
jsr fmult ; FAC=FAC*(constant from RAM)
|
||||||
|
|
||||||
jsr sin ; FAC=sin(FAC)
|
jsr sin ; FAC=sin(FAC)
|
||||||
|
|
||||||
; 32, 16, 32, 16, 32, 24
|
|
||||||
|
|
||||||
; 32 or 24
|
; 32 or 24
|
||||||
lda #<thirty_two
|
|
||||||
ldy #>thirty_two
|
ldy #>thirty_two
|
||||||
jmp fmult ; FAC=constant*FAC
|
|
||||||
|
|
||||||
; tail call
|
rts
|
||||||
.endif
|
|
||||||
|
|
||||||
sixteen:
|
sixteen:
|
||||||
.byte $85,$00,$00,$00,$00
|
.byte $85,$00,$00,$00,$00
|
||||||
|
|
Loading…
Reference in New Issue
Block a user