mirror of
https://github.com/AppleWin/AppleWin.git
synced 2025-01-18 06:31:57 +00:00
6522: Fix IFR.T2 when counter.b15=1
This commit is contained in:
parent
c277c5152d
commit
514d2adb79
@ -292,8 +292,10 @@ bool SY6522::IsTimer1Underflowed(BYTE reg)
|
||||
|
||||
bool SY6522::IsTimer2Underflowed(BYTE reg)
|
||||
{
|
||||
// FIXME: "m_regs.TIMER2_COUNTER.w >= 0" is always true! So function returns true when GetTimer2Counter() returns with b15==1
|
||||
return m_regs.TIMER2_COUNTER.w >= 0 && (short)GetTimer2Counter(reg) < 0;
|
||||
USHORT counter = m_regs.TIMER2_COUNTER.w; // NB. don't update the real T2C
|
||||
int timerIrqDelay = m_timer2IrqDelay; // NB. don't update the real timer2IrqDelay
|
||||
const UINT opcodeCycleAdjust = GetOpcodeCyclesForRead(reg); // to compensate for the 4/5/6 cycle read opcode
|
||||
return CheckTimerUnderflow(counter, timerIrqDelay, opcodeCycleAdjust);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user