Implement new effect: bit-crusher.

Maybe a combined hold/bit-crusher effect is needed someday.
This commit is contained in:
Veikko Sariola
2020-05-16 23:22:31 +03:00
parent 6a0a2fc36c
commit d87d2e22cf
7 changed files with 109 additions and 0 deletions

View File

@ -78,6 +78,27 @@ su_op_hold_holding:
%endif ; HOLD_ID > -1
;-------------------------------------------------------------------------------
; CRUSH Tick
;-------------------------------------------------------------------------------
%if CRUSH_ID > -1
SECT_TEXT(sucrush)
EXPORT MANGLE_FUNC(su_op_crush,0)
%ifdef INCLUDE_STEREO_CRUSH
jnc su_op_crush_mono
call su_stereo_filterhelper
%define INCLUDE_STEREO_FILTERHELPER
su_op_crush_mono:
%endif
fdiv dword [edx+su_crush_ports.resolution]
frndint
fmul dword [edx+su_crush_ports.resolution]
ret
%endif ; CRUSH_ID > -1
;-------------------------------------------------------------------------------
; GAIN Tick
;-------------------------------------------------------------------------------

View File

@ -156,6 +156,36 @@ struc su_hold_wrk
.holdval resd 1
endstruc
;-------------------------------------------------------------------------------
; CRUSH effect related defines
;-------------------------------------------------------------------------------
%assign CRUSH_ID -1
%macro USE_CRUSH 0
%if CRUSH_ID == -1
%assign CRUSH_ID CUR_ID
%assign CUR_ID CUR_ID + 2
%xdefine OPCODES OPCODES MANGLE_FUNC(su_op_crush,0),
%xdefine NUMPARAMS NUMPARAMS 1,
%endif
%endmacro
%macro SU_CRUSH 2
db %2
USE_CRUSH
%xdefine CMDS CMDS CRUSH_ID + %1,
%if %1 == STEREO
%define INCLUDE_STEREO_CRUSH
%endif
%endmacro
%define RESOLUTION(val) val
struc su_crush_ports
.resolution resd 1
.params
endstruc
;-------------------------------------------------------------------------------
; GAIN effect related defines
;-------------------------------------------------------------------------------