igs/igs027a.cpp: Corrected timer interval calculation. (#12759)
Some checks failed
Rebuild BGFX shaders / rebuild (push) Has been cancelled
CI (Linux) / build-linux (-U_FORTIFY_SOURCE, gcc, gcc, g++, mametiny, tiny) (push) Has been cancelled
CI (Linux) / build-linux (clang, clang, clang++, mame, mame) (push) Has been cancelled
CI (macOS) / build-macos (push) Has been cancelled
CI (Windows) / build-windows (clang, clang, clang++, mametiny, tiny) (push) Has been cancelled
CI (Windows) / build-windows (gcc, gcc, g++, mame, mame) (push) Has been cancelled
Build documentation / build-docs (push) Has been cancelled
XML/JSON validation / validate (push) Has been cancelled
Compile UI translations / build-language (push) Has been cancelled

Fixes slowdown in jking02.
This commit is contained in:
XingXing 2024-09-13 22:06:01 +08:00 committed by GitHub
parent 126e2e3f13
commit 1797664a33
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -87,7 +87,16 @@ template <unsigned N>
void igs027a_cpu_device::timer_rate_w(u8 data)
{
// TODO: determine how timer intervals are derived from clocks
m_irq_timers[N]->adjust(attotime::from_hz(data / 2), 0, attotime::from_hz(data / 2));
if (data)
{
constexpr u32 TIMER_DIVISOR = 4263;
auto period = attotime::from_ticks(TIMER_DIVISOR * (data + 1), clock());
m_irq_timers[N]->adjust(period, 0, period);
}
else
{
m_irq_timers[N]->adjust(attotime::never, 0, attotime::never);
}
}
u8 igs027a_cpu_device::irq_pending_r()