Move things to stack, anticipating support for multicore rendering.

This commit is contained in:
Veikko Sariola
2020-05-24 00:32:49 +03:00
parent 5c25eacd08
commit 457c1fdc32
6 changed files with 93 additions and 75 deletions

View File

@ -416,11 +416,6 @@ su_op_delay_loop:
;-------------------------------------------------------------------------------
; Delay data
;-------------------------------------------------------------------------------
SECT_BSS(sudelbuf)
EXPORT MANGLE_DATA(su_delay_buffer)
resb NUM_DELAY_LINES*su_delayline_wrk.size
SECT_DATA(suconst)
%ifndef C_DC_CONST

View File

@ -17,7 +17,7 @@ EXPORT MANGLE_FUNC(su_op_advance,0) ; Stack: addr voice wrkptr valptr comptr
add WRK, su_voice.size ; move to next voice
mov [_SP+su_stack.wrk], WRK ; update stack
mov ecx, [_SP+su_stack.voiceno] ; ecx = voice
apply bt dword,su_polyphony_bitmask,{,ecx} ; if voice bit of su_polyphonism not set
bt dword [_SP+su_stack.polyphony], ecx ; if voice bit of su_polyphonism not set
jnc su_op_advance_next_instrument ; goto next_instrument
mov VAL, PTRWORD [_SP+su_stack.val] ; rollback to where we were earlier
mov COM, PTRWORD [_SP+su_stack.com]

View File

@ -9,16 +9,16 @@
SECT_TEXT(suopout)
EXPORT MANGLE_FUNC(su_op_out,0) ; l r
mov _AX, PTRWORD su_synth_obj + su_synth.left
mov _AX, [_SP + su_stack.synth]
%ifdef INCLUDE_STEREO_OUT
jnc su_op_out_mono
call su_op_out_mono
add _AX, 4
su_op_out_mono:
%endif
fmul dword [INP+su_out_ports.gain] ; g*l
fadd dword [_AX] ; g*l+o
fstp dword [_AX] ; o'=g*l+o
fmul dword [INP + su_out_ports.gain] ; g*l
fadd dword [_AX + su_synth.left] ; g*l+o
fstp dword [_AX + su_synth.left] ; o'=g*l+o
ret
%endif ; SU_OUT_ID > -1
@ -51,7 +51,7 @@ su_op_send_mono:
%ifdef INCLUDE_GLOBAL_SEND
test _AX, SEND_GLOBAL
jz su_op_send_skipglobal
mov _CX, PTRWORD su_synth_obj
mov _CX, [_SP + su_stack.synth]
su_op_send_skipglobal:
%endif
test _AX, SEND_POP ; if the SEND_POP bit is not set

View File

@ -75,12 +75,16 @@ kmENV_func_leave2:
SECT_TEXT(sunoise)
EXPORT MANGLE_FUNC(su_op_noise,0)
mov _CX,_SP
%ifdef INCLUDE_STEREO_NOISE
jnc su_op_noise_mono
call su_op_noise_mono
su_op_noise_mono:
%endif
call MANGLE_FUNC(FloatRandomNumber,0)
imul eax, [_CX + su_stack.randseed],16007
mov [_CX + su_stack.randseed],eax
fild dword [_CX + su_stack.randseed]
apply fidiv dword,c_RandDiv
fld dword [INP+su_noise_ports.shape]
call su_waveshaper
fld dword [INP+su_noise_ports.gain]