Prevent integer overflow in Z80 CTC device, which causes a runtime error on WebAssembly builds. [Justin Kerk]

(nw) The issue was introduced in fc20d899ab
This commit is contained in:
Justin Kerk 2019-03-31 22:29:51 +00:00
parent 844245bcf2
commit 293fb66d7f

View File

@ -373,7 +373,10 @@ u8 z80ctc_channel_device::read()
LOG("CTC clock %f\n", period.as_hz());
return u8((m_timer->remaining().as_double() / period.as_double()) + 1.0);
if(!m_timer->remaining().is_never())
return u8((m_timer->remaining().as_double() / period.as_double()) + 1.0);
else
return 0;
}
}