From 0c0e2f6bdd98daf763059d809c1f2367abef22c0 Mon Sep 17 00:00:00 2001 From: michaelangel007 Date: Tue, 19 May 2020 08:28:44 -0700 Subject: [PATCH 1/3] Debugger fixes for 2.9.0.16 and 2.9.0.17 --- source/Debugger/Debug.cpp | 35 +++++++++++++++++++++++++---------- source/Debugger/Debug.h | 2 +- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/source/Debugger/Debug.cpp b/source/Debugger/Debug.cpp index 851cf0bd..7bd5b506 100644 --- a/source/Debugger/Debug.cpp +++ b/source/Debugger/Debug.cpp @@ -484,13 +484,17 @@ bool _Bookmark_Del( const WORD nAddress ) { // g_aBookmarks.at( iBookmark ) = NO_6502_TARGET; g_aBookmarks[ iBookmark ].bSet = false; + g_nBookmarks--; bDeleted = true; } } return bDeleted; } -bool Bookmark_Find( const WORD nAddress ) +// Returns: +// 0 if address does not have a bookmark set +// N+1 if there is an existing bookmark that has this address +int Bookmark_Find( const WORD nAddress ) { // Ugh, linear search // int nSize = g_aBookmarks.size(); @@ -500,10 +504,10 @@ bool Bookmark_Find( const WORD nAddress ) if (g_aBookmarks[ iBookmark ].nAddress == nAddress) { if (g_aBookmarks[ iBookmark ].bSet) - return true; + return iBookmark + 1; } } - return false; + return 0; } @@ -598,15 +602,26 @@ Update_t CmdBookmarkAdd (int nArgs ) ConsoleDisplayPush( sText ); return ConsoleUpdate(); } - - if ((iBookmark < MAX_BOOKMARKS) && (g_nBookmarks < MAX_BOOKMARKS)) + + // 2.9.0.16 Fixed: Replacing an existing bookmark incorrectly increased the total bookmark count. + int nOldBookmark = Bookmark_Find( nAddress ); + if (nOldBookmark) { - g_aBookmarks[iBookmark].bSet = true; - g_aBookmarks[iBookmark].nAddress = nAddress; - bAdded = true; - g_nBookmarks++; - iBookmark++; + _Bookmark_Del( nAddress ); } + + // 2.9.0.17 Fixed: If all bookmarks were used then setting a new one wouldn't update an existing one to the new address. + if (g_aBookmarks[ iBookmark ].bSet) + { + g_aBookmarks[ iBookmark ].nAddress = nAddress; + bAdded = true; + } + else + if (g_nBookmarks < MAX_BOOKMARKS) + { + bAdded = _Bookmark_Add( iBookmark, nAddress ); + iBookmark++; + } } if (!bAdded) diff --git a/source/Debugger/Debug.h b/source/Debugger/Debug.h index 70d1327b..91ac7d5c 100644 --- a/source/Debugger/Debug.h +++ b/source/Debugger/Debug.h @@ -135,7 +135,7 @@ // Prototypes _______________________________________________________________ // Bookmarks - bool Bookmark_Find( const WORD nAddress ); + int Bookmark_Find( const WORD nAddress ); // Breakpoints int CheckBreakpointsIO (); From dfbb63934c0dfc076e7febb8dd1c500a1acfe2c6 Mon Sep 17 00:00:00 2001 From: michaelangel007 Date: Tue, 19 May 2020 08:29:23 -0700 Subject: [PATCH 2/3] Debugger 2.9.0.18 --- source/Debugger/Debug.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/source/Debugger/Debug.cpp b/source/Debugger/Debug.cpp index 7bd5b506..587e0071 100644 --- a/source/Debugger/Debug.cpp +++ b/source/Debugger/Debug.cpp @@ -538,6 +538,8 @@ void _Bookmark_Reset() { g_aBookmarks[ iBookmark ].bSet = false; } + + g_nBookmarks = 0; } @@ -647,11 +649,7 @@ Update_t CmdBookmarkClear (int nArgs) { if (! _tcscmp(g_aArgs[nArgs].sArg, g_aParameters[ PARAM_WILDSTAR ].m_sName)) { - for (iBookmark = 0; iBookmark < MAX_BOOKMARKS; iBookmark++ ) - { - if (g_aBookmarks[ iBookmark ].bSet) - g_aBookmarks[ iBookmark ].bSet = false; - } + _Bookmark_Reset(); break; } From 2b9adac338352a32758231df9c80a653d15383de Mon Sep 17 00:00:00 2001 From: michaelangel007 Date: Tue, 19 May 2020 08:37:15 -0700 Subject: [PATCH 3/3] Debugger: 2.9.1.0 Bookmarks now have their own indicator --- docs/Debugger_Changelog.txt | 7 +++++ resource/Debug_Font.bmp | Bin 21560 -> 43130 bytes source/Debugger/Debug.cpp | 2 +- source/Debugger/Debugger_Display.cpp | 41 +++++++++++++++------------ 4 files changed, 31 insertions(+), 19 deletions(-) diff --git a/docs/Debugger_Changelog.txt b/docs/Debugger_Changelog.txt index 631c4e14..b2ca5a72 100644 --- a/docs/Debugger_Changelog.txt +++ b/docs/Debugger_Changelog.txt @@ -1,4 +1,11 @@ /* + + +2.9.1.0 Added: Bookmarks now have their own indicator (a number with a box around it) and replace the ":" seperator. Updated Debug_Font.bmp + +.18 Fixed: Resetting bookmarks wasn't setting the total bookmarks back to zero. +.17 Fixed: If all bookmarks were used then setting a new one wouldn't update an existing one to the new address. +.16 Fixed: Replacing an existing bookmark incorrectly increased the total bookmark count. .15 Cleanup: HELP CALC examples and See also. .14 Fixed: HELP JSR wasn't color-coding syntax. .13 Added: PROFILE LIST now shows how many clock cycles were executed. diff --git a/resource/Debug_Font.bmp b/resource/Debug_Font.bmp index 95baedb50d5bb927a7163c3cac20b758b9593922..bff94b660801a8de6b48cacb1ffeef5bc46564df 100644 GIT binary patch delta 2098 zcmd^+`E=v(JnoMJv-%wOc_+LFyj8Hx5v$t? zf^H`pMUN^=qlf<)D2?XN6MJDiHk&jEV_WK%N;GT_myXazA~fWPho<0N1M=+a>D$*L zU+h9Gy-#^RLQzPOEZ2O-YIAXtPT<#Og8D8Bruxdm@#U0)av zx0f#qDaQiRJWza9HZ5CNr>W1ENI4eDYD~%yju2%6I3j-u#TO7qNd>8_Ukz}> zW00bn$#OG)g3>`Q>t>2Cyr`{IEN5Tle+W^LmfpgdGzI_o4?l`tC~5EUCc06Y2A3fn s9h~y{+VE*Bq}fT2xu!F%vzfZTecf%*+fI)@k2fiaHKi9JeOzsQ0b`53s{jB1 delta 102 zcmex$foaDIMja<#ix37dFawerKwJRC4nWMvAOR#97?^ 0x7F to Mouse Text + // char bookmark_text[2] = { 0x7F + bAddressIsBookmark, 0 }; + // PrintTextCursorX( bookmark_text, linerect ); + FillRect( GetDebuggerMemDC(), &linerect, g_hConsoleBrushBG ); + PrintGlyph( linerect.left, linerect.top, 0x7F + bAddressIsBookmark ); // Glyphs 0x80 .. 0x89 = Unicode U+24EA, U+2460 .. U+2468 + linerect.left += g_aFontConfig[ FONT_DISASM_DEFAULT ]._nFontWidthAvg; + + DebuggerSetColorBG( DebuggerGetColor( iBackground ) ); + DebuggerSetColorFG( DebuggerGetColor( iForeground ) ); + } + else + PrintTextCursorX( ":", linerect ); + } else PrintTextCursorX( " ", linerect ); // bugfix, not showing "addr:" doesn't alternate color lines