From b5b1deeead7b4bf5f587c7e66260bdd82dc5ef57 Mon Sep 17 00:00:00 2001 From: tomcw Date: Sun, 22 Sep 2019 15:28:10 +0100 Subject: [PATCH] Debugger: added & used consts for video-scanner info --- source/Debugger/Debugger_Color.cpp | 7 ++++++- source/Debugger/Debugger_Color.h | 5 +++++ source/Debugger/Debugger_Display.cpp | 12 ++++++------ 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/source/Debugger/Debugger_Color.cpp b/source/Debugger/Debugger_Color.cpp index 5cf94c0c..90056f4f 100644 --- a/source/Debugger/Debugger_Color.cpp +++ b/source/Debugger/Debugger_Color.cpp @@ -126,7 +126,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA W8, // FG_SOURCE_TITLE W2, // BG_SOURCE_1 // C2 W2 for "Paper Look" W3, // BG_SOURCE_2 - W8 // FG_SOURCE + W8, // FG_SOURCE + + C3, // BG_VIDEOSCANNER_TITLE + W8, // FG_VIDEOSCANNER_TITLE + R8, // FG_VIDEOSCANNER_INVISIBLE + G8, // FG_VIDEOSCANNER_VISIBLE }; diff --git a/source/Debugger/Debugger_Color.h b/source/Debugger/Debugger_Color.h index 50aa4dd2..906a6f54 100644 --- a/source/Debugger/Debugger_Color.h +++ b/source/Debugger/Debugger_Color.h @@ -122,6 +122,11 @@ , BG_SOURCE_2 // even , FG_SOURCE + , BG_VIDEOSCANNER_TITLE + , FG_VIDEOSCANNER_TITLE + , FG_VIDEOSCANNER_INVISIBLE // red + , FG_VIDEOSCANNER_VISIBLE // green + , NUM_DEBUG_COLORS }; diff --git a/source/Debugger/Debugger_Display.cpp b/source/Debugger/Debugger_Display.cpp index 68b83abd..8ecce9d9 100644 --- a/source/Debugger/Debugger_Display.cpp +++ b/source/Debugger/Debugger_Display.cpp @@ -3673,7 +3673,7 @@ void DrawVideoScannerValue(int line, LPCTSTR name, int nValue, bool isVisible) if (!((g_iWindowThis == WINDOW_CODE) || ((g_iWindowThis == WINDOW_DATA)))) return; - int nFontWidth = g_aFontConfig[FONT_INFO]._nFontWidthAvg; + const int nFontWidth = g_aFontConfig[FONT_INFO]._nFontWidthAvg; RECT rect; rect.top = line * g_nFontHeight; @@ -3681,8 +3681,8 @@ void DrawVideoScannerValue(int line, LPCTSTR name, int nValue, bool isVisible) rect.left = DISPLAY_VIDEO_SCANNER_COLUMN; rect.right = rect.left + (5 * nFontWidth); - DebuggerSetColorFG(DebuggerGetColor(FG_INFO_CHAR_HI)); - DebuggerSetColorBG(DebuggerGetColor(VIDEO_INFO_BG)); + DebuggerSetColorBG(DebuggerGetColor(BG_VIDEOSCANNER_TITLE)); + DebuggerSetColorFG(DebuggerGetColor(FG_VIDEOSCANNER_TITLE)); PrintText(name, rect); @@ -3693,13 +3693,13 @@ void DrawVideoScannerValue(int line, LPCTSTR name, int nValue, bool isVisible) sprintf_s(sValue, sizeof(sValue), "%03X", nValue); // Needs to be far enough over, since 4 chars of ZeroPage symbol also calls us - int nOffset = 2; + const int nOffset = 2; rect.left = DISPLAY_VIDEO_SCANNER_COLUMN + (nOffset * nFontWidth); if (!isVisible) - DebuggerSetColorFG(DebuggerGetColor(FG_DISASM_BP_S_X)); // red + DebuggerSetColorFG(DebuggerGetColor(FG_VIDEOSCANNER_INVISIBLE)); // red else - DebuggerSetColorFG(DebuggerGetColor(FG_DISASM_BRANCH)); // green + DebuggerSetColorFG(DebuggerGetColor(FG_VIDEOSCANNER_VISIBLE)); // green PrintText(sValue, rect); }