From c64ba56d6ed37aeb14222c4f3d09a7684a87c54b Mon Sep 17 00:00:00 2001 From: pal1000 Date: Mon, 18 Nov 2013 12:30:52 +0200 Subject: [PATCH 1/3] Update windows Memory Viewer: Attempt automatic pause/resume when dumping RAM May need testing. --- Windows/Debugger/CtrlMemView.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Windows/Debugger/CtrlMemView.cpp b/Windows/Debugger/CtrlMemView.cpp index 8bf2c4c3ba..5ecf5e0b8c 100644 --- a/Windows/Debugger/CtrlMemView.cpp +++ b/Windows/Debugger/CtrlMemView.cpp @@ -437,15 +437,12 @@ void CtrlMemView::onMouseUp(WPARAM wParam, LPARAM lParam, int button) if (!Core_IsStepping()) // If emulator isn't paused { - MessageBox(wnd,L"You have to pause the emulator first",0,0); - break; - } - else - { - DumpMemoryWindow dump(wnd,debugger); - dump.exec(); - break; + Core_EnableStepping(true); } + DumpMemoryWindow dump(wnd,debugger); + dump.exec(); + Core_EnableStepping(false); + break; case ID_MEMVIEW_COPYVALUE_8: { @@ -702,4 +699,4 @@ void CtrlMemView::search(bool continueSearch) MessageBox(wnd,L"Not found",L"Search",MB_OK); searching = false; redraw(); -} \ No newline at end of file +} From 3d2d3cdaaa9e3a7994b7c95997be5ab5b880e076 Mon Sep 17 00:00:00 2001 From: pal1000 Date: Mon, 18 Nov 2013 15:38:31 +0200 Subject: [PATCH 2/3] Ask the user about resuming emulation after memory dump completed. --- Windows/Debugger/CtrlMemView.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Windows/Debugger/CtrlMemView.cpp b/Windows/Debugger/CtrlMemView.cpp index 5ecf5e0b8c..1b262644f9 100644 --- a/Windows/Debugger/CtrlMemView.cpp +++ b/Windows/Debugger/CtrlMemView.cpp @@ -441,7 +441,8 @@ void CtrlMemView::onMouseUp(WPARAM wParam, LPARAM lParam, int button) } DumpMemoryWindow dump(wnd,debugger); dump.exec(); - Core_EnableStepping(false); + int resume = MessageBox(wnd,L"Do you want to resume emulation",MB_YESNO); + if (resume == IDYES) Core_EnableStepping(false); break; case ID_MEMVIEW_COPYVALUE_8: From 34be878d2aba2ab63ebc5e234a59fb192f4c2de1 Mon Sep 17 00:00:00 2001 From: pal1000 Date: Tue, 19 Nov 2013 15:11:47 +0200 Subject: [PATCH 3/3] Automatically resume emulation after memory dump only if the emulation was active beforehand --- Windows/Debugger/CtrlMemView.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Windows/Debugger/CtrlMemView.cpp b/Windows/Debugger/CtrlMemView.cpp index 1b262644f9..6e3d2f28d2 100644 --- a/Windows/Debugger/CtrlMemView.cpp +++ b/Windows/Debugger/CtrlMemView.cpp @@ -435,14 +435,17 @@ void CtrlMemView::onMouseUp(WPARAM wParam, LPARAM lParam, int button) { case ID_MEMVIEW_DUMP: - if (!Core_IsStepping()) // If emulator isn't paused + bool PriorDumpIsPaused=Core_IsStepping(); + if (!PriorDumpIsPaused) // If emulator isn't paused { - Core_EnableStepping(true); + Core_EnableStepping(true); //force paused state } DumpMemoryWindow dump(wnd,debugger); dump.exec(); - int resume = MessageBox(wnd,L"Do you want to resume emulation",MB_YESNO); - if (resume == IDYES) Core_EnableStepping(false); + if (!PriorDumpIsPaused) // If emulator wasn't paused before dumping + { + Core_EnableStepping(false);//resume emulation + } break; case ID_MEMVIEW_COPYVALUE_8: