MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / DrawZeroPagePointers

Function DrawZeroPagePointers

source/Debugger/Debugger_Display.cpp:3270–3371  ·  view source on GitHub ↗

===========================================================================

Source from the content-addressed store, hash-verified

3268
3269//===========================================================================
3270void DrawZeroPagePointers ( int line )
3271{
3272 if (! ((g_iWindowThis == WINDOW_CODE) || ((g_iWindowThis == WINDOW_DATA))))
3273 return;
3274
3275 int nFontWidth = g_aFontConfig[ FONT_INFO ]._nFontWidthAvg;
3276
3277 RECT rect;
3278 rect.top = line * g_nFontHeight;
3279 rect.bottom = rect.top + g_nFontHeight;
3280 rect.left = DISPLAY_ZEROPAGE_COLUMN;
3281 rect.right = rect.left + (10 * nFontWidth);
3282
3283 DebuggerSetColorBG( DebuggerGetColor( BG_INFO_ZEROPAGE ));
3284
3285 const int nMaxSymbolLen = 7;
3286
3287 for (int iZP = 0; iZP < MAX_ZEROPAGE_POINTERS; iZP++)
3288 {
3289 RECT rect2 = rect;
3290
3291 Breakpoint_t *pZP = &g_aZeroPagePointers[iZP];
3292 bool bEnabled = pZP->bEnabled;
3293
3294#if DEBUG_FORCE_DISPLAY // Zero-Page
3295 bEnabled = true;
3296#endif
3297 if (bEnabled)
3298 {
3299 DebuggerSetColorFG( DebuggerGetColor( FG_INFO_TITLE ) );
3300 PrintTextCursorX( "Z", rect2 );
3301
3302 DebuggerSetColorFG( DebuggerGetColor( FG_INFO_BULLET ));
3303 PrintTextCursorX( StrFormat( "%X ", iZP ).c_str(), rect2 );
3304
3305// DebuggerSetColorFG( DebuggerGetColor( FG_INFO_OPERATOR ));
3306// PrintTextCursorX( " ", rect2 );
3307
3308 BYTE nZPAddr1 = (g_aZeroPagePointers[iZP].nAddress ) & 0xFF; // +MJP missig: "& 0xFF", or "(BYTE) ..."
3309 BYTE nZPAddr2 = (g_aZeroPagePointers[iZP].nAddress+1) & 0xFF;
3310
3311 std::string sAddressBuf1;
3312 std::string sAddressBuf2;
3313 std::string const& sSymbol1 = GetSymbol(nZPAddr1, 2, sAddressBuf1); // 2:8-bit value (if symbol not found)
3314 std::string const& sSymbol2 = GetSymbol(nZPAddr2, 2, sAddressBuf2); // 2:8-bit value (if symbol not found)
3315
3316 std::string sText;
3317
3318// if ((sSymbol1.length() == 1) && (sSymbol2.length() == 1))
3319// sText = sSymbol1 + sSymbol2;
3320
3321 DebuggerSetColorFG( DebuggerGetColor( FG_DISASM_ADDRESS ));
3322
3323 if (!sSymbol1.empty() && sSymbol1[0] == '$')
3324 {
3325// sText = pSymbol1;
3326// sZPAddr = WordToHexStr( nZPAddr1 );
3327 }

Callers 1

DrawSubWindow_InfoFunction · 0.85

Calls 9

DebuggerSetColorBGFunction · 0.85
DebuggerGetColorFunction · 0.85
DebuggerSetColorFGFunction · 0.85
PrintTextCursorXFunction · 0.85
StrFormatFunction · 0.85
PrintTextFunction · 0.85
ByteToHexStrFunction · 0.85
ReadByteFromMemoryFunction · 0.85
WordToHexStrFunction · 0.85

Tested by

no test coverage detected