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

Function DrawSubWindow_Source2

source/Debugger/Debugger_Display.cpp:3762–3831  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

3760
3761//===========================================================================
3762void DrawSubWindow_Source2 (Update_t bUpdate)
3763{
3764// if (! g_bSourceLevelDebugging)
3765// return;
3766
3767 DebuggerSetColorFG( DebuggerGetColor( FG_SOURCE ));
3768
3769 const int nLines = g_nDisasmWinHeight;
3770
3771 int y = g_nDisasmWinHeight;
3772 int nHeight = g_nDisasmWinHeight;
3773
3774 if (g_aWindowConfig[ g_iWindowThis ].bSplit) // HACK: Split Window Height is odd, so bottom window gets +1 height
3775 nHeight++;
3776
3777 RECT rect = { 0 };
3778 rect.top = (y * g_nFontHeight);
3779 rect.bottom = rect.top + (nHeight * g_nFontHeight);
3780 rect.left = 0;
3781 rect.right = DISPLAY_DISASM_RIGHT; // HACK: MAGIC #: 7
3782
3783// Draw Title
3784 std::string sTitle = " Source: " + g_aSourceFileName;
3785 sTitle.resize(MIN(sTitle.size(), size_t(g_nConsoleDisplayWidth)));
3786
3787 DebuggerSetColorBG( DebuggerGetColor( BG_SOURCE_TITLE ));
3788 DebuggerSetColorFG( DebuggerGetColor( FG_SOURCE_TITLE ));
3789 PrintText( sTitle.c_str(), rect );
3790 rect.top += g_nFontHeight;
3791
3792// Draw Source Lines
3793 int iBackground;
3794 int iForeground;
3795
3796 int iSourceCursor = 2; // (g_nDisasmWinHeight / 2);
3797 int iSourceLine = FindSourceLine( regs.pc );
3798
3799 if (iSourceLine == NO_SOURCE_LINE)
3800 {
3801 iSourceCursor = NO_SOURCE_LINE;
3802 }
3803 else
3804 {
3805 iSourceLine -= iSourceCursor;
3806 if (iSourceLine < 0)
3807 iSourceLine = 0;
3808 }
3809
3810 for ( int iLine = 0; iLine < nLines; iLine++ )
3811 {
3812 if (iLine != iSourceCursor)
3813 {
3814 iBackground = BG_SOURCE_1;
3815 if (iLine & 1)
3816 iBackground = BG_SOURCE_2;
3817 iForeground = FG_SOURCE;
3818 }
3819 else

Callers 1

DrawWindowBottomFunction · 0.85

Calls 6

DebuggerSetColorFGFunction · 0.85
DebuggerGetColorFunction · 0.85
DebuggerSetColorBGFunction · 0.85
PrintTextFunction · 0.85
FindSourceLineFunction · 0.85
DrawSourceLineFunction · 0.85

Tested by

no test coverage detected