Debugger: Format changes only (PR #1076)

This commit is contained in:
Kelvin Lee 2022-04-04 03:15:22 +10:00 committed by GitHub
parent b6404e7d96
commit 1bcf371309
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 166 additions and 158 deletions

View File

@ -786,7 +786,6 @@ Update_t CmdProfile (int nArgs)
// Dump to console // Dump to console
if (iParam == PARAM_LIST) if (iParam == PARAM_LIST)
{ {
char *pText; char *pText;
char sText[ CONSOLE_WIDTH ]; char sText[ CONSOLE_WIDTH ];
@ -5061,11 +5060,11 @@ Update_t CmdNTSC (int nArgs)
uint32_t* pChromaTable = NTSC_VideoGetChromaTable( false, bColorTV ); uint32_t* pChromaTable = NTSC_VideoGetChromaTable( false, bColorTV );
char aStatusText[ CONSOLE_WIDTH*2 ] = "Loaded"; char aStatusText[ CONSOLE_WIDTH*2 ] = "Loaded";
//uint8_t* pTmp = (uint8_t*) pChromaTable; //uint8_t* pTmp = (uint8_t*) pChromaTable;
//*pTmp++ = 0xFF; // b //*pTmp++ = 0xFF; // b
//*pTmp++ = 0x00; // g //*pTmp++ = 0x00; // g
//*pTmp++ = 0x00; // r //*pTmp++ = 0x00; // r
//*pTmp++ = 0xFF; // a //*pTmp++ = 0xFF; // a
if (nFound) if (nFound)
{ {
@ -5192,7 +5191,7 @@ Update_t CmdNTSC (int nArgs)
uint8_t *pTemp64x256 = new uint8_t[ 64 * 256 * 4 ]; uint8_t *pTemp64x256 = new uint8_t[ 64 * 256 * 4 ];
memset( pTemp64x256, 0, g_nChromaSize ); memset( pTemp64x256, 0, g_nChromaSize );
//Transpose16x1::transposeFrom16x1( pSwizzled, (uint8_t*) pChromaTable ); //Transpose16x1::transposeFrom16x1( pSwizzled, (uint8_t*) pChromaTable );
if (pBmp->nWidthPixels == 16) if (pBmp->nWidthPixels == 16)
{ {
@ -5317,7 +5316,7 @@ int _SearchMemoryFind(
WORD nAddress2 = nAddress; WORD nAddress2 = nAddress;
int nMemBlocks = vMemorySearchValues.size(); int nMemBlocks = vMemorySearchValues.size();
for (int iBlock = 0; iBlock < nMemBlocks; iBlock++, nAddress2++ ) for ( int iBlock = 0; iBlock < nMemBlocks; iBlock++, nAddress2++ )
{ {
MemorySearch_t ms = vMemorySearchValues.at( iBlock ); MemorySearch_t ms = vMemorySearchValues.at( iBlock );
ms.m_bFound = false; ms.m_bFound = false;
@ -7942,7 +7941,7 @@ void ProfileFormat( bool bExport, ProfileFormat_e eFormatMode )
pColorTotal = CHC_DEFAULT; // white pColorTotal = CHC_DEFAULT; // white
} }
// Opcode // Opcode
if (bExport) // Export = SeperateColumns if (bExport) // Export = SeperateColumns
sprintf( pText sprintf( pText
, "\"Percent\"" DELIM "\"Count\"" DELIM "\"Opcode\"" DELIM "\"Mnemonic\"" DELIM "\"Addressing Mode\"\n" , "\"Percent\"" DELIM "\"Count\"" DELIM "\"Opcode\"" DELIM "\"Mnemonic\"" DELIM "\"Addressing Mode\"\n"
@ -8659,7 +8658,7 @@ void DebugInitialize ()
} }
#if _DEBUG #if _DEBUG
//g_bConsoleBufferPaused = true; //g_bConsoleBufferPaused = true;
#endif #endif
_Bookmark_Reset(); _Bookmark_Reset();

View File

@ -326,7 +326,7 @@ int GetDisassemblyLine(WORD nBaseAddress, DisasmLine_t& line_)
pTarget = &strAddressBuf; pTarget = &strAddressBuf;
} }
// sprintf( sTarget, g_aOpmodes[ iOpmode ]._sFormat, pTarget ); //sprintf( sTarget, g_aOpmodes[ iOpmode ]._sFormat, pTarget );
if (bDisasmFormatFlags & DISASM_FORMAT_OFFSET) if (bDisasmFormatFlags & DISASM_FORMAT_OFFSET)
{ {
int nAbsTargetOffset = (line_.nTargetOffset > 0) ? line_.nTargetOffset : -line_.nTargetOffset; int nAbsTargetOffset = (line_.nTargetOffset > 0) ? line_.nTargetOffset : -line_.nTargetOffset;
@ -348,7 +348,7 @@ int GetDisassemblyLine(WORD nBaseAddress, DisasmLine_t& line_)
nTargetValue = *(mem + nTargetPointer) | (*(mem + ((nTargetPointer + 1) & 0xffff)) << 8); nTargetValue = *(mem + nTargetPointer) | (*(mem + ((nTargetPointer + 1) & 0xffff)) << 8);
// if (((iOpmode >= AM_A) && (iOpmode <= AM_NZ)) && (iOpmode != AM_R)) //if (((iOpmode >= AM_A) && (iOpmode <= AM_NZ)) && (iOpmode != AM_R))
// sprintf( sTargetValue_, "%04X", nTargetValue ); // & 0xFFFF // sprintf( sTargetValue_, "%04X", nTargetValue ); // & 0xFFFF
if (g_iConfigDisasmTargets & DISASM_TARGET_ADDR) if (g_iConfigDisasmTargets & DISASM_TARGET_ADDR)
@ -366,7 +366,7 @@ int GetDisassemblyLine(WORD nBaseAddress, DisasmLine_t& line_)
unsigned _char = FormatCharTxtCtrl(FormatCharTxtHigh(line_.nImmediate, NULL), NULL); unsigned _char = FormatCharTxtCtrl(FormatCharTxtHigh(line_.nImmediate, NULL), NULL);
sprintf(line_.sImmediate, "%c", _char); sprintf(line_.sImmediate, "%c", _char);
// if (ConsoleColorIsEscapeMeta( nImmediate_ )) //if (ConsoleColorIsEscapeMeta( nImmediate_ ))
#if OLD_CONSOLE_COLOR #if OLD_CONSOLE_COLOR
if (ConsoleColorIsEscapeMeta(_char)) if (ConsoleColorIsEscapeMeta(_char))
sprintf(line_.sImmediate, "%c%c", _char, _char); sprintf(line_.sImmediate, "%c%c", _char, _char);
@ -375,17 +375,18 @@ int GetDisassemblyLine(WORD nBaseAddress, DisasmLine_t& line_)
#endif #endif
} }
// if (iOpmode == AM_NA ) // Indirect Absolute //if (iOpmode == AM_NA ) // Indirect Absolute
// sprintf( sTargetValue_, "%04X", nTargetPointer & 0xFFFF ); // sprintf( sTargetValue_, "%04X", nTargetPointer & 0xFFFF );
// else //else
// // sprintf( sTargetValue_, "%02X", nTargetValue & 0xFF ); // //sprintf( sTargetValue_, "%02X", nTargetValue & 0xFF );
// sprintf( sTargetValue_, "%04X:%02X", nTargetPointer & 0xFFFF, nTargetValue & 0xFF ); // sprintf( sTargetValue_, "%04X:%02X", nTargetPointer & 0xFFFF, nTargetValue & 0xFF );
} }
} }
else else
{
if (iOpmode == AM_M) if (iOpmode == AM_M)
{ {
// sprintf( sTarget, g_aOpmodes[ iOpmode ]._sFormat, (unsigned)nTarget ); //sprintf( sTarget, g_aOpmodes[ iOpmode ]._sFormat, (unsigned)nTarget );
sprintf(line_.sTarget , "%02X", (unsigned)nTarget); sprintf(line_.sTarget , "%02X", (unsigned)nTarget);
if (nTarget == 0) if (nTarget == 0)
@ -399,8 +400,8 @@ int GetDisassemblyLine(WORD nBaseAddress, DisasmLine_t& line_)
bDisasmFormatFlags |= DISASM_FORMAT_CHAR; bDisasmFormatFlags |= DISASM_FORMAT_CHAR;
line_.nImmediate = (BYTE)nTarget; line_.nImmediate = (BYTE)nTarget;
unsigned _char = FormatCharTxtCtrl(FormatCharTxtHigh(line_.nImmediate, NULL), NULL);
unsigned _char = FormatCharTxtCtrl(FormatCharTxtHigh(line_.nImmediate, NULL), NULL);
sprintf(line_.sImmediate, "%c", _char); sprintf(line_.sImmediate, "%c", _char);
#if OLD_CONSOLE_COLOR #if OLD_CONSOLE_COLOR
if (ConsoleColorIsEscapeMeta(_char)) if (ConsoleColorIsEscapeMeta(_char))
@ -410,6 +411,7 @@ int GetDisassemblyLine(WORD nBaseAddress, DisasmLine_t& line_)
#endif #endif
} }
} }
}
sprintf(line_.sAddress, "%04X", nBaseAddress); sprintf(line_.sAddress, "%04X", nBaseAddress);
@ -575,6 +577,8 @@ void FormatNopcodeBytes(WORD nBaseAddress, DisasmLine_t& line_)
strncpy(pDst, (const char*)(mem + nBaseAddress), iByte); strncpy(pDst, (const char*)(mem + nBaseAddress), iByte);
pDst += iByte; pDst += iByte;
*pDst = 0; *pDst = 0;
break;
case NOP_STRING_APPLE: case NOP_STRING_APPLE:
iByte = line_.nOpbyte; // handle all bytes of text iByte = line_.nOpbyte; // handle all bytes of text
pSrc = (const char*)mem + nStartAddress; pSrc = (const char*)mem + nStartAddress;
@ -604,10 +608,10 @@ void FormatNopcodeBytes(WORD nBaseAddress, DisasmLine_t& line_)
break; break;
default: default:
#if _DEBUG // Unhandled data disassembly! #if _DEBUG // Unhandled data disassembly!
int* FATAL = 0; int* FATAL = 0;
*FATAL = 0xDEADC0DE; *FATAL = 0xDEADC0DE;
#endif #endif
iByte++; iByte++;
break; break;
} }
@ -660,13 +664,17 @@ void FormatDisassemblyLine(const DisasmLine_t& line, char* sDisassembly, const i
strcat( sDisassembly, ", Y" ); strcat( sDisassembly, ", Y" );
} }
*/ */
char sTarget[32]; char sTarget[32];
if (line.bTargetValue || line.bTargetRelative || line.bTargetImmediate) if (line.bTargetValue || line.bTargetRelative || line.bTargetImmediate)
{ {
if (line.bTargetRelative) if (line.bTargetRelative)
{
strcpy(sTarget, line.sTargetValue); strcpy(sTarget, line.sTargetValue);
}
else else
{
if (line.bTargetImmediate) if (line.bTargetImmediate)
{ {
strcat(sDisassembly, "#"); strcat(sDisassembly, "#");
@ -675,6 +683,7 @@ void FormatDisassemblyLine(const DisasmLine_t& line, char* sDisassembly, const i
} }
else else
sprintf(sTarget, g_aOpmodes[line.iOpmode].m_sFormat, line.nTarget); sprintf(sTarget, g_aOpmodes[line.iOpmode].m_sFormat, line.nTarget);
}
strcat(sDisassembly, "$"); strcat(sDisassembly, "$");
strcat(sDisassembly, sTarget); strcat(sDisassembly, sTarget);