Minor fixes to ELF loading and suspend/resume stuff.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2105 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
Jake.Stine 2009-10-31 20:42:51 +00:00
parent 810d617411
commit e2131fb954
5 changed files with 17 additions and 3 deletions

View File

@ -94,6 +94,7 @@ void SysCoreThread::Reset()
{ {
Suspend(); Suspend();
m_resetVirtualMachine = true; m_resetVirtualMachine = true;
m_hasValidState = false;
} }
// This function *will* reset the emulator in order to allow the specified elf file to // This function *will* reset the emulator in order to allow the specified elf file to

View File

@ -535,6 +535,7 @@ enum CoreThreadStatus
CoreStatus_Indeterminate, CoreStatus_Indeterminate,
CoreStatus_Resumed, CoreStatus_Resumed,
CoreStatus_Suspended, CoreStatus_Suspended,
CoreStatus_Reset,
CoreStatus_Stopped, CoreStatus_Stopped,
}; };
@ -551,6 +552,7 @@ public:
virtual bool Suspend( bool isBlocking=true ); virtual bool Suspend( bool isBlocking=true );
virtual void Resume(); virtual void Resume();
virtual void Reset();
virtual void StateCheckInThread(); virtual void StateCheckInThread();
virtual void ApplySettings( const Pcsx2Config& src ); virtual void ApplySettings( const Pcsx2Config& src );

View File

@ -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 AppCoreThread::Suspend( bool isBlocking )
{ {
bool retval = _parent::Suspend( isBlocking ); bool retval = _parent::Suspend( isBlocking );
@ -41,7 +50,6 @@ bool AppCoreThread::Suspend( bool isBlocking )
return retval; return retval;
} }
static int resume_tries = 0; static int resume_tries = 0;
void AppCoreThread::Resume() void AppCoreThread::Resume()

View File

@ -512,8 +512,10 @@ void Pcsx2App::OnSysExecute( wxCommandEvent& evt )
if( evt.GetInt() != -1 ) CoreThread.Reset(); else CoreThread.Suspend(); if( evt.GetInt() != -1 ) CoreThread.Reset(); else CoreThread.Suspend();
CDVDsys_SetFile( CDVDsrc_Iso, g_Conf->CurrentIso ); CDVDsys_SetFile( CDVDsrc_Iso, g_Conf->CurrentIso );
if( evt.GetInt() != -1 || (CDVD == NULL) ) if( evt.GetInt() != -1 )
CDVDsys_ChangeSource( (CDVD_SourceType)evt.GetInt() ); CDVDsys_ChangeSource( (CDVD_SourceType)evt.GetInt() );
else if( CDVD == NULL )
CDVDsys_ChangeSource( CDVDsrc_NoDisc );
if( !CoreThread.HasValidState() ) if( !CoreThread.HasValidState() )
CoreThread.SetElfOverride( _sysexec_elf_override ); CoreThread.SetElfOverride( _sysexec_elf_override );

View File

@ -577,4 +577,5 @@ void PerPluginMenuInfo::OnLoaded()
g_plugins->GetName( PluginId ) + L" " + g_plugins->GetVersion( PluginId ) g_plugins->GetName( PluginId ) + L" " + g_plugins->GetVersion( PluginId )
); );
MyMenu.Enable( GetPluginMenuId_Settings(PluginId), true ); MyMenu.Enable( GetPluginMenuId_Settings(PluginId), true );
} }