Merge pull request #6288 from JosJuice/boot-savestate-thread

Don't involve host thread when booting from savestate
This commit is contained in:
JosJuice 2018-01-05 21:45:28 +01:00 committed by GitHub
commit 6ad04fc589
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 9 deletions

View File

@ -341,15 +341,6 @@ static void CpuThread(const std::optional<std::string>& savestate_path, bool del
if (_CoreParameter.bFastmem) if (_CoreParameter.bFastmem)
EMM::InstallExceptionHandler(); // Let's run under memory watch EMM::InstallExceptionHandler(); // Let's run under memory watch
if (savestate_path)
{
QueueHostJob([&savestate_path, delete_savestate] {
::State::LoadAs(*savestate_path);
if (delete_savestate)
File::Delete(*savestate_path);
});
}
s_is_started = true; s_is_started = true;
CPUSetInitialExecutionState(); CPUSetInitialExecutionState();
@ -374,6 +365,13 @@ static void CpuThread(const std::optional<std::string>& savestate_path, bool del
MemoryWatcher::Init(); MemoryWatcher::Init();
#endif #endif
if (savestate_path)
{
::State::LoadAs(*savestate_path);
if (delete_savestate)
File::Delete(*savestate_path);
}
// Enter CPU run loop. When we leave it - we are done. // Enter CPU run loop. When we leave it - we are done.
CPU::Run(); CPU::Run();