feat(sointu): remove 16-bit output toggle from song; make it compile time option

This commit is contained in:
vsariola
2021-01-05 18:08:13 +02:00
parent 30379c981d
commit 588488ce54
98 changed files with 48 additions and 140 deletions

View File

@ -1,4 +1,4 @@
{{- if not .Song.Output16Bit }}
{{- if not .Output16Bit }}
{{- if not .Clip }}
mov {{.DI}}, [{{.Stack "OutputBufPtr"}}] ; edi containts ptr
mov {{.SI}}, {{.PTRWORD}} su_synth_obj + su_synthworkspace.left

View File

@ -23,7 +23,7 @@
#define SU_CALLCONV
#endif
{{- if .Song.Output16Bit}}
{{- if .Output16Bit}}
typedef short SUsample;
#define SU_SAMPLE_RANGE 32767.0
{{- else}}

View File

@ -1,4 +1,4 @@
{{- if not .Song.Output16Bit }}
{{- if not .Output16Bit }}
(i64.store (global.get $outputBufPtr) (i64.load (i32.const 4128))) ;; load the sample from left & right channels as one 64bit int and store it in the address pointed by outputBufPtr
(global.set $outputBufPtr (i32.add (global.get $outputBufPtr) (i32.const 8))) ;; advance outputbufptr
{{- else }}

View File

@ -111,8 +111,8 @@
;; TODO: only export start and length with certain compiler options; in demo use, they can be hard coded
;; in the intro
(global $outputStart (export "s") i32 (i32.const 8388608)) ;; TODO: do not hard code, layout memory somehow intelligently
(global $outputLength (export "l") i32 (i32.const {{if .Song.Output16Bit}}{{mul .EncodedSong.TotalRows .Song.SamplesPerRow 4}}{{else}}{{mul .EncodedSong.TotalRows .Song.SamplesPerRow 8}}{{end}}))
(global $output16bit (export "t") i32 (i32.const {{if .Song.Output16Bit}}1{{else}}0{{end}}))
(global $outputLength (export "l") i32 (i32.const {{if .Output16Bit}}{{mul .EncodedSong.TotalRows .Song.SamplesPerRow 4}}{{else}}{{mul .EncodedSong.TotalRows .Song.SamplesPerRow 8}}{{end}}))
(global $output16bit (export "t") i32 (i32.const {{if .Output16Bit}}1{{else}}0{{end}}))
;;------------------------------------------------------------------------------
@ -155,7 +155,7 @@
(start $render) ;; we run render automagically when the module is instantiated
(func $render (param)
{{- if .Song.Output16Bit }} (local $channel i32) {{- end }}
{{- if .Output16Bit }} (local $channel i32) {{- end }}
loop $pattern_loop
(global.set $row (i32.const 0))
loop $row_loop