diff --git a/src/devices/video/EmuNV2A_PTIMER.cpp b/src/devices/video/EmuNV2A_PTIMER.cpp index db3b0777b..c78ea1554 100644 --- a/src/devices/video/EmuNV2A_PTIMER.cpp +++ b/src/devices/video/EmuNV2A_PTIMER.cpp @@ -12,7 +12,7 @@ static inline uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c) rl = (uint64_t)u.l.low * (uint64_t)b; rh = (uint64_t)u.l.high * (uint64_t)b; rh += (rl >> 32); - res.l.high = rh / c; + res.l.high = (uint32_t)rh / c; res.l.low = (((rh % c) << 32) + (rl & 0xffffffff)) / c; return res.ll; } @@ -21,10 +21,10 @@ static inline uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c) static uint64_t ptimer_get_clock(NV2AState * d) { // Get time in nanoseconds - long int time = static_cast(std::chrono::duration_cast(std::chrono::high_resolution_clock::now().time_since_epoch()).count()); + uint64_t time = std::chrono::duration_cast(std::chrono::high_resolution_clock::now().time_since_epoch()).count(); return muldiv64(time, - d->pramdac.core_clock_freq * d->ptimer.numerator, + uint32_t(d->pramdac.core_clock_freq * d->ptimer.numerator), CLOCKS_PER_SEC * d->ptimer.denominator); }