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

Function DrawSubWindow_Data

source/Debugger/Debugger_Display.cpp:3419–3548  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

3417
3418//===========================================================================
3419void DrawSubWindow_Data (Update_t bUpdate)
3420{
3421// HDC hDC = g_hDC;
3422 int iBackground;
3423
3424 const int nMaxOpcodes = WINDOW_DATA_BYTES_PER_LINE;
3425
3426 _ASSERT( CONSOLE_WIDTH > (WINDOW_DATA_BYTES_PER_LINE * 3));
3427
3428 const int nDefaultFontWidth = 7; // g_aFontConfig[FONT_DISASM_DEFAULT]._nFontWidth or g_nFontWidthAvg
3429 const int X_OPCODE = 6 * nDefaultFontWidth;
3430 const int X_CHAR = (6 + (nMaxOpcodes*3)) * nDefaultFontWidth;
3431
3432 int iMemDump = 0;
3433
3434 MemoryDump_t* pMD = &g_aMemDump[ iMemDump ];
3435 USHORT nAddress = pMD->nAddress;
3436
3437 FlushCacheForPrefixMemory(pMD->addrPrefix);
3438
3439// if (!pMD->bActive)
3440// return;
3441
3442// int iWindows = g_iThisWindow;
3443// WindowSplit_t * pWindow = &g_aWindowConfig[ iWindow ];
3444
3445 RECT rect = { 0 };
3446 rect.top = 0;
3447
3448 WORD iAddress = nAddress;
3449
3450 const int nLines = g_nDisasmWinHeight;
3451
3452 for ( int iLine = 0; iLine < nLines; iLine++ )
3453 {
3454 iAddress = nAddress;
3455
3456 // Format
3457 std::string sAddress = WordToHexStr( iAddress );
3458
3459 std::string sOpcodes;
3460 WORD srcAddr = iAddress;
3461 for (int iByte = 0; iByte < nMaxOpcodes; ++iByte, ++srcAddr)
3462 {
3463 StrAppendByteAsHex(sOpcodes, ReadByteFromMemoryWithPrefix(srcAddr, pMD->addrPrefix));
3464 sOpcodes += ' ';
3465 }
3466
3467 int nFontHeight = g_aFontConfig[ FONT_DISASM_DEFAULT ]._nLineHeight;
3468
3469 // Draw
3470 rect.left = 0;
3471 rect.right = DISPLAY_DISASM_RIGHT;
3472 rect.bottom = rect.top + nFontHeight;
3473
3474 iBackground = !!(iLine & 1) ? BG_DATA_1 : BG_DATA_2;
3475
3476 DebuggerSetColorBG( DebuggerGetColor( iBackground ) );

Callers 1

DrawWindow_DataFunction · 0.85

Calls 8

WordToHexStrFunction · 0.85
DebuggerSetColorBGFunction · 0.85
DebuggerGetColorFunction · 0.85
DebuggerSetColorFGFunction · 0.85
PrintTextCursorXFunction · 0.85
ColorizeSpecialCharFunction · 0.85

Tested by

no test coverage detected