Pause before browsing for a state file on Windows.

This commit is contained in:
Unknown W. Brackets 2012-12-29 12:33:40 -08:00
parent 589916fca2
commit 020f69e5fb

View File

@ -313,6 +313,13 @@ namespace MainWindow
break;
case ID_FILE_LOADSTATE:
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));
@ -321,6 +328,13 @@ namespace MainWindow
break;
case ID_FILE_SAVESTATE:
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));
@ -780,6 +794,13 @@ namespace MainWindow
if (!result)
MessageBox(0, "Savestate failure. Please try again later.", "Sorry", MB_OK);
SetCursor(LoadCursor(0, IDC_ARROW));
if (g_State.bEmuThreadStarted && nextState == CORE_RUNNING)
{
for (int i=0; i<numCPUs; i++)
if (disasmWindow[i])
SendMessage(disasmWindow[i]->GetDlgHandle(), WM_COMMAND, IDC_GO, 0);
}
}
void SetNextState(CoreState state)