mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-13 09:39:33 +01:00
Wait for the runloop to end in savestates/debug.
This way, even if the runloop hasn't checked coreState yet, we will wait.
This commit is contained in:
1 parent
2164a7fdf9
commit
7c3c06fd23
5 files changed
+15
-34
No files matched your search
@@ -308,7 +308,7 @@ namespace MainWindow
|
||||
if (disasmWindow[i])
|
||||
SendMessage(disasmWindow[i]->GetDlgHandle(), WM_COMMAND, IDC_STOP, 0);
|
||||
|
||||
Sleep(100);//UGLY wait for event instead
|
||||
Core_WaitInactive();
|
||||
|
||||
for (int i=0; i<numCPUs; i++)
|
||||
if (disasmWindow[i])
|
||||
@@ -328,7 +328,7 @@ namespace MainWindow
|
||||
if (disasmWindow[i])
|
||||
SendMessage(disasmWindow[i]->GetDlgHandle(), WM_COMMAND, IDC_STOP, 0);
|
||||
|
||||
Sleep(100);//UGLY wait for event instead
|
||||
Core_WaitInactive();
|
||||
|
||||
for (int i=0; i<numCPUs; i++)
|
||||
if (disasmWindow[i])
|
||||
@@ -354,13 +354,6 @@ namespace MainWindow
|
||||
break;
|
||||
|
||||
case ID_FILE_LOADSTATEFILE:
|
||||
if (g_State.bEmuThreadStarted)
|
||||
{
|
||||
nextState = Core_IsStepping() ? CORE_STEPPING : CORE_RUNNING;
|
||||
for (int i=0; i<numCPUs; i++)
|
||||
if (disasmWindow[i])
|
||||
SendMessage(disasmWindow[i]->GetDlgHandle(), WM_COMMAND, IDC_STOP, 0);
|
||||
}
|
||||
if (W32Util::BrowseForFileName(true, hWnd, "Load state",0,"Save States (*.ppst)\0*.ppst\0All files\0*.*\0\0","ppst",fn))
|
||||
{
|
||||
SetCursor(LoadCursor(0,IDC_WAIT));
|
||||
@@ -369,13 +362,6 @@ namespace MainWindow
|
||||
break;
|
||||
|
||||
case ID_FILE_SAVESTATEFILE:
|
||||
if (g_State.bEmuThreadStarted)
|
||||
{
|
||||
nextState = Core_IsStepping() ? CORE_STEPPING : CORE_RUNNING;
|
||||
for (int i=0; i<numCPUs; i++)
|
||||
if (disasmWindow[i])
|
||||
SendMessage(disasmWindow[i]->GetDlgHandle(), WM_COMMAND, IDC_STOP, 0);
|
||||
}
|
||||
if (W32Util::BrowseForFileName(false, hWnd, "Save state",0,"Save States (*.ppst)\0*.ppst\0All files\0*.*\0\0","ppst",fn))
|
||||
{
|
||||
SetCursor(LoadCursor(0,IDC_WAIT));
|
||||
@@ -386,25 +372,11 @@ namespace MainWindow
|
||||
// TODO: Add UI for multiple slots
|
||||
|
||||
case ID_FILE_QUICKLOADSTATE:
|
||||
if (g_State.bEmuThreadStarted)
|
||||
{
|
||||
nextState = Core_IsStepping() ? CORE_STEPPING : CORE_RUNNING;
|
||||
for (int i=0; i<numCPUs; i++)
|
||||
if (disasmWindow[i])
|
||||
SendMessage(disasmWindow[i]->GetDlgHandle(), WM_COMMAND, IDC_STOP, 0);
|
||||
}
|
||||
SetCursor(LoadCursor(0,IDC_WAIT));
|
||||
SaveState::LoadSlot(0, SaveStateActionFinished);
|
||||
break;
|
||||
|
||||
case ID_FILE_QUICKSAVESTATE:
|
||||
if (g_State.bEmuThreadStarted)
|
||||
{
|
||||
nextState = Core_IsStepping() ? CORE_STEPPING : CORE_RUNNING;
|
||||
for (int i=0; i<numCPUs; i++)
|
||||
if (disasmWindow[i])
|
||||
SendMessage(disasmWindow[i]->GetDlgHandle(), WM_COMMAND, IDC_STOP, 0);
|
||||
}
|
||||
SetCursor(LoadCursor(0,IDC_WAIT));
|
||||
SaveState::SaveSlot(0, SaveStateActionFinished);
|
||||
break;
|
||||
@@ -643,7 +615,8 @@ namespace MainWindow
|
||||
break;
|
||||
|
||||
case WM_CLOSE:
|
||||
Sleep(100);//UGLY wait for event instead
|
||||
Core_Stop();
|
||||
Core_WaitInactive(200);
|
||||
EmuThread_Stop();
|
||||
|
||||
/*
|
||||
|
||||
Reference in new issue
Block a user