Detach the GE debugger on close.

And attach in a few missing places, clean up a few comments.
This commit is contained in:
Unknown W. Brackets 2013-11-16 01:42:24 -08:00
parent ac8edb4282
commit 95d76c6641

View file

@ -71,7 +71,6 @@ CGEDebugger::CGEDebugger(HINSTANCE _hInstance, HWND _hParent)
// it's ugly, but .rc coordinates don't match actual pixels and it screws
// up both the size and the aspect ratio
// TODO: Could be scrollable in case the framebuf is larger? Also should be better positioned.
RECT frameRect;
HWND frameWnd = GetDlgItem(m_hDlg,IDC_GEDBG_FRAME);
@ -140,8 +139,6 @@ void CGEDebugger::SetupPreviews() {
}
void CGEDebugger::UpdatePreviews() {
// TODO: Do something different if not paused?
wchar_t desc[256];
const GPUDebugBuffer *primaryBuffer = NULL;
bool bufferResult = false;
@ -288,6 +285,10 @@ BOOL CGEDebugger::DlgProc(UINT message, WPARAM wParam, LPARAM lParam) {
return TRUE;
case WM_CLOSE:
attached = false;
ResumeFromStepping();
breakNext = BREAK_NONE;
Show(false);
return TRUE;
@ -309,7 +310,6 @@ BOOL CGEDebugger::DlgProc(UINT message, WPARAM wParam, LPARAM lParam) {
break;
case IDC_GEDBG_FBTABS:
fbTabs->HandleNotify(lParam);
// TODO: Move this somewhere...
if (attached && gpuDebug != NULL) {
UpdatePreviews();
}
@ -345,6 +345,7 @@ BOOL CGEDebugger::DlgProc(UINT message, WPARAM wParam, LPARAM lParam) {
case IDC_GEDBG_BREAKTEX:
{
attached = true;
if (!gpuDebug) {
break;
}
@ -367,7 +368,6 @@ BOOL CGEDebugger::DlgProc(UINT message, WPARAM wParam, LPARAM lParam) {
SetDlgItemText(m_hDlg, IDC_GEDBG_FRAMEBUFADDR, L"");
SetDlgItemText(m_hDlg, IDC_GEDBG_TEXADDR, L"");
// TODO: detach? Should probably have separate UI, or just on activate?
ResumeFromStepping();
breakNext = BREAK_NONE;
break;
@ -397,6 +397,7 @@ BOOL CGEDebugger::DlgProc(UINT message, WPARAM wParam, LPARAM lParam) {
case WM_GEDBG_TOGGLEPCBREAKPOINT:
{
attached = true;
u32 pc = (u32)wParam;
bool temp;
bool isBreak = IsAddressBreakpoint(pc, temp);
@ -410,6 +411,7 @@ BOOL CGEDebugger::DlgProc(UINT message, WPARAM wParam, LPARAM lParam) {
case WM_GEDBG_RUNTOWPARAM:
{
attached = true;
u32 pc = (u32)wParam;
AddAddressBreakpoint(pc, true);
SendMessage(m_hDlg,WM_COMMAND,IDC_GEDBG_RESUME,0);