Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Andrea Odetti 2021-02-04 10:13:57 +00:00
commit ad5b6628b5
5 changed files with 44 additions and 4 deletions

View file

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

View file

@ -44,5 +44,6 @@ void SetMainCpuDefault(eApple2Type apple2Type);
eCpuType GetActiveCpu(void); eCpuType GetActiveCpu(void);
void SetActiveCpu(eCpuType cpu); void SetActiveCpu(eCpuType cpu);
bool IsIrqAsserted(void);
bool Is6502InterruptEnabled(void); bool Is6502InterruptEnabled(void);
void ResetCyclesExecutedForDebugger(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 W8, // FG_VIDEOSCANNER_TITLE
Y8, // FG_VIDEOSCANNER_INVISIBLE Y8, // FG_VIDEOSCANNER_INVISIBLE
G8, // FG_VIDEOSCANNER_VISIBLE G8, // FG_VIDEOSCANNER_VISIBLE
C3, // BG_IRQ_TITLE
R8, // FG_IRQ_TITLE
}; };

View file

@ -129,6 +129,9 @@
, FG_VIDEOSCANNER_INVISIBLE // yellow , FG_VIDEOSCANNER_INVISIBLE // yellow
, FG_VIDEOSCANNER_VISIBLE // green , FG_VIDEOSCANNER_VISIBLE // green
, BG_IRQ_TITLE
, FG_IRQ_TITLE // red
, NUM_DEBUG_COLORS , 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 INFO_COL_3 = (63 * 7); // nFontWidth
const int DISPLAY_MINIMEM_COLUMN = INFO_COL_3; const int DISPLAY_MINIMEM_COLUMN = INFO_COL_3;
const int DISPLAY_VIDEO_SCANNER_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 #else
const int DISPLAY_CPU_INFO_LEFT_COLUMN = SCREENSPLIT1; // TC: SCREENSPLIT1 is not defined anywhere in the .sln! 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)))) if (!((g_iWindowThis == WINDOW_CODE) || ((g_iWindowThis == WINDOW_DATA))))
return; return;
@ -3784,7 +3811,7 @@ void DrawVideoScannerValue(int line, int vert, int horz, bool isVisible)
sprintf_s(sValue, sizeof(sValue), "%03X", nValue); sprintf_s(sValue, sizeof(sValue), "%03X", nValue);
if (!isVisible) if (!isVisible)
DebuggerSetColorFG(DebuggerGetColor(FG_VIDEOSCANNER_INVISIBLE)); // red DebuggerSetColorFG(DebuggerGetColor(FG_VIDEOSCANNER_INVISIBLE)); // yellow
else else
DebuggerSetColorFG(DebuggerGetColor(FG_VIDEOSCANNER_VISIBLE)); // green DebuggerSetColorFG(DebuggerGetColor(FG_VIDEOSCANNER_VISIBLE)); // green
PrintText(sValue, rect); PrintText(sValue, rect);
@ -3793,8 +3820,7 @@ void DrawVideoScannerValue(int line, int vert, int horz, bool isVisible)
} }
//=========================================================================== //===========================================================================
static void DrawVideoScannerInfo(int line)
void DrawVideoScannerInfo (int line)
{ {
NTSC_VideoGetScannerAddressForDebugger(); // update g_nVideoClockHorz/g_nVideoClockVert NTSC_VideoGetScannerAddressForDebugger(); // update g_nVideoClockHorz/g_nVideoClockVert
@ -3872,6 +3898,8 @@ void DrawSubWindow_Info ( Update_t bUpdate, int iWindow )
if (bUpdate & UPDATE_VIDEOSCANNER) if (bUpdate & UPDATE_VIDEOSCANNER)
DrawVideoScannerInfo(yBeam); DrawVideoScannerInfo(yBeam);
DrawIRQInfo(yBeam);
if ((bUpdate & UPDATE_REGS) || (bUpdate & UPDATE_FLAGS)) if ((bUpdate & UPDATE_REGS) || (bUpdate & UPDATE_FLAGS))
DrawRegisters( yRegs ); DrawRegisters( yRegs );