Commit 86e6cfbd authored by PoroCYon's avatar PoroCYon
Browse files

[clinkster] .. and translate the sections

parent 8c10c079
...@@ -44,35 +44,35 @@ extern __imp__waveOutGetPosition@12 ...@@ -44,35 +44,35 @@ extern __imp__waveOutGetPosition@12
;; ********** Public variables ********** ;; ********** Public variables **********
section MusBuf bss align=4 SECT_BSS(MusBuf) align=4
PUBLIC_DATA(Clinkster_MusicBuffer): PUBLIC_DATA(Clinkster_MusicBuffer):
.align24 .align24
resw (TOTAL_SAMPLES*2) resw (TOTAL_SAMPLES*2)
resw 2 ; padding to catch extra write in conversion resw 2 ; padding to catch extra write in conversion
section tps rdata align=4 SECT_RDATA(tps) align=4
PUBLIC_DATA(Clinkster_TicksPerSecond): PUBLIC_DATA(Clinkster_TicksPerSecond):
dd TICKS_PER_SECOND dd TICKS_PER_SECOND
section muslen rdata align=4 SECT_RDATA(muslen) align=4
PUBLIC_DATA(Clinkster_MusicLength): PUBLIC_DATA(Clinkster_MusicLength):
dd MUSIC_LENGTH dd MUSIC_LENGTH
section numtr rdata align=4 SECT_RDATA(numtr) align=4
PUBLIC_DATA(Clinkster_NumTracks): PUBLIC_DATA(Clinkster_NumTracks):
dd NUMTRACKS dd NUMTRACKS
%if CLINKSTER_GENERATE_TIMING_DATA %if CLINKSTER_GENERATE_TIMING_DATA
section musdat bss align=4 SECT_BSS(musdat) align=4
PUBLIC_DATA(Clinkster_NoteTiming): PUBLIC_DATA(Clinkster_NoteTiming):
.align16 .align16
resd 2*(NUMTRACKS<<LOGNUMTICKS) resd 2*(NUMTRACKS<<LOGNUMTICKS)
section timing data align=4 ECT_DATA(timing) align=4
timing_ptr: dd Clinkster_NoteTiming timing_ptr: dd Clinkster_NoteTiming
%endif %endif
section WavFile rdata align=4 SECT_RDATA(WavFile) align=4
PUBLIC_DATA(Clinkster_WavFileHeader): PUBLIC_DATA(Clinkster_WavFileHeader):
db "RIFF" db "RIFF"
dd 36+TOTAL_SAMPLES*4 dd 36+TOTAL_SAMPLES*4
...@@ -89,59 +89,59 @@ PUBLIC_DATA(Clinkster_WavFileHeader): ...@@ -89,59 +89,59 @@ PUBLIC_DATA(Clinkster_WavFileHeader):
;; ********** System structures ********** ;; ********** System structures **********
section WaveForm rdata align=1 SECT_RDATA(WaveForm) align=1
PUBLIC_DATA(WaveFormat): PUBLIC_DATA(WaveFormat):
dw 1,2 dw 1,2
dd SAMPLE_RATE dd SAMPLE_RATE
dd SAMPLE_RATE*4 dd SAMPLE_RATE*4
dw 4,16,0 dw 4,16,0
section WaveHdr data align=4 SECT_DATA(WaveHdr) align=4
PUBLIC_DATA(WaveHdr): PUBLIC_DATA(WaveHdr):
dd PUBLIC_DATA(Clinkster_MusicBuffer) dd PUBLIC_DATA(Clinkster_MusicBuffer)
dd (TOTAL_SAMPLES*4) dd (TOTAL_SAMPLES*4)
dd 0,0,0,0,0,0 dd 0,0,0,0,0,0
section wavehand bss align=4 SECT_BSS(wavehand) align=4
PUBLIC_DATA(WaveOutHandle): PUBLIC_DATA(WaveOutHandle):
.align16 .align16
resd 1 resd 1
section WaveTime data align=4 SECT_DATA(WaveTime) align=4
PUBLIC_DATA(WaveTime): PUBLIC_DATA(WaveTime):
dd 4,0,0,0,0,0,0,0 dd 4,0,0,0,0,0,0,0
;; ********** Internal buffers ********** ;; ********** Internal buffers **********
section MixBuf bss align=4 SECT_BSS(MixBuf) align=4
resd MAX_DELAY_LENGTH resd MAX_DELAY_LENGTH
PUBLIC_DATA(MixingBuffer): PUBLIC_DATA(MixingBuffer):
.align24 .align24
resd TOTAL_SAMPLES resd TOTAL_SAMPLES
section InstrBuf bss align=4 SECT_BSS(InstrBuf) align=4
PUBLIC_DATA(InstrumentBuffer): PUBLIC_DATA(InstrumentBuffer):
.align16 .align16
resd MAX_INSTRUMENT_SUBSAMPLES resd MAX_INSTRUMENT_SUBSAMPLES
section InstrRen bss align=4 SECT_BSS(InstrRen) align=4
resd 256 resd 256
PUBLIC_DATA(InstrumentRender): PUBLIC_DATA(InstrumentRender):
.align16 .align16
resd MAX_INSTRUMENT_SUBSAMPLES resd MAX_INSTRUMENT_SUBSAMPLES
section InstrSto bss align=4 SECT_BSS(InstrSto) align=4
PUBLIC_DATA(InstrumentStore): PUBLIC_DATA(InstrumentStore):
.align16 .align16
resd MAX_TOTAL_INSTRUMENT_SAMPLES resd MAX_TOTAL_INSTRUMENT_SAMPLES
section InstrPoi bss align=4 SECT_BSS(InstrPoi) align=4
PUBLIC_DATA(InstrumentPointers): PUBLIC_DATA(InstrumentPointers):
.align16 .align16
resd MAX_TRACK_INSTRUMENT_RENDERS+1 resd MAX_TRACK_INSTRUMENT_RENDERS+1
section wforms bss align=4 SECT_BSS(wforms) align=4
waveforms: waveforms:
.align16 .align16
resd 6*WAVE_SIZE resd 6*WAVE_SIZE
...@@ -149,7 +149,7 @@ waveforms: ...@@ -149,7 +149,7 @@ waveforms:
;; ********** Instrument parameter access ********** ;; ********** Instrument parameter access **********
section paramw rdata align=4 SECT_RDATA(paramw) align=4
param_weights: param_weights:
dd 0.125 ; Release dd 0.125 ; Release
dd 0.125 ; Decay dd 0.125 ; Decay
...@@ -212,36 +212,36 @@ endstruc ...@@ -212,36 +212,36 @@ endstruc
;; ********** Internal constants and tables ********** ;; ********** Internal constants and tables **********
section resamp rdata align=4 SECT_RDATA(resamp) align=4
resamplefilter: resamplefilter:
db -1,-2,-4,-4,-2,3,14,30,51,98,116,126 db -1,-2,-4,-4,-2,3,14,30,51,98,116,126
db 126,116,98,51,30,14,3,-2,-4,-4,-2,-1 db 126,116,98,51,30,14,3,-2,-4,-4,-2,-1
resamplefilter_end: resamplefilter_end:
FILTER_SIZE equ (resamplefilter_end-resamplefilter) FILTER_SIZE equ (resamplefilter_end-resamplefilter)
section wavestep rdata align=4 SECT_RDATA(wavestep) align=4
c_wavestep: dd 0.000030517578125 c_wavestep: dd 0.000030517578125
section basefreq rdata align=4 SECT_RDATA(basefreq) align=4
c_basefreq: dd 2.86698696365342 c_basefreq: dd 2.86698696365342
section halfnote rdata align=4 SECT_RDATA(halfnote) align=4
c_halfnote: dd 1.05946309435929 c_halfnote: dd 1.05946309435929
section finalamp rdata align=4 SECT_RDATA(finalamp) align=4
c_finalamp: dd 32767 c_finalamp: dd 32767
section velfac rdata align=4 SECT_RDATA(velfac) align=4
c_velocityfac: dd 0.007874015748031496 c_velocityfac: dd 0.007874015748031496
section delaystr rdata align=4 SECT_RDATA(delaystr) align=4
c_delaystr: dd DELAY_STRENGTH c_delaystr: dd DELAY_STRENGTH
section offset rdata align=4 SECT_RDATA(offset) align=4
c_timeoffset: dd CLINKSTER_TIMER_OFFSET*4 c_timeoffset: dd CLINKSTER_TIMER_OFFSET*4
section tempo rdata align=4 SECT_RDATA(tempo) align=4
c_ticklength: dd SUBSAMPLES_PER_TICK/4*4 c_ticklength: dd SUBSAMPLES_PER_TICK/4*4
section half rdata align=4 SECT_RDATA(half) align=4
c_onehalf: dd 0.5 c_onehalf: dd 0.5
;; ********** Internal global variables ********** ;; ********** Internal global variables **********
section vars bss align=8 SECT_BSS(vars) align=8
vars_align16 vars_align16
layer_random: resd 1 layer_random: resd 1
...@@ -274,7 +274,7 @@ layer_phasetmp: resd 1 ...@@ -274,7 +274,7 @@ layer_phasetmp: resd 1
;; ********** Generate the sound for one layer ********** ;; ********** Generate the sound for one layer **********
section mklayer text align=1 SECT_TEXT(mklayer) align=1
makelayer: makelayer:
mov edx, layer_params mov edx, layer_params
...@@ -437,7 +437,7 @@ makelayer: ...@@ -437,7 +437,7 @@ makelayer:
;; ********** Interpolate one section of amplitude envelope ********** ;; ********** Interpolate one section of amplitude envelope **********
section adsr text align=1 SECT_TEXT(adsr) align=1
apply_adsr: apply_adsr:
; On condition g: ; On condition g:
; st0 = amplitude target ; st0 = amplitude target
...@@ -494,7 +494,7 @@ apply_adsr: ...@@ -494,7 +494,7 @@ apply_adsr:
;; ********** Main music generation ********** ;; ********** Main music generation **********
section genMus text align=1 SECT_TEXT(genMus) align=1
PUBLIC_FN(Clinkster_GenerateMusic,0): PUBLIC_FN(Clinkster_GenerateMusic,0):
pusha pusha
fninit fninit
...@@ -878,7 +878,7 @@ PUBLIC_FN(Clinkster_GenerateMusic,0): ...@@ -878,7 +878,7 @@ PUBLIC_FN(Clinkster_GenerateMusic,0):
;; ********** Start music ********** ;; ********** Start music **********
%ifdef WIN32 %ifdef WIN32
section startmus text align=1 SECT_TEXT(startmus) align=1
PUBLIC_FN(Clinkster_StartMusic,0): PUBLIC_FN(Clinkster_StartMusic,0):
; Start music ; Start music
push byte 0 push byte 0
...@@ -903,7 +903,7 @@ PUBLIC_FN(Clinkster_StartMusic,0): ...@@ -903,7 +903,7 @@ PUBLIC_FN(Clinkster_StartMusic,0):
;; ********** Get current play position ********** ;; ********** Get current play position **********
section getpos text align=1 SECT_TEXT(getpos) align=1
PUBLIC_FN(Clinkster_GetPosition,0): PUBLIC_FN(Clinkster_GetPosition,0):
push byte 32 ; sizeof(MMTIME) push byte 32 ; sizeof(MMTIME)
push _WaveTime push _WaveTime
...@@ -921,7 +921,7 @@ PUBLIC_FN(Clinkster_GetPosition,0): ...@@ -921,7 +921,7 @@ PUBLIC_FN(Clinkster_GetPosition,0):
;; ********** Get time since instrument trigger ********** ;; ********** Get time since instrument trigger **********
%if CLINKSTER_GENERATE_TIMING_DATA %if CLINKSTER_GENERATE_TIMING_DATA
section insttrig text align=1 SECT_TEXT(insttrig) align=1
PUBLIC_FN(Clinkster_GetInstrumentTrigger,8): PUBLIC_FN(Clinkster_GetInstrumentTrigger,8):
cvttss2si eax, [esp+8] cvttss2si eax, [esp+8]
mov ecx, [esp+4] mov ecx, [esp+4]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment