hackfix for per-game settings overriding the main settings. This quick and dirty hack goes out to billiard in return for his own generous hacks. fixes issue 3004. it's a hack, so it should be replaced with a more sane method...

also: hacks.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6337 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Shawn Hoffman 2010-11-03 07:37:13 +00:00
parent e1549658a2
commit 7b23bf666f
2 changed files with 32 additions and 1 deletions

View File

@ -63,6 +63,16 @@ namespace BootManager
extern "C" HINSTANCE wxGetInstance();
#endif
// TODO this is an ugly hack which allows us to restore values trampled by per-game settings
// Apply fire liberally
struct ConfigCache
{
bool bCPUThread, bSkipIdle, bEnableFPRF, bMMU, bMMUBAT,
bAlternateRFI, bFastDiscSpeed, bMergeBlocks;
int iTLBHack;
};
static ConfigCache config_cache;
// Boot the ISO or file
bool BootCore(const std::string& _rFilename)
{
@ -102,6 +112,15 @@ bool BootCore(const std::string& _rFilename)
StartUp.m_strGameIni = std::string(File::GetUserPath(D_GAMECONFIG_IDX)) + unique_id + ".ini";
if (unique_id.size() == 6 && game_ini.Load(StartUp.m_strGameIni.c_str()))
{
config_cache.bCPUThread = StartUp.bCPUThread;
config_cache.bSkipIdle = StartUp.bSkipIdle;
config_cache.bEnableFPRF = StartUp.bEnableFPRF;
config_cache.bMMU = StartUp.bMMU;
config_cache.bMMUBAT = StartUp.bMMUBAT;
config_cache.iTLBHack = StartUp.iTLBHack;
config_cache.bAlternateRFI = StartUp.bAlternateRFI;
config_cache.bFastDiscSpeed = StartUp.bFastDiscSpeed;
config_cache.bMergeBlocks = StartUp.bMergeBlocks;
// General settings
game_ini.Get("Core", "CPUThread", &StartUp.bCPUThread, StartUp.bCPUThread);
game_ini.Get("Core", "SkipIdle", &StartUp.bSkipIdle, StartUp.bSkipIdle);
@ -148,6 +167,18 @@ bool BootCore(const std::string& _rFilename)
void Stop()
{
Core::Stop();
SCoreStartupParameter& StartUp = SConfig::GetInstance().m_LocalCoreStartupParameter;
StartUp.bCPUThread = config_cache.bCPUThread;
StartUp.bSkipIdle = config_cache.bSkipIdle;
StartUp.bEnableFPRF = config_cache.bEnableFPRF;
StartUp.bMMU = config_cache.bMMU;
StartUp.bMMUBAT = config_cache.bMMUBAT;
StartUp.iTLBHack = config_cache.iTLBHack;
StartUp.bAlternateRFI = config_cache.bAlternateRFI;
StartUp.bFastDiscSpeed = config_cache.bFastDiscSpeed;
StartUp.bMergeBlocks = config_cache.bMergeBlocks;
}
} // namespace

View File

@ -913,7 +913,7 @@ void CFrame::DoStop()
g_pCodeWindow->ToggleDLLWindow(IDM_VIDEOWINDOW, false);
}
Core::Stop();
BootManager::Stop();
// Destroy the renderer frame when not rendering to main
m_RenderParent->Disconnect(wxID_ANY, wxEVT_SIZE,