mirror of
https://github.com/holub/mame
synced 2025-10-07 01:16:22 +03:00
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:
parent
844245bcf2
commit
293fb66d7f
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user