From 35aac70cd1ff6d1eb6ad72e7ff9d8a619fe54440 Mon Sep 17 00:00:00 2001 From: arcum42 Date: Tue, 3 Nov 2009 13:31:45 +0000 Subject: [PATCH] Cause the gui to remember if 'Enable Patches' is checked. (Still not used, though.) git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2121 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/Counters.cpp | 4 ++-- pcsx2/gui/MainFrame.cpp | 2 ++ pcsx2/gui/MainFrame.h | 7 ++++--- pcsx2/gui/MainMenuClicks.cpp | 12 ++++++++++++ 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/pcsx2/Counters.cpp b/pcsx2/Counters.cpp index e125782a72..61609d5a55 100644 --- a/pcsx2/Counters.cpp +++ b/pcsx2/Counters.cpp @@ -325,7 +325,7 @@ static __forceinline void frameLimit() // Shortcut for cases where no waiting is needed (they're running slow already, // so don't bog 'em down with extra math...) if( sDeltaTime >= 0 ) return; - + // If we're way ahead then we can afford to sleep the thread a bit. // (note, sleep(1) thru sleep(2) tend to be the least accurate sleeps, and longer // sleeps tend to be pretty reliable, so that's why the convoluted if/else below) @@ -357,7 +357,7 @@ static __forceinline void VSyncStart(u32 sCycle) psxVBlankStart(); if (gates) rcntStartGate(true, sCycle); // Counters Start Gate code - //if (Config.Patch) applypatch(1); // fixme - Apply patches + //if (EmuConfig.EnablePatches) applypatch(1); // fixme - Apply patches // INTC - VB Blank Start Hack -- // Hack fix! This corrects a freezeup in Granda 2 where it decides to spin diff --git a/pcsx2/gui/MainFrame.cpp b/pcsx2/gui/MainFrame.cpp index ba7b675f6f..8ae8e14915 100644 --- a/pcsx2/gui/MainFrame.cpp +++ b/pcsx2/gui/MainFrame.cpp @@ -158,6 +158,7 @@ void MainEmuFrame::ConnectMenus() ConnectMenu( MenuId_Boot_ELF, Menu_OpenELF_Click ); ConnectMenu( MenuId_IsoBrowse, Menu_IsoBrowse_Click ); ConnectMenu( MenuId_SkipBiosToggle, Menu_SkipBiosToggle_Click ); + ConnectMenu( MenuId_EnablePatches, Menu_EnablePatches_Click ); ConnectMenu( MenuId_Exit, Menu_Exit_Click ); ConnectMenu( MenuId_Sys_SuspendResume, Menu_SuspendResume_Click ); @@ -509,6 +510,7 @@ void MainEmuFrame::ApplySettings() wxMenuBar& menubar( *GetMenuBar() ); menubar.Check( MenuId_SkipBiosToggle, g_Conf->EmuOptions.SkipBiosSplash ); + menubar.Check( MenuId_EnablePatches, g_Conf->EmuOptions.EnablePatches ); menubar.Check( MenuId_Config_Multitap0Toggle, g_Conf->EmuOptions.MultitapPort0_Enabled ); menubar.Check( MenuId_Config_Multitap1Toggle, g_Conf->EmuOptions.MultitapPort1_Enabled ); diff --git a/pcsx2/gui/MainFrame.h b/pcsx2/gui/MainFrame.h index b7040b722b..5577438830 100644 --- a/pcsx2/gui/MainFrame.h +++ b/pcsx2/gui/MainFrame.h @@ -78,9 +78,9 @@ public: PerPluginMenuInfo() : MyMenu( *new wxMenu() ) { } - + virtual ~PerPluginMenuInfo() throw(); - + void Populate( PluginsEnum_t pid ); void OnUnloaded(); void OnLoaded(); @@ -112,7 +112,7 @@ protected: wxMenu& m_SaveStatesSubmenu; wxMenuItem& m_MenuItem_Console; - + PerPluginMenuInfo m_PluginMenuPacks[PluginId_Count]; CmdEvt_ListenerBinding m_Listener_CoreThreadStatus; @@ -157,6 +157,7 @@ protected: void Menu_IsoBrowse_Click(wxCommandEvent &event); void Menu_IsoRecent_Click(wxCommandEvent &event); void Menu_SkipBiosToggle_Click(wxCommandEvent &event); + void Menu_EnablePatches_Click(wxCommandEvent &event); void Menu_BootCdvd_Click(wxCommandEvent &event); void Menu_OpenELF_Click(wxCommandEvent &event); diff --git a/pcsx2/gui/MainMenuClicks.cpp b/pcsx2/gui/MainMenuClicks.cpp index 2b950108c5..0c47a110be 100644 --- a/pcsx2/gui/MainMenuClicks.cpp +++ b/pcsx2/gui/MainMenuClicks.cpp @@ -121,6 +121,7 @@ void MainEmuFrame::Menu_BootCdvd_Click( wxCommandEvent &event ) } g_Conf->EmuOptions.SkipBiosSplash = GetMenuBar()->IsChecked( MenuId_SkipBiosToggle ); + g_Conf->EmuOptions.EnablePatches = GetMenuBar()->IsChecked( MenuId_EnablePatches ); AppSaveSettings(); sApp.SysExecute( g_Conf->CdvdSource ); @@ -171,6 +172,17 @@ void MainEmuFrame::Menu_SkipBiosToggle_Click( wxCommandEvent &event ) } } +void MainEmuFrame::Menu_EnablePatches_Click( wxCommandEvent &event ) +{ + g_Conf->EmuOptions.EnablePatches = GetMenuBar()->IsChecked( MenuId_EnablePatches ); + + if( wxConfigBase* conf = GetAppConfig() ) + { + IniSaver saver( *conf ); + g_Conf->EmuOptions.LoadSave( saver ); + } +} + void MainEmuFrame::Menu_OpenELF_Click(wxCommandEvent &event) { CoreThread.Suspend();