m68705: fix prescaler update (nw)

Restore the proper behaviour of the timer.
This commit is contained in:
Patrick Mackinlay 2019-05-05 14:23:54 +07:00
parent 50d7af6b86
commit cec68f5a61

View File

@ -917,7 +917,7 @@ void m6805_timer::update(unsigned count)
return;
// compute new prescaler value and counter decrements
unsigned const prescale = m_prescale + ((m_source == TIMER) ? m_timer_edges : count);
unsigned const prescale = (m_prescale & ((1 << m_divisor) - 1)) + ((m_source == TIMER) ? m_timer_edges : count);
unsigned const decrements(prescale >> m_divisor);
// check for zero crossing