From a528f797b1b8a3bf4274dc187849b5e13338900f Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Mon, 23 Sep 2013 23:44:58 -0700 Subject: [PATCH 1/2] 32-bit warning fixes in the debugger/win UI. --- Windows/Debugger/CtrlDisAsmView.cpp | 10 +++++----- Windows/main.cpp | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Windows/Debugger/CtrlDisAsmView.cpp b/Windows/Debugger/CtrlDisAsmView.cpp index 9883a08413..ade830fe16 100644 --- a/Windows/Debugger/CtrlDisAsmView.cpp +++ b/Windows/Debugger/CtrlDisAsmView.cpp @@ -124,7 +124,7 @@ void CtrlDisAsmView::scanFunctions() } std::sort(func.lines.begin(),func.lines.end(),compareBranchLines); - for (int i = 0; i < func.lines.size(); i++) + for (size_t i = 0; i < func.lines.size(); i++) { for (int l = 0; l < NUM_LANES; l++) { @@ -184,7 +184,7 @@ void CtrlDisAsmView::scanFunctions() lanes[i].used = false; std::sort(strayLines.begin(),strayLines.end(),compareBranchLines); - for (int i = 0; i < strayLines.size(); i++) + for (size_t i = 0; i < strayLines.size(); i++) { for (int l = 0; l < NUM_LANES; l++) { @@ -666,19 +666,19 @@ void CtrlDisAsmView::onPaint(WPARAM wParam, LPARAM lParam) } SelectObject(hdc,condPen); - for (int i = 0; i < visibleFunctionAddresses.size(); i++) + for (size_t i = 0; i < visibleFunctionAddresses.size(); i++) { auto it = functions.find(visibleFunctionAddresses[i]); if (it == functions.end()) continue; DisassemblyFunction& func = it->second; - for (int l = 0; l < func.lines.size(); l++) + for (size_t l = 0; l < func.lines.size(); l++) { drawBranchLine(hdc,func.lines[l]); } } - for (int i = 0; i < strayLines.size(); i++) + for (size_t i = 0; i < strayLines.size(); i++) { drawBranchLine(hdc,strayLines[i]); } diff --git a/Windows/main.cpp b/Windows/main.cpp index 4f1eb3ff7f..72adef9dfa 100644 --- a/Windows/main.cpp +++ b/Windows/main.cpp @@ -101,7 +101,7 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin // Really should find a way to do this in XP too :/ if (0 != GetLocaleInfo(LOCALE_NAME_USER_DEFAULT, LOCALE_SNAME, lcCountry, 256)) { langRegion = ConvertWStringToUTF8(lcCountry); - for (int i = 0; i < langRegion.size(); i++) { + for (size_t i = 0; i < langRegion.size(); i++) { if (langRegion[i] == '-') langRegion[i] = '_'; } From 4cae7bf8d3a33a70cbef7f8b8d25db605387bfaa Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Mon, 23 Sep 2013 23:45:17 -0700 Subject: [PATCH 2/2] Defer initialization of the GE dbg preview. Maybe it's causing slowdown on some cards to init a new context? --- Windows/GEDebugger/GEDebugger.cpp | 20 +++++++++++++++----- Windows/GEDebugger/GEDebugger.h | 3 +++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/Windows/GEDebugger/GEDebugger.cpp b/Windows/GEDebugger/GEDebugger.cpp index 229dde2447..db54132203 100644 --- a/Windows/GEDebugger/GEDebugger.cpp +++ b/Windows/GEDebugger/GEDebugger.cpp @@ -86,18 +86,23 @@ static void RunPauseAction() { } CGEDebugger::CGEDebugger(HINSTANCE _hInstance, HWND _hParent) - : Dialog((LPCSTR)IDD_GEDEBUGGER, _hInstance, _hParent) { + : Dialog((LPCSTR)IDD_GEDEBUGGER, _hInstance, _hParent), frameWindow(NULL) { breakCmds.resize(256, false); - // TODO: Could be scrollable in case the framebuf is larger? Also should be better positioned. - frameWindow = new SimpleGLWindow(m_hInstance, m_hDlg, (750 - 512) / 2, 40, 512, 272); - // TODO: Why doesn't this work? - frameWindow->Clear(); } CGEDebugger::~CGEDebugger() { delete frameWindow; } +void CGEDebugger::SetupFrameWindow() { + if (frameWindow == NULL) { + // TODO: Could be scrollable in case the framebuf is larger? Also should be better positioned. + frameWindow = new SimpleGLWindow(m_hInstance, m_hDlg, (750 - 512) / 2, 40, 512, 272); + // TODO: Why doesn't this work? + frameWindow->Clear(); + } +} + BOOL CGEDebugger::DlgProc(UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { case WM_INITDIALOG: @@ -111,10 +116,15 @@ BOOL CGEDebugger::DlgProc(UINT message, WPARAM wParam, LPARAM lParam) { Show(false); return TRUE; + case WM_SHOWWINDOW: + SetupFrameWindow(); + break; + case WM_COMMAND: switch (LOWORD(wParam)) { case IDC_GEDBG_BREAK: attached = true; + SetupFrameWindow(); //breakNextOp = true; pauseWait.notify_one(); breakNextDraw = true; diff --git a/Windows/GEDebugger/GEDebugger.h b/Windows/GEDebugger/GEDebugger.h index 0ba85f2019..c0a1283855 100644 --- a/Windows/GEDebugger/GEDebugger.h +++ b/Windows/GEDebugger/GEDebugger.h @@ -31,5 +31,8 @@ public: protected: BOOL DlgProc(UINT message, WPARAM wParam, LPARAM lParam); +private: + void SetupFrameWindow(); + SimpleGLWindow *frameWindow; };