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

Function _DrawSoftSwitchLanguageCardBank

source/Debugger/Debugger_Display.cpp:2692–2781  ·  view source on GitHub ↗

Debugger: Support LC status and memory https://github.com/AppleWin/AppleWin/issues/406 Bank2 Bank1 First Access, Second Access ----------------------------------------------- C080 C088 Read RAM, Write protect MF_HIGHRAM ~MF_WRITERAM C081 C089 Read ROM, Write enable ~MF_HIGHRAM MF_WRITERAM C082 C08A Read ROM, Write

Source from the content-addressed store, hash-verified

2690// @param iBankDisplay Either 1 or 2
2691//===========================================================================
2692void _DrawSoftSwitchLanguageCardBank( RECT & rect, const int iBankDisplay, int bg_default = BG_INFO )
2693{
2694 const int w = g_aFontConfig[ FONT_DISASM_DEFAULT ]._nFontWidthAvg;
2695 const int dx80 = 7 * w; // "80:B2/MxR/W"
2696 // ^------^
2697 const int dx88 = 8 * w; // "88:B1/M "
2698 // ^-------^
2699
2700#ifdef _DEBUG
2701 const int finalRectRight = rect.left + 11 * w;
2702#endif
2703
2704 rect.right = rect.left + dx80;
2705
2706 // 0 = ROM
2707 // 1 = Bank 1
2708 // 2 = Bank 2
2709 bool bBankWritable = (GetMemMode() & MF_WRITERAM) ? 1 : 0;
2710 int iBankActive = (GetMemMode() & MF_HIGHRAM)
2711 ? (GetMemMode() & MF_BANK2)
2712 ? 2
2713 : 1
2714 : 0
2715 ;
2716 bool bBankOn = (iBankActive == iBankDisplay);
2717
2718 // B#/[M]
2719 char sOn [ 4 ] = "B#"; // LC# but one char too wide :-/
2720 char sOff[ 4 ] = "M";
2721 // C080 LC2
2722 // C088 LC1
2723 int nAddress = 0xC080 + (8 * (2 - iBankDisplay));
2724 sOn[1] = '0' + iBankDisplay;
2725
2726 // if off then ONLY highlight 'M' but only for the appropiate bank
2727 // if on then do NOT highlight 'M'
2728 // if on then also only highly the ACTIVE bank
2729 _DrawTriStateSoftSwitch( rect, nAddress, iBankDisplay, iBankActive, NULL, sOn, sOff, " ", bg_default );
2730
2731 rect.top -= g_nFontHeight;
2732 rect.bottom -= g_nFontHeight;
2733
2734 if (iBankDisplay == 2)
2735 {
2736 rect.left += dx80;
2737 rect.right += 4*w;
2738
2739 DebuggerSetColorFG( DebuggerGetColor( FG_DISASM_BP_S_X )); // Red
2740 DebuggerSetColorBG( DebuggerGetColor( bg_default ));
2741 PrintTextCursorX( (GetMemMode() & MF_ALTZP) ? "x" : " ", rect );
2742
2743 // [B2]/M R/[W]
2744 // [B2]/M [R]/W
2745 const char *pOn = "R";
2746 const char *pOff = "W";
2747
2748 _DrawSoftSwitchHighlight( rect, !bBankWritable, pOn, pOff, bg_default );
2749 }

Callers 1

DrawSoftSwitchesFunction · 0.85

Calls 12

GetMemModeFunction · 0.85
_DrawTriStateSoftSwitchFunction · 0.85
DebuggerSetColorFGFunction · 0.85
DebuggerGetColorFunction · 0.85
DebuggerSetColorBGFunction · 0.85
PrintTextCursorXFunction · 0.85
_DrawSoftSwitchHighlightFunction · 0.85
GetRamWorksActiveBankFunction · 0.85
ByteToHexStrFunction · 0.85
GetLanguageCardMethod · 0.80
GetActiveBankMethod · 0.45

Tested by

no test coverage detected