From ff9b185a7f6e4794ebe5a07b7970dc11c695e6cc Mon Sep 17 00:00:00 2001 From: "j4ck.fr0st" Date: Mon, 5 Apr 2010 13:05:47 +0000 Subject: [PATCH] Fixed game-specific Wii/Widescreen and RE0 Hack checkboxes. Disabled game-specific Wii/Progressive Scan checkbox, since its never used by Dolphin; it would cause side-effects to global configuration if we did write to SysConf in that place. Fixes Issue 2518 git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5283 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/Core.cpp | 9 ++++++++- Source/Core/DolphinWX/Src/ISOProperties.cpp | 7 +++++++ Source/Plugins/Plugin_DSP_HLE/Src/Config.cpp | 8 ++++++++ Source/Plugins/Plugin_DSP_HLE/Src/Config.h | 5 +++++ Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_AX.cpp | 2 +- Source/Plugins/Plugin_DSP_HLE/Src/main.cpp | 5 +++-- 6 files changed, 32 insertions(+), 4 deletions(-) diff --git a/Source/Core/Core/Src/Core.cpp b/Source/Core/Core/Src/Core.cpp index 55ddeecbe2..cd78d897e5 100644 --- a/Source/Core/Core/Src/Core.cpp +++ b/Source/Core/Core/Src/Core.cpp @@ -338,7 +338,14 @@ THREAD_RETURN EmuThread(void *pArg) VideoInitialize.Fifo_CPUBase = &ProcessorInterface::Fifo_CPUBase; VideoInitialize.Fifo_CPUEnd = &ProcessorInterface::Fifo_CPUEnd; VideoInitialize.Fifo_CPUWritePointer = &ProcessorInterface::Fifo_CPUWritePointer; - VideoInitialize.bAutoAspectIs16_9 = _CoreParameter.bWii ? (SConfig::GetInstance().m_SYSCONF->GetData("IPL.AR") ? true : false) : false; + bool aspectWide = _CoreParameter.bWii; + if (aspectWide) + { + IniFile gameIni; + gameIni.Load(_CoreParameter.m_strGameIni.c_str()); + gameIni.Get("Wii", "Widescreen", &aspectWide, !!SConfig::GetInstance().m_SYSCONF->GetData("IPL.AR")); + } + VideoInitialize.bAutoAspectIs16_9 = aspectWide; Plugins.GetVideo()->Initialize(&VideoInitialize); // Call the dll diff --git a/Source/Core/DolphinWX/Src/ISOProperties.cpp b/Source/Core/DolphinWX/Src/ISOProperties.cpp index ffc531920d..01f1b6e934 100644 --- a/Source/Core/DolphinWX/Src/ISOProperties.cpp +++ b/Source/Core/DolphinWX/Src/ISOProperties.cpp @@ -299,6 +299,13 @@ void CISOProperties::CreateGUIControls(bool IsWad) EnableProgressiveScan->Hide(); EnableWideScreen->Hide(); } + else + { + //Progressive Scan is not used by Dolphin itself, + //and changing it on a per-game basis would have the side-effect of changing the SysConf, + //making this setting rather useless. + EnableProgressiveScan->Disable(); + } // Video sbVideoOverrides = new wxStaticBoxSizer(wxVERTICAL, m_GameConfig, _("Video")); ForceFiltering = new wxCheckBox(m_GameConfig, ID_FORCEFILTERING, _("Force Filtering"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator); diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/Config.cpp b/Source/Plugins/Plugin_DSP_HLE/Src/Config.cpp index 48da157aaf..d3178e211d 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/Config.cpp +++ b/Source/Plugins/Plugin_DSP_HLE/Src/Config.cpp @@ -36,6 +36,7 @@ void CConfig::Load() file.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "DSP.ini").c_str()); file.Get("Config", "EnableHLEAudio", &m_EnableHLEAudio, true); // Sound Settings file.Get("Config", "EnableRE0AudioFix", &m_EnableRE0Fix, false); // RE0 Hack + m_RE0Fix = m_EnableRE0Fix; ac_Config.Load(file); } @@ -49,3 +50,10 @@ void CConfig::Save() file.Save((std::string(File::GetUserPath(D_CONFIG_IDX)) + "DSP.ini").c_str()); } + +void CConfig::LoadGameIni(const char* gameIniPath) +{ + IniFile gameIni; + gameIni.Load(gameIniPath); + gameIni.Get("HLEaudio", "UseRE0Fix", &m_RE0Fix, m_EnableRE0Fix); +} diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/Config.h b/Source/Plugins/Plugin_DSP_HLE/Src/Config.h index 68e7f70326..9a55711da2 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/Config.h +++ b/Source/Plugins/Plugin_DSP_HLE/Src/Config.h @@ -23,12 +23,17 @@ struct CConfig { bool m_EnableHLEAudio; + //is the RE0 fix enabled in config? bool m_EnableRE0Fix; + //is the RE0 supposed to be used? + //this value includes game.ini, avoiding overwrite of config + bool m_RE0Fix; CConfig(); void Load(); void Save(); + void LoadGameIni(const char*); }; extern CConfig g_Config; diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_AX.cpp b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_AX.cpp index 8265a792d1..6bd4f6ee1b 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_AX.cpp +++ b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_AX.cpp @@ -66,7 +66,7 @@ static void ProcessUpdates(AXPB &PB) int on = 0, off = 0; for (int j = 0; j < numupd; j++) { - int k = g_Config.m_EnableRE0Fix ? 0 : j; + int k = g_Config.m_RE0Fix ? 0 : j; const u16 updpar = Memory_Read_U16(updaddr + k); const u16 upddata = Memory_Read_U16(updaddr + k + 2); diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/main.cpp b/Source/Plugins/Plugin_DSP_HLE/Src/main.cpp index c90f9f209b..199f1d14d6 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/main.cpp +++ b/Source/Plugins/Plugin_DSP_HLE/Src/main.cpp @@ -142,8 +142,9 @@ void GetDllInfo(PLUGIN_INFO* _PluginInfo) void SetDllGlobals(PLUGIN_GLOBALS* _pPluginGlobals) { - globals = _pPluginGlobals; - LogManager::SetInstance((LogManager *)globals->logManager); + globals = _pPluginGlobals; + LogManager::SetInstance((LogManager *)globals->logManager); + g_Config.LoadGameIni(globals->game_ini); } void DllConfig(HWND _hParent)