From 020f69e5fb7c74aedf2ffd08bcff3538e677212d Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 29 Dec 2012 12:33:40 -0800 Subject: [PATCH] Pause before browsing for a state file on Windows. --- Windows/WndMainWindow.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Windows/WndMainWindow.cpp b/Windows/WndMainWindow.cpp index c6f593a109..f6442f8315 100644 --- a/Windows/WndMainWindow.cpp +++ b/Windows/WndMainWindow.cpp @@ -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; iGetDlgHandle(), 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; iGetDlgHandle(), 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; iGetDlgHandle(), WM_COMMAND, IDC_GO, 0); + } } void SetNextState(CoreState state)