From 05d50510965b264f598ac62da1be72312cedaeaf Mon Sep 17 00:00:00 2001 From: "ramapcsx2.code" Date: Wed, 14 Aug 2013 09:48:36 +0000 Subject: [PATCH] Finishing up widescreen patch support: Add GUI toggle and connect it. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5716 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/Config.h | 2 +- pcsx2/Pcsx2Config.cpp | 1 + pcsx2/System/SysCoreThread.cpp | 1 + pcsx2/gui/App.h | 1 + pcsx2/gui/AppCoreThread.cpp | 21 ++++++++++++--------- pcsx2/gui/MainFrame.cpp | 5 +++++ pcsx2/gui/MainFrame.h | 1 + pcsx2/gui/MainMenuClicks.cpp | 6 ++++++ 8 files changed, 28 insertions(+), 10 deletions(-) diff --git a/pcsx2/Config.h b/pcsx2/Config.h index 8e4070e2be..48a81287f6 100644 --- a/pcsx2/Config.h +++ b/pcsx2/Config.h @@ -410,7 +410,7 @@ struct Pcsx2Config CdvdDumpBlocks :1, // enables cdvd block dumping EnablePatches :1, // enables patch detection and application EnableCheats :1, // enables cheat detection and application - + EnableWideScreenPatches :1, // when enabled uses BOOT2 injection, skipping sony bios splashes UseBOOT2Injection :1, BackupSavestate :1, diff --git a/pcsx2/Pcsx2Config.cpp b/pcsx2/Pcsx2Config.cpp index 93b5a79c82..e33555803e 100644 --- a/pcsx2/Pcsx2Config.cpp +++ b/pcsx2/Pcsx2Config.cpp @@ -387,6 +387,7 @@ void Pcsx2Config::LoadSave( IniInterface& ini ) IniBitBool( CdvdDumpBlocks ); IniBitBool( EnablePatches ); IniBitBool( EnableCheats ); + IniBitBool( EnableWideScreenPatches ); IniBitBool( ConsoleToStdio ); IniBitBool( HostFs ); diff --git a/pcsx2/System/SysCoreThread.cpp b/pcsx2/System/SysCoreThread.cpp index 8248252cf1..a968bb27a2 100644 --- a/pcsx2/System/SysCoreThread.cpp +++ b/pcsx2/System/SysCoreThread.cpp @@ -219,6 +219,7 @@ void SysCoreThread::VsyncInThread() { if (EmuConfig.EnablePatches) ApplyPatch(); if (EmuConfig.EnableCheats) ApplyCheat(); + if (EmuConfig.EnableWideScreenPatches) ApplyCheat(); } void SysCoreThread::GameStartingInThread() diff --git a/pcsx2/gui/App.h b/pcsx2/gui/App.h index 54c85a1893..9ec953a847 100644 --- a/pcsx2/gui/App.h +++ b/pcsx2/gui/App.h @@ -102,6 +102,7 @@ enum MenuIdentifiers MenuId_EnableBackupStates, // Checkbox to enable/disables savestates backup MenuId_EnablePatches, MenuId_EnableCheats, + MenuId_EnableWideScreenPatches, MenuId_EnableHostFs, MenuId_State_Load, diff --git a/pcsx2/gui/AppCoreThread.cpp b/pcsx2/gui/AppCoreThread.cpp index 8ffdb43772..bdc3583cc2 100644 --- a/pcsx2/gui/AppCoreThread.cpp +++ b/pcsx2/gui/AppCoreThread.cpp @@ -305,11 +305,14 @@ void AppCoreThread::ApplySettings( const Pcsx2Config& src ) wxString gamePatch; wxString gameFixes; wxString gameCheats; - wxString gameWsHacks; + wxString gameWsHacks; wxString gameName; wxString gameCompat; + int numberLoadedCheats; + int numberLoadedWideScreenPatches; + if (ElfCRC) gameCRC.Printf( L"%8.8x", ElfCRC ); if (!DiscSerial.IsEmpty()) gameSerial = L" [" + DiscSerial + L"]"; @@ -352,17 +355,17 @@ void AppCoreThread::ApplySettings( const Pcsx2Config& src ) ResetCheatsCount(); if (EmuConfig.EnableCheats) { - if (int cheats = LoadCheats(gameCRC, PathDefs::GetCheats(), L"Cheats")) { - gameCheats.Printf(L" [%d Cheats]", cheats); + if (numberLoadedCheats = LoadCheats(gameCRC, PathDefs::GetCheats(), L"Cheats")) { + gameCheats.Printf(L" [%d Cheats]", numberLoadedCheats); } } - // FIXME: we should have a widescreen hacks config - if (EmuConfig.EnableCheats) { - if (int cheats = LoadCheats(gameCRC, PathDefs::GetCheatsWS(), L"Widescreen hacks")) { - gameWsHacks.Printf(L" [%d WS hacks]", cheats); - } - } + // FIXME: we should have a widescreen hacks config + if (EmuConfig.EnableWideScreenPatches) { + if (numberLoadedWideScreenPatches = LoadCheats(gameCRC, PathDefs::GetCheatsWS(), L"Widescreen hacks")) { + gameWsHacks.Printf(L" [%d WS hacks]", numberLoadedWideScreenPatches); + } + } Console.SetTitle(gameName+gameSerial+gameCompat+gameFixes+gamePatch+gameCheats+gameWsHacks); diff --git a/pcsx2/gui/MainFrame.cpp b/pcsx2/gui/MainFrame.cpp index 485bde5823..2cab4905a7 100644 --- a/pcsx2/gui/MainFrame.cpp +++ b/pcsx2/gui/MainFrame.cpp @@ -211,6 +211,7 @@ void MainEmuFrame::ConnectMenus() ConnectMenu( MenuId_EnableBackupStates, Menu_EnableBackupStates_Click ); ConnectMenu( MenuId_EnablePatches, Menu_EnablePatches_Click ); ConnectMenu( MenuId_EnableCheats, Menu_EnableCheats_Click ); + ConnectMenu( MenuId_EnableWideScreenPatches, Menu_EnableWideScreenPatches_Click ); ConnectMenu( MenuId_EnableHostFs, Menu_EnableHostFs_Click ); ConnectMenu( MenuId_Exit, Menu_Exit_Click ); @@ -423,6 +424,9 @@ MainEmuFrame::MainEmuFrame(wxWindow* parent, const wxString& title) m_menuSys.Append(MenuId_EnableCheats, _("Enable Cheats"), wxEmptyString, wxITEM_CHECK); + m_menuSys.Append(MenuId_EnableWideScreenPatches, _("Enable WideScreen Patches"), + wxEmptyString, wxITEM_CHECK); + m_menuSys.Append(MenuId_EnableHostFs, _("Enable Host Filesystem"), wxEmptyString, wxITEM_CHECK); @@ -668,6 +672,7 @@ void MainEmuFrame::ApplyConfigToGui(AppConfig& configToApply, int flags) {//these should not be affected by presets menubar.Check( MenuId_EnableBackupStates, configToApply.EmuOptions.BackupSavestate ); menubar.Check( MenuId_EnableCheats, configToApply.EmuOptions.EnableCheats ); + menubar.Check( MenuId_EnableWideScreenPatches, configToApply.EmuOptions.EnableWideScreenPatches ); menubar.Check( MenuId_EnableHostFs, configToApply.EmuOptions.HostFs ); #ifdef __LINUX__ menubar.Check( MenuId_Console_Stdio, configToApply.EmuOptions.ConsoleToStdio ); diff --git a/pcsx2/gui/MainFrame.h b/pcsx2/gui/MainFrame.h index cd39bb21d7..f153ccada7 100644 --- a/pcsx2/gui/MainFrame.h +++ b/pcsx2/gui/MainFrame.h @@ -178,6 +178,7 @@ protected: void Menu_EnableBackupStates_Click(wxCommandEvent &event); void Menu_EnablePatches_Click(wxCommandEvent &event); void Menu_EnableCheats_Click(wxCommandEvent &event); + void Menu_EnableWideScreenPatches_Click(wxCommandEvent &event); void Menu_EnableHostFs_Click(wxCommandEvent &event); void Menu_BootCdvd_Click(wxCommandEvent &event); diff --git a/pcsx2/gui/MainMenuClicks.cpp b/pcsx2/gui/MainMenuClicks.cpp index 6b95b5d088..14399bed9b 100644 --- a/pcsx2/gui/MainMenuClicks.cpp +++ b/pcsx2/gui/MainMenuClicks.cpp @@ -436,6 +436,12 @@ void MainEmuFrame::Menu_EnableCheats_Click( wxCommandEvent& ) AppSaveSettings(); } +void MainEmuFrame::Menu_EnableWideScreenPatches_Click( wxCommandEvent& ) +{ + g_Conf->EmuOptions.EnableWideScreenPatches = GetMenuBar()->IsChecked( MenuId_EnableWideScreenPatches ); + AppSaveSettings(); +} + void MainEmuFrame::Menu_EnableHostFs_Click( wxCommandEvent& ) { g_Conf->EmuOptions.HostFs = GetMenuBar()->IsChecked( MenuId_EnableHostFs );