diff --git a/source/CPU.cpp b/source/CPU.cpp index 2be35bcf..5578d0e5 100644 --- a/source/CPU.cpp +++ b/source/CPU.cpp @@ -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); diff --git a/source/CPU.h b/source/CPU.h index bd2aab11..8b1b95b0 100644 --- a/source/CPU.h +++ b/source/CPU.h @@ -44,5 +44,6 @@ void SetMainCpuDefault(eApple2Type apple2Type); eCpuType GetActiveCpu(void); void SetActiveCpu(eCpuType cpu); +bool IsIrqAsserted(void); bool Is6502InterruptEnabled(void); void ResetCyclesExecutedForDebugger(void); diff --git a/source/Debugger/Debugger_Color.cpp b/source/Debugger/Debugger_Color.cpp index b0ceac1a..4effa6a8 100644 --- a/source/Debugger/Debugger_Color.cpp +++ b/source/Debugger/Debugger_Color.cpp @@ -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 }; diff --git a/source/Debugger/Debugger_Color.h b/source/Debugger/Debugger_Color.h index c9d264c5..22a1757c 100644 --- a/source/Debugger/Debugger_Color.h +++ b/source/Debugger/Debugger_Color.h @@ -129,6 +129,9 @@ , FG_VIDEOSCANNER_INVISIBLE // yellow , FG_VIDEOSCANNER_VISIBLE // green + , BG_IRQ_TITLE + , FG_IRQ_TITLE // red + , NUM_DEBUG_COLORS }; diff --git a/source/Debugger/Debugger_Display.cpp b/source/Debugger/Debugger_Display.cpp index cc494ee9..faca9d72 100644 --- a/source/Debugger/Debugger_Display.cpp +++ b/source/Debugger/Debugger_Display.cpp @@ -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 );