mirror of
https://github.com/AppleWin/AppleWin.git
synced 2024-12-31 21:29:39 +00:00
Fixed 6522 & interrupt:
. Broadside needs to see IRQ within 17 cycles (6 opcodes) of 6522 counter underflowing to detect Mockingboard. (Fixes #605)
This commit is contained in:
parent
eea8cb3cdf
commit
ceb0416bf3
@ -427,6 +427,13 @@ static __forceinline void CheckInterruptSources(ULONG uExecutedCycles)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GH#605: IRQ needs to occur within 17 cycles (6 opcodes) of configuring the timer interrupt
|
||||||
|
void CpuAdjustIrqCheck(UINT uCyclesUntilInterrupt)
|
||||||
|
{
|
||||||
|
if (uCyclesUntilInterrupt < IRQ_CHECK_TIMEOUT)
|
||||||
|
g_nIrqCheckTimeout = uCyclesUntilInterrupt;
|
||||||
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
||||||
#include "CPU/cpu6502.h" // MOS 6502
|
#include "CPU/cpu6502.h" // MOS 6502
|
||||||
|
@ -14,6 +14,7 @@ struct regsrec
|
|||||||
extern regsrec regs;
|
extern regsrec regs;
|
||||||
extern unsigned __int64 g_nCumulativeCycles;
|
extern unsigned __int64 g_nCumulativeCycles;
|
||||||
|
|
||||||
|
void CpuAdjustIrqCheck(UINT uCyclesUntilInterrupt);
|
||||||
void CpuDestroy ();
|
void CpuDestroy ();
|
||||||
void CpuCalcCycles(ULONG nExecutedCycles);
|
void CpuCalcCycles(ULONG nExecutedCycles);
|
||||||
DWORD CpuExecute(const DWORD uCycles, const bool bVideoUpdate);
|
DWORD CpuExecute(const DWORD uCycles, const bool bVideoUpdate);
|
||||||
|
@ -427,6 +427,7 @@ static void SY6522_Write(BYTE nDevice, BYTE nReg, BYTE nValue)
|
|||||||
pMB->sy6522.TIMER1_COUNTER.w = pMB->sy6522.TIMER1_LATCH.w;
|
pMB->sy6522.TIMER1_COUNTER.w = pMB->sy6522.TIMER1_LATCH.w;
|
||||||
|
|
||||||
StartTimer1(pMB);
|
StartTimer1(pMB);
|
||||||
|
CpuAdjustIrqCheck(pMB->sy6522.TIMER1_LATCH.w); // Sync IRQ check timeout with 6522 counter underflow - GH#608
|
||||||
break;
|
break;
|
||||||
case 0x07: // TIMER1H_LATCH
|
case 0x07: // TIMER1H_LATCH
|
||||||
// Clear Timer1 Interrupt Flag.
|
// Clear Timer1 Interrupt Flag.
|
||||||
@ -444,6 +445,7 @@ static void SY6522_Write(BYTE nDevice, BYTE nReg, BYTE nValue)
|
|||||||
pMB->sy6522.TIMER2_COUNTER.w = pMB->sy6522.TIMER2_LATCH.w;
|
pMB->sy6522.TIMER2_COUNTER.w = pMB->sy6522.TIMER2_LATCH.w;
|
||||||
|
|
||||||
StartTimer2(pMB);
|
StartTimer2(pMB);
|
||||||
|
CpuAdjustIrqCheck(pMB->sy6522.TIMER1_LATCH.w); // Sync IRQ check timeout with 6522 counter underflow - GH#608
|
||||||
break;
|
break;
|
||||||
case 0x0a: // SERIAL_SHIFT
|
case 0x0a: // SERIAL_SHIFT
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user