A fix to the RE0 Audio fix (Hopefully this fixes it once and for all.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3200 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
death2droid 2009-05-11 13:10:19 +00:00
parent 9a25c5f70b
commit b8fe20e84e
3 changed files with 29 additions and 0 deletions

View file

@ -30,6 +30,8 @@ SConfig::SConfig()
{
// Make sure we have log manager
LoadSettings();
//Mkae sure we load settings
LoadSettingsHLE();
}
@ -247,4 +249,13 @@ void SConfig::LoadSettings()
ini.Get("Core", "WiiMote1Plugin", &m_LocalCoreStartupParameter.m_strWiimotePlugin[0], m_DefaultWiiMotePlugin.c_str());
}
}
void SConfig::LoadSettingsHLE()
{
IniFile ini;
//
ini.Load(FULL_CONFIG_DIR "DSP.ini");
ini.Get("Config", "EnableRE0AudioFix", &m_EnableRE0Fix, false); // RE0 Hack
}

View file

@ -40,6 +40,9 @@ enum INTERFACE_LANGUAGE
struct SConfig
{
//DSP HLE Audio fix
bool m_EnableRE0Fix;
// hard coded default plugins ...
std::string m_DefaultGFXPlugin;
std::string m_DefaultDSPPlugin;
@ -80,6 +83,9 @@ struct SConfig
// load settings
void LoadSettings();
//Special load settings
void LoadSettingsHLE();
/* Return the permanent and somewhat globally used instance of this struct
there is also a Core::GetStartupParameter() instance of it with almost
the same values */

View file

@ -26,6 +26,7 @@
#include "../../PatchEngine.h"
#include "../../CoreTiming.h"
#include "../../Debugger/Debugger_BreakPoints.h"
#include "../../ConfigManager.h"
#include "../PowerPC.h"
#include "../Profiler.h"
#include "../PPCTables.h"
@ -160,6 +161,7 @@ ps_adds1
*/
Jit64 jit;
int CODE_SIZE = 1024*1024*16;
@ -232,6 +234,8 @@ namespace CPUCompare
// This is only called by Default() in this file. It will execute an instruction with the interpreter functions.
void Jit64::WriteCallInterpreter(UGeckoInstruction inst)
{
gpr.Flush(FLUSH_ALL);
fpr.Flush(FLUSH_ALL);
if (js.isLastInstruction)
@ -241,6 +245,14 @@ namespace CPUCompare
}
Interpreter::_interpreterInstruction instr = GetInterpreterOp(inst);
ABI_CallFunctionC((void*)instr, inst.hex);
if (js.isLastInstruction && SConfig::GetInstance().m_EnableRE0Fix )
{
SConfig::GetInstance().LoadSettingsHLE();//Make sure the settings are up to date
MOV(32, R(EAX), M(&NPC));
WriteRfiExitDestInEAX();
}
}
void Jit64::unknown_instruction(UGeckoInstruction inst)