Fix a couple of warnings from PR#1090 (PR #1094)

* Fix a couple of warnings from PR#1090
* Fix as suggested and further improvement
This commit is contained in:
Kelvin Lee 2022-04-30 19:53:14 +10:00 committed by GitHub
parent a5c41dd8ca
commit 0ab10905e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 7 deletions

View File

@ -1845,7 +1845,7 @@ WORD DrawDisassemblyLine ( int iLine, const WORD nBaseAddress )
//===========================================================================
static void DrawFlags ( int line, WORD nRegFlags )
static void DrawFlags ( int line, BYTE nRegFlags )
{
if (! ((g_iWindowThis == WINDOW_CODE) || ((g_iWindowThis == WINDOW_DATA))))
return;
@ -2154,12 +2154,9 @@ void DrawRegister ( int line, LPCTSTR name, const int nBytes, const WORD nValue,
DebuggerSetColorBG( DebuggerGetColor( iBackground ));
PrintText( name, rect );
unsigned int nData = nValue;
int nOffset = 6;
if (PARAM_REG_SP == iSource)
{
WORD nStackDepth = _6502_STACK_END - nValue;
BYTE nStackDepth = _6502_STACK_END - (_6502_STACK_BEGIN + (nValue & 0xFF));
int nFontWidth = g_aFontConfig[ FONT_INFO ]._nFontWidthAvg;
rect.left += (2 * nFontWidth) + (nFontWidth >> 1); // 2.5 looks a tad nicer then 2
@ -2172,10 +2169,13 @@ void DrawRegister ( int line, LPCTSTR name, const int nBytes, const WORD nValue,
if (nBytes == 2)
{
sValue = WordToHexStr( nData );
sValue = WordToHexStr( nValue );
}
else
{
assert(nBytes == 1 && nValue < 256); // Ensure the following downsizing is legal.
const BYTE nData = BYTE(nValue);
rect.left = DISPLAY_REGS_COLUMN + (3 * nFontWidth);
// rect.right = SCREENSPLIT2;
@ -2190,10 +2190,11 @@ void DrawRegister ( int line, LPCTSTR name, const int nBytes, const WORD nValue,
DebuggerSetColorFG( DebuggerGetColor( FG_INFO_OPERATOR ));
PrintTextCursorX( "'", rect ); // PrintTextCursorX()
sValue = StrFormat( " %02X", nData );
sValue = " " + ByteToHexStr( nData );
}
// Needs to be far enough over, since 4 chars of ZeroPage symbol also calls us
const int nOffset = 6;
rect.left = DISPLAY_REGS_COLUMN + (nOffset * nFontWidth);
if ((PARAM_REG_PC == iSource) || (PARAM_REG_SP == iSource)) // Stack Pointer is target address, but doesn't look as good.