From 941ca9d46cd454ed3943331eef7257309cb7c510 Mon Sep 17 00:00:00 2001 From: death2droid Date: Sun, 10 May 2009 12:33:47 +0000 Subject: [PATCH] Add the ability to set UseRE0 hack in game.ini. Tho at the moment there is a bug with changing it in the GUI when ever you change it it automatically resets to nothing. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3193 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/DolphinWX/Src/ISOProperties.cpp | 19 +++++++++++++++++-- Source/Core/DolphinWX/Src/ISOProperties.h | 4 ++++ Source/Plugins/Plugin_DSP_HLE/Src/Config.cpp | 11 +++++++++++ Source/Plugins/Plugin_DSP_HLE/Src/Config.h | 2 +- .../Plugins/Plugin_DSP_HLE/Src/ConfigDlg.cpp | 1 + 5 files changed, 34 insertions(+), 3 deletions(-) diff --git a/Source/Core/DolphinWX/Src/ISOProperties.cpp b/Source/Core/DolphinWX/Src/ISOProperties.cpp index 1e9776a4e1..83281205d7 100644 --- a/Source/Core/DolphinWX/Src/ISOProperties.cpp +++ b/Source/Core/DolphinWX/Src/ISOProperties.cpp @@ -280,11 +280,14 @@ void CISOProperties::CreateGUIControls() ProjHack1 = new wxCheckBox(m_GameConfig, ID_PROJHACK1, _("Projection Hack"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator); ForceFiltering = new wxCheckBox(m_GameConfig, ID_FORCEFILTERING, _("Force Filtering"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator); EFBCopyDisable = new wxCheckBox(m_GameConfig, ID_EFBCOPYDISABLE, _("Disable Copy to EFB"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator); - EFBCopyDisableHotKey = new wxCheckBox(m_GameConfig, ID_EFBCOPYDISABLEHOTKEY, _("With Hotkey E"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator); + EFBCopyDisableHotKey = new wxCheckBox(m_GameConfig, ID_EFBCOPYDISABLEHOTKEY, _("With Hotkey E"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator); EFBToTextureEnable = new wxCheckBox(m_GameConfig, ID_EFBTOTEXTUREENABLE, _("Enable EFB To Texture"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator); SafeTextureCache = new wxCheckBox(m_GameConfig, ID_SAFETEXTURECACHE, _("Safe Texture Cache"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator); DstAlphaPass = new wxCheckBox(m_GameConfig, ID_DSTALPHAPASS, _("Distance Alpha Pass"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator); UseXFB = new wxCheckBox(m_GameConfig, ID_USEXFB, _("Use XFB"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator); + //HLE Audio + sbHLEaudioOverrides = new wxStaticBoxSizer(wxVERTICAL, m_GameConfig, _("HLE Audio")); + UseRE0Fix = new wxCheckBox(m_GameConfig, ID_RE0FIX, _("Use RE0 Fix"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator); // Manual edit config file sEmuState = new wxBoxSizer(wxHORIZONTAL); EditConfig = new wxButton(m_GameConfig, ID_EDITCONFIG, _("Edit Config"), wxDefaultPosition, wxDefaultSize); @@ -311,14 +314,16 @@ void CISOProperties::CreateGUIControls() sbVideoOverrides->Add(ProjHack1, 0, wxEXPAND|wxLEFT, 5); sbVideoOverrides->Add(ForceFiltering, 0, wxEXPAND|wxLEFT, 5); sbVideoOverrides->Add(EFBCopyDisable, 0, wxEXPAND|wxLEFT, 5); - sbVideoOverrides->Add(EFBCopyDisableHotKey, 0, wxEXPAND|wxLEFT, 5); + sbVideoOverrides->Add(EFBCopyDisableHotKey, 0, wxEXPAND|wxLEFT, 5); sbVideoOverrides->Add(EFBToTextureEnable, 0, wxEXPAND|wxLEFT, 5); sbVideoOverrides->Add(SafeTextureCache, 0, wxEXPAND|wxLEFT, 5); sbVideoOverrides->Add(DstAlphaPass, 0, wxEXPAND|wxLEFT, 5); sbVideoOverrides->Add(UseXFB, 0, wxEXPAND|wxLEFT, 5); + sbHLEaudioOverrides->Add(UseRE0Fix, 0, wxEXPAND|wxLEFT, 5); sbGameConfig->Add(sbCoreOverrides, 0, wxEXPAND); sbGameConfig->Add(sbWiiOverrides, 0, wxEXPAND); sbGameConfig->Add(sbVideoOverrides, 0, wxEXPAND); + sbGameConfig->Add(sbHLEaudioOverrides, 0, wxEXPAND); sbGameConfig->Add(EditConfig); sConfigPage->Add(sbGameConfig, 0, wxEXPAND|wxALL, 5); sEmuState->Add(EmuStateText, 0, wxALIGN_CENTER_VERTICAL); @@ -646,6 +651,12 @@ void CISOProperties::LoadGameConfig() else UseXFB->Set3StateValue(wxCHK_UNDETERMINED); + if (GameIni.Get("HLEsound", "UseRE0Fix", &bTemp)) + UseRE0Fix->Set3StateValue((wxCheckBoxState)bTemp); + else + UseRE0Fix->Set3StateValue(wxCHK_UNDETERMINED); + + GameIni.Get("EmuState", "EmulationStateId", &iTemp, -1); if (iTemp == -1) { @@ -744,6 +755,10 @@ bool CISOProperties::SaveGameConfig() else GameIni.Set("Video", "UseXFB", UseXFB->Get3StateValue()); + if (UseRE0Fix->Get3StateValue() == wxCHK_UNDETERMINED) + GameIni.DeleteKey("HLEaudio", "UseRE0Fix"); + else + GameIni.Set("HLEaudio", "UseRE0Fix", UseRE0Fix->Get3StateValue()); GameIni.Set("EmuState", "EmulationStateId", EmuState->GetSelection()); GameIni.Set("EmuState", "EmulationIssues", EmuIssues->GetValue()); diff --git a/Source/Core/DolphinWX/Src/ISOProperties.h b/Source/Core/DolphinWX/Src/ISOProperties.h index 822e786a67..70e19267a5 100644 --- a/Source/Core/DolphinWX/Src/ISOProperties.h +++ b/Source/Core/DolphinWX/Src/ISOProperties.h @@ -58,6 +58,7 @@ class CISOProperties : public wxDialog wxStaticBoxSizer *sbCoreOverrides; wxStaticBoxSizer *sbWiiOverrides; wxStaticBoxSizer *sbVideoOverrides; + wxStaticBoxSizer *sbHLEaudioOverrides; wxBoxSizer *sEmuState; wxBoxSizer *sPatches; wxBoxSizer *sPatchButtons; @@ -86,6 +87,8 @@ class CISOProperties : public wxDialog wxCheckBox *ProjHack1, *ForceFiltering, *EFBCopyDisable, *EFBCopyDisableHotKey, *EFBToTextureEnable, *SafeTextureCache, *DstAlphaPass, *UseXFB; + // HLE Audio + wxCheckBox *UseRE0Fix; wxButton *EditConfig; wxStaticText *EmuStateText; @@ -160,6 +163,7 @@ class CISOProperties : public wxDialog ID_SAFETEXTURECACHE, ID_DSTALPHAPASS, ID_USEXFB, + ID_RE0FIX, ID_ENABLEPROGRESSIVESCAN, ID_ENABLEWIDESCREEN, ID_OPTIMIZEQUANTIZERS, diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/Config.cpp b/Source/Plugins/Plugin_DSP_HLE/Src/Config.cpp index 4fb6eec8cc..68930bf337 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/Config.cpp +++ b/Source/Plugins/Plugin_DSP_HLE/Src/Config.cpp @@ -15,6 +15,7 @@ // Official SVN repository and contact information can be found at // http://code.google.com/p/dolphin-emu/ +#include "Globals.h" #include "Common.h" #include "IniFile.h" #include "Config.h" @@ -49,3 +50,13 @@ void CConfig::Save() file.Save(FULL_CONFIG_DIR "DSP.ini"); } + +void CConfig::GameIniLoad() { + IniFile *iniFile = ((struct SConfig *)globals->config)->m_LocalCoreStartupParameter.gameIni; + if (! iniFile) + return; + + if (iniFile->Exists("HLEaudio", "UseRE0Fix")) + iniFile->Get("HLEaudio", "UseRE0Fix", &m_EnableRE0Fix, 0); +} + diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/Config.h b/Source/Plugins/Plugin_DSP_HLE/Src/Config.h index 8e63cee894..182e9fba70 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/Config.h +++ b/Source/Plugins/Plugin_DSP_HLE/Src/Config.h @@ -28,7 +28,7 @@ struct CConfig CConfig(); void Load(); - + void GameIniLoad(); void Save(); }; diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/ConfigDlg.cpp b/Source/Plugins/Plugin_DSP_HLE/Src/ConfigDlg.cpp index 0c84f115e9..fede3cd81d 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/ConfigDlg.cpp +++ b/Source/Plugins/Plugin_DSP_HLE/Src/ConfigDlg.cpp @@ -32,6 +32,7 @@ ConfigDialog::ConfigDialog(wxWindow *parent, wxWindowID id, const wxString &titl { // Load config settings g_Config.Load(); + g_Config.GameIniLoad(); // Center window CenterOnParent();