Line match reverb_fx.c and delay_fx.c for S&Gs

This commit is contained in:
Phillip Stephens 2022-07-28 07:24:49 -07:00
parent 14dc741030
commit 51a84f6ed2
2 changed files with 45 additions and 11 deletions

View File

@ -1,3 +1,14 @@
/* ---------------------------------------
---------------------------------------
*/
#include "musyx/musyx_priv.h"
void sndAuxCallbackDelay(u8 reason, SND_AUX_INFO* info, void* user) {
@ -12,7 +23,6 @@ void sndAuxCallbackDelay(u8 reason, SND_AUX_INFO* info, void* user) {
s32* rightPtr;
s32* surPtr;
SND_AUX_DELAY* delay;
switch (reason) {
case 0:
delay = (SND_AUX_DELAY*)user;
@ -42,9 +52,10 @@ void sndAuxCallbackDelay(u8 reason, SND_AUX_INFO* info, void* user) {
delay->currentPos[0] = (delay->currentPos[0] + 1) % delay->currentSize[0];
delay->currentPos[1] = (delay->currentPos[1] + 1) % delay->currentSize[1];
delay->currentPos[2] = (delay->currentPos[2] + 1) % delay->currentSize[2];
/* fallthrough */
case 1:
return;
case 1: break;
default:
// ASSERT_MSG(FALSE);
break;
}
}
@ -62,13 +73,15 @@ bool8 sndAuxCallbackUpdateSettingsDelay(SND_AUX_DELAY* delay) {
delay->currentOutput[i] = (delay->output[i] << 7) / 100;
}
delay->left = (s32*)salMalloc(delay->currentSize[0] * 0x280);
delay->right = (s32*)salMalloc(delay->currentSize[1] * 0x280);
delay->sur = (s32*)salMalloc(delay->currentSize[2] * 0x280);
delay->left = (s32*)salMalloc(delay->currentSize[0] * 160 * 4);
delay->right = (s32*)salMalloc(delay->currentSize[1] * 160 * 4);
delay->sur = (s32*)salMalloc(delay->currentSize[2] * 160 * 4);
left = delay->left;
right = delay->right;
sur = delay->sur;
// ASSERT_MSG(delay->left!=NULL);
// ASSERT_MSG(delay->right!=NULL);
// ASSERT_MSG(delay->sur!=NULL);
for (i = 0; i < delay->currentSize[0] * 160; ++i) {
*left = 0;

View File

@ -1,5 +1,22 @@
/* ---------------------------------------
---------------------------------------
*/
#include "musyx/musyx_priv.h"
extern bool8 ReverbHICreate(_SND_REVHI_WORK* rev, f32 coloration, f32 time, f32 mix, f32 damping, f32 preDelay, f32 crosstalk);
extern void ReverbHIFree(_SND_REVHI_WORK* rev);
@ -7,11 +24,15 @@ void sndAuxCallbackReverbHI(u8 reason, SND_AUX_INFO* info, void* user) {
switch (reason) {
case SND_AUX_REASON_BUFFERUPDATE:
if (((SND_AUX_REVERBHI*)user)->tempDisableFX == 0) {
ReverbHICallback(info->data.bufferUpdate.left, info->data.bufferUpdate.right, info->data.bufferUpdate.surround, user);
ReverbHICallback(info->data.bufferUpdate.left,
info->data.bufferUpdate.right,
info->data.bufferUpdate.surround, user);
}
/* fallthrough */
case SND_AUX_REASON_PARAMETERUPDATE:
return;
break;
default:
//ASSERT_MSG(FALSE);
break;
}
}