Debugger: Simplify console print (PR #1038)

. Simplify console display functions using StrFormat()
. Update TestDebugger that needs StrFormat() now
This commit is contained in:
Kelvin Lee
2022-02-18 09:12:04 +11:00
committed by GitHub
parent 43b9df253a
commit 5a5d0e2df4
11 changed files with 518 additions and 629 deletions
+3 -8
View File
@@ -247,9 +247,7 @@ Update_t CmdConfigGetFont(int nArgs)
{
for (int iFont = 0; iFont < NUM_FONTS; iFont++)
{
TCHAR sText[CONSOLE_WIDTH] = TEXT("");
ConsoleBufferPushFormat(sText, " Font: %-20s A:%2d M:%2d",
// g_sFontNameCustom, g_nFontWidthAvg, g_nFontWidthMax );
ConsoleBufferPushFormat(" Font: %-20s A:%2d M:%2d",
g_aFontConfig[iFont]._sFontName,
g_aFontConfig[iFont]._nFontWidthAvg,
g_aFontConfig[iFont]._nFontWidthMax);
@@ -276,8 +274,7 @@ Update_t CmdConfigFont(int nArgs)
if ((!_tcscmp(g_aArgs[iArg].sArg, g_aParameters[PARAM_WILDSTAR].m_sName)) ||
(!_tcscmp(g_aArgs[iArg].sArg, g_aParameters[PARAM_MEM_SEARCH_WILD].m_sName)))
{
TCHAR sText[CONSOLE_WIDTH];
ConsoleBufferPushFormat(sText, "Lines: %d Font Px: %d Line Px: %d"
ConsoleBufferPushFormat("Lines: %d Font Px: %d Line Px: %d"
, g_nDisasmDisplayLines
, g_aFontConfig[FONT_DISASM_DEFAULT]._nFontHeight
, g_aFontConfig[FONT_DISASM_DEFAULT]._nLineHeight);
@@ -355,9 +352,7 @@ void DebuggerMouseClick(int x, int y)
int cy = nOffsetInScreenY / nFontHeight;
#if _DEBUG
char sText[CONSOLE_WIDTH];
sprintf(sText, "x:%d y:%d cx:%d cy:%d", x, y, cx, cy);
ConsoleDisplayPush(sText);
ConsoleDisplayPushFormat("x:%d y:%d cx:%d cy:%d", x, y, cx, cy);
DebugDisplay();
#endif