From e32643dbd448200173aa0b5809bc16f3ff3920de Mon Sep 17 00:00:00 2001 From: mpohoreski Date: Mon, 3 Jul 2006 01:43:19 +0000 Subject: [PATCH] fixed few font formatting bugs --- AppleWin/source/Debug.cpp | 6 ++-- AppleWin/source/Debugger_Display.cpp | 43 +++++++++++++++++++--------- 2 files changed, 34 insertions(+), 15 deletions(-) diff --git a/AppleWin/source/Debug.cpp b/AppleWin/source/Debug.cpp index a53537de..b13f0f7d 100644 --- a/AppleWin/source/Debug.cpp +++ b/AppleWin/source/Debug.cpp @@ -8430,13 +8430,15 @@ void DebugInitialize () #endif } -#if !USE_APPLE_FONT +//#if USE_APPLE_FONT +// _UpdateWindowFontHeights( g_aFontConfig[ FONT_DISASM_DEFAULT ]._nFontHeight ); +//#else // TODO: g_aFontPitch _CmdConfigFont( FONT_INFO , g_sFontNameInfo , FIXED_PITCH | FF_MODERN , g_nFontHeight ); // DEFAULT_CHARSET _CmdConfigFont( FONT_CONSOLE , g_sFontNameConsole, FIXED_PITCH | FF_MODERN , g_nFontHeight ); // DEFAULT_CHARSET _CmdConfigFont( FONT_DISASM_DEFAULT, g_sFontNameDisasm , FIXED_PITCH | FF_MODERN , g_nFontHeight ); // OEM_CHARSET _CmdConfigFont( FONT_DISASM_BRANCH , g_sFontNameBranch , DEFAULT_PITCH | FF_DECORATIVE, g_nFontHeight+3); // DEFAULT_CHARSET -#endif +//#endif /* g_hFontDebugger = CreateFont( diff --git a/AppleWin/source/Debugger_Display.cpp b/AppleWin/source/Debugger_Display.cpp index be63ffc0..52fbb5a9 100644 --- a/AppleWin/source/Debugger_Display.cpp +++ b/AppleWin/source/Debugger_Display.cpp @@ -642,6 +642,7 @@ int DebugDrawText ( LPCTSTR pText, RECT & rRect ) #endif DebuggerPrint( rRect.left, rRect.top, (char*)pText ); +// rRect.left += (DEBUG_FONT_CELL_WIDTH * nLen) #else ExtTextOut( g_hDC, rRect.left, rRect.top, @@ -687,11 +688,13 @@ int DebugDrawTextHorz ( LPCTSTR pText, RECT & rRect ) SIZE size; int nChars = DebugDrawText( pText, rRect ); - if (GetTextExtentPoint32( g_hDC, pText, nChars, &size )) +#if !USE_APPLE_FONT + if (GetTextExtentPoint32( g_hDC, pText, nChars, &size )) { rRect.left += size.cx; } else +#endif { rRect.left += (nFontWidth * nChars); } @@ -1369,10 +1372,24 @@ WORD DrawDisassemblyLine (HDC dc, int iLine, WORD nBaseAddress, LPTSTR text) , _NUM_TAB_STOPS }; - float aTabs[ _NUM_TAB_STOPS ] = -// { 6, 16, 26, 41, 46, 49 }; // 17, 27, 41 - { 5.75, 15.5, 25, 40.5, 45.5, 48.5 }; +// int X_OPCODE = 6 * nDefaultFontWidth; +// int X_LABEL = 17 * nDefaultFontWidth; +// int X_INSTRUCTION = 26 * nDefaultFontWidth; // 27 +// int X_IMMEDIATE = 40 * nDefaultFontWidth; // 41 +// int X_BRANCH = 46 * nDefaultFontWidth; + float aTabs[ _NUM_TAB_STOPS ] = +// { 6, 16, 26, 41, 46, 49 }; // 6, 17, 26, 40, 46 +#if USE_APPLE_FONT +// { 5, 14, 20, 40, 46, 49 }; + // xxxx:xx xx xx LABELxxxxxx MNEMONIC 'E' = + // 0 45 14 26 + { 5, 14, 26, 41, 47, 49 }; +#else + { 5.75, 15.5, 25, 40.5, 45.5, 48.5 }; +#endif + +#if !USE_APPLE_FONT if (! g_bConfigDisasmAddressColon) { aTabs[ TS_OPCODE ] -= 1; @@ -1384,7 +1401,7 @@ WORD DrawDisassemblyLine (HDC dc, int iLine, WORD nBaseAddress, LPTSTR text) aTabs[ TS_INSTRUCTION ] -= 2; aTabs[ TS_IMMEDIATE ] -= 1; } - +#endif const int OPCODE_TO_LABEL_SPACE = static_cast( aTabs[ TS_INSTRUCTION ] - aTabs[ TS_LABEL ] ); int iTab = 0; @@ -1401,13 +1418,11 @@ WORD DrawDisassemblyLine (HDC dc, int iLine, WORD nBaseAddress, LPTSTR text) aTabs[ iTab ] *= nDefaultFontWidth; } -// int X_OPCODE = 6 * nDefaultFontWidth; -// int X_LABEL = 17 * nDefaultFontWidth; -// int X_INSTRUCTION = 26 * nDefaultFontWidth; // 27 -// int X_IMMEDIATE = 40 * nDefaultFontWidth; // 41 -// int X_BRANCH = 46 * nDefaultFontWidth; - +#if USE_APPLE_FONT + const int DISASM_SYMBOL_LEN = 12; +#else const int DISASM_SYMBOL_LEN = 9; +#endif if (dc) { @@ -1518,13 +1533,14 @@ WORD DrawDisassemblyLine (HDC dc, int iLine, WORD nBaseAddress, LPTSTR text) if (bAddressIsBookmark) { - DebuggerSetColorBG( dc, DebuggerGetColor( iBackground ) ); + DebuggerSetColorBG( dc, DebuggerGetColor( iBackground ) ); DebuggerSetColorFG( dc, DebuggerGetColor( iForeground ) ); } // Address Seperator if (! bCursorLine) DebuggerSetColorFG( dc, DebuggerGetColor( FG_DISASM_OPERATOR ) ); + if (g_bConfigDisasmAddressColon) DebugDrawTextHorz( TEXT(":"), linerect ); @@ -2352,7 +2368,7 @@ void DrawSubWindow_Console (Update_t bUpdate) if ((bUpdate & UPDATE_CONSOLE_INPUT) || (bUpdate & UPDATE_CONSOLE_DISPLAY)) { DebuggerSetColorFG( g_hDC, DebuggerGetColor( FG_CONSOLE_OUTPUT )); // COLOR_FG_CONSOLE - DebuggerSetColorBG( g_hDC, DebuggerGetColor( BG_CONSOLE_OUTPUT )); // COLOR_BG_CONSOLE + DebuggerSetColorBG( g_hDC, DebuggerGetColor( BG_CONSOLE_OUTPUT )); // COLOR_BG_CONSOLE // int nLines = MIN(g_nConsoleDisplayTotal - g_iConsoleDisplayStart, g_nConsoleDisplayHeight); int iLine = g_iConsoleDisplayStart + CONSOLE_FIRST_LINE; @@ -2714,6 +2730,7 @@ void DrawWindow_Console( Update_t bUpdate ) DebuggerSetColorBG(g_hDC, DebuggerGetColor( BG_DISASM_2 )); // COLOR_BG_CODE #if USE_APPLE_FONT +// RenderFilledRect( viewportrect ); #else // Can't use DebugDrawText, since we don't ned the CLIPPED flag // TODO: add default param OPAQUE|CLIPPED