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

Function DrawDisassemblyLine

source/Debugger/Debugger_Display.cpp:1376–4074  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1374
1375//===========================================================================
1376WORD DrawDisassemblyLine ( int iLine, const WORD nBaseAddress )
1377{
1378 if (! ((g_iWindowThis == WINDOW_CODE) || ((g_iWindowThis == WINDOW_DATA))))
1379 return 0;
1380
1381// int iOpcode;
1382 int iOpmode;
1383 int nOpbyte;
1384 DisasmLine_t line;
1385
1386 int iTable = NUM_SYMBOL_TABLES;
1387 std::string const* pSymbol = FindSymbolFromAddress( nBaseAddress, &iTable );
1388 const char* pMnemonic = NULL;
1389
1390 // Data Disassembler
1391 int bDisasmFormatFlags = GetDisassemblyLine( nBaseAddress, line );
1392 const DisasmData_t *pData = line.pDisasmData;
1393
1394// iOpcode = line.iOpcode;
1395 iOpmode = line.iOpmode;
1396 nOpbyte = line.nOpbyte;
1397
1398 // sAddress, sOpcodes, sTarget, sTargetOffset, nTargetOffset, sTargetPointer, sTargetValue, sImmediate, nImmediate, sBranch );
1399 //> Address Separator Opcodes Label Mnemonic Target [Immediate] [Branch]
1400 //
1401 //> xxxx: xx xx xx LABEL MNEMONIC 'E' =
1402 //> ^ ^ ^ ^ ^
1403 //> 6 17 27 41 46
1404 const int nDefaultFontWidth = 7; // g_aFontConfig[FONT_DISASM_DEFAULT]._nFontWidth or g_nFontWidthAvg
1405
1406 enum TabStop_e
1407 {
1408 TS_OPCODE
1409 , TS_LABEL
1410 , TS_INSTRUCTION
1411 , TS_IMMEDIATE
1412 , TS_BRANCH
1413 , TS_CHAR
1414 , _NUM_TAB_STOPS
1415 };
1416
1417// int X_OPCODE = 6 * nDefaultFontWidth;
1418// int X_LABEL = 17 * nDefaultFontWidth;
1419// int X_INSTRUCTION = 26 * nDefaultFontWidth; // 27
1420// int X_IMMEDIATE = 40 * nDefaultFontWidth; // 41
1421// int X_BRANCH = 46 * nDefaultFontWidth;
1422
1423 float aTabs[ _NUM_TAB_STOPS ] =
1424#if USE_APPLE_FONT
1425 // xxxx:xx xx xx LABELxxxxxx MNEMONIC 'E' =
1426 // 0 45 14 26
1427 { 5, 14, 26, 41, 48, 49 };
1428#else
1429 { 5.75, 15.5, 25, 40.5, 45.5, 48.5 };
1430#endif
1431
1432#if !USE_APPLE_FONT
1433 if (! g_bConfigDisasmAddressColon)

Callers 1

DrawSubWindow_CodeFunction · 0.85

Calls 12

FindSymbolFromAddressFunction · 0.85
GetDisassemblyLineFunction · 0.85
GetBreakpointInfoFunction · 0.85
Bookmark_FindFunction · 0.85
DebuggerSetColorBGFunction · 0.85
DebuggerGetColorFunction · 0.85
DebuggerSetColorFGFunction · 0.85
PrintTextCursorXFunction · 0.85
GetDebuggerMemDCFunction · 0.85
PrintGlyphFunction · 0.85
ColorizeSpecialCharFunction · 0.85
PrintTextFunction · 0.85

Tested by

no test coverage detected