mirror of
https://github.com/AppleWin/AppleWin.git
synced 2024-06-27 07:29:30 +00:00
Core emulation: simplify NMI & IRQ handling
This commit is contained in:
parent
18f5fafb30
commit
fa18382757
|
@ -446,7 +446,6 @@ static __forceinline bool IRQ(ULONG& uExecutedCycles, BOOL& flagc, BOOL& flagn,
|
||||||
(g_bmIRQ & 8) ? "MOUSE" : "UNKNOWN";
|
(g_bmIRQ & 8) ? "MOUSE" : "UNKNOWN";
|
||||||
LogOutput("IRQ (%08X) (%s)\n", (UINT)g_nCycleIrqStart, pSrc);
|
LogOutput("IRQ (%08X) (%s)\n", (UINT)g_nCycleIrqStart, pSrc);
|
||||||
#endif
|
#endif
|
||||||
CheckSynchronousInterruptSources(7, uExecutedCycles);
|
|
||||||
g_interruptInLastExecutionBatch = true;
|
g_interruptInLastExecutionBatch = true;
|
||||||
irqTaken = true;
|
irqTaken = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,18 +50,12 @@ static DWORD Cpu6502(DWORD uTotalCycles, const bool bVideoUpdate)
|
||||||
{
|
{
|
||||||
const UINT uZ80Cycles = z80_mainloop(uTotalCycles, uExecutedCycles); CYC(uZ80Cycles)
|
const UINT uZ80Cycles = z80_mainloop(uTotalCycles, uExecutedCycles); CYC(uZ80Cycles)
|
||||||
}
|
}
|
||||||
|
else if (NMI(uExecutedCycles, flagc, flagn, flagv, flagz) || IRQ(uExecutedCycles, flagc, flagn, flagv, flagz))
|
||||||
|
{
|
||||||
|
// Allow AppleWin debugger's single-stepping to just step the pending IRQ
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (IRQ(uExecutedCycles, flagc, flagn, flagv, flagz) || NMI(uExecutedCycles, flagc, flagn, flagv, flagz))
|
|
||||||
{
|
|
||||||
if (bVideoUpdate)
|
|
||||||
{
|
|
||||||
ULONG uElapsedCycles = uExecutedCycles - uPreviousCycles;
|
|
||||||
NTSC_VideoUpdateCycles(uElapsedCycles);
|
|
||||||
}
|
|
||||||
continue; // Allow AppleWin debugger's single-stepping to just step the pending IRQ
|
|
||||||
}
|
|
||||||
|
|
||||||
HEATMAP_X( regs.pc );
|
HEATMAP_X( regs.pc );
|
||||||
Fetch(iOpcode, uExecutedCycles);
|
Fetch(iOpcode, uExecutedCycles);
|
||||||
|
|
||||||
|
|
|
@ -50,18 +50,12 @@ static DWORD Cpu65C02(DWORD uTotalCycles, const bool bVideoUpdate)
|
||||||
{
|
{
|
||||||
const UINT uZ80Cycles = z80_mainloop(uTotalCycles, uExecutedCycles); CYC(uZ80Cycles)
|
const UINT uZ80Cycles = z80_mainloop(uTotalCycles, uExecutedCycles); CYC(uZ80Cycles)
|
||||||
}
|
}
|
||||||
|
else if (NMI(uExecutedCycles, flagc, flagn, flagv, flagz) || IRQ(uExecutedCycles, flagc, flagn, flagv, flagz))
|
||||||
|
{
|
||||||
|
// Allow AppleWin debugger's single-stepping to just step the pending IRQ
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (IRQ(uExecutedCycles, flagc, flagn, flagv, flagz) || NMI(uExecutedCycles, flagc, flagn, flagv, flagz))
|
|
||||||
{
|
|
||||||
if (bVideoUpdate)
|
|
||||||
{
|
|
||||||
ULONG uElapsedCycles = uExecutedCycles - uPreviousCycles;
|
|
||||||
NTSC_VideoUpdateCycles(uElapsedCycles);
|
|
||||||
}
|
|
||||||
continue; // Allow AppleWin debugger's single-stepping to just step the pending IRQ
|
|
||||||
}
|
|
||||||
|
|
||||||
HEATMAP_X( regs.pc );
|
HEATMAP_X( regs.pc );
|
||||||
Fetch(iOpcode, uExecutedCycles);
|
Fetch(iOpcode, uExecutedCycles);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user