From 2ecbabd815f5811835e54a30ca916087787ea4db Mon Sep 17 00:00:00 2001 From: Kingcom Date: Sun, 8 Sep 2013 10:04:39 +0200 Subject: [PATCH] Reset while stepping improvements --- Windows/WndMainWindow.cpp | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/Windows/WndMainWindow.cpp b/Windows/WndMainWindow.cpp index 253727ff6f..45752df26f 100644 --- a/Windows/WndMainWindow.cpp +++ b/Windows/WndMainWindow.cpp @@ -998,6 +998,9 @@ namespace MainWindow EnableWindow(memoryWindow[0]->GetDlgHandle(),FALSE); if (Core_IsStepping()) { + // If the current PC is on a breakpoint, disabling stepping doesn't work without + // explicitly skipping it + CBreakPoints::SetSkipFirst(currentMIPS->pc); Core_EnableStepping(false); } NativeMessageReceived("stop", ""); @@ -1005,16 +1008,32 @@ namespace MainWindow break; case ID_EMULATION_RESET: - if (Core_IsStepping()) { - Core_EnableStepping(false); - } EnableWindow(disasmWindow[0]->GetDlgHandle(),FALSE); EnableWindow(memoryWindow[0]->GetDlgHandle(),FALSE); + + if (Core_IsStepping()) { + // If the current PC is on a breakpoint, disabling stepping doesn't work without + // explicitly skipping it + CBreakPoints::SetSkipFirst(currentMIPS->pc); + Core_EnableStepping(false); + } + NativeMessageReceived("reset", ""); break; case ID_EMULATION_CHEATS: g_Config.bEnableCheats = !g_Config.bEnableCheats; osm.ShowOnOff(g->T("Cheats"), g_Config.bEnableCheats); + + EnableWindow(disasmWindow[0]->GetDlgHandle(),FALSE); + EnableWindow(memoryWindow[0]->GetDlgHandle(),FALSE); + + if (Core_IsStepping()) { + // If the current PC is on a breakpoint, disabling stepping doesn't work without + // explicitly skipping it + CBreakPoints::SetSkipFirst(currentMIPS->pc); + Core_EnableStepping(false); + } + NativeMessageReceived("reset", ""); break;