From cff8fe8f77cda18cda80b95364d59dc45a9c6830 Mon Sep 17 00:00:00 2001 From: skidau Date: Tue, 22 Jan 2013 21:17:29 +1100 Subject: [PATCH] Revert the fix for the random static audio that would sometimes occur in DSP HLE and DSP LLE. The fix caused the music in Fast - Racing League to play random sounds. This reverts commit r7bf72a6c8476798ecbb9cdb13ec3a8f0b9858da6. Fixes issue 5910. --- Source/Core/Core/Src/DSP/DSPAccelerator.cpp | 5 +++-- Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AX_Voice.h | 8 +++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Source/Core/Core/Src/DSP/DSPAccelerator.cpp b/Source/Core/Core/Src/DSP/DSPAccelerator.cpp index 2058a92f9d..dcb79b7ac5 100644 --- a/Source/Core/Core/Src/DSP/DSPAccelerator.cpp +++ b/Source/Core/Core/Src/DSP/DSPAccelerator.cpp @@ -165,10 +165,11 @@ u16 dsp_read_accelerator() // Somehow, YN1 and YN2 must be initialized with their "loop" values, // so yeah, it seems likely that we should raise an exception to let // the DSP program do that, at least if DSP_FORMAT == 0x0A. - if ((Address & ~0x1f) == (EndAddress & ~0x1f)) + if (Address >= EndAddress) { // Set address back to start address. - Address = (g_dsp.ifx_regs[DSP_ACSAH] << 16) | g_dsp.ifx_regs[DSP_ACSAL]; + if ((Address & ~0x1f) == (EndAddress & ~0x1f)) + Address = (g_dsp.ifx_regs[DSP_ACSAH] << 16) | g_dsp.ifx_regs[DSP_ACSAL]; DSPCore_SetException(EXP_ACCOV); } diff --git a/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AX_Voice.h b/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AX_Voice.h index e39b38b100..349dc7e03b 100644 --- a/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AX_Voice.h +++ b/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AX_Voice.h @@ -203,10 +203,12 @@ u16 AcceleratorGetSample() // // On real hardware, this would raise an interrupt that is handled by the // UCode. We simulate what this interrupt does here. - if ((*acc_cur_addr & ~0x1F) == (acc_end_addr & ~0x1F)) + if (*acc_cur_addr >= acc_end_addr) { - // If we are really at the end, loop back to loop_addr. - *acc_cur_addr = acc_loop_addr; + // If we are really at the end (and we don't simply have cur_addr > + // end_addr all the time), loop back to loop_addr. + if ((*acc_cur_addr & ~0x1F) == (acc_end_addr & ~0x1F)) + *acc_cur_addr = acc_loop_addr; if (acc_pb->audio_addr.looping) {