Added an option "Enable Loop Audio Hack" in DSP config.

I know hack is not good but before we find a better way to detect different games, at least this option allows some games to output normal sound without breaking other games.

Besides, this commit will hopefully fix the "Unknown device: /dev/usb/hid" issue, but not sure as I have no game to test on this issue.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4623 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
ayuanx
2009-11-28 11:40:04 +00:00
parent 60352d92eb
commit 0f7b1a2f95
7 changed files with 42 additions and 15 deletions

View File

@ -21,8 +21,9 @@
#include "UCodes.h"
#include "UCode_AX_ADPCM.h"
#include "UCode_AX.h"
#include "../main.h"
#include "Mixer.h"
#include "../main.h"
#include "../Config.h"
// ----------------------------------------------------
// Externals
@ -92,7 +93,6 @@ inline void MixAddVoice(ParamBlockType &pb, int *templbuffer, int *temprbuffer,
// =============
if (pb.running)
{
// Read initial parameters
// ------------
//constants
@ -191,7 +191,9 @@ inline void MixAddVoice(ParamBlockType &pb, int *templbuffer, int *temprbuffer,
break;
case AUDIOFORMAT_ADPCM:
sample = ADPCM_Step(pb.adpcm, samplePos, newSamplePos, frac);
u32 toSamplePos;
toSamplePos = (newSamplePos > sampleEnd) ? sampleEnd : newSamplePos;
sample = ADPCM_Step(pb.adpcm, samplePos, toSamplePos, frac);
break;
default:
@ -246,7 +248,7 @@ inline void MixAddVoice(ParamBlockType &pb, int *templbuffer, int *temprbuffer,
}
else
{
if (Wii && (_uCode == UCODE_AXWII))
if (!g_Config.m_EnableLoopFix && Wii && (_uCode == UCODE_AXWII))
{
// This accurate boundary wrapping will fix the hangup in many AXWii games like:
// New Super Mario Bros.Wii, Fatal Frame 4, Resident Evil Darkside Chronicles
@ -261,7 +263,9 @@ inline void MixAddVoice(ParamBlockType &pb, int *templbuffer, int *temprbuffer,
{
pb.running = 0;
}
// not sure if this will mute the unwanted over looping sound
pb.mixer.volume_left = 0;
pb.mixer.volume_right = 0;
break;
}
}