From 000ebab3c50621162efd7ea162309a1712216bd5 Mon Sep 17 00:00:00 2001 From: "Michael \"Code Poet\" Pohoreski" Date: Sat, 3 Jun 2023 11:08:16 -0700 Subject: [PATCH] Debugger 2.9.1.24 (#1236) --- docs/Debugger_Changelog.txt | 1 + source/Debugger/Debug.cpp | 2 +- source/Debugger/Debugger_Color.cpp | 16 +++++++++++++++- source/Debugger/Debugger_Display.cpp | 13 ++----------- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/docs/Debugger_Changelog.txt b/docs/Debugger_Changelog.txt index 5d8c9f53..267d0cc1 100644 --- a/docs/Debugger_Changelog.txt +++ b/docs/Debugger_Changelog.txt @@ -1,4 +1,5 @@ /* +2.9.1.24 Fixed: Disassembly line when at PC for BW mode. GH #1231 2.9.1.23 Fixed: Show floating-point values in scientific notation. 2.9.1.22 Fixed: `df FAC` was incorrectly getting marked up as `db` 2.9.1.21 Fixed: `df` showing zero was displaying 0 instead 0.0 diff --git a/source/Debugger/Debug.cpp b/source/Debugger/Debug.cpp index c5ac3291..22bf407a 100644 --- a/source/Debugger/Debug.cpp +++ b/source/Debugger/Debug.cpp @@ -53,7 +53,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #define MAKE_VERSION(a,b,c,d) ((a<<24) | (b<<16) | (c<<8) | (d)) // See /docs/Debugger_Changelog.txt for full details - const int DEBUGGER_VERSION = MAKE_VERSION(2,9,1,23); + const int DEBUGGER_VERSION = MAKE_VERSION(2,9,1,24); // Public _________________________________________________________________________________________ diff --git a/source/Debugger/Debugger_Color.cpp b/source/Debugger/Debugger_Color.cpp index 152c8ecd..647bbc14 100644 --- a/source/Debugger/Debugger_Color.cpp +++ b/source/Debugger/Debugger_Color.cpp @@ -218,7 +218,7 @@ static void _SetupColorRamp(const int iPrimary, int & iColor_) //=========================================================================== -void ConfigColorsReset(void) +void ConfigColorsReset (void) { // int iColor = 1; // black only has one level, skip it, since black levels same as white levels // for (int iPrimary = 1; iPrimary < 8; iPrimary++ ) @@ -248,6 +248,20 @@ void ConfigColorsReset(void) else BW = 255; + // GH #1231 + // Force contrast between: + // BG_DISASM_PC_X and FG_DISASM_PC_X + if (iColor == FG_DISASM_PC_X) + { + int nIndexBG = iColor - 1; + int nPrevBG = g_aColors[ SCHEME_BW ][ nIndexBG ] & 0xFF; + int nContrast = 0xFF - nPrevBG; + int nDelta = abs(BW - nPrevBG); + + if (nDelta < 0x80) + BW = nContrast; + } + COLORREF nMono = RGB(M, M, M); COLORREF nBW = RGB(BW, BW, BW); diff --git a/source/Debugger/Debugger_Display.cpp b/source/Debugger/Debugger_Display.cpp index 9682c552..37dd51a0 100644 --- a/source/Debugger/Debugger_Display.cpp +++ b/source/Debugger/Debugger_Display.cpp @@ -1435,7 +1435,7 @@ WORD DrawDisassemblyLine ( int iLine, const WORD nBaseAddress ) int bAddressIsBookmark = Bookmark_Find( nBaseAddress ); DebugColors_e iBackground = BG_DISASM_1; - DebugColors_e iForeground = FG_DISASM_MNEMONIC; // FG_DISASM_TEXT; + DebugColors_e iForeground = FG_DISASM_ADDRESS; bool bCursorLine = false; if (((! g_bDisasmCurBad) && (iLine == g_nDisasmCurLine)) @@ -1498,22 +1498,13 @@ WORD DrawDisassemblyLine ( int iLine, const WORD nBaseAddress ) } else { - iForeground = FG_DISASM_MNEMONIC; + iForeground = FG_DISASM_ADDRESS; } } DebuggerSetColorBG( DebuggerGetColor( iBackground ) ); DebuggerSetColorFG( DebuggerGetColor( iForeground ) ); - // Address - if (! bCursorLine) - DebuggerSetColorFG( DebuggerGetColor( FG_DISASM_ADDRESS ) ); -// else -// { -// DebuggerSetColorBG( GetDebuggerMemDC(), DebuggerGetColor( FG_DISASM_BOOKMARK ) ); // swapped -// DebuggerSetColorFG( GetDebuggerMemDC(), DebuggerGetColor( BG_DISASM_BOOKMARK ) ); // swapped -// } - if ( g_bConfigDisasmAddressView ) { PrintTextCursorX( (LPCTSTR) line.sAddress, linerect );