From c109fbeaaedca54319c4e2f42ec4560dc94d67c7 Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Wed, 27 Jan 2010 13:31:55 +0000 Subject: [PATCH] * Vsync setting is retained more reliably across suspend/resume/plugin config. * fps/cpu% readout is a bit more stable. * Plugin config menus update plugin names after on-the-fly changes. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2528 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/CDVD/CDVDisoReader.cpp | 1 - pcsx2/gui/CpuUsageProvider.cpp | 7 ++++- pcsx2/gui/CpuUsageProvider.h | 10 ++++++- pcsx2/gui/FrameForGS.cpp | 8 ++++-- pcsx2/gui/MainFrame.cpp | 40 ++++++++++++-------------- pcsx2/gui/MainFrame.h | 1 - pcsx2/gui/MainMenuClicks.cpp | 2 +- pcsx2/gui/Panels/ConfigurationPanels.h | 18 +++++++++++- pcsx2/gui/Panels/MemoryCardsPanel.cpp | 21 ++++++++++++++ pcsx2/gui/Plugins.cpp | 14 +++++---- 10 files changed, 87 insertions(+), 35 deletions(-) diff --git a/pcsx2/CDVD/CDVDisoReader.cpp b/pcsx2/CDVD/CDVDisoReader.cpp index 682cd61fa7..4a2d55e062 100644 --- a/pcsx2/CDVD/CDVDisoReader.cpp +++ b/pcsx2/CDVD/CDVDisoReader.cpp @@ -200,7 +200,6 @@ static bool FindLayer1Start() uint midsector = (iso->blocks / 2) & ~0xf; uint deviation = 0; - //for( uint sector=searchstart; (layer1start==-1) && (sector<=searchend); sector += 16) while( (layer1start == -1) && (deviation < midsector-16) ) { u8 tempbuffer[CD_FRAMESIZE_RAW]; diff --git a/pcsx2/gui/CpuUsageProvider.cpp b/pcsx2/gui/CpuUsageProvider.cpp index a159c1ede4..3702eb98b7 100644 --- a/pcsx2/gui/CpuUsageProvider.cpp +++ b/pcsx2/gui/CpuUsageProvider.cpp @@ -51,6 +51,11 @@ DefaultCpuUsageProvider::DefaultCpuUsageProvider() m_pct_ui = 0; m_writepos = 0; + Reset(); +} + +void DefaultCpuUsageProvider::Reset() +{ for( int i=0; iGSWindow.WindowPos, wxSize( 640, 480 ), @@ -271,14 +273,14 @@ wxStaticText* GSFrame::GetLabel_OutputDisabled() const void GSFrame::CoreThread_OnResumed() { - m_timer_UpdateTitle.Start( 275 ); + m_timer_UpdateTitle.Start( TitleBarUpdateMs ); } void GSFrame::CoreThread_OnSuspended() { // Could stop the timer outright here, tho no harm in having an occasional // update here or there, just in case some state info changes while emu is suspended. - m_timer_UpdateTitle.Start( 333 ); + m_timer_UpdateTitle.Start( TitleBarUpdateMs ); } // overrides base Show behavior. @@ -301,7 +303,7 @@ bool GSFrame::Show( bool shown ) if( wxStaticText* label = GetLabel_OutputDisabled() ) label->Show( EmuConfig.GS.DisableOutput ); - m_timer_UpdateTitle.Start( 275 ); + m_timer_UpdateTitle.Start( TitleBarUpdateMs ); } else { diff --git a/pcsx2/gui/MainFrame.cpp b/pcsx2/gui/MainFrame.cpp index 0c83f6ead6..591cf180a2 100644 --- a/pcsx2/gui/MainFrame.cpp +++ b/pcsx2/gui/MainFrame.cpp @@ -213,7 +213,23 @@ void MainEmuFrame::DispatchEvent( const PluginEventType& plugin_evt ) if( !pxAssertMsg( GetMenuBar()!=NULL, "Mainframe menu bar is NULL!" ) ) return; //ApplyCoreStatus(); - ApplyPluginStatus(); + + if( plugin_evt == CorePlugins_Unloaded ) + { + for( int i=0; iGetName( PluginId_CDVD ).c_str() ) ); + } } void MainEmuFrame::DispatchEvent( const CoreThreadStatus& status ) @@ -259,8 +275,8 @@ MainEmuFrame::MainEmuFrame(wxWindow* parent, const wxString& title) , m_menuBoot ( *new wxMenu() ) , m_menuCDVD ( *new wxMenu() ) - , m_menuSys ( *new wxMenu() ) - , m_menuConfig( *new wxMenu() ) + , m_menuSys ( *new wxMenu() ) + , m_menuConfig ( *new wxMenu() ) , m_menuMisc ( *new wxMenu() ) , m_menuDebug ( *new wxMenu() ) @@ -524,24 +540,6 @@ void MainEmuFrame::ApplyCoreStatus() menubar.Enable( MenuId_Sys_Shutdown, SysHasValidState() || (g_plugins!=NULL) ); } -void MainEmuFrame::ApplyPluginStatus() -{ - if( g_plugins == NULL ) - { - for( int i=0; iGetName( PluginId_CDVD ).c_str() ) ); - } -} - void MainEmuFrame::ApplySettings() { wxMenuBar& menubar( *GetMenuBar() ); diff --git a/pcsx2/gui/MainFrame.h b/pcsx2/gui/MainFrame.h index b948ec865e..c806b41a5f 100644 --- a/pcsx2/gui/MainFrame.h +++ b/pcsx2/gui/MainFrame.h @@ -230,7 +230,6 @@ public: protected: void ApplySettings(); void ApplyCoreStatus(); - void ApplyPluginStatus(); void SaveEmuOptions(); diff --git a/pcsx2/gui/MainMenuClicks.cpp b/pcsx2/gui/MainMenuClicks.cpp index 96281a3152..43109e5a81 100644 --- a/pcsx2/gui/MainMenuClicks.cpp +++ b/pcsx2/gui/MainMenuClicks.cpp @@ -405,7 +405,7 @@ void MainEmuFrame::Menu_ShowConsole_Stdio(wxCommandEvent &event) void MainEmuFrame::Menu_PrintCDVD_Info(wxCommandEvent &event) { g_Conf->EmuOptions.CdvdVerboseReads = GetMenuBar()->IsChecked( MenuId_CDVD_Info ); - const_cast(EmuConfig).CdvdVerboseReads = true; // read-only in core thread, so it's safe to modify. + const_cast(EmuConfig).CdvdVerboseReads = g_Conf->EmuOptions.CdvdVerboseReads; // read-only in core thread, so it's safe to modify. SaveEmuOptions(); } diff --git a/pcsx2/gui/Panels/ConfigurationPanels.h b/pcsx2/gui/Panels/ConfigurationPanels.h index 8de3ecfa38..5db3a57e31 100644 --- a/pcsx2/gui/Panels/ConfigurationPanels.h +++ b/pcsx2/gui/Panels/ConfigurationPanels.h @@ -318,8 +318,24 @@ namespace Panels // -------------------------------------------------------------------------------------- class MemoryCardsPanel : public BaseApplicableConfigPanel { + class SingleCardPanel : public BaseApplicableConfigPanel + { + protected: + + + public: + SingleCardPanel( wxWindow* parent, uint portidx, uint slotidx ); + virtual ~SingleCardPanel() throw() { } + void Apply(); + void AppStatusEvent_OnSettingsApplied(); + }; + protected: - + wxCheckBox* m_checkbox_NtfsCompress; + wxCheckBox* m_checkbox_Ejection; + wxCheckBox* m_checkbox_Multitap1; + wxCheckBox* m_checkbox_Multitap2; + public: MemoryCardsPanel( wxWindow* parent ); virtual ~MemoryCardsPanel() throw() { } diff --git a/pcsx2/gui/Panels/MemoryCardsPanel.cpp b/pcsx2/gui/Panels/MemoryCardsPanel.cpp index 68e39809e4..5cc3c4cb03 100644 --- a/pcsx2/gui/Panels/MemoryCardsPanel.cpp +++ b/pcsx2/gui/Panels/MemoryCardsPanel.cpp @@ -16,9 +16,30 @@ #include "PrecompiledHeader.h" #include "ConfigurationPanels.h" +// -------------------------------------------------------------------------------------- +// SingleCardPanel Implementations +// -------------------------------------------------------------------------------------- +Panels::MemoryCardsPanel::SingleCardPanel::SingleCardPanel( wxWindow* parent, uint portidx, uint slotidx ) + : BaseApplicableConfigPanel( parent, wxVERTICAL, wxsFormat( L"Port %u / Slot %u", portidx, slotidx ) ) +{ +} + +void Panels::MemoryCardsPanel::SingleCardPanel::Apply() +{ +} + +void Panels::MemoryCardsPanel::SingleCardPanel::AppStatusEvent_OnSettingsApplied() +{ +} + +// -------------------------------------------------------------------------------------- +// MemoryCardsPanel Implementations +// -------------------------------------------------------------------------------------- Panels::MemoryCardsPanel::MemoryCardsPanel( wxWindow* parent ) : BaseApplicableConfigPanel( parent ) { + + AppStatusEvent_OnSettingsApplied(); } diff --git a/pcsx2/gui/Plugins.cpp b/pcsx2/gui/Plugins.cpp index 8573b9fe44..9e13361c56 100644 --- a/pcsx2/gui/Plugins.cpp +++ b/pcsx2/gui/Plugins.cpp @@ -47,9 +47,11 @@ class AppPluginManager : public PluginManager typedef PluginManager _parent; public: - AppPluginManager( const wxString (&folders)[PluginId_Count] ) : PluginManager( folders ) + AppPluginManager( const wxString (&folders)[PluginId_Count] ) + : PluginManager( folders ) { SetSettingsFolder( GetSettingsFolder().ToString() ); + wxGetApp().PostPluginStatus( CorePlugins_Loaded ); } virtual ~AppPluginManager() throw() @@ -98,7 +100,12 @@ public: sApp.OpenGsPanel(); } - return _parent::OpenPlugin_GS(); + bool retval = _parent::OpenPlugin_GS(); + + if( g_LimiterMode == Limit_Turbo ) + GSsetVsync( false ); + + return retval; } // Yay, this plugin is guaranteed to always be opened first and closed last. @@ -318,8 +325,6 @@ void Pcsx2App::OnLoadPluginsComplete( wxCommandEvent& evt ) } if( fn_tmp != NULL ) fn_tmp( evt ); - - PostPluginStatus( CorePlugins_Loaded ); } void Pcsx2App::CancelLoadingPlugins() @@ -382,7 +387,6 @@ void LoadPluginsImmediate() wxString passins[PluginId_Count]; ConvertPluginFilenames( passins ); wxGetApp().m_CorePlugins = new AppPluginManager( passins ); - } void UnloadPlugins()