mirror of https://github.com/PrimeDecomp/prime.git
Line match reverb_fx.c and delay_fx.c for S&Gs
Former-commit-id: 51a84f6ed2
This commit is contained in:
parent
13d2ba0a49
commit
7d56323cd4
|
@ -1,3 +1,14 @@
|
||||||
|
/* ---------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---------------------------------------
|
||||||
|
*/
|
||||||
#include "musyx/musyx_priv.h"
|
#include "musyx/musyx_priv.h"
|
||||||
|
|
||||||
void sndAuxCallbackDelay(u8 reason, SND_AUX_INFO* info, void* user) {
|
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* rightPtr;
|
||||||
s32* surPtr;
|
s32* surPtr;
|
||||||
SND_AUX_DELAY* delay;
|
SND_AUX_DELAY* delay;
|
||||||
|
|
||||||
switch (reason) {
|
switch (reason) {
|
||||||
case 0:
|
case 0:
|
||||||
delay = (SND_AUX_DELAY*)user;
|
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[0] = (delay->currentPos[0] + 1) % delay->currentSize[0];
|
||||||
delay->currentPos[1] = (delay->currentPos[1] + 1) % delay->currentSize[1];
|
delay->currentPos[1] = (delay->currentPos[1] + 1) % delay->currentSize[1];
|
||||||
delay->currentPos[2] = (delay->currentPos[2] + 1) % delay->currentSize[2];
|
delay->currentPos[2] = (delay->currentPos[2] + 1) % delay->currentSize[2];
|
||||||
/* fallthrough */
|
case 1: break;
|
||||||
case 1:
|
default:
|
||||||
return;
|
// ASSERT_MSG(FALSE);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,13 +73,15 @@ bool8 sndAuxCallbackUpdateSettingsDelay(SND_AUX_DELAY* delay) {
|
||||||
delay->currentOutput[i] = (delay->output[i] << 7) / 100;
|
delay->currentOutput[i] = (delay->output[i] << 7) / 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
delay->left = (s32*)salMalloc(delay->currentSize[0] * 0x280);
|
delay->left = (s32*)salMalloc(delay->currentSize[0] * 160 * 4);
|
||||||
delay->right = (s32*)salMalloc(delay->currentSize[1] * 0x280);
|
delay->right = (s32*)salMalloc(delay->currentSize[1] * 160 * 4);
|
||||||
delay->sur = (s32*)salMalloc(delay->currentSize[2] * 0x280);
|
delay->sur = (s32*)salMalloc(delay->currentSize[2] * 160 * 4);
|
||||||
|
|
||||||
left = delay->left;
|
left = delay->left;
|
||||||
right = delay->right;
|
right = delay->right;
|
||||||
sur = delay->sur;
|
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) {
|
for (i = 0; i < delay->currentSize[0] * 160; ++i) {
|
||||||
*left = 0;
|
*left = 0;
|
||||||
|
|
|
@ -1,5 +1,22 @@
|
||||||
|
/* ---------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
#include "musyx/musyx_priv.h"
|
#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 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);
|
extern void ReverbHIFree(_SND_REVHI_WORK* rev);
|
||||||
|
|
||||||
|
@ -7,11 +24,15 @@ void sndAuxCallbackReverbHI(u8 reason, SND_AUX_INFO* info, void* user) {
|
||||||
switch (reason) {
|
switch (reason) {
|
||||||
case SND_AUX_REASON_BUFFERUPDATE:
|
case SND_AUX_REASON_BUFFERUPDATE:
|
||||||
if (((SND_AUX_REVERBHI*)user)->tempDisableFX == 0) {
|
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:
|
case SND_AUX_REASON_PARAMETERUPDATE:
|
||||||
return;
|
break;
|
||||||
|
default:
|
||||||
|
//ASSERT_MSG(FALSE);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue