mirror of
https://github.com/libretro/ppsspp.git
synced 2025-02-10 19:12:12 +00:00
Merge pull request #4606 from pal1000/master
Pause emulation if needed only when user clicks OK on Dump Memory Window
This commit is contained in:
commit
7407be91ae
@ -436,16 +436,7 @@ void CtrlMemView::onMouseUp(WPARAM wParam, LPARAM lParam, int button)
|
||||
case ID_MEMVIEW_DUMP:
|
||||
{
|
||||
DumpMemoryWindow dump(wnd, debugger);
|
||||
bool priorDumpWasStepping = Core_IsStepping();
|
||||
if (!priorDumpWasStepping) // If emulator isn't paused
|
||||
{
|
||||
Core_EnableStepping(true); //force paused state
|
||||
}
|
||||
dump.exec();
|
||||
if (!priorDumpWasStepping) // If emulator wasn't paused before dumping
|
||||
{
|
||||
Core_EnableStepping(false); //Resume emulation automatically
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include <stdio.h>
|
||||
#include "Core/MemMap.h"
|
||||
#include "Windows/W32Util/ShellUtil.h"
|
||||
#include "Core/Core.h"
|
||||
|
||||
DumpMemoryWindow* DumpMemoryWindow::bp;
|
||||
|
||||
@ -77,10 +78,12 @@ INT_PTR CALLBACK DumpMemoryWindow::dlgFunc(HWND hwnd, UINT iMsg, WPARAM wParam,
|
||||
break;
|
||||
}
|
||||
|
||||
bool priorDumpWasStepping = Core_IsStepping();
|
||||
if (!priorDumpWasStepping) Core_EnableStepping(true); // If emulator isn't paused force paused state
|
||||
fwrite(Memory::GetPointer(bp->start), 1, bp->size, output);
|
||||
fclose(output);
|
||||
|
||||
MessageBoxA(hwnd,"Done.","Error",MB_OK);
|
||||
if (!priorDumpWasStepping) Core_EnableStepping(false); // If emulator wasn't paused before memory dump resume emulation automatically.
|
||||
MessageBoxA(hwnd,"Done.","Information",MB_OK);
|
||||
EndDialog(hwnd,true);
|
||||
}
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user