Debugger: add red 'IRQ' after the v/h-pos when IRQ is being asserted to the 6502

This commit is contained in:
tomcw 2021-01-31 19:38:06 +00:00
parent fad4dd2ad1
commit fcafa18340
5 changed files with 44 additions and 4 deletions

View File

@ -193,6 +193,11 @@ void SetActiveCpu(eCpuType cpu)
g_ActiveCPU = cpu;
}
bool IsIrqAsserted(void)
{
return g_bmIRQ ? true : false;
}
bool Is6502InterruptEnabled(void)
{
return !(regs.ps & AF_INTERRUPT);

View File

@ -44,5 +44,6 @@ void SetMainCpuDefault(eApple2Type apple2Type);
eCpuType GetActiveCpu(void);
void SetActiveCpu(eCpuType cpu);
bool IsIrqAsserted(void);
bool Is6502InterruptEnabled(void);
void ResetCyclesExecutedForDebugger(void);

View File

@ -134,6 +134,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
W8, // FG_VIDEOSCANNER_TITLE
Y8, // FG_VIDEOSCANNER_INVISIBLE
G8, // FG_VIDEOSCANNER_VISIBLE
C3, // BG_IRQ_TITLE
R8, // FG_IRQ_TITLE
};

View File

@ -129,6 +129,9 @@
, FG_VIDEOSCANNER_INVISIBLE // yellow
, FG_VIDEOSCANNER_VISIBLE // green
, BG_IRQ_TITLE
, FG_IRQ_TITLE // red
, NUM_DEBUG_COLORS
};

View File

@ -174,6 +174,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
const int INFO_COL_3 = (63 * 7); // nFontWidth
const int DISPLAY_MINIMEM_COLUMN = INFO_COL_3;
const int DISPLAY_VIDEO_SCANNER_COLUMN = INFO_COL_3;
const int DISPLAY_IRQ_COLUMN = INFO_COL_3 + (12 * 7); // (12 chars from v/h-pos) * nFontWidth
#else
const int DISPLAY_CPU_INFO_LEFT_COLUMN = SCREENSPLIT1; // TC: SCREENSPLIT1 is not defined anywhere in the .sln!
@ -3748,7 +3749,33 @@ void DrawSubWindow_Data (Update_t bUpdate)
}
//===========================================================================
void DrawVideoScannerValue(int line, int vert, int horz, bool isVisible)
static void DrawIRQInfo(int line)
{
if (!((g_iWindowThis == WINDOW_CODE) || ((g_iWindowThis == WINDOW_DATA))))
return;
const int nFontWidth = g_aFontConfig[FONT_INFO]._nFontWidthAvg;
const int nameWidth = 3; // 3 chars
const int totalWidth = nameWidth;
RECT rect;
rect.top = line * g_nFontHeight;
rect.bottom = rect.top + g_nFontHeight;
rect.left = DISPLAY_IRQ_COLUMN;
rect.right = rect.left + (totalWidth * nFontWidth);
DebuggerSetColorBG(DebuggerGetColor(BG_IRQ_TITLE));
DebuggerSetColorFG(DebuggerGetColor(FG_IRQ_TITLE));
if (IsIrqAsserted())
PrintText("IRQ", rect);
else
PrintText(" ", rect);
}
//===========================================================================
static void DrawVideoScannerValue(int line, int vert, int horz, bool isVisible)
{
if (!((g_iWindowThis == WINDOW_CODE) || ((g_iWindowThis == WINDOW_DATA))))
return;
@ -3784,7 +3811,7 @@ void DrawVideoScannerValue(int line, int vert, int horz, bool isVisible)
sprintf_s(sValue, sizeof(sValue), "%03X", nValue);
if (!isVisible)
DebuggerSetColorFG(DebuggerGetColor(FG_VIDEOSCANNER_INVISIBLE)); // red
DebuggerSetColorFG(DebuggerGetColor(FG_VIDEOSCANNER_INVISIBLE)); // yellow
else
DebuggerSetColorFG(DebuggerGetColor(FG_VIDEOSCANNER_VISIBLE)); // green
PrintText(sValue, rect);
@ -3793,8 +3820,7 @@ void DrawVideoScannerValue(int line, int vert, int horz, bool isVisible)
}
//===========================================================================
void DrawVideoScannerInfo (int line)
static void DrawVideoScannerInfo(int line)
{
NTSC_VideoGetScannerAddressForDebugger(); // update g_nVideoClockHorz/g_nVideoClockVert
@ -3872,6 +3898,8 @@ void DrawSubWindow_Info ( Update_t bUpdate, int iWindow )
if (bUpdate & UPDATE_VIDEOSCANNER)
DrawVideoScannerInfo(yBeam);
DrawIRQInfo(yBeam);
if ((bUpdate & UPDATE_REGS) || (bUpdate & UPDATE_FLAGS))
DrawRegisters( yRegs );