core, slightly increase accuracy of some hw timers

This commit is contained in:
kub 2024-03-02 10:36:49 +01:00
parent 506adbd5eb
commit 80f51a1d59
2 changed files with 4 additions and 4 deletions

View file

@ -97,9 +97,9 @@ void m68k_comm_check(u32 a)
u32 pcd_stopwatch_read(int sub)
{
// ugh..
// ugh... stopwatch runs 384 cycles per step, divide by mult with inverse
u32 d = sub ? SekCyclesDoneS68k() : pcd_cycles_m68k_to_s68k(SekCyclesDone());
d = (d - Pico_mcd->m.stopwatch_base_c) / 384;
d = ((d - Pico_mcd->m.stopwatch_base_c) * ((1LL << 32) / 384)) >> 32;
return d & 0x0fff;
}