mirror of
https://github.com/AppleWin/AppleWin.git
synced 2024-12-22 09:30:15 +00:00
Fix #366 (IRQ erroreously deducting extra cycles)
This commit is contained in:
parent
7f3cc09217
commit
58671545bb
@ -398,7 +398,7 @@ static __forceinline int Fetch(BYTE& iOpcode, ULONG uExecutedCycles)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//#define ENABLE_NMI_SUPPORT // Not used - so don't enable
|
//#define ENABLE_NMI_SUPPORT // Not used - so don't enable
|
||||||
static __forceinline void NMI(ULONG& uExecutedCycles, UINT& uExtraCycles, BOOL& flagc, BOOL& flagn, BOOL& flagv, BOOL& flagz)
|
static __forceinline void NMI(ULONG& uExecutedCycles, BOOL& flagc, BOOL& flagn, BOOL& flagv, BOOL& flagz)
|
||||||
{
|
{
|
||||||
#ifdef ENABLE_NMI_SUPPORT
|
#ifdef ENABLE_NMI_SUPPORT
|
||||||
if(g_bNmiFlank)
|
if(g_bNmiFlank)
|
||||||
@ -414,12 +414,13 @@ static __forceinline void NMI(ULONG& uExecutedCycles, UINT& uExtraCycles, BOOL&
|
|||||||
PUSH(regs.ps & ~AF_BREAK)
|
PUSH(regs.ps & ~AF_BREAK)
|
||||||
regs.ps = regs.ps | AF_INTERRUPT & ~AF_DECIMAL;
|
regs.ps = regs.ps | AF_INTERRUPT & ~AF_DECIMAL;
|
||||||
regs.pc = * (WORD*) (mem+0xFFFA);
|
regs.pc = * (WORD*) (mem+0xFFFA);
|
||||||
|
UINT uExtraCycles = 0; // Needed for CYC(a) macro
|
||||||
CYC(7)
|
CYC(7)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static __forceinline void IRQ(ULONG& uExecutedCycles, UINT& uExtraCycles, BOOL& flagc, BOOL& flagn, BOOL& flagv, BOOL& flagz)
|
static __forceinline void IRQ(ULONG& uExecutedCycles, BOOL& flagc, BOOL& flagn, BOOL& flagv, BOOL& flagz)
|
||||||
{
|
{
|
||||||
if(g_bmIRQ && !(regs.ps & AF_INTERRUPT))
|
if(g_bmIRQ && !(regs.ps & AF_INTERRUPT))
|
||||||
{
|
{
|
||||||
@ -433,6 +434,7 @@ static __forceinline void IRQ(ULONG& uExecutedCycles, UINT& uExtraCycles, BOOL&
|
|||||||
PUSH(regs.ps & ~AF_BREAK)
|
PUSH(regs.ps & ~AF_BREAK)
|
||||||
regs.ps = regs.ps | AF_INTERRUPT & ~AF_DECIMAL;
|
regs.ps = regs.ps | AF_INTERRUPT & ~AF_DECIMAL;
|
||||||
regs.pc = * (WORD*) (mem+0xFFFE);
|
regs.pc = * (WORD*) (mem+0xFFFE);
|
||||||
|
UINT uExtraCycles = 0; // Needed for CYC(a) macro
|
||||||
CYC(7)
|
CYC(7)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -328,8 +328,8 @@ static DWORD Cpu6502 (DWORD uTotalCycles)
|
|||||||
// NTSC_END
|
// NTSC_END
|
||||||
|
|
||||||
CheckInterruptSources(uExecutedCycles);
|
CheckInterruptSources(uExecutedCycles);
|
||||||
NMI(uExecutedCycles, uExtraCycles, flagc, flagn, flagv, flagz);
|
NMI(uExecutedCycles, flagc, flagn, flagv, flagz);
|
||||||
IRQ(uExecutedCycles, uExtraCycles, flagc, flagn, flagv, flagz);
|
IRQ(uExecutedCycles, flagc, flagn, flagv, flagz);
|
||||||
|
|
||||||
if ( IsDebugBreakpointHit() )
|
if ( IsDebugBreakpointHit() )
|
||||||
break;
|
break;
|
||||||
|
@ -331,8 +331,8 @@ static DWORD Cpu65C02 (DWORD uTotalCycles)
|
|||||||
// NTSC_END
|
// NTSC_END
|
||||||
|
|
||||||
CheckInterruptSources(uExecutedCycles);
|
CheckInterruptSources(uExecutedCycles);
|
||||||
NMI(uExecutedCycles, uExtraCycles, flagc, flagn, flagv, flagz);
|
NMI(uExecutedCycles, flagc, flagn, flagv, flagz);
|
||||||
IRQ(uExecutedCycles, uExtraCycles, flagc, flagn, flagv, flagz);
|
IRQ(uExecutedCycles, flagc, flagn, flagv, flagz);
|
||||||
|
|
||||||
if( IsDebugBreakpointHit() )
|
if( IsDebugBreakpointHit() )
|
||||||
break;
|
break;
|
||||||
|
@ -416,8 +416,8 @@ static DWORD Cpu65D02 (DWORD uTotalCycles)
|
|||||||
// NTSC_END
|
// NTSC_END
|
||||||
|
|
||||||
CheckInterruptSources(uExecutedCycles);
|
CheckInterruptSources(uExecutedCycles);
|
||||||
NMI(uExecutedCycles, uExtraCycles, flagc, flagn, flagv, flagz);
|
NMI(uExecutedCycles, flagc, flagn, flagv, flagz);
|
||||||
IRQ(uExecutedCycles, uExtraCycles, flagc, flagn, flagv, flagz);
|
IRQ(uExecutedCycles, flagc, flagn, flagv, flagz);
|
||||||
|
|
||||||
if( IsDebugBreakpointHit() )
|
if( IsDebugBreakpointHit() )
|
||||||
break;
|
break;
|
||||||
|
@ -72,11 +72,11 @@ static __forceinline void CheckInterruptSources(ULONG uExecutedCycles)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static __forceinline void NMI(ULONG& uExecutedCycles, UINT& uExtraCycles, BOOL& flagc, BOOL& flagn, BOOL& flagv, BOOL& flagz)
|
static __forceinline void NMI(ULONG& uExecutedCycles, BOOL& flagc, BOOL& flagn, BOOL& flagv, BOOL& flagz)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static __forceinline void IRQ(ULONG& uExecutedCycles, UINT& uExtraCycles, BOOL& flagc, BOOL& flagn, BOOL& flagv, BOOL& flagz)
|
static __forceinline void IRQ(ULONG& uExecutedCycles, BOOL& flagc, BOOL& flagn, BOOL& flagv, BOOL& flagz)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user