Skip to content
Permalink
Browse files
Adjusted the audio loop criteria, using >= on the Wii and == on GC. T…
…his fixes the audio static that occurred in Wii games after hours of play.

Fixes issue 5938.
Fixes issue 6067.
  • Loading branch information
skidau committed Mar 25, 2013
1 parent b00201d commit 51290fd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
@@ -21,6 +21,8 @@
#include "DSPHost.h"
#include "DSPHWInterface.h"
#include "DSPInterpreter.h"
#include "CoreTiming.h"
#include "Core.h"

// The hardware adpcm decoder :)
static s16 ADPCM_Step(u32& _rSamplePos)
@@ -168,9 +170,11 @@ u16 dsp_read_accelerator()
if (Address >= EndAddress)
{
// Set address back to start address.
if ((Address & ~0x1f) == (EndAddress & ~0x1f))
if (Core::g_CoreStartupParameter.bWii || Address == EndAddress)
{
Address = (g_dsp.ifx_regs[DSP_ACSAH] << 16) | g_dsp.ifx_regs[DSP_ACSAL];
DSPCore_SetException(EXP_ACCOV);
DSPCore_SetException(EXP_ACCOV);
}
}

g_dsp.ifx_regs[DSP_ACCAH] = Address >> 16;
@@ -29,6 +29,8 @@
#include "Common.h"
#include "UCode_AX_Structs.h"
#include "../../DSP.h"
#include "CoreTiming.h"
#include "Core.h"

#ifdef AX_GC
# define PB_TYPE AXPB
@@ -205,9 +207,8 @@ u16 AcceleratorGetSample()
// UCode. We simulate what this interrupt does here.
if (*acc_cur_addr >= acc_end_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))
// loop back to loop_addr.
if (Core::g_CoreStartupParameter.bWii || *acc_cur_addr == acc_end_addr)
*acc_cur_addr = acc_loop_addr;

if (acc_pb->audio_addr.looping)

0 comments on commit 51290fd

Please sign in to comment.