This commit is contained in:
2024-06-09 18:44:55 +03:00
parent 342f91c6ca
commit 2a579218a0
26 changed files with 2826 additions and 514 deletions

View File

@ -1,6 +1,6 @@
%define SU_LENGTH_IN_SAMPLES 2703680
%define SU_LENGTH_IN_SAMPLES 3968832
%define SU_SAMPLE_RATE 44100
%define SU_BPM 137.
%define SU_BPM 112.
;-------------------------------------------------------------------------------
; unit struct
@ -61,7 +61,7 @@ endstruc
section .synth_object bss align=256
su_synth_obj:
resb su_synthworkspace.size
resb 40*su_delayline_wrk.size
resb 30*su_delayline_wrk.size
;-------------------------------------------------------------------------------
@ -76,7 +76,7 @@ global _su_render_song@4
_su_render_song@4:
pushad ; Stack: edi, esi, ebp, esp, ebx, edx, ecx, eax, retaddr_su_render_song, OutputBufPtr
xor eax, eax
push 20752 ; Stack: VoiceTrackBitmask, edi, esi, ebp, esp, ebx, edx, ecx, eax, retaddr_su_render_song, OutputBufPtr
push 5792 ; Stack: VoiceTrackBitmask, edi, esi, ebp, esp, ebx, edx, ecx, eax, retaddr_su_render_song, OutputBufPtr
push 1 ; Stack: RandSeed, VoiceTrackBitmask, edi, esi, ebp, esp, ebx, edx, ecx, eax, retaddr_su_render_song, OutputBufPtr
push eax ; Stack: GlobalTick, RandSeed, VoiceTrackBitmask, edi, esi, ebp, esp, ebx, edx, ecx, eax, retaddr_su_render_song, OutputBufPtr
su_render_rowloop: ; loop through every row in the song
@ -85,8 +85,8 @@ su_render_rowloop: ; loop through every row in the song
xor eax, eax ; ecx is the current sample within row
su_render_sampleloop: ; loop through every sample in the row
push eax ; Stack: Sample, Row, GlobalTick, RandSeed, VoiceTrackBitmask, edi, esi, ebp, esp, ebx, edx, ecx, eax, retaddr_su_render_song, OutputBufPtr
push 4572 ; Stack: PolyphonyBitmask, Sample, Row, GlobalTick, RandSeed, VoiceTrackBitmask, edi, esi, ebp, esp, ebx, edx, ecx, eax, retaddr_su_render_song, OutputBufPtr ; does the next voice reuse the current opcodes?
push 17 ; Stack: VoicesRemain, PolyphonyBitmask, Sample, Row, GlobalTick, RandSeed, VoiceTrackBitmask, edi, esi, ebp, esp, ebx, edx, ecx, eax, retaddr_su_render_song, OutputBufPtr
push 1013380 ; Stack: PolyphonyBitmask, Sample, Row, GlobalTick, RandSeed, VoiceTrackBitmask, edi, esi, ebp, esp, ebx, edx, ecx, eax, retaddr_su_render_song, OutputBufPtr ; does the next voice reuse the current opcodes?
push 20 ; Stack: VoicesRemain, PolyphonyBitmask, Sample, Row, GlobalTick, RandSeed, VoiceTrackBitmask, edi, esi, ebp, esp, ebx, edx, ecx, eax, retaddr_su_render_song, OutputBufPtr
mov edx, dword su_synth_obj ; edx points to the synth object
mov ebx, dword su_patch_opcodes ; COM points to vm code
mov esi, dword su_patch_operands ; VAL points to unit params
@ -114,11 +114,11 @@ su_render_sampleloop: ; loop through every sample in the row
pop eax ; eax = Sample, Stack: Row, GlobalTick, RandSeed, VoiceTrackBitmask, edi, esi, ebp, esp, ebx, edx, ecx, eax, retaddr_su_render_song, OutputBufPtr
inc dword [esp + 4] ; increment global time, used by delays
inc eax
cmp eax, 4828
cmp eax, 5906
jl su_render_sampleloop
pop eax ; eax = Row, Stack: GlobalTick, RandSeed, VoiceTrackBitmask, edi, esi, ebp, esp, ebx, edx, ecx, eax, retaddr_su_render_song, OutputBufPtr ; Stack: pushad ptr
inc eax
cmp eax, 560
cmp eax, 672
jl su_render_rowloop
; rewind the stack the entropy of multiple pop eax is probably lower than add
pop eax ; eax = GlobalTick, Stack: RandSeed, VoiceTrackBitmask, edi, esi, ebp, esp, ebx, edx, ecx, eax, retaddr_su_render_song, OutputBufPtr
@ -183,9 +183,9 @@ su_update_voices_skipreset:
su_update_voices_nexttrack:
pop ebx ; ebx=first voice of next instrument, Stack: ptrnrow
pop edx ; edx=patrnrow
add esi, 35
add esi, 42
inc ebp
cmp ebp,su_synth_obj + 12
cmp ebp,su_synth_obj + 11
jl su_update_voices_trackloop
ret
@ -254,16 +254,6 @@ su_op_advance_finish:
popad ; Popped: eax, ecx = DelayWorkSpace, edx = Synth, ebx = OpcodeStream, esp, ebp = Voice, esi = OperandStream, edi. Stack: retaddr_su_run_vm, VoicesRemain, PolyphonyBitmask, Sample, Row, GlobalTick, RandSeed, VoiceTrackBitmask, edi, esi, ebp, esp, ebx, edx, ecx, eax, retaddr_su_render_song, OutputBufPtr
ret
;-------------------------------------------------------------------------------
; ADD opcode: add the two top most signals on the stack
;-------------------------------------------------------------------------------
; Mono: a b -> a+b b
;-------------------------------------------------------------------------------
section .su_op_add code align=1
su_op_add:
fadd st1
ret
;-------------------------------------------------------------------------------
; ADDP opcode: add the two top most signals on the stack and pop
;-------------------------------------------------------------------------------
; Mono: a b -> a+b
@ -274,22 +264,6 @@ su_op_addp:
faddp st1, st0
ret
;-------------------------------------------------------------------------------
; LOADNOTE opcode: load the current note, scaled to [-1,1]
;-------------------------------------------------------------------------------
; Mono: (empty) -> n, where n is the note
;-------------------------------------------------------------------------------
section .su_op_loadnote code align=1
su_op_loadnote:
fild dword [edx-su_voice.inputs+su_voice.note]
fmul dword [FCONST_0_00781250] ; s=n/128.0
fsub dword [FCONST_0_500000] ; s-.5
fadd st0, st0 ; 2*s-1
ret
;-------------------------------------------------------------------------------
; MULP opcode: multiply the two top most signals on the stack and pop
;-------------------------------------------------------------------------------
@ -306,6 +280,44 @@ su_op_mulp_mono:
fmulp st1
ret
;-------------------------------------------------------------------------------
; XCH opcode: exchange the signals on the stack
;-------------------------------------------------------------------------------
; Mono: a b -> b a
; stereo: a b c d -> c d a b
;-------------------------------------------------------------------------------
section .su_op_xch code align=1
su_op_xch:
fxch st0, st1
ret
;-------------------------------------------------------------------------------
; HOLD opcode: sample and hold the signal, reducing sample rate
;-------------------------------------------------------------------------------
; Mono version: holds the signal at a rate defined by the freq parameter
; Stereo version: holds both channels
;-------------------------------------------------------------------------------
section .su_op_hold code align=1
su_op_hold:
fld dword [edx] ; f x
fmul st0, st0 ; f^2 x
fchs ; -f^2 x
fadd dword [ebp] ; p-f^2 x
fst dword [ebp] ; p <- p-f^2
fldz ; 0 p x
fucomip st1 ; p x
fstp dword [esp-4] ; t=p, x
jc short su_op_hold_holding ; if (0 < p) goto holding
fld1 ; 1 x
fadd dword [esp-4] ; 1+t x
fstp dword [ebp] ; x
fst dword [ebp+4] ; save holded value
ret ; x
su_op_hold_holding:
fstp st0 ;
fld dword [ebp+4] ; x
ret
;-------------------------------------------------------------------------------
; FILTER opcode: perform low/high/band-pass/notch etc. filtering on the signal
@ -336,6 +348,10 @@ su_op_filter:
jz short su_op_filter_skiplowpass
fadd dword [ebp]
su_op_filter_skiplowpass:
test al, byte 0x20
jz short su_op_filter_skipbandpass
fadd dword [ebp+8]
su_op_filter_skipbandpass:
test al, byte 0x10
jz short su_op_filter_skiphighpass
fadd dword [ebp+4]
@ -386,7 +402,6 @@ su_op_delay:
lea ebx,[su_delay_times + ebx*2] ; BX now points to the right position within delay time table
movzx esi, word [esp + 88] ; notice that we load word, so we wrap at 65536
mov ecx, dword [esp + 60] ; ebp is now the separate delay workspace, as they require a lot more space
jnc su_op_delay_mono
push eax ; save _ah (delay count)
fxch ; r l
call su_op_delay_do ; D(r) l process delay for the right channel
@ -641,9 +656,17 @@ su_op_oscillat_single:
fsub dword [FCONST_0_500000]
fdiv dword [FCONST_0_00781250]
faddp st1
test al, byte 0x08
jnz su_op_oscillat_skipnote
fiadd dword [edx-su_voice.inputs+su_voice.note] ; // st0 is note, st1 is t+d offset
su_op_oscillat_skipnote:
fmul dword [ICONST_1034594986]
call su_power
test al, byte 0x08
jz short su_op_oscillat_normalize_note
fmul dword [FCONST_3_80000em05] ; // st0 is now frequency for lfo
jmp short su_op_oscillat_normalized
su_op_oscillat_normalize_note:
fmul dword [FCONST_9_269614em05] ; // st0 is now frequency
su_op_oscillat_normalized:
fadd dword [ebp]
@ -676,10 +699,6 @@ su_op_oscillat_notsine:
jz short su_op_oscillat_not_trisaw
call su_oscillat_trisaw
su_op_oscillat_not_trisaw:
test al, byte 0x10
jz short su_op_oscillat_not_pulse
call su_oscillat_pulse
su_op_oscillat_not_pulse:
su_op_oscillat_shaping:
; finally, shape the oscillator and apply gain
fld dword [edx + 16]
@ -688,17 +707,6 @@ su_op_oscillat_gain:
fmul dword [edx + 20]
ret
section .su_oscillat_pulse code align=1
su_oscillat_pulse:
fucomi st1 ; // c p
fld1
jnc short su_oscillat_pulse_up ; // +1 c p
fchs ; // -1 c p
su_oscillat_pulse_up:
fstp st1 ; // +-1 p
fstp st1 ; // +-1
ret
section .su_oscillat_trisaw code align=1
su_oscillat_trisaw:
fucomi st1 ; // c p
@ -904,17 +912,17 @@ section .su_vm_jumptable data align=1
su_vm_jumptable:
dd su_op_envelope
dd su_op_oscillator
dd su_op_mulp
dd su_op_noise
dd su_op_filter
dd su_op_addp
dd su_op_pan
dd su_op_outaux
dd su_op_send
dd su_op_distort
dd su_op_addp
dd su_op_mulp
dd su_op_xch
dd su_op_filter
dd su_op_outaux
dd su_op_pan
dd su_op_delay
dd su_op_add
dd su_op_loadnote
dd su_op_send
dd su_op_noise
dd su_op_hold
dd su_op_in
dd su_op_out
@ -925,17 +933,17 @@ section .su_vm_transformcounts data align=1
su_vm_transformcounts:
db 5
db 6
db 1
db 0
db 0
db 0
db 2
db 2
db 0
db 1
db 2
db 1
db 1
db 4
db 0
db 0
db 1
db 2
db 1
db 0
db 1
@ -946,124 +954,146 @@ su_vm_transformcounts:
section .su_patterns data align=1
su_patterns:
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 48,1,1,1,48,1,1,1,48,1,1,1,48,1,1,1
db 48,1,1,1,48,1,1,1,48,1,1,1,48,1,48,1
db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,1,1,1,58,1,1,1,1,1,1,1,58,1,1,1
db 0,0,0,0,72,1,1,1,1,1,1,1,72,1,1,1
db 1,1,1,1,72,1,1,1,1,1,1,1,72,1,1,1
db 0,38,50,38,0,38,50,38,0,38,50,38,0,38,50,50
db 0,46,58,46,0,46,58,46,0,46,58,46,0,46,58,58
db 0,48,60,48,0,48,60,48,0,48,60,48,0,48,60,60
db 0,41,53,41,0,41,53,41,0,41,53,41,0,41,53,53
db 0,48,60,48,0,48,60,48,0,48,60,55,0,53,52,53
db 59,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0
db 0,0,53,1,1,1,53,1,1,1,53,1,1,1,53,53
db 1,1,53,1,1,1,53,1,1,1,53,1,1,1,53,53
db 1,1,53,1,1,1,53,1,1,1,53,1,1,1,53,1
db 1,1,53,1,1,1,53,1,1,1,53,1,1,1,53,52
db 0,0,0,0,0,0,0,0,57,57,57,57,54,54,54,54
db 0,0,0,0,0,0,0,0,0,0,57,57,1,52,52,1
db 50,0,0,50,0,50,50,1,50,1,0,50,0,50,0,50
db 0,0,0,50,0,50,50,1,50,1,0,50,0,50,50,50
db 0,46,46,46,0,46,46,1,46,1,0,46,0,46,46,46
db 0,0,46,46,0,46,46,1,46,1,0,46,0,46,46,46
db 0,0,0,48,0,48,48,1,48,1,0,48,0,48,48,48
db 41,1,0,41,0,41,41,1,41,1,0,41,0,41,41,41
db 0,46,74,74,0,46,72,1,74,1,0,74,0,74,74,74
db 76,76,76,76,0,48,70,1,76,1,0,48,0,48,48,79
db 0,0,50,50,0,50,50,1,50,1,0,50,0,50,50,50
db 48,1,0,48,0,48,48,1,48,1,0,48,0,48,48,48
db 74,0,0,74,0,74,72,1,74,1,0,74,0,74,0,72
db 0,0,0,74,0,74,72,1,74,1,0,74,0,74,74,72
db 0,74,74,74,0,74,72,1,74,1,0,74,0,74,74,72
db 0,0,74,74,0,74,72,1,74,1,0,74,0,74,74,76
db 0,0,0,76,0,76,76,1,76,1,0,76,0,76,76,76
db 77,1,0,77,0,77,77,1,77,1,0,77,0,77,77,67
db 0,74,70,46,0,74,69,1,70,1,0,70,0,70,70,70
db 72,72,72,48,0,72,74,1,72,1,0,76,0,76,74,48
db 0,0,74,74,0,74,72,1,74,1,0,74,0,74,74,72
db 76,1,0,76,0,76,76,1,76,1,0,76,0,76,76,76
db 77,0,0,77,0,77,76,1,77,1,0,77,0,77,0,76
db 0,0,0,77,0,77,76,1,77,1,0,77,0,77,77,76
db 0,77,77,77,0,77,76,1,77,1,0,77,0,77,77,76
db 0,0,77,77,0,77,76,1,77,1,0,77,0,77,77,79
db 0,0,0,79,0,79,79,1,79,1,0,79,0,79,79,79
db 81,1,0,81,0,81,81,1,81,1,0,81,0,81,81,72
db 0,70,46,70,0,70,46,1,46,1,0,46,0,46,46,46
db 48,48,48,72,0,76,48,1,48,1,0,72,0,72,77,76
db 0,0,77,77,0,77,76,1,77,1,0,77,0,77,77,76
db 79,1,0,79,0,79,79,1,79,1,0,79,0,79,79,79
db 0,0,0,0,0,0,0,0,77,0,0,0,64,0,0,0
db 62,0,0,0,0,0,69,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,69,0,0,0,0,0,0,0
db 62,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,64,0,0,0,65,0,0,0
db 79,0,0,0,0,0,0,0,0,0,0,0,0,0,81,0
db 0,0,0,0,0,0,0,0,0,0,60,0,0,0,0,0
db 74,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 65,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0
db 79,1,1,1,1,1,1,1,0,0,0,0,0,0,84,0
db 0,0,0,0,0,0,0,0,70,0,0,0,69,0,0,0
db 74,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,65,0,0,0,76,0,0,0
db 74,0,0,0,0,0,81,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,81,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,76,0,0,0,77,0,0,0
db 67,0,0,0,0,0,0,0,0,0,0,0,0,0,69,0
db 0,0,0,0,0,0,0,0,0,0,72,0,0,0,0,0
db 62,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 77,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0
db 67,1,1,1,1,1,1,1,0,0,0,0,0,0,72,0
db 0,0,0,0,0,0,0,0,82,0,0,0,81,0,0,0
db 52,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,1,1,1,62,1,64,1,65,1,1,1,67,1,1,1
db 69,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 53,1,1,1,1,1,1,1,1,1,1,1,1,1,64,62
db 64,1,1,1,1,1,1,1,69,1,1,1,1,1,1,1
db 33,0,0,0,33,33,33,33,0,0,33,0,0,33,0,0
db 28,0,0,0,28,28,28,28,0,0,28,0,0,28,0,0
db 26,1,1,1,26,26,26,28,0,0,28,0,0,28,0,0
db 23,0,0,0,23,23,23,23,0,0,23,0,0,23,0,0
db 28,1,1,1,28,28,28,30,0,0,30,0,0,30,0,0
db 32,0,0,0,32,32,32,32,0,0,32,0,0,32,0,0
db 26,1,1,1,1,1,1,1,1,1,25,1,1,1,1,1
db 23,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 28,1,1,1,1,1,1,1,30,1,1,1,1,1,32,1
db 21,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 33,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 45,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 45,0,0,0,45,45,45,45,0,0,45,0,0,45,0,0
db 40,0,0,0,40,40,40,40,0,0,40,0,0,40,0,0
db 38,0,0,0,38,38,38,40,0,0,40,0,0,40,0,0
db 35,0,0,0,35,35,35,35,0,0,35,0,0,35,0,0
db 40,0,0,0,40,40,40,42,0,0,42,0,0,42,0,0
db 47,0,0,0,47,47,47,47,0,0,47,0,0,47,0,0
db 38,1,1,1,1,1,1,1,1,1,37,1,1,1,1,1
db 35,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 40,1,1,1,1,1,1,1,42,1,1,1,1,1,44,1
db 40,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 44,0,0,0,44,44,44,44,0,0,44,0,0,44,0,0
db 57,1,1,1,1,1,1,1,1,1,57,1,1,1,1,1
db 57,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 59,1,1,1,1,1,1,1,59,1,1,1,1,1,59,1
db 49,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 49,0,0,0,49,49,49,49,0,0,49,0,0,49,0,0
db 42,0,0,0,42,42,42,42,0,0,42,0,0,42,0,0
db 59,0,0,0,59,59,59,59,0,0,59,0,0,59,0,0
db 54,1,1,1,1,1,1,1,1,1,54,1,1,1,1,1
db 54,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 56,1,1,1,1,1,1,1,56,1,1,1,1,1,56,1
db 64,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,1,1,1,50,1,52,1,53,1,1,1,55,1,1,1
db 65,1,1,1,1,1,1,1,1,1,1,1,1,1,52,50
db 52,1,1,1,1,1,1,1,57,1,1,1,1,1,1,1
db 52,0,0,0,52,52,52,52,0,0,52,0,0,52,0,0
db 57,0,0,0,57,57,57,57,0,0,57,0,0,57,0,0
db 62,1,1,1,1,1,1,1,1,1,62,1,1,1,1,1
db 62,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 64,1,1,1,1,1,1,1,64,1,1,1,1,1,64,1
db 50,1,1,1,50,1,1,1,50,1,1,1,50,1,1,1
db 52,1,1,1,52,1,1,1,52,1,1,1,52,1,1,1
db 56,0,0,0,56,56,56,56,0,0,56,0,0,56,0,0
db 54,0,0,0,54,54,54,54,0,0,54,0,0,54,0,0
db 62,1,1,1,62,1,1,1,62,1,1,1,62,1,1,1
db 64,1,1,1,64,1,1,1,64,1,1,1,64,1,1,1
db 0,0,0,0,0,0,0,0,0,0,0,0,69,1,1,1
db 73,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0
db 74,1,1,1,1,1,1,1,1,1,0,0,73,1,0,71
db 73,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 0,0,0,0,0,0,0,0,73,1,1,1,1,1,1,1
db 81,1,1,1,1,1,1,1,1,1,1,1,83,1,1,1
db 85,1,1,1,1,1,1,1,83,1,1,1,1,1,1,81
db 80,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,1,1,1,0,0,0,0,78,1,1,1,1,1,1,80
db 81,1,1,1,1,1,1,1,1,1,0,0,78,1,1,80
db 81,1,1,1,1,1,1,1,1,0,0,0,83,1,1,81
db 80,1,1,1,1,1,1,1,81,1,1,1,1,1,1,1
db 83,1,1,1,1,1,0,0,81,1,1,1,1,1,1,83
db 85,1,1,1,1,1,1,1,0,0,0,0,85,83,85,86
db 85,1,1,1,1,1,1,1,0,0,0,0,81,83,85,86
db 83,1,1,1,1,1,1,1,81,1,1,1,1,1,83,81
db 80,1,1,1,1,1,1,1,76,78,80,83,80,81,83,88
db 86,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,1,1,1,1,1,0,0,86,1,1,1,85,1,1,1
db 83,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,1,1,1,1,0,0,0,83,1,1,1,88,1,1,1
db 1,1,1,1,1,1,1,0,86,1,1,1,88,1,1,1
db 88,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,1,1,1,1,1,0,0,76,1,1,1,1,1,1,1
db 81,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0
db 50,1,1,1,1,1,1,1,1,1,49,1,1,1,1,1
db 47,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 38,1,1,1,1,1,1,1,1,1,49,1,1,1,1,1
db 1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0
db 60,1,1,1,62,62,62,62,1,1,62,1,1,62,1,1
db 62,1,1,1,62,62,62,62,1,1,62,1,1,62,1,1
db 62,1,1,1,62,1,1,1,62,1,1,1,62,1,62,62
;-------------------------------------------------------------------------------
; Tracks
;-------------------------------------------------------------------------------
section .su_tracks data align=1
su_tracks:
db 0,0,0,0,0,0,0,0,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,3,3,3
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,3,3,3
db 5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,3,3,3
db 0,0,0,0,0,0,0,0,7,7,8,8,9,10,8,9,7,7,8,8,9,10,8,11,7,7,8,8,9,10,8,9,0,0,0
db 0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0
db 13,14,14,14,14,14,14,14,14,14,14,15,15,14,15,15,16,15,15,15,16,15,15,15,16,15,15,15,16,15,15,15,3,3,3
db 0,0,0,0,0,0,0,17,0,0,0,0,0,0,0,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 19,20,21,22,23,24,25,26,19,27,21,22,28,24,25,26,19,27,21,22,28,24,25,26,19,27,21,22,28,24,25,26,0,0,0
db 29,30,31,32,33,34,35,36,29,37,31,32,38,34,35,36,29,37,31,32,38,34,35,36,29,37,31,32,38,34,35,36,0,0,0
db 39,40,41,42,43,44,45,46,39,47,41,42,48,44,45,46,39,47,41,42,48,44,45,46,39,47,41,42,48,44,45,46,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,49,50,51,52,53,54,55,56,49,50,51,57,53,58,59,60,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,61,62,63,60,64,65,66,67,61,62,63,68,64,69,70,52,0,0,0,0
db 16,1,1,2,3,4,5,6,1,7,7,7,7,7,7,7,7,7,7,8,8,9,10,11,12,7,7,11,12,13,14,15,1,13,14,15,1,0,1,1,1,1
db 17,1,1,1,1,1,18,1,1,19,19,19,19,19,19,19,19,19,19,20,20,21,22,23,24,19,19,23,24,25,26,27,1,25,26,27,1,0,1,1,1,1
db 0,28,1,1,1,1,28,1,1,20,20,20,20,20,20,20,20,20,20,24,24,19,19,24,29,20,20,24,29,30,31,32,1,30,31,32,1,0,1,1,1,1
db 0,1,33,1,1,1,33,1,1,34,34,34,34,34,34,34,34,34,34,29,29,35,35,29,36,34,34,29,36,37,38,39,1,37,38,39,1,0,1,1,1,1
db 0,1,1,40,41,31,42,43,1,44,44,44,44,44,44,44,44,44,44,36,36,45,45,36,1,44,44,36,1,46,47,48,1,46,47,48,1,0,1,1,1,1
db 0,1,1,1,1,1,1,1,1,7,7,7,7,7,7,7,7,7,7,29,29,35,35,29,29,19,19,29,29,49,49,50,50,49,49,50,50,0,1,1,1,1
db 0,1,1,1,1,1,1,1,1,19,19,19,19,19,19,19,19,19,19,51,51,52,52,51,51,45,45,51,51,53,53,54,54,53,53,54,54,0,1,1,1,1
db 0,1,1,1,1,1,1,1,1,1,1,1,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,72,76,77,78,79,80,1,1,1
db 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,81,82,27,1,83,82,27,84,1,1,1,1,1
db 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 0,1,1,1,1,1,1,1,1,85,86,85,86,85,86,85,86,85,86,86,86,86,86,86,86,86,86,86,86,87,53,87,53,87,53,87,53,0,1,1,1,1
;-------------------------------------------------------------------------------
; Sample offsets
;-------------------------------------------------------------------------------
section .su_sample_offsets data align=1
su_sample_offsets:
dd 1448797
dw 251
dw 9710
dd 1351767
dw 284
dw 10741
dd 1034961
dw 2073
dw 398
dd 1622065
dw 1916
dw 76
dd 1252819
dw 6513
dw 905
dd 741926
dw 1034
dw 1
dd 560606
dw 4276
dw 1
dd 641780
dw 2423
dw 1
dd 433554
dw 2615
dw 5676
dd 367477
dw 1343
dw 1
dd 1543725
dw 831
dw 104
dd 557335
dw 2374
dw 821
;-------------------------------------------------------------------------------
; Delay times
;-------------------------------------------------------------------------------
section .su_delay_times data align=1
su_delay_times:
dw 1395,350,1744,1744,69,12550,24402,21265,32419,1116,1188,1276,1356,1422,1492,1556,1618,1140,1212,1300,1380,1446,1516,1580,1642
dw 5230,4533,23625,47250,1116,1188,1276,1356,1422,1492,1556,1618,1140,1212,1300,1380,1446,1516,1580,1642
;-------------------------------------------------------------------------------
@ -1071,14 +1101,14 @@ su_delay_times:
;-------------------------------------------------------------------------------
section .su_patch_opcodes data align=1
su_patch_opcodes:
db 2,4,6,2,8,10,10,6,12,10,10,14,17,2,18,0,2,4,20,6,2,8,6,10,10,12,14,17,2,18,2,18,0,2,22,8,6,2,22,8,6,12,2,4,6,12,10,20,14,17,0,2,18,18,2,4,4,6,4,12,6,10,10,14,17,0,3,3,7,5,7,15,17,0,3,5,7,11,11,15,17,0,2,4,6,14,17,2,18,0,2,4,4,12,8,12,6,2,4,4,12,8,12,6,22,15,11,11,17,0,2,2,6,4,24,4,12,4,12,6,10,10,14,23,17,26,18,0,29,23,31,0
db 2,4,4,6,8,10,2,4,4,6,12,8,10,15,17,0,2,4,4,8,14,10,18,21,17,0,3,5,11,19,21,17,2,4,10,22,0,2,22,2,4,4,8,4,14,8,10,14,18,17,0,2,4,10,18,17,0,2,4,10,2,24,10,14,14,8,18,17,2,22,2,22,0,2,2,10,24,10,14,14,18,17,24,26,22,0,3,5,11,19,17,0,29,21,31,0
;-------------------------------------------------------------------------------
; The parameters / inputs to each opcode
;-------------------------------------------------------------------------------
section .su_patch_operands data align=1
su_patch_operands:
db 0,70,0,0,76,88,69,0,128,63,79,66,0,43,0,0,128,43,79,84,82,68,100,62,64,12,69,68,12,48,16,64,50,0,62,76,0,0,128,46,40,0,0,76,0,0,96,86,116,0,0,114,37,130,95,0,68,0,0,83,3,107,57,67,68,128,78,64,64,42,26,47,54,0,0,128,19,136,0,54,68,70,0,128,26,255,255,0,53,0,0,128,64,128,0,0,0,3,97,0,0,54,0,0,128,64,6,0,0,2,3,79,128,0,62,0,0,42,64,64,0,1,64,125,128,39,76,68,114,60,39,19,39,73,62,74,128,94,176,0,47,91,0,42,65,86,71,83,88,66,91,49,100,89,34,64,74,64,42,70,17,17,64,78,13,128,88,128,66,22,46,68,10,116,16,64,40,0,8,90,0,0,128,21,78,0,85,64,77,54,0,2,87,111,128,64,128,97,50,60,0,0,128,82,64,0,3,64,127,128,78,128,76,109,128,64,67,128,11,1,74,0,0,64,64,67,0,4,64,99,129,64,89,43,1,78,36,74,64,83,40,0,40,0,63,51,54,64,94,0,128,64,128,35,76,28,52,128,64,102,35,114,67,20,0,48,64,64,64,46,78,128,64,128,35,76,99,54,128,64,128,35,128,80,128,0,0,0,4,1,65,122,128,72,103,128,64,20,6,40,102,47,78,68,0,84,25,84,127,76,52,128,91,48,128,67,88,73,0,57,37,56,35,55,64,0,5,58,128,129,30,128,80,53,128,24,61,69,103,84,12,5,3,27,14,82,200,0,2,61,113,122,97,9,15,128
db 57,85,62,63,84,91,65,0,0,67,35,128,79,61,0,1,65,78,128,32,57,87,50,64,71,91,54,0,0,64,64,128,79,62,0,1,80,68,128,64,92,128,96,27,25,10,70,0,72,61,77,32,0,2,81,74,130,77,48,0,2,42,128,128,47,128,112,64,69,128,53,98,0,1,39,33,0,67,87,71,128,62,64,0,3,63,88,128,73,76,128,61,16,2,1,92,76,95,0,92,89,82,81,64,0,128,64,128,72,89,41,0,20,71,40,74,128,37,75,0,40,65,77,71,74,52,64,64,126,64,128,66,64,64,75,118,61,128,33,93,64,42,4,104,128,128,50,100,68,94,128,64,64,31,5,0,43,89,50,128,79,42,0,5,72,128,128,64,124,0,14,68,0,0,110,76,52,0,6,81,53,128,0,68,0,0,83,2,39,110,128,68,118,112,64,59,128,8,47,54,0,0,128,19,120,0,54,68,70,0,128,26,255,255,0,61,0,0,128,18,62,0,0,94,52,63,116,98,56,119,128,64,64,59,0,65,9,0,20,104,0,0,79,0,77,64,76,68,0,7,64,128,128,50,64,64,2,30,128,125,25,4,15,128
;-------------------------------------------------------------------------------
; Constants
@ -1088,6 +1118,7 @@ FCONST_32767_0 dd 0x46fffe00
FCONST_0_00781250 dd 0x3c000000
FCONST_0_500000 dd 0x3f000000
FCONST_0_99609375 dd 0x3f7f0000
FCONST_3_80000em05 dd 0x381f6230
FCONST_9_269614em05 dd 0x38c265dc
FCONST_84_28075 dd 0x42a88fbe
ICONST_2147483648 dd 0x80000000