mirror of
https://github.com/AppleWin/AppleWin.git
synced 2025-04-13 03:38:37 +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";
|
||||
LogOutput("IRQ (%08X) (%s)\n", (UINT)g_nCycleIrqStart, pSrc);
|
||||
#endif
|
||||
CheckSynchronousInterruptSources(7, uExecutedCycles);
|
||||
g_interruptInLastExecutionBatch = true;
|
||||
irqTaken = true;
|
||||
}
|
||||
|
@ -50,18 +50,12 @@ static DWORD Cpu6502(DWORD uTotalCycles, const bool bVideoUpdate)
|
||||
{
|
||||
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
|
||||
{
|
||||
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 );
|
||||
Fetch(iOpcode, uExecutedCycles);
|
||||
|
||||
|
@ -50,18 +50,12 @@ static DWORD Cpu65C02(DWORD uTotalCycles, const bool bVideoUpdate)
|
||||
{
|
||||
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
|
||||
{
|
||||
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 );
|
||||
Fetch(iOpcode, uExecutedCycles);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user