Added new Apple Debugger Font

This commit is contained in:
mpohoreski 2006-07-02 09:57:26 +00:00
parent f38d1abf8c
commit 6b66130891
5 changed files with 834 additions and 151 deletions

View File

@ -44,7 +44,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// TODO: COLOR LOAD ["filename"]
// See Debugger_Changelong.txt for full details
const int DEBUGGER_VERSION = MAKE_VERSION(2,5,6,41);
const int DEBUGGER_VERSION = MAKE_VERSION(2,5,6,42);
// Public _________________________________________________________________________________________
@ -647,23 +647,24 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
{TEXT("START") , NULL, PARAM_START }, // benchmark
{TEXT("STOP") , NULL, PARAM_STOP }, // benchmark
// Help Categories
{TEXT("*") , NULL, PARAM_WILDSTAR },
{TEXT("BOOKMARKS") , NULL, PARAM_CAT_BOOKMARKS },
{TEXT("BREAKPOINTS"), NULL, PARAM_CAT_BREAKPOINTS },
{TEXT("CONFIG") , NULL, PARAM_CAT_CONFIG },
{TEXT("CPU") , NULL, PARAM_CAT_CPU },
{"*" , NULL, PARAM_WILDSTAR },
{"BOOKMARKS" , NULL, PARAM_CAT_BOOKMARKS },
{"BREAKPOINTS" , NULL, PARAM_CAT_BREAKPOINTS },
{"CONFIG" , NULL, PARAM_CAT_CONFIG },
{"CPU" , NULL, PARAM_CAT_CPU },
// {TEXT("EXPRESSION") ,
{TEXT("FLAGS") , NULL, PARAM_CAT_FLAGS },
{TEXT("HELP") , NULL, PARAM_CAT_HELP },
{TEXT("MEMORY") , NULL, PARAM_CAT_MEMORY }, // alias // SOURCE [SYMBOLS] [MEMORY] filename
{TEXT("OUTPUT") , NULL, PARAM_CAT_OUTPUT },
{TEXT("OPERATORS" ), NULL, PARAM_CAT_OPERATORS },
{TEXT("RANGE" ), NULL, PARAM_CAT_RANGE },
{"FLAGS" , NULL, PARAM_CAT_FLAGS },
{"HELP" , NULL, PARAM_CAT_HELP },
{"KEYBOARD" , NULL, PARAM_CAT_KEYBOARD },
{"MEMORY" , NULL, PARAM_CAT_MEMORY }, // alias // SOURCE [SYMBOLS] [MEMORY] filename
{"OUTPUT" , NULL, PARAM_CAT_OUTPUT },
{"OPERATORS" , NULL, PARAM_CAT_OPERATORS },
{"RANGE" , NULL, PARAM_CAT_RANGE },
// {TEXT("REGISTERS") , NULL, PARAM_CAT_REGISTERS },
{TEXT("SYMBOLS") , NULL, PARAM_CAT_SYMBOLS },
{TEXT("WATCHES") , NULL, PARAM_CAT_WATCHES },
{TEXT("WINDOW") , NULL, PARAM_CAT_WINDOW },
{TEXT("ZEROPAGE") , NULL, PARAM_CAT_ZEROPAGE },
{"SYMBOLS" , NULL, PARAM_CAT_SYMBOLS },
{"WATCHES" , NULL, PARAM_CAT_WATCHES },
{"WINDOW" , NULL, PARAM_CAT_WINDOW },
{"ZEROPAGE" , NULL, PARAM_CAT_ZEROPAGE },
// Memory
{TEXT("?") , NULL, PARAM_MEM_SEARCH_WILD },
// {TEXT("*") , NULL, PARAM_MEM_SEARCH_BYTE },
@ -8045,6 +8046,43 @@ void DebugBegin ()
g_bDebuggerViewingAppleOutput = false;
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;
// DebuggerSetColorFG( aColors[ iFG ] );
// DebuggerSetColorBG( aColors[ iBG ] );
int iChar = 0;
int x = 0;
int y = 0;
for (iChar = 0; iChar < 256; iChar++)
{
x = (iChar % 16);
y = (iChar / 16);
iFG = (x >> 1); // (iChar % 8);
iBG = (y >> 1) & 7; // (iChar / 8) & 7;
DebuggerSetColorFG( aColors[ iFG ] );
DebuggerSetColorBG( aColors[ iBG ] );
DebuggerPrintChar( x * (APPLE_FONT_WIDTH / 2), y * (APPLE_FONT_HEIGHT / 2), iChar );
}
#endif
}
//===========================================================================
@ -8152,6 +8190,16 @@ void DebugDestroy ()
{
_CmdSymbolsClear( (Symbols_e) iTable );
}
SelectObject( g_hDstDC, GetStockObject(NULL_BRUSH) );
DeleteObject( g_hBrushFG );
DeleteObject( g_hBrushBG );
DeleteDC( g_hDebugFontDC );
DeleteObject( g_hDebugFontBitmap );
ReleaseDC( g_hFrameWindow, g_hDstDC );
}
@ -8172,13 +8220,13 @@ void DebugEnd ()
g_hTraceFile = NULL;
}
g_vMemorySearchResults.erase( g_vMemorySearchResults.begin(), g_vMemorySearchResults.end() );
}
#if _DEBUG
#define DEBUG_COLOR_RAMP 0
//===========================================================================
void _SetupColorRamp( const int iPrimary, int & iColor_ )
{
TCHAR sRamp[ CONSOLE_WIDTH*2 ] = TEXT("");
@ -8214,6 +8262,7 @@ void _SetupColorRamp( const int iPrimary, int & iColor_ )
}
#endif // _DEBUG
//===========================================================================
void _ConfigColorsReset()
{
// int iColor = 1; // black only has one level, skip it, since black levels same as white levels
@ -8259,6 +8308,80 @@ void DebugInitialize ()
{
AssemblerOff(); // update prompt
#if _DEBUG
DWORD nError = 0;
#endif
g_hDstDC = GetDC( g_hFrameWindow );
#if _DEBUG
nError = GetLastError();
#endif
// Must select a bitmap into the temp DC !
HDC hTmpDC = CreateCompatibleDC( g_hDstDC );
#if _DEBUG
nError = GetLastError();
#endif
g_hDebugFontDC = 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 );
#else
// Scale at run-time
// Black = Transparent
// White = Opaque
HBITMAP hTmpBitamp = LoadBitmap(g_hInstance,TEXT("CHARSET40"));
#if _DEBUG
nError = GetLastError();
#endif
SelectObject( hTmpDC ,hTmpBitamp);
#if _DEBUG
nError = GetLastError();
#endif
g_hDebugFontBrush = GetStockBrush( WHITE_BRUSH );
SelectObject(g_hDebugFontDC, g_hDebugFontBrush );
// SelectObject(hTmpDC, g_hDebugFontBrush );
#if _DEBUG
nError = GetLastError();
#endif
g_hDebugFontBitmap = CreateCompatibleBitmap(
hTmpDC,
APPLE_FONT_X_REGIONSIZE/2, APPLE_FONT_Y_REGIONSIZE/2
);
#if _DEBUG
nError = GetLastError();
#endif
SelectObject(g_hDebugFontDC,g_hDebugFontBitmap);
StretchBlt(
g_hDebugFontDC, // 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
0, APPLE_FONT_Y_APPLE_80COL, // int nXOriginSrc, int nYOriginSrc,
APPLE_FONT_X_REGIONSIZE, APPLE_FONT_Y_REGIONSIZE, // int nWidthSrc, int nHeightSrc,
SRCCOPY // DWORD dwRop // raster operation code
);
DeleteObject( hTmpBitamp );
DeleteObject( hTmpDC );
#endif
DeleteDC( g_hDstDC ); g_hDstDC = NULL;
ZeroMemory( g_aConsoleDisplay, sizeof( g_aConsoleDisplay ) ); // CONSOLE_WIDTH * CONSOLE_HEIGHT );
ConsoleInputReset();

File diff suppressed because it is too large Load Diff

View File

@ -1,17 +1,46 @@
#ifndef DEBUGGER_DISPLAY_H
#define DEBUGGER_DISPLAY_H
// Test Colors & Glyphs
#define DEBUG_APPLE_FONT 0
// Re-route all debugger text to new font
#define USE_APPLE_FONT 0
// Win32 Debugger Font
// 1 = Use seperate 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
#if APPLE_FONT_NEW
#define APPLE_FONT_BITMAP_PADDED 0
#else
#define APPLE_FONT_BITMAP_PADDED 1
#endif
extern HDC g_hDstDC ;
extern HBRUSH g_hBrushFG;
extern HBRUSH g_hBrushBG;
extern HDC g_hDebugFontDC;
extern HBRUSH g_hDebugFontBrush;
extern HBITMAP g_hDebugFontBitmap;
extern const int DISPLAY_HEIGHT;
extern FontConfig_t g_aFontConfig[ NUM_FONTS ];
void DebuggerSetColorFG( COLORREF nRGB );
void DebuggerSetColorBG( COLORREF nRGB, bool bTransparent = false );
void DebuggerPrintChar( const int x, const int y, const int iChar );
int DebugDrawText ( LPCTSTR pText, RECT & rRect );
int DebugDrawTextFixed ( LPCTSTR pText, RECT & rRect );
int DebugDrawTextLine ( LPCTSTR pText, RECT & rRect );
int DebugDrawTextHorz ( LPCTSTR pText, RECT & rRect );
void DrawWindow_Source (Update_t bUpdate);
void DrawBreakpoints (HDC dc, int line);

View File

@ -142,7 +142,7 @@ void Help_Operators()
ConsoleBufferPush( TEXT(" - Subtraction" ) );
ConsoleBufferPush( TEXT(" * Multiplication" ) );
ConsoleBufferPush( TEXT(" / Division" ) );
ConsoleBufferPush( TEXT(" % Modulas / Remainder" ) );
ConsoleBufferPush( TEXT(" % Modulas or Remainder" ) );
ConsoleBufferPush( TEXT(" Operators: (Bit Wise)" ) );
ConsoleBufferPush( TEXT(" & Bit-wise and (AND)" ) );
ConsoleBufferPush( TEXT(" | Bit-wise or (OR )" ) );
@ -167,11 +167,6 @@ void Help_Operators()
int iBreakOp = 0;
for( iBreakOp = 0; iBreakOp < NUM_BREAKPOINT_OPERATORS; iBreakOp++ )
{
// if (iBreakOp == PARAM_BP_LESS_EQUAL)
// continue;
// if (iBreakOp == PARAM_BP_GREATER_EQUAL)
// continue;
if ((iBreakOp >= PARAM_BP_LESS_EQUAL) &&
(iBreakOp <= PARAM_BP_GREATER_EQUAL))
{
@ -182,6 +177,23 @@ void Help_Operators()
ConsoleBufferPush( sText );
}
void Help_KeyboardShortcuts()
{
ConsoleBufferPush(" Scrolling:" );
ConsoleBufferPush(" Up Arrow" );
ConsoleBufferPush(" Down Arrow" );
ConsoleBufferPush(" Shift + Up Arrow" );
ConsoleBufferPush(" Shift + Down Arrow" );
ConsoleBufferPush(" Page Up" );
ConsoleBufferPush(" Page Down" );
ConsoleBufferPush(" Shift + Page Up" );
ConsoleBufferPush(" Shift + Page Down" );
ConsoleBufferPush(" Bookmarks:" );
ConsoleBufferPush(" Ctrl-Shift-#" );
ConsoleBufferPush(" Ctrl-# " );
}
//===========================================================================
Update_t CmdMOTD( int nArgs )
{
@ -284,6 +296,16 @@ Update_t CmdHelpSpecific (int nArgs)
case PARAM_CAT_CPU : iCmdBegin = CMD_ASSEMBLE ; iCmdEnd = CMD_UNASSEMBLE ; break;
case PARAM_CAT_FLAGS : iCmdBegin = CMD_FLAG_CLEAR ; iCmdEnd = CMD_FLAG_SET_N ; break;
case PARAM_CAT_HELP : iCmdBegin = CMD_HELP_LIST ; iCmdEnd = CMD_MOTD ; break;
case PARAM_CAT_KEYBOARD :
// HACK: check if we have an exact command match first
nFound = FindCommand( g_aArgs[iArg].sArg, pFunction, & iCommand );
if ((!nFound) || (iCommand != CMD_INPUT_KEY))
{
nArgs = 0;
Help_KeyboardShortcuts();
}
bCategory = false;
break;
case PARAM_CAT_MEMORY : iCmdBegin = CMD_MEMORY_COMPARE ; iCmdEnd = CMD_MEMORY_FILL ; break;
case PARAM_CAT_OUTPUT : iCmdBegin = CMD_OUTPUT_CALC ; iCmdEnd = CMD_OUTPUT_RUN ; break;
case PARAM_CAT_SYMBOLS :

View File

@ -1276,6 +1276,7 @@
// , PARAM_CAT_EXPRESSION
, PARAM_CAT_FLAGS
, PARAM_CAT_HELP
, PARAM_CAT_KEYBOARD
, PARAM_CAT_MEMORY
, PARAM_CAT_OUTPUT
, PARAM_CAT_OPERATORS