6522: Fix IFR.T2 when counter.b15=1
This commit is contained in:
parent
c277c5152d
commit
514d2adb79
1 changed files with 4 additions and 2 deletions
|
@ -292,8 +292,10 @@ bool SY6522::IsTimer1Underflowed(BYTE reg)
|
||||||
|
|
||||||
bool SY6522::IsTimer2Underflowed(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
|
USHORT counter = m_regs.TIMER2_COUNTER.w; // NB. don't update the real T2C
|
||||||
return m_regs.TIMER2_COUNTER.w >= 0 && (short)GetTimer2Counter(reg) < 0;
|
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…
Add table
Reference in a new issue