diff --git a/docs/Debugger_Changelog.txt b/docs/Debugger_Changelog.txt index e7debc998..6980cc033 100644 --- a/docs/Debugger_Changelog.txt +++ b/docs/Debugger_Changelog.txt @@ -1,6 +1,8 @@ /* -2.9.1.3 Added: DB command now optionally supports = +2.9.1.5 Added: Disassembly window now shows signed decimal values for immediate values. +2.9.1.4 Changed: Show symbol warnings in Orange, and length of symbols in light blue. +2.9.1.3 Added: DB commanoptionally supports = DB HGR = 2000:3FFF 2.9.1.2 Fixed: Off by one end address when deleting DisasmData_t 2.9.1.1 Added: X command now supports a range and will chop off the appropiate data sections. diff --git a/source/Debugger/Debug.cpp b/source/Debugger/Debug.cpp index ebdcc5a93..dc7549012 100644 --- a/source/Debugger/Debug.cpp +++ b/source/Debugger/Debug.cpp @@ -51,7 +51,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #define ALLOW_INPUT_LOWERCASE 1 // See /docs/Debugger_Changelog.txt for full details - const int DEBUGGER_VERSION = MAKE_VERSION(2,9,1,3); + const int DEBUGGER_VERSION = MAKE_VERSION(2,9,1,5); // Public _________________________________________________________________________________________ diff --git a/source/Debugger/Debugger_Color.cpp b/source/Debugger/Debugger_Color.cpp index 2ef90c117..3db6714b1 100644 --- a/source/Debugger/Debugger_Color.cpp +++ b/source/Debugger/Debugger_Color.cpp @@ -95,6 +95,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA G8, // FG_DISASM_SYMBOL C8, // FG_DISASM_CHAR G8, // FG_DISASM_BRANCH + COLOR_CUSTOM_01, // FG_DISASM_SINT8 C3, // BG_INFO (C4, C2 too dark) C3, // BG_INFO_WATCH diff --git a/source/Debugger/Debugger_Color.h b/source/Debugger/Debugger_Color.h index 22a1757c5..9cef06cfd 100644 --- a/source/Debugger/Debugger_Color.h +++ b/source/Debugger/Debugger_Color.h @@ -89,6 +89,7 @@ /*ZZZ*/ , FG_DISASM_SYMBOL // Green HOME , FG_DISASM_CHAR // Cyan 'c' , FG_DISASM_BRANCH // Green ^ = v + , FG_DISASM_SINT8 // Lite Blue , BG_INFO // Cyan Regs/Stack/BP/Watch/ZP , BG_INFO_WATCH // Cyan diff --git a/source/Debugger/Debugger_Console.h b/source/Debugger/Debugger_Console.h index 74c12375d..2ac3e4d49 100644 --- a/source/Debugger/Debugger_Console.h +++ b/source/Debugger/Debugger_Console.h @@ -68,7 +68,7 @@ #define CHC_ARG_MAND "`7" // < > #define CHC_ARG_OPT "`4" // [ ] #define CHC_ARG_SEP "`9" // | grey - #define CHC_NUM_DEC "`6" // cyan looks better then yellow (_SearchMemoryDisplay), S D000:FFFF A9 00, PROFILE, HELP BP + #define CHC_NUM_DEC "`:" // Lite Blue looks better then yellow (_SearchMemoryDisplay), S D000:FFFF A9 00, PROFILE, HELP BP #define CHC_NUM_HEX "`3" #define CHC_SYMBOL "`2" // Symbols #define CHC_ADDRESS "`8" // Hex Address diff --git a/source/Debugger/Debugger_Disassembler.cpp b/source/Debugger/Debugger_Disassembler.cpp index 8649ac09f..6d2554d5f 100644 --- a/source/Debugger/Debugger_Disassembler.cpp +++ b/source/Debugger/Debugger_Disassembler.cpp @@ -390,22 +390,28 @@ int GetDisassemblyLine(WORD nBaseAddress, DisasmLine_t& line_) if (iOpmode == AM_M) { // sprintf( sTarget, g_aOpmodes[ iOpmode ]._sFormat, (unsigned)nTarget ); - sprintf(line_.sTarget, "%02X", (unsigned)nTarget); + sprintf(line_.sTarget , "%02X", (unsigned)nTarget); - if (iOpmode == AM_M) - { - bDisasmFormatFlags |= DISASM_FORMAT_CHAR; - line_.nImmediate = (BYTE)nTarget; - unsigned _char = FormatCharTxtCtrl(FormatCharTxtHigh(line_.nImmediate, NULL), NULL); + if (nTarget == 0) + line_.sImmediateSignedDec[0] = 0; // nothing + else + if (nTarget < 128) + sprintf(line_.sImmediateSignedDec, "+%d" , nTarget ); + else + if (nTarget >= 128) + sprintf(line_.sImmediateSignedDec, "-%d" , (~nTarget + 1) & 0x7F ); - sprintf(line_.sImmediate, "%c", _char); + bDisasmFormatFlags |= DISASM_FORMAT_CHAR; + line_.nImmediate = (BYTE)nTarget; + unsigned _char = FormatCharTxtCtrl(FormatCharTxtHigh(line_.nImmediate, NULL), NULL); + + sprintf(line_.sImmediate, "%c", _char); #if OLD_CONSOLE_COLOR - if (ConsoleColorIsEscapeMeta(_char)) - sprintf(line_.sImmediate, "%c%c", _char, _char); - else - sprintf(line_.sImmediate, "%c", _char); + if (ConsoleColorIsEscapeMeta(_char)) + sprintf(line_.sImmediate, "%c%c", _char, _char); + else + sprintf(line_.sImmediate, "%c", _char); #endif - } } } diff --git a/source/Debugger/Debugger_Display.cpp b/source/Debugger/Debugger_Display.cpp index 31478f5d5..80443f761 100644 --- a/source/Debugger/Debugger_Display.cpp +++ b/source/Debugger/Debugger_Display.cpp @@ -1515,7 +1515,7 @@ WORD DrawDisassemblyLine ( int iLine, const WORD nBaseAddress ) } - // Address Seperator + // Address Seperator if (! bCursorLine) DebuggerSetColorFG( DebuggerGetColor( FG_DISASM_OPERATOR ) ); @@ -1782,6 +1782,17 @@ WORD DrawDisassemblyLine ( int iLine, const WORD nBaseAddress ) } } + // 2.9.1.4: Print decimal for immediate values + if (line.bTargetImmediate) + { + linerect.left = (int) aTabs[ TS_IMMEDIATE ]; + DebuggerSetColorFG( DebuggerGetColor( FG_INFO_OPERATOR )); + PrintTextCursorX( "#", linerect ); + + DebuggerSetColorFG( DebuggerGetColor( FG_DISASM_SINT8 )); + PrintTextCursorX( line.sImmediateSignedDec, linerect); + } + // Immediate Char if (bDisasmFormatFlags & DISASM_FORMAT_CHAR) { diff --git a/source/Debugger/Debugger_Types.h b/source/Debugger/Debugger_Types.h index 3b42763d4..2bf23b2be 100644 --- a/source/Debugger/Debugger_Types.h +++ b/source/Debugger/Debugger_Types.h @@ -960,6 +960,7 @@ const DisasmData_t* pDisasmData; // If != NULL then bytes are marked up as data char sTargetValue [ CHARS_FOR_ADDRESS ]; // char sTargetAddress[ CHARS_FOR_ADDRESS ]; + char sImmediateSignedDec[ 6 ]; // "-128" .. "+127" char sImmediate[ 4 ]; // 'c' char nImmediate; char sBranch [ 4 ]; // ^