Debugger display (#666, #702):

. Video-scanner: when invisible use yellow (instead of red) (fixes #666)
. Soft-switches: row "80:" show a red 'x' when AltZP is set (#702)
This commit is contained in:
tomcw 2019-10-20 11:30:31 +01:00
parent 098b8036eb
commit 52376fd664
3 changed files with 46 additions and 29 deletions

View File

@ -132,7 +132,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
C3, // BG_VIDEOSCANNER_TITLE C3, // BG_VIDEOSCANNER_TITLE
W8, // FG_VIDEOSCANNER_TITLE W8, // FG_VIDEOSCANNER_TITLE
R8, // FG_VIDEOSCANNER_INVISIBLE Y8, // FG_VIDEOSCANNER_INVISIBLE
G8, // FG_VIDEOSCANNER_VISIBLE G8, // FG_VIDEOSCANNER_VISIBLE
}; };

View File

@ -126,7 +126,7 @@
, BG_VIDEOSCANNER_TITLE , BG_VIDEOSCANNER_TITLE
, FG_VIDEOSCANNER_TITLE , FG_VIDEOSCANNER_TITLE
, FG_VIDEOSCANNER_INVISIBLE // red , FG_VIDEOSCANNER_INVISIBLE // yellow
, FG_VIDEOSCANNER_VISIBLE // green , FG_VIDEOSCANNER_VISIBLE // green
, NUM_DEBUG_COLORS , NUM_DEBUG_COLORS

View File

@ -2778,10 +2778,10 @@ void _DrawSoftSwitch( RECT & rect, int nAddress, bool bSet, char *sPrefix, char
// 2.9.0.8 // 2.9.0.8
//=========================================================================== //===========================================================================
void _DrawTriStateSoftSwitch( RECT & rect, int nAddress, int iDisplay, int iActive, char *sPrefix, char *sOn, char *sOff, const char *sSuffix = NULL, int bg_default = BG_INFO ) void _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 )
{ {
// if ((iActive == 0) || (iDisplay == iActive)) // if ((iActive == 0) || (iBankDisplay == iActive))
bool bSet = (iDisplay == iActive); bool bSet = (iBankDisplay == iActive);
if ( bSet ) if ( bSet )
_DrawSoftSwitch( rect, nAddress, bSet, NULL, sOn, sOff, " ", bg_default ); _DrawSoftSwitch( rect, nAddress, bSet, NULL, sOn, sOff, " ", bg_default );
@ -2792,7 +2792,7 @@ void _DrawTriStateSoftSwitch( RECT & rect, int nAddress, int iDisplay, int iActi
? 2 ? 2
: 1 : 1
; ;
bool bDisabled = ((iActive == 0) && (iBank == iDisplay)); bool bDisabled = ((iActive == 0) && (iBank == iBankDisplay));
_DrawSoftSwitchAddress( temp, nAddress, bg_default ); _DrawSoftSwitchAddress( temp, nAddress, bg_default );
@ -2841,13 +2841,15 @@ void _DrawTriStateSoftSwitch( RECT & rect, int nAddress, int iDisplay, int iActi
// 2.9.0.4 Draw Language Card Bank Usage // 2.9.0.4 Draw Language Card Bank Usage
// @param iBankDisplay Either 1 or 2 // @param iBankDisplay Either 1 or 2
//=========================================================================== //===========================================================================
void _DrawSoftSwitchLanguageCardBank( RECT & rect, int iBankDisplay, int bg_default = BG_INFO ) void _DrawSoftSwitchLanguageCardBank( RECT & rect, const int iBankDisplay, int bg_default = BG_INFO )
{ {
int w = g_aFontConfig[ FONT_DISASM_DEFAULT ]._nFontWidthAvg; const int w = g_aFontConfig[ FONT_DISASM_DEFAULT ]._nFontWidthAvg;
int dx = 8 * w; // "80:L#/M R/W" const int dx80 = 7 * w; // "80:L#/MxR/W"
// ^------^
const int dx88 = 8 * w; // "88:L#/M "
// ^-------^ // ^-------^
rect.right = rect.left + dx; rect.right = rect.left + dx80;
// 0 = RAM // 0 = RAM
// 1 = Bank 1 // 1 = Bank 1
@ -2861,8 +2863,9 @@ void _DrawSoftSwitchLanguageCardBank( RECT & rect, int iBankDisplay, int bg_defa
; ;
bool bBankOn = (iBankActive == iBankDisplay); bool bBankOn = (iBankActive == iBankDisplay);
char sOff[ 4 ] = "M"; // Bn/[M]
char sOn [ 4 ] = "B#"; // LC# but one char too wide :-/ char sOn [ 4 ] = "B#"; // LC# but one char too wide :-/
char sOff[ 4 ] = "M";
// C080 LC2 // C080 LC2
// C088 LC1 // C088 LC1
int nAddress = 0xC080 + (8 * (2 - iBankDisplay)); int nAddress = 0xC080 + (8 * (2 - iBankDisplay));
@ -2876,12 +2879,36 @@ void _DrawSoftSwitchLanguageCardBank( RECT & rect, int iBankDisplay, int bg_defa
rect.top -= g_nFontHeight; rect.top -= g_nFontHeight;
rect.bottom -= g_nFontHeight; rect.bottom -= g_nFontHeight;
rect.left += dx; if (iBankDisplay == 2)
{
rect.left += dx80;
rect.right += w;
if (GetMemMode() & MF_ALTZP)
{
DebuggerSetColorFG( DebuggerGetColor( FG_DISASM_BP_S_X )); // Red
DebuggerSetColorBG( DebuggerGetColor( bg_default ));
PrintText( "x", rect );
}
rect.left += w;
rect.right += 3*w; rect.right += 3*w;
// [B2]/M R/[W]
// [B2]/M [R]/W
const char *pOn = "R";
const char *pOff = "W";
_DrawSoftSwitchHighlight( rect, !bBankWritable, pOn, pOff, bg_default );
}
#if defined(RAMWORKS) || defined(SATURN) #if defined(RAMWORKS) || defined(SATURN)
if (iBankDisplay == 1) else
{ {
_ASSERT(iBankDisplay == 1);
rect.left += dx88;
rect.right += 3*w;
int iActiveBank = -1; int iActiveBank = -1;
char sText[ 4 ] = "?"; // Default to RAMWORKS char sText[ 4 ] = "?"; // Default to RAMWORKS
#ifdef RAMWORKS #ifdef RAMWORKS
@ -2903,16 +2930,6 @@ void _DrawSoftSwitchLanguageCardBank( RECT & rect, int iBankDisplay, int bg_defa
} }
#endif // SATURN #endif // SATURN
if (iBankDisplay == 2)
{
// [2]/M R/[W]
// [2]/M [R]/W
const char *pOn = "R";
const char *pOff = "W";
_DrawSoftSwitchHighlight( rect, !bBankWritable, pOn, pOff, bg_default );
}
rect.top += g_nFontHeight; rect.top += g_nFontHeight;
rect.bottom += g_nFontHeight; rect.bottom += g_nFontHeight;
} }
@ -2962,7 +2979,7 @@ void _DrawSoftSwitchMainAuxBanks( RECT & rect, int bg_default = BG_INFO )
temp.left += dx; temp.left += dx;
temp.right += 3*w; temp.right += 3*w;
DebuggerSetColorFG( DebuggerGetColor( FG_DISASM_BP_S_X )); // FG_INFO_OPCODE )); Yellow DebuggerSetColorFG( DebuggerGetColor( FG_DISASM_BP_S_X )); // Red
DebuggerSetColorBG( DebuggerGetColor( bg_default )); DebuggerSetColorBG( DebuggerGetColor( bg_default ));
PrintTextCursorX( "W", temp ); PrintTextCursorX( "W", temp );
_DrawSoftSwitchHighlight( temp, !bAuxWrite, "m", "x", BG_DATA_2 ); _DrawSoftSwitchHighlight( temp, !bAuxWrite, "m", "x", BG_DATA_2 );
@ -3090,7 +3107,7 @@ void DrawSoftSwitches( int iSoftSwitch )
// Language Card Bank 1/2 // Language Card Bank 1/2
// See: MemSetPaging() // See: MemSetPaging()
// LC2 // LC2 & C008/C009 (ALTZP & ALT-LC)
DebuggerSetColorBG( DebuggerGetColor( bgMemory )); // BG_INFO_2 -> BG_DATA_2 DebuggerSetColorBG( DebuggerGetColor( bgMemory )); // BG_INFO_2 -> BG_DATA_2
_DrawSoftSwitchLanguageCardBank( rect, 2, bgMemory ); _DrawSoftSwitchLanguageCardBank( rect, 2, bgMemory );