mirror of
https://github.com/vsariola/sointu.git
synced 2025-06-04 01:28:45 -04:00
Use some of the unused space of synth object for curvoices.
This commit is contained in:
parent
457c1fdc32
commit
2c6f4f44d5
@ -18,13 +18,6 @@
|
|||||||
%endmacro
|
%endmacro
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%ifdef INCLUDE_MULTIVOICE_TRACKS
|
|
||||||
struc trackarray
|
|
||||||
.curvoices resd MAX_TRACKS
|
|
||||||
.size
|
|
||||||
endstruc
|
|
||||||
%endif
|
|
||||||
|
|
||||||
struc su_playerstack ; the structure of stack _as the output sound sees it_
|
struc su_playerstack ; the structure of stack _as the output sound sees it_
|
||||||
.rowtick RESPTR 1 ; which tick within this row are we at
|
.rowtick RESPTR 1 ; which tick within this row are we at
|
||||||
.row RESPTR 1 ; which total row of the song are we at
|
.row RESPTR 1 ; which total row of the song are we at
|
||||||
@ -32,7 +25,6 @@ struc su_playerstack ; the structure of stack _as the output sound sees it_
|
|||||||
.randseed RESPTR 1
|
.randseed RESPTR 1
|
||||||
%ifdef INCLUDE_MULTIVOICE_TRACKS
|
%ifdef INCLUDE_MULTIVOICE_TRACKS
|
||||||
.trackbits RESPTR 1
|
.trackbits RESPTR 1
|
||||||
.trackarray resb trackarray.size
|
|
||||||
%endif
|
%endif
|
||||||
.cleanup
|
.cleanup
|
||||||
%if BITS == 32
|
%if BITS == 32
|
||||||
@ -141,11 +133,7 @@ EXPORT MANGLE_FUNC(su_render,PTRSIZE) ; Stack: ptr
|
|||||||
call su_gmdls_load
|
call su_gmdls_load
|
||||||
%endif
|
%endif
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
%ifdef INCLUDE_MULTIVOICE_TRACKS ; TODO: it's nice to keep the curvoices in stack but it's very unnice having to clear them ourselves
|
%ifdef INCLUDE_MULTIVOICE_TRACKS
|
||||||
sub _SP, trackarray.size; reserve space from stack for the current voiceno
|
|
||||||
mov _DI, _SP
|
|
||||||
mov ecx, trackarray.size/4
|
|
||||||
rep stosd
|
|
||||||
push VOICETRACK_BITMASK
|
push VOICETRACK_BITMASK
|
||||||
%endif
|
%endif
|
||||||
push 1 ; randseed
|
push 1 ; randseed
|
||||||
@ -201,7 +189,7 @@ su_update_voices: ; Stack: retaddr row
|
|||||||
apply {lea _SI,},MANGLE_DATA(su_tracks),_AX,{} ; esi points to the pattern data for current track
|
apply {lea _SI,},MANGLE_DATA(su_tracks),_AX,{} ; esi points to the pattern data for current track
|
||||||
xor eax, eax ; eax is the first voice of next track
|
xor eax, eax ; eax is the first voice of next track
|
||||||
xor ebx, ebx ; ebx is the first voice of current track
|
xor ebx, ebx ; ebx is the first voice of current track
|
||||||
lea _BP, [_SP + su_playerstack.trackarray] ; ebp points to the current_voiceno array
|
mov _BP, PTRWORD su_synth_obj ; ebp points to the current_voiceno array
|
||||||
su_update_voices_trackloop:
|
su_update_voices_trackloop:
|
||||||
movzx eax, byte [_SI] ; eax = current pattern
|
movzx eax, byte [_SI] ; eax = current pattern
|
||||||
imul eax, PATTERN_SIZE ; eax = offset to current pattern data
|
imul eax, PATTERN_SIZE ; eax = offset to current pattern data
|
||||||
@ -217,7 +205,7 @@ su_calculate_voices_loop: ; do {
|
|||||||
push _CX ; Stack: next_instr ptrnrow
|
push _CX ; Stack: next_instr ptrnrow
|
||||||
cmp al, HLD ; anything but hold causes action
|
cmp al, HLD ; anything but hold causes action
|
||||||
je short su_update_voices_nexttrack
|
je short su_update_voices_nexttrack
|
||||||
mov ecx, dword [_BP]
|
mov cl, byte [_BP]
|
||||||
mov edi, ecx
|
mov edi, ecx
|
||||||
add edi, ebx
|
add edi, ebx
|
||||||
shl edi, MAX_UNITS_SHIFT + 6 ; each unit = 64 bytes and there are 1<<MAX_UNITS_SHIFT units + small header
|
shl edi, MAX_UNITS_SHIFT + 6 ; each unit = 64 bytes and there are 1<<MAX_UNITS_SHIFT units + small header
|
||||||
@ -229,7 +217,7 @@ su_calculate_voices_loop: ; do {
|
|||||||
jl su_update_voices_skipreset
|
jl su_update_voices_skipreset
|
||||||
xor ecx,ecx ; curvoice = 0
|
xor ecx,ecx ; curvoice = 0
|
||||||
su_update_voices_skipreset:
|
su_update_voices_skipreset:
|
||||||
mov dword [_BP],ecx
|
mov byte [_BP],cl
|
||||||
add ecx, ebx
|
add ecx, ebx
|
||||||
shl ecx, MAX_UNITS_SHIFT + 6 ; each unit = 64 bytes and there are 1<<MAX_UNITS_SHIFT units + small header
|
shl ecx, MAX_UNITS_SHIFT + 6 ; each unit = 64 bytes and there are 1<<MAX_UNITS_SHIFT units + small header
|
||||||
apply {lea _DI,},su_synth_obj+su_synth.voices,_CX,{}
|
apply {lea _DI,},su_synth_obj+su_synth.voices,_CX,{}
|
||||||
@ -241,8 +229,8 @@ su_update_voices_nexttrack:
|
|||||||
pop _BX ; ebx=first voice of next instrument, Stack: ptrnrow
|
pop _BX ; ebx=first voice of next instrument, Stack: ptrnrow
|
||||||
pop _DX ; edx=patrnrow
|
pop _DX ; edx=patrnrow
|
||||||
add _SI, MAX_PATTERNS
|
add _SI, MAX_PATTERNS
|
||||||
add _BP, 4
|
inc _BP
|
||||||
lea _AX, [_SP + su_playerstack.trackarray + MAX_TRACKS*4]
|
apply {lea _AX,},su_synth_obj,MAX_TRACKS,{}
|
||||||
cmp _BP,_AX
|
cmp _BP,_AX
|
||||||
jl su_update_voices_trackloop
|
jl su_update_voices_trackloop
|
||||||
ret
|
ret
|
||||||
|
@ -246,7 +246,7 @@ endstruc
|
|||||||
; synth struct
|
; synth struct
|
||||||
;-------------------------------------------------------------------------------
|
;-------------------------------------------------------------------------------
|
||||||
struc su_synth
|
struc su_synth
|
||||||
.reserved resd 8 ; this is so that left/right/aux ports are aligned to the input ports of units
|
.curvoices resb 32 ; these are used by the multitrack player to store which voice is playing on which track
|
||||||
.left resd 1
|
.left resd 1
|
||||||
.right resd 1
|
.right resd 1
|
||||||
.aux resd 6 ; 3 auxiliary signals
|
.aux resd 6 ; 3 auxiliary signals
|
||||||
|
Loading…
x
Reference in New Issue
Block a user