Allow setting cpu engine and whatever bHLE_BS2 is from game ini.

This commit is contained in:
rog 2012-12-27 09:42:20 -05:00
parent 94116bf89c
commit 2fd1c9e7c2
3 changed files with 10 additions and 8 deletions

View File

@ -47,7 +47,6 @@
#include "VideoBackendBase.h" #include "VideoBackendBase.h"
#include "Movie.h" #include "Movie.h"
namespace BootManager namespace BootManager
{ {
@ -56,8 +55,8 @@ namespace BootManager
struct ConfigCache struct ConfigCache
{ {
bool valid, bCPUThread, bSkipIdle, bEnableFPRF, bMMU, bMMUBAT, bool valid, bCPUThread, bSkipIdle, bEnableFPRF, bMMU, bMMUBAT,
bVBeam, bFastDiscSpeed, bMergeBlocks, bDSPHLE, bDisableWiimoteSpeaker; bVBeam, bFastDiscSpeed, bMergeBlocks, bDSPHLE, bDisableWiimoteSpeaker, bHLE_BS2;
int iTLBHack; int iTLBHack, iCPUCore;
std::string strBackend; std::string strBackend;
}; };
static ConfigCache config_cache; static ConfigCache config_cache;
@ -90,6 +89,7 @@ bool BootCore(const std::string& _rFilename)
config_cache.valid = true; config_cache.valid = true;
config_cache.bCPUThread = StartUp.bCPUThread; config_cache.bCPUThread = StartUp.bCPUThread;
config_cache.bSkipIdle = StartUp.bSkipIdle; config_cache.bSkipIdle = StartUp.bSkipIdle;
config_cache.iCPUCore = StartUp.iCPUCore;
config_cache.bEnableFPRF = StartUp.bEnableFPRF; config_cache.bEnableFPRF = StartUp.bEnableFPRF;
config_cache.bMMU = StartUp.bMMU; config_cache.bMMU = StartUp.bMMU;
config_cache.bMMUBAT = StartUp.bMMUBAT; config_cache.bMMUBAT = StartUp.bMMUBAT;
@ -100,6 +100,7 @@ bool BootCore(const std::string& _rFilename)
config_cache.bDSPHLE = StartUp.bDSPHLE; config_cache.bDSPHLE = StartUp.bDSPHLE;
config_cache.bDisableWiimoteSpeaker = StartUp.bDisableWiimoteSpeaker; config_cache.bDisableWiimoteSpeaker = StartUp.bDisableWiimoteSpeaker;
config_cache.strBackend = StartUp.m_strVideoBackend; config_cache.strBackend = StartUp.m_strVideoBackend;
config_cache.bHLE_BS2 = StartUp.bHLE_BS2;
// General settings // General settings
game_ini.Get("Core", "CPUThread", &StartUp.bCPUThread, StartUp.bCPUThread); game_ini.Get("Core", "CPUThread", &StartUp.bCPUThread, StartUp.bCPUThread);
@ -114,6 +115,8 @@ bool BootCore(const std::string& _rFilename)
game_ini.Get("Core", "DSPHLE", &StartUp.bDSPHLE, StartUp.bDSPHLE); game_ini.Get("Core", "DSPHLE", &StartUp.bDSPHLE, StartUp.bDSPHLE);
game_ini.Get("Wii", "DisableWiimoteSpeaker",&StartUp.bDisableWiimoteSpeaker, StartUp.bDisableWiimoteSpeaker); game_ini.Get("Wii", "DisableWiimoteSpeaker",&StartUp.bDisableWiimoteSpeaker, StartUp.bDisableWiimoteSpeaker);
game_ini.Get("Core", "GFXBackend", &StartUp.m_strVideoBackend, StartUp.m_strVideoBackend.c_str()); game_ini.Get("Core", "GFXBackend", &StartUp.m_strVideoBackend, StartUp.m_strVideoBackend.c_str());
game_ini.Get("Core", "CPUCore", &StartUp.iCPUCore, StartUp.iCPUCore);
game_ini.Get("Core", "HLE_BS2", &StartUp.bHLE_BS2, StartUp.bHLE_BS2);
VideoBackend::ActivateBackend(StartUp.m_strVideoBackend); VideoBackend::ActivateBackend(StartUp.m_strVideoBackend);
if (Movie::IsPlayingInput() && Movie::IsConfigSaved()) if (Movie::IsPlayingInput() && Movie::IsConfigSaved())
@ -123,6 +126,7 @@ bool BootCore(const std::string& _rFilename)
StartUp.bDSPHLE = Movie::IsDSPHLE(); StartUp.bDSPHLE = Movie::IsDSPHLE();
StartUp.bProgressive = Movie::IsProgressive(); StartUp.bProgressive = Movie::IsProgressive();
StartUp.bFastDiscSpeed = Movie::IsFastDiscSpeed(); StartUp.bFastDiscSpeed = Movie::IsFastDiscSpeed();
StartUp.iCPUCore = Movie::GetCPUMode();
if (Movie::IsUsingMemcard() && Movie::IsStartingFromClearSave() && !StartUp.bWii) if (Movie::IsUsingMemcard() && Movie::IsStartingFromClearSave() && !StartUp.bWii)
{ {
if (File::Exists("Movie.raw")) if (File::Exists("Movie.raw"))
@ -159,6 +163,7 @@ void Stop()
config_cache.valid = false; config_cache.valid = false;
StartUp.bCPUThread = config_cache.bCPUThread; StartUp.bCPUThread = config_cache.bCPUThread;
StartUp.bSkipIdle = config_cache.bSkipIdle; StartUp.bSkipIdle = config_cache.bSkipIdle;
StartUp.iCPUCore = config_cache.iCPUCore;
StartUp.bEnableFPRF = config_cache.bEnableFPRF; StartUp.bEnableFPRF = config_cache.bEnableFPRF;
StartUp.bMMU = config_cache.bMMU; StartUp.bMMU = config_cache.bMMU;
StartUp.bMMUBAT = config_cache.bMMUBAT; StartUp.bMMUBAT = config_cache.bMMUBAT;
@ -170,6 +175,7 @@ void Stop()
StartUp.bDisableWiimoteSpeaker = config_cache.bDisableWiimoteSpeaker; StartUp.bDisableWiimoteSpeaker = config_cache.bDisableWiimoteSpeaker;
StartUp.m_strVideoBackend = config_cache.strBackend; StartUp.m_strVideoBackend = config_cache.strBackend;
VideoBackend::ActivateBackend(StartUp.m_strVideoBackend); VideoBackend::ActivateBackend(StartUp.m_strVideoBackend);
StartUp.bHLE_BS2 = config_cache.bHLE_BS2;
} }
} }

View File

@ -431,7 +431,7 @@ void EmuThread()
CBoot::BootUp(); CBoot::BootUp();
// Setup our core, but can't use dynarec if we are compare server // Setup our core, but can't use dynarec if we are compare server
if (Movie::GetCPUMode() && (!_CoreParameter.bRunCompareServer || if (_CoreParameter.iCPUCore && (!_CoreParameter.bRunCompareServer ||
_CoreParameter.bRunCompareClient)) _CoreParameter.bRunCompareClient))
PowerPC::SetMode(PowerPC::MODE_JIT); PowerPC::SetMode(PowerPC::MODE_JIT);
else else

View File

@ -37,10 +37,6 @@ namespace
void CCPU::Init(int cpu_core) void CCPU::Init(int cpu_core)
{ {
if (Movie::IsPlayingInput() && Movie::IsConfigSaved())
{
cpu_core = Movie::GetCPUMode();
}
PowerPC::Init(cpu_core); PowerPC::Init(cpu_core);
m_SyncEvent = 0; m_SyncEvent = 0;
} }