From e656c11c47ff90ced63d6d02085115e39bd78239 Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Fri, 29 Nov 2024 15:04:47 -0600 Subject: [PATCH] More things --- src/audio/mixer.c | 7 +++++-- src/audio/port_eu.c | 18 +++++++++--------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/audio/mixer.c b/src/audio/mixer.c index da8970194..ed34e23a5 100644 --- a/src/audio/mixer.c +++ b/src/audio/mixer.c @@ -132,6 +132,7 @@ void aInterleaveImpl(uint16_t dest, uint16_t left, uint16_t right, uint16_t c) { return; } + // Im sure this should be 3 but hey int count = ROUND_UP_16(rspa.nbytes) >> 4; int16_t *l = BUF_S16(left); @@ -273,7 +274,7 @@ void aResampleImpl(uint8_t flags, uint16_t pitch, RESAMPLE_STATE state) { void aEnvSetup1Impl(uint8_t initial_vol_wet, uint16_t rate_wet, uint16_t rate_left, uint16_t rate_right) { rspa.vol_wet = (uint16_t)(initial_vol_wet << 8); rspa.rate_wet = rate_wet; - rspa.rate[0] = 0; + rspa.rate[0] = rate_left; rspa.rate[1] = rate_right; } @@ -288,10 +289,12 @@ void aEnvMixerImpl(uint16_t in_addr, uint16_t n_samples, bool swap_reverb, int32_t wet_dry_addr, uint32_t unk) { swap_reverb = false; + neg_3 = 0; + neg_2 = 0; int16_t *in = BUF_S16(in_addr); int16_t *dry[2] = {BUF_S16(((wet_dry_addr >> 24) & 0xFF) << 4), BUF_S16(((wet_dry_addr >> 16) & 0xFF) << 4)}; int16_t *wet[2] = {BUF_S16(((wet_dry_addr >> 8) & 0xFF) << 4), BUF_S16(((wet_dry_addr) & 0xFF) << 4)}; - int16_t negs[4] = {neg_left ? -1 : 0, neg_right ? -1 : 0, 0, 0}; + int16_t negs[4] = {neg_left ? -1 : 0, neg_right ? -1 : 0, neg_3 ? -4 : 0, neg_2 ? -2 : 0}; int swapped[2] = {swap_reverb ? 1 : 0, swap_reverb ? 0 : 1}; int n = ROUND_UP_16(n_samples); diff --git a/src/audio/port_eu.c b/src/audio/port_eu.c index c40fc49d2..60fbc1dbd 100644 --- a/src/audio/port_eu.c +++ b/src/audio/port_eu.c @@ -160,7 +160,7 @@ struct SPTask* create_next_audio_frame_task(void) { gAiBufferLengths[index] = gAudioBufferParameters.maxAiBufferLength; } if (osRecvMesg(D_800EA3AC, &sp54, 0) != -1) { - func_800CBCB0((u32) sp54.data16); + func_800CBCB0(sp54.data32); } gAudioCmd = synthesis_execute((Acmd*) gAudioCmd, &writtenCmds, currAiBuffer, gAiBufferLengths[index]); gAudioRandom = osGetCount() * (gAudioRandom + gAudioFrameCount); @@ -300,26 +300,26 @@ void func_800CBBE8(u32 arg0, s8 arg1) { } //! @todo clenanup, something's weird with the variables. D_800EA4A4 is probably EuAudioCmd bc of the + 0x100 +#if 1 void func_800CBC24(void) { s32 temp_t6; s32 test; - OSMesg thing; temp_t6 = D_800EA3A0[0] - D_800EA3A4[0]; test = (u8) temp_t6; test = (test + 0x100) & 0xFF; - do { - } while (0); if (D_800EA4A4 < test) { D_800EA4A4 = test; } - OSMesg audioMesg; - audioMesg.ptr = ((D_800EA3A0[0] & 0xFF) | ((D_800EA3A4[0] & 0xFF) << 8)); - - thing = audioMesg; - osSendMesg(D_800EA3AC, thing, 0); + osSendMesg(D_800EA3AC, OS_MESG_32(((D_800EA3A0[0] & 0xFF) | ((D_800EA3A4[0] & 0xFF) << 8))), 0); D_800EA3A4[0] = D_800EA3A0[0]; } +#else +void func_800CBC24(void) { + osSendMesg(D_800EA3AC, OS_MESG_32(((D_800EA3A0[0] & 0xff) << 8 | (D_800EA3A4[0] & 0xff))), OS_MESG_NOBLOCK); + D_800EA3A4[0] = D_800EA3A0[0]; +} +#endif void func_800CBCB0(u32 arg0) { struct EuAudioCmd* cmd;