From fd0a422d89e78942039f109192529af70efd3485 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Fri, 5 Apr 2013 00:57:43 -0700 Subject: [PATCH] Actually respect autorun on Windows. Fixes #1179. --- UI/EmuScreen.cpp | 8 -------- Windows/WindowsHost.cpp | 5 ++++- Windows/WndMainWindow.cpp | 14 -------------- Windows/WndMainWindow.h | 1 - 4 files changed, 4 insertions(+), 24 deletions(-) diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index 08e45aad0b..514b9f4c7a 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -83,14 +83,6 @@ EmuScreen::EmuScreen(const std::string &filename) : invalid_(true) { host->BootDone(); host->UpdateDisassembly(); -#ifdef _WIN32 - if (g_Config.bAutoRun) { - Core_EnableStepping(false); - } else { - Core_EnableStepping(true); - } -#endif - LayoutGamepad(dp_xres, dp_yres); NOTICE_LOG(BOOT, "Loading %s...", fileToStart.c_str()); diff --git a/Windows/WindowsHost.cpp b/Windows/WindowsHost.cpp index 3551757c9c..2e2fd38c86 100644 --- a/Windows/WindowsHost.cpp +++ b/Windows/WindowsHost.cpp @@ -138,7 +138,10 @@ void WindowsHost::PollControllers(InputState &input_state) void WindowsHost::BootDone() { symbolMap.SortSymbols(); - PostMessage(MainWindow::GetHWND(), WM_USER+1, 0,0); + SendMessage(MainWindow::GetHWND(), WM_USER+1, 0,0); + + SetDebugMode(!g_Config.bAutoRun); + Core_EnableStepping(!g_Config.bAutoRun); } static std::string SymbolMapFilename(const char *currentFilename) diff --git a/Windows/WndMainWindow.cpp b/Windows/WndMainWindow.cpp index 32a03048d8..206ea14e68 100644 --- a/Windows/WndMainWindow.cpp +++ b/Windows/WndMainWindow.cpp @@ -49,7 +49,6 @@ namespace MainWindow HWND hwndDisplay; HWND hwndGameList; static HMENU menu; - static CoreState nextState = CORE_POWERDOWN; static HINSTANCE hInst; @@ -657,14 +656,6 @@ namespace MainWindow if (memoryWindow[0]) memoryWindow[0]->NotifyMapLoaded(); - if (nextState == CORE_RUNNING) - PostMessage(hwndMain, WM_COMMAND, ID_EMULATION_RUN, 0); - else if (globalUIState == UISTATE_INGAME) - { - if (disasmWindow[0]) - SendMessage(disasmWindow[0]->GetDlgHandle(), WM_COMMAND, IDC_GO, 0); - } - SetForegroundWindow(hwndMain); break; @@ -892,11 +883,6 @@ namespace MainWindow SetCursor(LoadCursor(0, IDC_ARROW)); } - void SetNextState(CoreState state) - { - nextState = state; - } - HINSTANCE GetHInstance() { return hInst; diff --git a/Windows/WndMainWindow.h b/Windows/WndMainWindow.h index cf30d6dfb3..7996aa920d 100644 --- a/Windows/WndMainWindow.h +++ b/Windows/WndMainWindow.h @@ -18,7 +18,6 @@ namespace MainWindow HWND GetDisplayHWND(); void SetPlaying(const char*text); void BrowseAndBoot(std::string defaultPath); - void SetNextState(CoreState state); void SaveStateActionFinished(bool result, void *userdata); void _ViewFullScreen(HWND hWnd); void _ViewNormal(HWND hWnd);