コード例 #1
0
ファイル: AppCoreThread.cpp プロジェクト: Alchemistxxd/pcsx2
void AppCoreThread::ResetQuick()
{
	if( !GetSysExecutorThread().IsSelf() )
	{
		GetSysExecutorThread().PostEvent( SysExecEvent_InvokeCoreThreadMethod(&AppCoreThread::ResetQuick) );
		return;
	}

	_parent::ResetQuick();
}
コード例 #2
0
ファイル: AppCoreThread.cpp プロジェクト: Alchemistxxd/pcsx2
void AppCoreThread::Resume()
{
	if( !GetSysExecutorThread().IsSelf() )
	{
		GetSysExecutorThread().PostEvent( SysExecEvent_InvokeCoreThreadMethod(&AppCoreThread::Resume) );
		return;
	}

	GetCorePlugins().Init();
	_parent::Resume();
}
コード例 #3
0
ファイル: AppCoreThread.cpp プロジェクト: Alchemistxxd/pcsx2
void AppCoreThread::Suspend( bool isBlocking )
{
	if (IsClosed()) return;

	if (IsSelf())
	{
		// this should never fail...
		bool result = GetSysExecutorThread().Rpc_TryInvokeAsync( _Suspend, L"AppCoreThread::Suspend" );
		pxAssert(result);
	}
	else if (!GetSysExecutorThread().Rpc_TryInvoke( _Suspend, L"AppCoreThread::Suspend" ))
		_parent::Suspend(true);
}
コード例 #4
0
ファイル: AppCoreThread.cpp プロジェクト: Alchemistxxd/pcsx2
// Returns TRUE if the event is posted to the SysExecutor.
// Returns FALSE if the thread *is* the SysExecutor (no message is posted, calling code should
//  handle the code directly).
bool BaseScopedCoreThread::PostToSysExec( BaseSysExecEvent_ScopedCore* msg )
{
	std::unique_ptr<BaseSysExecEvent_ScopedCore> smsg( msg );
	if( !smsg || GetSysExecutorThread().IsSelf()) return false;

	msg->SetSyncState(m_sync);
	msg->SetResumeStates(m_sync_resume, m_mtx_resume);

	GetSysExecutorThread().PostEvent( smsg.release() );
	m_sync.WaitForResult();
	m_sync.RethrowException();

	return true;
}
コード例 #5
0
ファイル: Saveslots.cpp プロジェクト: dragonfax/pcsx2
void States_FreezeCurrentSlot()
{
	// FIXME : Use of the IsSavingOrLoading flag is mostly a hack until we implement a
	// complete thread to manage queuing savestate tasks, and zipping states to disk.  --air
	if (!SysHasValidState())
	{
		Console.WriteLn("Save state: Aborting (VM is not active).");
		return;
	}

	if (wxGetApp().HasPendingSaves() || IsSavingOrLoading.exchange(true))
	{
		Console.WriteLn("Load or save action is already pending.");
		return;
	}
	Sstates_updateLoadBackupMenuItem(true);

	GSchangeSaveState(StatesC, SaveStateBase::GetFilename(StatesC).ToUTF8());
	StateCopy_SaveToSlot(StatesC);

	// Hack: Update the saveslot saying it's filled *right now* because it's still writing the file and we don't have a timestamp.
	saveslot_cache[StatesC].empty = false;
	saveslot_cache[StatesC].updated = wxDateTime::Now();
	saveslot_cache[StatesC].crc = ElfCRC;

	GetSysExecutorThread().PostIdleEvent(SysExecEvent_ClearSavingLoadingFlag());
}
コード例 #6
0
ファイル: AppCoreThread.cpp プロジェクト: Alchemistxxd/pcsx2
void AppCoreThread::ChangeCdvdSource()
{
	if( !GetSysExecutorThread().IsSelf() )
	{
		GetSysExecutorThread().PostEvent( new SysExecEvent_InvokeCoreThreadMethod(&AppCoreThread::ChangeCdvdSource) );
		return;
	}

	CDVD_SourceType cdvdsrc( g_Conf->CdvdSource );
	if( cdvdsrc == CDVDsys_GetSourceType() ) return;

	// Fast change of the CDVD source only -- a Pause will suffice.

	ScopedCoreThreadPause paused_core;
	GetCorePlugins().Close( PluginId_CDVD );
	CDVDsys_ChangeSource( cdvdsrc );
	paused_core.AllowResume();

	// TODO: Add a listener for CDVDsource changes?  Or should we bother?
}
コード例 #7
0
ファイル: AppCoreThread.cpp プロジェクト: Alchemistxxd/pcsx2
void BaseScopedCoreThread::DoResume()
{
	if( m_alreadyStopped ) return;
	if( !GetSysExecutorThread().IsSelf() )
	{
		//DbgCon.WriteLn("(ScopedCoreThreadPause) Threaded Scope Created!");
		m_sync_resume.PostResult( m_allowResume ? ScopedCore_NonblockingResume : ScopedCore_SkipResume );
		m_mtx_resume.Wait();
	}
	else
		CoreThread.Resume();
}
コード例 #8
0
ファイル: Saveslots.cpp プロジェクト: Aced14/pcsx2
void _States_DefrostCurrentSlot( bool isFromBackup )
{
	if( !SysHasValidState() )
	{
		Console.WriteLn( "Load state: Aborting (VM is not active)." );
		return;
	}

	if( IsSavingOrLoading.exchange(true) )
	{
		Console.WriteLn( "Load or save action is already pending." );
		return;
	}

	GSchangeSaveState( StatesC, SaveStateBase::GetFilename( StatesC ).ToUTF8() );
	StateCopy_LoadFromSlot( StatesC, isFromBackup );

	GetSysExecutorThread().PostIdleEvent( SysExecEvent_ClearSavingLoadingFlag() );

	Sstates_updateLoadBackupMenuItem();
}
コード例 #9
0
ファイル: Saveslots.cpp プロジェクト: Aced14/pcsx2
void States_FreezeCurrentSlot()
{
	// FIXME : Use of the IsSavingOrLoading flag is mostly a hack until we implement a
	// complete thread to manage queuing savestate tasks, and zipping states to disk.  --air
	if( !SysHasValidState() )
	{
		Console.WriteLn( "Save state: Aborting (VM is not active)." );
		return;
	}

	if( wxGetApp().HasPendingSaves() || IsSavingOrLoading.exchange(true) )
	{
		Console.WriteLn( "Load or save action is already pending." );
		return;
	}
	Sstates_updateLoadBackupMenuItem( true );

	GSchangeSaveState( StatesC, SaveStateBase::GetFilename( StatesC ).ToUTF8() );
	StateCopy_SaveToSlot( StatesC );
	
	GetSysExecutorThread().PostIdleEvent( SysExecEvent_ClearSavingLoadingFlag() );
}
コード例 #10
0
ファイル: AppCoreThread.cpp プロジェクト: Alchemistxxd/pcsx2
void AppCoreThread::Cancel( bool isBlocking )
{
	if (GetSysExecutorThread().IsRunning() && !GetSysExecutorThread().Rpc_TryInvoke( _Cancel, L"AppCoreThread::Cancel" ))
		_parent::Cancel( wxTimeSpan(0, 0, 4, 0) );
}