Console now has color support!

This commit is contained in:
mpohoreski 2006-07-03 15:27:49 +00:00
parent 84a22f823d
commit 1a132ef3b5
4 changed files with 275 additions and 114 deletions

View File

@ -540,7 +540,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// TODO: This really needs to be phased out, and use the ConfigFont[] settings
#if USE_APPLE_FONT
int g_nFontHeight = DEBUG_FONT_HEIGHT; // 13 -> 12 Lucida Console is readable
int g_nFontHeight = CONSOLE_FONT_HEIGHT; // 13 -> 12 Lucida Console is readable
#else
int g_nFontHeight = 15; // 13 -> 12 Lucida Console is readable
#endif
@ -8052,19 +8052,6 @@ void DebugBegin ()
UpdateDisplay( UPDATE_ALL );
#if DEBUG_APPLE_FONT
COLORREF aColors[ 8 ] =
{
RGB( 0, 0, 0 ), // K
RGB( 255, 0, 0 ), // R
RGB( 0, 255, 0 ), // G
RGB( 255, 255, 0 ), // Y
RGB( 0, 0, 255 ), // B
RGB( 255, 0, 255 ), // M
RGB( 0, 255, 255 ), // C
RGB( 255, 255, 255 ), // W
};
int iFG = 7;
int iBG = 4;
@ -8081,8 +8068,8 @@ void DebugBegin ()
iFG = (x >> 1); // (iChar % 8);
iBG = (y >> 1) & 7; // (iChar / 8) & 7;
DebuggerSetColorFG( aColors[ iFG ] );
DebuggerSetColorBG( aColors[ iBG ] );
DebuggerSetColorFG( aConsoleColors[ iFG ] );
DebuggerSetColorBG( aConsoleColors[ iBG ] );
DebuggerPrintChar( x * (APPLE_FONT_WIDTH / 2), y * (APPLE_FONT_HEIGHT / 2), iChar );
}
@ -8197,11 +8184,11 @@ void DebugDestroy ()
SelectObject( g_hDstDC, GetStockObject(NULL_BRUSH) );
DeleteObject( g_hBrushFG );
DeleteObject( g_hBrushBG );
DeleteObject( g_hConsoleBrushFG );
DeleteObject( g_hConsoleBrushBG );
DeleteDC( g_hDebugFontDC );
DeleteObject( g_hDebugFontBitmap );
DeleteDC( g_hConsoleFontDC );
DeleteObject( g_hConsoleFontBitmap );
ReleaseDC( g_hFrameWindow, g_hDstDC );
}
@ -8328,15 +8315,15 @@ void DebugInitialize ()
nError = GetLastError();
#endif
g_hDebugFontDC = CreateCompatibleDC( g_hDstDC );
g_hConsoleFontDC = CreateCompatibleDC( g_hDstDC );
#if _DEBUG
nError = GetLastError();
#endif
#if APPLE_FONT_NEW
// Pre-scaled bitmap
g_hDebugFontBitmap = LoadBitmap(g_hInstance,TEXT("IDB_DEBUG_FONT_7x8"));
SelectObject( g_hDebugFontDC, g_hDebugFontBitmap );
g_hConsoleFontBitmap = LoadBitmap(g_hInstance,TEXT("IDB_DEBUG_FONT_7x8"));
SelectObject( g_hConsoleFontDC, g_hConsoleFontBitmap );
#else
// Scale at run-time
@ -8352,8 +8339,8 @@ void DebugInitialize ()
nError = GetLastError();
#endif
g_hDebugFontBrush = GetStockBrush( WHITE_BRUSH );
SelectObject(g_hDebugFontDC, g_hDebugFontBrush );
g_hConsoleFontBrush = GetStockBrush( WHITE_BRUSH );
SelectObject(g_hConsoleFontDC, g_hConsoleFontBrush );
// SelectObject(hTmpDC, g_hDebugFontBrush );
@ -8361,17 +8348,17 @@ void DebugInitialize ()
nError = GetLastError();
#endif
g_hDebugFontBitmap = CreateCompatibleBitmap(
g_hConsoleFontBitmap = CreateCompatibleBitmap(
hTmpDC,
APPLE_FONT_X_REGIONSIZE/2, APPLE_FONT_Y_REGIONSIZE/2
);
#if _DEBUG
nError = GetLastError();
#endif
SelectObject(g_hDebugFontDC,g_hDebugFontBitmap);
SelectObject( g_hConsoleFontDC, g_hConsoleFontBitmap );
StretchBlt(
g_hDebugFontDC, // HDC hdcDest, // handle to destination DC
g_hConsoleFontDC, // HDC hdcDest, // handle to destination DC
0, 0, // int nXOriginDest, int nYOriginDest, // y-coord of destination upper-left corner
APPLE_FONT_X_REGIONSIZE/2, APPLE_FONT_Y_REGIONSIZE/2, // int nWidthDest, int nHeightDest,
hTmpDC, // HDC hdcSrc, // handle to source DC
@ -8423,10 +8410,10 @@ void DebugInitialize ()
{
g_aFontConfig[ iFont ]._hFont = NULL;
#if USE_APPLE_FONT
g_aFontConfig[ iFont ]._nFontHeight = DEBUG_FONT_HEIGHT;
g_aFontConfig[ iFont ]._nFontWidthAvg = DEBUG_FONT_WIDTH;
g_aFontConfig[ iFont ]._nFontWidthMax = DEBUG_FONT_WIDTH;
g_aFontConfig[ iFont ]._nLineHeight = DEBUG_FONT_HEIGHT;
g_aFontConfig[ iFont ]._nFontHeight = CONSOLE_FONT_HEIGHT;
g_aFontConfig[ iFont ]._nFontWidthAvg = CONSOLE_FONT_WIDTH;
g_aFontConfig[ iFont ]._nFontWidthMax = CONSOLE_FONT_WIDTH;
g_aFontConfig[ iFont ]._nLineHeight = CONSOLE_FONT_HEIGHT;
#endif
}
@ -8440,6 +8427,12 @@ void DebugInitialize ()
_CmdConfigFont( FONT_DISASM_BRANCH , g_sFontNameBranch , DEFAULT_PITCH | FF_DECORATIVE, g_nFontHeight+3); // DEFAULT_CHARSET
//#endif
int iColor;
iColor = FG_CONSOLE_OUTPUT;
COLORREF nColor = gaColorPalette[ g_aColorIndex[ iColor ] ];
g_anConsoleColor[ CONSOLE_COLOR_PREV ] = nColor;
/*
g_hFontDebugger = CreateFont(
g_nFontHeight // Height

View File

@ -33,7 +33,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include <assert.h>
// NEW UI debugging
// #define DEBUG_FORCE_DISPLAY 1
#define DEBUG_FORCE_DISPLAY 1
#define DEBUG_FONT_NO_BACKGROUND_CHAR 0
#define DEBUG_FONT_NO_BACKGROUND_TEXT 1
@ -53,15 +53,47 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// Display - Win32
HDC g_hDstDC = NULL; // App Window
HDC g_hDebugFontDC = NULL; // Debug Font
HBRUSH g_hDebugFontBrush = NULL;
HBITMAP g_hDebugFontBitmap = NULL;
HDC g_hConsoleFontDC = NULL;
HBRUSH g_hConsoleFontBrush = NULL;
HBITMAP g_hConsoleFontBitmap = NULL;
HBRUSH g_hBrushFG = NULL;
HBRUSH g_hBrushBG = NULL;
HBRUSH g_hConsoleBrushFG = NULL;
HBRUSH g_hConsoleBrushBG = NULL;
COLORREF g_anConsoleColor[ MAX_CONSOLE_COLORS ] =
{
RGB( 0, 0, 0 ), // 0 000 K
RGB( 255, 0, 0 ), // 1 001 R
RGB( 0, 255, 0 ), // 2 010 G
RGB( 255, 255, 0 ), // 3 011 Y
RGB( 0, 0, 255 ), // 4 100 B
RGB( 255, 0, 255 ), // 5 101 M
RGB( 0, 255, 255 ), // 6 110 C
RGB( 255, 255, 255 ), // 7 111 W
};
char * g_asConsoleColor[ MAX_CONSOLE_COLORS ] =
{
"`0", // ConsoleColorMake( sColorW, CONSOLE_COLOR_W );
"`1",
"`2",
"`3",
"`4",
"`5",
"`6",
"`7"
};
// Disassembly
/*
// Thought about moving MouseText to another location, say high bit, 'A' + 0x80
// But would like to keep compatibility with existing CHARSET40
// Since we should be able to display all apple chars 0x00 .. 0xFF with minimal processing
// Use CONSOLE_COLOR_ESCAPE_CHAR to shift to mouse text
* Apple Font
K Mouse Text Up Arror
H Mouse Text Left Arrow
J Mouse Text Down Arrow
* Wingdings
\xE1 Up Arrow
\xE2 Down Arrow
@ -76,9 +108,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
\x18 Up
\x19 Down
*/
TCHAR g_sConfigBranchIndicatorUp [ NUM_DISASM_BRANCH_TYPES+1 ] = TEXT(" ^\x35");
TCHAR g_sConfigBranchIndicatorEqual[ NUM_DISASM_BRANCH_TYPES+1 ] = TEXT(" =\x33");
TCHAR g_sConfigBranchIndicatorDown [ NUM_DISASM_BRANCH_TYPES+1 ] = TEXT(" v\x36");
char * g_sConfigBranchIndicatorUp [ NUM_DISASM_BRANCH_TYPES+1 ] = { " ", "^", "`K", "\x35" };
char * g_sConfigBranchIndicatorEqual[ NUM_DISASM_BRANCH_TYPES+1 ] = { " ", "=", "`H", "\x33" };
char * g_sConfigBranchIndicatorDown [ NUM_DISASM_BRANCH_TYPES+1 ] = { " ", "v", "`J", "\x36" };
// Drawing
// Width
@ -447,7 +479,7 @@ const DWORD aROP4[ 256 ] =
// 0xAA00EC
// 0x00EC02E8
#if DEBUG_ROP
#if DEBUG_FONT_ROP
static iRop4 = 0;
#endif
@ -455,14 +487,14 @@ const DWORD aROP4[ 256 ] =
//===========================================================================
void DebuggerSetColorFG( COLORREF nRGB )
{
if (g_hBrushFG)
if (g_hConsoleBrushFG)
{
SelectObject( g_hDstDC, GetStockObject(NULL_BRUSH) );
DeleteObject( g_hBrushFG );
g_hBrushFG = NULL;
DeleteObject( g_hConsoleBrushFG );
g_hConsoleBrushFG = NULL;
}
g_hBrushFG = CreateSolidBrush( nRGB );
g_hConsoleBrushFG = CreateSolidBrush( nRGB );
}
void DebuggerSetColorFG( HDC hDC, COLORREF nRGB )
@ -478,16 +510,16 @@ void DebuggerSetColorFG( HDC hDC, COLORREF nRGB )
//===================================================
void DebuggerSetColorBG( COLORREF nRGB, bool bTransparent )
{
if (g_hBrushBG)
if (g_hConsoleBrushBG)
{
SelectObject( g_hDstDC, GetStockObject(NULL_BRUSH) );
DeleteObject( g_hBrushBG );
g_hBrushBG = NULL;
DeleteObject( g_hConsoleBrushBG );
g_hConsoleBrushBG = NULL;
}
if (! bTransparent)
{
g_hBrushBG = CreateSolidBrush( nRGB );
g_hConsoleBrushBG = CreateSolidBrush( nRGB );
}
}
@ -501,40 +533,33 @@ void DebuggerSetColorBG( HDC hDC, COLORREF nRGB )
#endif
}
// @param glyph Specifies a glyph from the 16x16 chars Apple Font Texture.
//===========================================================================
void DebuggerPrintChar( const int x, const int y, const int iChar )
void DebuggerPrintChar( const int x, const int y, const int glyph )
{
HDC g_hDstDC = FrameGetDC();
// BitBlt(
// hdcDest
// nXDest, nYDest
// nWidth, nHeight
// hdcSrc
// nXSrc, nYSrc
// dwRop
int xDst = x; //(x * FW);
int yDst = y; //(y * FH);
int xDst = x;
int yDst = y;
// 16x16 chars in bitmap
int xSrc = (iChar & 0x0F) * CW;
int ySrc = (iChar >> 4) * CH;
int xSrc = (glyph & 0x0F) * CONSOLE_FONT_GRID_X;
int ySrc = (glyph >> 4) * CONSOLE_FONT_GRID_Y;
#if !DEBUG_FONT_NO_BACKGROUND_CHAR
// Background color
if (g_hBrushBG)
if (g_hConsoleBrushBG)
{
SelectObject( g_hDstDC, g_hBrushBG );
SelectObject( g_hDstDC, g_hConsoleBrushBG );
// Draw Background (solid pattern)
BitBlt(
g_hDstDC, //
xDst, yDst,
FW, FH,
g_hDebugFontDC,
0, CH * 2, // Space
PATCOPY
g_hDstDC, // hdcDest
xDst, yDst, // nXDest, nYDest
CONSOLE_FONT_WIDTH, CONSOLE_FONT_HEIGHT, // nWidth, nHeight
g_hConsoleFontDC, // hdcSrc
0, CONSOLE_FONT_GRID_Y * 2, // nXSrc, nYSrc // FontTexture[2][0] = Solid (Filled) Space
PATCOPY // dwRop
);
}
#endif
@ -549,61 +574,142 @@ void DebuggerPrintChar( const int x, const int y, const int iChar )
// 0 0 1 0 0 0 1 0 0x22 DSna
// 1 1 1 0 1 0 1 0 0xEA DPSao
// Black = Transparent
// White = Opaque
// Black = Transparent (DC Background)
// White = Opaque (DC Text color)
#if DEBUG_FONT_ROP
SelectObject( g_hDstDC, g_hConsoleBrushFG );
BitBlt(
g_hDstDC,
xDst, yDst,
DEBUG_FONT_WIDTH, DEBUG_FONT_HEIGHT,
g_hDebugFontDC,
xSrc, ySrc,
aROP4[ iRop4 ]
);
#else
// Use inverted source as mask (AND)
// D & ~S -> DSna
BitBlt(
g_hDstDC,
xDst, yDst,
FW, FH,
g_hDebugFontDC,
CONSOLE_FONT_WIDTH, CONSOLE_FONT_HEIGHT,
g_hConsoleFontDC,
xSrc, ySrc,
DSna
);
SelectObject( g_hDstDC, g_hBrushFG );
SelectObject( g_hDstDC, g_hConsoleBrushFG );
// Use Source ask mask to make color Pattern mask (AND), then apply to dest (OR)
// D | (P & S) -> DPSao
BitBlt(
g_hDstDC,
xDst, yDst,
FW, FH,
g_hDebugFontDC,
CONSOLE_FONT_WIDTH, CONSOLE_FONT_HEIGHT,
g_hConsoleFontDC,
xSrc, ySrc,
DPSao
);
#if DEBUG_ROP
// aROP4[ iRop4 ]
#endif
// */
SelectObject( g_hDstDC, GetStockObject(NULL_BRUSH) );
FrameReleaseDC();
}
//===========================================================================
void DebuggerPrint ( int x, int y, char *pText )
{
int nLeft = x;
if (pText)
{
HDC g_hDstDC = FrameGetDC();
unsigned char c;
char *p = pText;
while (p && *p)
{
c = *p;
while (c = *p)
{
// ~0-7 // fg
// ~? // print
// ? // shift print
if (p[0] == '\n')
{
x = nLeft;
y += CONSOLE_FONT_HEIGHT;
p++;
continue; // c = 0;
}
if (ConsoleColorIsEscapeMeta( c ))
{
p++;
c = *p;
if (ConsoleColorIsEscapeData( c ))
{
DebuggerSetColorFG( ConsoleColorGetEscapeData( c ) );
p++;
continue; // c = 0;
}
// if ((p[1]) >= '8') && (p[1] <= '9')
// ;
}
else
if ((c >= 0x20) && (c <= 0x7F))
{
c += 0x80;
DebuggerPrintChar( x, y, c );
// DebuggerPrintChar( x, y, c );
}
if (c)
{
// 16x16 chars in bitmap
int tx = (c & 0x0F) * CONSOLE_FONT_GRID_X;
int ty = (c >> 4) * CONSOLE_FONT_GRID_Y;
if (g_hConsoleBrushBG)
{
SelectObject( g_hDstDC, g_hConsoleBrushBG );
// Draw Background (solid pattern)
BitBlt(
g_hDstDC, //
x, y,
CONSOLE_FONT_WIDTH, CONSOLE_FONT_HEIGHT,
g_hConsoleFontDC,
0, CONSOLE_FONT_GRID_Y * 2, // Space
PATCOPY
);
}
BitBlt(
g_hDstDC,
x, y,
CONSOLE_FONT_WIDTH, CONSOLE_FONT_HEIGHT,
g_hConsoleFontDC,
tx, ty,
DSna
);
SelectObject( g_hDstDC, g_hConsoleBrushFG );
BitBlt(
g_hDstDC,
x, y,
CONSOLE_FONT_WIDTH, CONSOLE_FONT_HEIGHT,
g_hConsoleFontDC,
tx, ty,
DPSao
);
x += CONSOLE_FONT_WIDTH;
}
x += (APPLE_FONT_WIDTH/2);
p++;
}
SelectObject( g_hDstDC, GetStockObject(NULL_BRUSH) );
FrameReleaseDC();
}
}
@ -686,9 +792,9 @@ int DebugDrawTextHorz ( LPCTSTR pText, RECT & rRect )
{
int nFontWidth = g_aFontConfig[ FONT_DISASM_DEFAULT ]._nFontWidthAvg;
SIZE size;
int nChars = DebugDrawText( pText, rRect );
#if !USE_APPLE_FONT
SIZE size;
if (GetTextExtentPoint32( g_hDC, pText, nChars, &size ))
{
rRect.left += size.cx;
@ -805,16 +911,16 @@ int FormatDisassemblyLine( WORD nBaseAddress, int iOpcode, int iOpmode, int nOpB
if (nTarget < nBaseAddress)
{
wsprintf( sBranch_, TEXT(" %c"), g_sConfigBranchIndicatorUp[ g_iConfigDisasmBranchType ] );
wsprintf( sBranch_, TEXT("%s"), g_sConfigBranchIndicatorUp[ g_iConfigDisasmBranchType ] );
}
else
if (nTarget > nBaseAddress)
{
wsprintf( sBranch_, TEXT(" %c"), g_sConfigBranchIndicatorDown[ g_iConfigDisasmBranchType ] );
wsprintf( sBranch_, TEXT("%s"), g_sConfigBranchIndicatorDown[ g_iConfigDisasmBranchType ] );
}
else
{
wsprintf( sBranch_, TEXT("%c "), g_sConfigBranchIndicatorEqual[ g_iConfigDisasmBranchType ] );
wsprintf( sBranch_, TEXT("%s"), g_sConfigBranchIndicatorEqual[ g_iConfigDisasmBranchType ] );
}
}
@ -1216,11 +1322,12 @@ void DrawBreakpoints (HDC dc, int line)
DebugDrawTextFixed( sText, rect2 );
}
#if !USE_APPLE_FONT
// Windows HACK: Bugfix: Rest of line is still breakpoint background color
DebuggerSetColorBG(dc, DebuggerGetColor( BG_INFO )); // COLOR_BG_DATA
DebuggerSetColorFG(dc, DebuggerGetColor( FG_INFO_TITLE )); //COLOR_STATIC
DebugDrawTextHorz( TEXT(" "), rect2 );
#endif
rect.top += g_nFontHeight;
rect.bottom += g_nFontHeight;
}

View File

@ -4,44 +4,100 @@
// Test Colors & Glyphs
#define DEBUG_APPLE_FONT 0
// Re-route all debugger text to new font
#define USE_APPLE_FONT 0
#define USE_APPLE_FONT 1
// Win32 Debugger Font
// 1 = Use seperate BMP
// 1 = Use Debugger_Font_7x8.BMP
// 0 = Use CHARSET40.bmp (fg & bg colors aren't proper)
#define APPLE_FONT_NEW 1
// 7x8 Font
#define APPLE_FONT_SCALE_ONE_HALF 1
//#define APPLE_FONT_SCALE_ONE_HALF 1
#define APPLE_FONT_SCALE_ONE_HALF $ERROR("APPLE_FONT_SCALE_ONE_HALF")
#if APPLE_FONT_NEW
#define APPLE_FONT_BITMAP_PADDED 0
#define DEBUG_FONT_WIDTH 7
#define DEBUG_FONT_HEIGHT 8
#define DEBUG_FONT_CELL_WIDTH 7
#define DEBUG_FONT_CELL_HEIGHT 8
#else
#define APPLE_FONT_BITMAP_PADDED 1
#endif
enum AppleFontSize_e
enum ConsoleFontSize_e
{
CW = DEBUG_FONT_CELL_WIDTH ,
CH = DEBUG_FONT_CELL_HEIGHT,
#if APPLE_FONT_NEW
// Grid Alignment
CONSOLE_FONT_GRID_X = 7,
CONSOLE_FONT_GRID_Y = 8,
// Font Char Width/Height
FW = DEBUG_FONT_WIDTH ,
FH = DEBUG_FONT_HEIGHT,
// Font Char Width/Height in pixels
CONSOLE_FONT_WIDTH = 7,
CONSOLE_FONT_HEIGHT = 8,
#else
CONSOLE_FONT_GRID_X = 8,
CONSOLE_FONT_GRID_Y = 8,
// Font Char Width/Height in pixels
CONSOLE_FONT_WIDTH = 7,
CONSOLE_FONT_HEIGHT = 8,
#endif
};
extern HDC g_hDstDC ;
extern HBRUSH g_hBrushFG;
extern HBRUSH g_hBrushBG;
extern HBRUSH g_hConsoleBrushFG;
extern HBRUSH g_hConsoleBrushBG;
extern HDC g_hDebugFontDC;
extern HBRUSH g_hDebugFontBrush;
extern HBITMAP g_hDebugFontBitmap;
extern HDC g_hConsoleFontDC;
extern HBRUSH g_hConsoleFontBrush;
extern HBITMAP g_hConsoleFontBitmap;
enum ConsoleColors_e
{
CONSOLE_COLOR_K,
CONSOLE_COLOR_PREV = 0,
CONSOLE_COLOR_R,
CONSOLE_COLOR_G,
CONSOLE_COLOR_Y,
CONSOLE_COLOR_B,
CONSOLE_COLOR_M,
CONSOLE_COLOR_C,
CONSOLE_COLOR_W,
MAX_CONSOLE_COLORS
};
extern COLORREF g_anConsoleColor[ MAX_CONSOLE_COLORS ];
extern char *g_asConsoleColor[ MAX_CONSOLE_COLORS ];
// ` ~ should always display ~
#define CONSOLE_COLOR_ESCAPE_CHAR '`'
inline bool ConsoleColorIsEscapeMeta( char c )
{
if (CONSOLE_COLOR_ESCAPE_CHAR == c)
return true;
return false;
}
inline bool ConsoleColorIsEscapeData( char c )
{
if ((c >= '0') && (c <= '7'))
return true;
return false;
}
inline COLORREF ConsoleColorGetEscapeData( char c )
{
int iColor = (c - '0') & (MAX_CONSOLE_COLORS - 1);
return g_anConsoleColor[ iColor ];
}
inline void ConsoleColorMake( char * pText, ConsoleColors_e eColor )
{
#if USE_APPLE_FONT
pText[0] = CONSOLE_COLOR_ESCAPE_CHAR;
pText[1] = eColor + '0';
pText[2] = 0;
#else
pText[0] = 0;
#endif
}
extern const int DISPLAY_HEIGHT;
extern FontConfig_t g_aFontConfig[ NUM_FONTS ];

View File

@ -1067,9 +1067,14 @@ Update_t CmdVersion (int nArgs)
UnpackVersion( nVersion, nMajor, nMinor, nFixMajor, nFixMinor );
// wsprintf( sText, "Version" ); ConsoleBufferPush( sText );
wsprintf( sText, " Emulator: %s Debugger: %d.%d.%d.%d"
wsprintf( sText, " Emulator: %s%s%s Debugger: %s%d.%d.%d.%d%s"
, g_asConsoleColor[ CONSOLE_COLOR_G ]
, VERSIONSTRING
, nMajor, nMinor, nFixMajor, nFixMinor );
, g_asConsoleColor[ CONSOLE_COLOR_PREV ]
, g_asConsoleColor[ CONSOLE_COLOR_G ]
, nMajor, nMinor, nFixMajor, nFixMinor
, g_asConsoleColor[ CONSOLE_COLOR_PREV ]
);
ConsoleBufferPush( sText );
if (nArgs)