From 177b9fa6b1931440c31baa1e25bee14199f3f928 Mon Sep 17 00:00:00 2001 From: Kingcom Date: Wed, 14 Aug 2013 23:30:50 +0200 Subject: [PATCH 1/2] Separate accelerator table when the debugger is active --- Windows/Debugger/Debugger_Disasm.cpp | 8 ++++++++ Windows/Globals.cpp | 1 + Windows/main.cpp | 3 ++- Windows/main.h | 3 ++- Windows/ppsspp.rc | Bin 40202 -> 40416 bytes Windows/resource.h | Bin 21952 -> 22042 bytes 6 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Windows/Debugger/Debugger_Disasm.cpp b/Windows/Debugger/Debugger_Disasm.cpp index c0b592f8e..27d1ccebc 100644 --- a/Windows/Debugger/Debugger_Disasm.cpp +++ b/Windows/Debugger/Debugger_Disasm.cpp @@ -587,6 +587,14 @@ BOOL CDisasm::DlgProc(UINT message, WPARAM wParam, LPARAM lParam) case WM_CLOSE: Show(false); return TRUE; + case WM_ACTIVATE: + if (wParam == WA_ACTIVE || wParam == WA_CLICKACTIVE) + { + g_debuggerActive = true; + } else { + g_debuggerActive = false; + } + break; } return FALSE; } diff --git a/Windows/Globals.cpp b/Windows/Globals.cpp index 1344fc94f..36ed0137f 100644 --- a/Windows/Globals.cpp +++ b/Windows/Globals.cpp @@ -24,5 +24,6 @@ // Globals HMENU g_hPopupMenus; +bool g_debuggerActive = false; #endif diff --git a/Windows/main.cpp b/Windows/main.cpp index b16f1d83e..4e76933d4 100644 --- a/Windows/main.cpp +++ b/Windows/main.cpp @@ -124,6 +124,7 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin EmuThread_Start(); HACCEL hAccelTable = LoadAccelerators(_hInstance, (LPCTSTR)IDR_ACCELS); + HACCEL hDebugAccelTable = LoadAccelerators(_hInstance, (LPCTSTR)IDR_DEBUGACCELS); //so.. we're at the message pump of the GUI thread for (MSG msg; GetMessage(&msg, NULL, 0, 0); ) // for no quit @@ -141,7 +142,7 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin } //Translate accelerators and dialog messages... - if (!TranslateAccelerator(hwndMain, hAccelTable, &msg)) + if (!TranslateAccelerator(hwndMain, g_debuggerActive ? hDebugAccelTable : hAccelTable, &msg)) { if (!DialogManager::IsDialogMessage(&msg)) { diff --git a/Windows/main.h b/Windows/main.h index 2467aef03..f513292c2 100644 --- a/Windows/main.h +++ b/Windows/main.h @@ -28,4 +28,5 @@ extern CDisasm *disasmWindow[MAX_CPUCOUNT]; extern CMemoryDlg *memoryWindow[MAX_CPUCOUNT]; -extern HMENU g_hPopupMenus; \ No newline at end of file +extern HMENU g_hPopupMenus; +extern bool g_debuggerActive; \ No newline at end of file diff --git a/Windows/ppsspp.rc b/Windows/ppsspp.rc index 6d592f5a57a2786d6e27ff896436b7f82a32e6c7..fe5591399dda95e856da1244f00f98674a79cfae 100644 GIT binary patch delta 56 zcmeC$#q?k|(}s6Kf}RX63_%R>K+=`Li6NB1eR42|$~MHV3`{ From bfbea62ce343b3abdf6a6994f13a0164b0657d7c Mon Sep 17 00:00:00 2001 From: Kingcom Date: Wed, 14 Aug 2013 23:46:59 +0200 Subject: [PATCH 2/2] Send messages to the debugger --- Windows/Debugger/Debugger_Disasm.cpp | 4 ++++ Windows/main.cpp | 13 ++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Windows/Debugger/Debugger_Disasm.cpp b/Windows/Debugger/Debugger_Disasm.cpp index 27d1ccebc..3eb8a101c 100644 --- a/Windows/Debugger/Debugger_Disasm.cpp +++ b/Windows/Debugger/Debugger_Disasm.cpp @@ -17,6 +17,7 @@ #include "Windows/Debugger/CtrlRegisterList.h" #include "Windows/Debugger/CtrlMemView.h" #include "Windows/Debugger/Debugger_Lists.h" +#include "Windows/WndMainWindow.h" #include "Core/Core.h" #include "Core/CPU.h" @@ -224,6 +225,9 @@ BOOL CDisasm::DlgProc(UINT message, WPARAM wParam, LPARAM lParam) CtrlRegisterList *reglist = CtrlRegisterList::getFrom(GetDlgItem(m_hDlg,IDC_REGLIST)); switch(LOWORD(wParam)) { + case ID_TOGGLE_PAUSE: + SendMessage(MainWindow::GetHWND(),WM_COMMAND,ID_TOGGLE_PAUSE,0); + break; case IDC_SHOWVFPU: vfpudlg->Show(true); break; diff --git a/Windows/main.cpp b/Windows/main.cpp index 4e76933d4..6c026a789 100644 --- a/Windows/main.cpp +++ b/Windows/main.cpp @@ -142,7 +142,18 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin } //Translate accelerators and dialog messages... - if (!TranslateAccelerator(hwndMain, g_debuggerActive ? hDebugAccelTable : hAccelTable, &msg)) + HWND wnd; + HACCEL accel; + if (g_debuggerActive) + { + wnd = disasmWindow[0]->GetDlgHandle(); + accel = hDebugAccelTable; + } else { + wnd = hwndMain; + accel = hAccelTable; + } + + if (!TranslateAccelerator(wnd, accel, &msg)) { if (!DialogManager::IsDialogMessage(&msg)) {