From 9a1022d016516981f78e8e122cd4d9b044b90a49 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Fri, 23 Jun 2023 05:04:48 -0700 Subject: [PATCH] Match and link creverb.c Former-commit-id: e2c11d276b33db57b3a894fd11dad98b0fb2d201 --- configure.py | 2 +- include/musyx/musyx_priv.h | 2 +- src/musyx/runtime/CheapReverb/creverb.c | 4 ++-- src/musyx/runtime/synth_adsr.c | 7 +++++++ 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/configure.py b/configure.py index 0a1d89c1..45ee1068 100755 --- a/configure.py +++ b/configure.py @@ -951,7 +951,7 @@ LIBS = [ ["musyx/runtime/hw_dolphin", True], ["musyx/runtime/hw_memory", True], ["musyx/runtime/CheapReverb/creverb_fx", True], - ["musyx/runtime/CheapReverb/creverb", False], + ["musyx/runtime/CheapReverb/creverb", True], ["musyx/runtime/StdReverb/reverb_fx", True], ["musyx/runtime/StdReverb/reverb", False], ["musyx/runtime/Delay/delay_fx", True], diff --git a/include/musyx/musyx_priv.h b/include/musyx/musyx_priv.h index ef781cee..715002d9 100644 --- a/include/musyx/musyx_priv.h +++ b/include/musyx/musyx_priv.h @@ -884,7 +884,7 @@ void synthSetBpm(u32 pbm, u8 set, u8 section); void synthFXCloneMidiSetup(SYNTH_VOICE* dest, SYNTH_VOICE* src); void synthSetMusicVolumeType(u8 vGroup, u8 type); -extern u32 synthGlobalVariable[16]; +extern long synthGlobalVariable[16]; extern u16 voicePrioSortRootListRoot; extern u8 voiceMusicRunning; extern u8 voiceFxRunning; diff --git a/src/musyx/runtime/CheapReverb/creverb.c b/src/musyx/runtime/CheapReverb/creverb.c index dd8cca5a..45fa4edc 100644 --- a/src/musyx/runtime/CheapReverb/creverb.c +++ b/src/musyx/runtime/CheapReverb/creverb.c @@ -21,7 +21,7 @@ static void DLsetdelay(_SND_REVSTD_DELAYLINE* dl, s32 lag) { } static void DLcreate(_SND_REVSTD_DELAYLINE* dl, s32 len) { - dl->length = len * sizeof(f32); + dl->length = (s32)len * sizeof(f32); dl->inputs = (f32*)salMalloc(len * sizeof(f32)); memset(dl->inputs, 0, len * sizeof(len)); dl->lastOutput = 0.f; @@ -62,7 +62,7 @@ bool ReverbSTDCreate(_SND_REVSTD_WORK* rv, float coloration, float time, float m rv->level = mix; rv->damping = damping; if (rv->damping < 0.05f) { - rv->damping = 0.05; + rv->damping = 0.05f; } rv->damping = 1.f - (rv->damping * 0.8f + 0.05f); diff --git a/src/musyx/runtime/synth_adsr.c b/src/musyx/runtime/synth_adsr.c index df06efcd..5c6144e0 100644 --- a/src/musyx/runtime/synth_adsr.c +++ b/src/musyx/runtime/synth_adsr.c @@ -55,4 +55,11 @@ u32 adsrStartRelease(ADSR_VARS* adsr, u32 rtime) { } u32 adsrRelease(ADSR_VARS* adsr) { + switch(adsr->mode) { + case 0: + case 1: + return adsrStartRelease(adsr, adsr->data.dls.rTime); + } + + return FALSE; }