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

Function _DrawTriStateSoftSwitch

source/Debugger/Debugger_Display.cpp:2629–2669  ·  view source on GitHub ↗

2.9.0.8 ===========================================================================

Source from the content-addressed store, hash-verified

2627// 2.9.0.8
2628//===========================================================================
2629void _DrawTriStateSoftSwitch( RECT & rect, int nAddress, const int iBankDisplay, int iActive, char *sPrefix, char *sOn, char *sOff, const char *sSuffix = NULL, int bg_default = BG_INFO )
2630{
2631// if ((iActive == 0) || (iBankDisplay == iActive))
2632 bool bSet = (iBankDisplay == iActive);
2633
2634 if ( bSet )
2635 _DrawSoftSwitch( rect, nAddress, bSet, NULL, sOn, sOff, " ", bg_default );
2636 else // Main Memory is active, or Bank # is not active
2637 {
2638 RECT temp = rect;
2639 int iBank = (GetMemMode() & MF_BANK2)
2640 ? 2
2641 : 1
2642 ;
2643 bool bDisabled = ((iActive == 0) && (iBank == iBankDisplay));
2644
2645
2646 _DrawSoftSwitchAddress( temp, nAddress, bg_default );
2647
2648 // TODO: Q. Show which bank we are writing to in red?
2649 // A. No, since we highlight bank 2 or 1, along with R/W
2650 DebuggerSetColorBG( DebuggerGetColor( bg_default ));
2651 if ( bDisabled )
2652 DebuggerSetColorFG( DebuggerGetColor( FG_INFO_TITLE ) );
2653 else
2654 DebuggerSetColorFG( DebuggerGetColor( FG_DISASM_OPERATOR ) );
2655
2656 PrintTextCursorX( sOn , temp );
2657 PrintTextCursorX( "/" , temp );
2658
2659 ColorizeFlags( bDisabled, bg_default, FG_DISASM_OPERATOR );
2660 PrintTextCursorX( sOff, temp );
2661
2662 DebuggerSetColorBG( DebuggerGetColor( bg_default ));
2663 DebuggerSetColorFG( DebuggerGetColor( FG_INFO_TITLE ));
2664 PrintTextCursorX( " " , temp );
2665
2666 rect.top += g_nFontHeight;
2667 rect.bottom += g_nFontHeight;
2668 }
2669}
2670
2671/*
2672 Debugger: Support LC status and memory

Callers 1

Calls 8

_DrawSoftSwitchFunction · 0.85
GetMemModeFunction · 0.85
_DrawSoftSwitchAddressFunction · 0.85
DebuggerSetColorBGFunction · 0.85
DebuggerGetColorFunction · 0.85
DebuggerSetColorFGFunction · 0.85
PrintTextCursorXFunction · 0.85
ColorizeFlagsFunction · 0.85

Tested by

no test coverage detected