Skip to content

Commit

Permalink
Debugger: 2.9.1.5 Added: Disassembly window now shows signed decimal …
Browse files Browse the repository at this point in the history
…values for immediate values.
  • Loading branch information
Michaelangel007 committed Jan 4, 2022
1 parent aaae1dd commit 65ab105
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 16 deletions.
4 changes: 3 additions & 1 deletion 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.
Expand Down
2 changes: 1 addition & 1 deletion source/Debugger/Debug.cpp
Expand Up @@ -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 _________________________________________________________________________________________
Expand Down
1 change: 1 addition & 0 deletions source/Debugger/Debugger_Color.cpp
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions source/Debugger/Debugger_Color.h
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion source/Debugger/Debugger_Console.h
Expand Up @@ -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
Expand Down
30 changes: 18 additions & 12 deletions source/Debugger/Debugger_Disassembler.cpp
Expand Up @@ -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
}
}
}

Expand Down
13 changes: 12 additions & 1 deletion source/Debugger/Debugger_Display.cpp
Expand Up @@ -1515,7 +1515,7 @@ WORD DrawDisassemblyLine ( int iLine, const WORD nBaseAddress )
}


// Address Seperator
// Address Seperator
if (! bCursorLine)
DebuggerSetColorFG( DebuggerGetColor( FG_DISASM_OPERATOR ) );

Expand Down Expand Up @@ -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)
{
Expand Down
1 change: 1 addition & 0 deletions source/Debugger/Debugger_Types.h
Expand Up @@ -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 ]; // ^
Expand Down

0 comments on commit 65ab105

Please sign in to comment.