diff --git a/pcsx2/System/SysCoreThread.cpp b/pcsx2/System/SysCoreThread.cpp index efa5d8a031..f0e2ad70bf 100644 --- a/pcsx2/System/SysCoreThread.cpp +++ b/pcsx2/System/SysCoreThread.cpp @@ -94,6 +94,7 @@ void SysCoreThread::Reset() { Suspend(); m_resetVirtualMachine = true; + m_hasValidState = false; } // This function *will* reset the emulator in order to allow the specified elf file to diff --git a/pcsx2/gui/App.h b/pcsx2/gui/App.h index a4ed2336ec..06cfc0bb53 100644 --- a/pcsx2/gui/App.h +++ b/pcsx2/gui/App.h @@ -535,6 +535,7 @@ enum CoreThreadStatus CoreStatus_Indeterminate, CoreStatus_Resumed, CoreStatus_Suspended, + CoreStatus_Reset, CoreStatus_Stopped, }; @@ -551,6 +552,7 @@ public: virtual bool Suspend( bool isBlocking=true ); virtual void Resume(); + virtual void Reset(); virtual void StateCheckInThread(); virtual void ApplySettings( const Pcsx2Config& src ); diff --git a/pcsx2/gui/AppCoreThread.cpp b/pcsx2/gui/AppCoreThread.cpp index 265a35efc4..2d764b28d1 100644 --- a/pcsx2/gui/AppCoreThread.cpp +++ b/pcsx2/gui/AppCoreThread.cpp @@ -27,6 +27,15 @@ AppCoreThread::~AppCoreThread() throw() { } +void AppCoreThread::Reset() +{ + _parent::Reset(); + + wxCommandEvent evt( pxEVT_CoreThreadStatus ); + evt.SetInt( CoreStatus_Reset ); + wxGetApp().AddPendingEvent( evt ); +} + bool AppCoreThread::Suspend( bool isBlocking ) { bool retval = _parent::Suspend( isBlocking ); @@ -41,7 +50,6 @@ bool AppCoreThread::Suspend( bool isBlocking ) return retval; } - static int resume_tries = 0; void AppCoreThread::Resume() diff --git a/pcsx2/gui/AppMain.cpp b/pcsx2/gui/AppMain.cpp index 202974f8f2..62c5b6ae41 100644 --- a/pcsx2/gui/AppMain.cpp +++ b/pcsx2/gui/AppMain.cpp @@ -512,8 +512,10 @@ void Pcsx2App::OnSysExecute( wxCommandEvent& evt ) if( evt.GetInt() != -1 ) CoreThread.Reset(); else CoreThread.Suspend(); CDVDsys_SetFile( CDVDsrc_Iso, g_Conf->CurrentIso ); - if( evt.GetInt() != -1 || (CDVD == NULL) ) + if( evt.GetInt() != -1 ) CDVDsys_ChangeSource( (CDVD_SourceType)evt.GetInt() ); + else if( CDVD == NULL ) + CDVDsys_ChangeSource( CDVDsrc_NoDisc ); if( !CoreThread.HasValidState() ) CoreThread.SetElfOverride( _sysexec_elf_override ); diff --git a/pcsx2/gui/MainFrame.cpp b/pcsx2/gui/MainFrame.cpp index 91a83539ac..daf1b50a50 100644 --- a/pcsx2/gui/MainFrame.cpp +++ b/pcsx2/gui/MainFrame.cpp @@ -577,4 +577,5 @@ void PerPluginMenuInfo::OnLoaded() g_plugins->GetName( PluginId ) + L" " + g_plugins->GetVersion( PluginId ) ); MyMenu.Enable( GetPluginMenuId_Settings(PluginId), true ); -} \ No newline at end of file +} +