From 72af6e8ae4d202e681167b78ed0f9b1b60ca574f Mon Sep 17 00:00:00 2001 From: Exverge Date: Sat, 6 Jul 2024 15:18:22 -0400 Subject: [PATCH] Hardcode frequency on Apple Silicon On Apple Silicon, PPCTimer estimates a terribily inaccurate RSTSC frequency and results in games (specifically tested Color Splash & MK8) run extremely fast especially in the title screens which unsurpisingly doesn't work that well. The value hardcoded is the same frequency as on Rosetta. Admittedly this probably isn't the best solution however it is accurate and it works. --- src/util/highresolutiontimer/HighResolutionTimer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/util/highresolutiontimer/HighResolutionTimer.cpp b/src/util/highresolutiontimer/HighResolutionTimer.cpp index 67ffa349..de144b32 100644 --- a/src/util/highresolutiontimer/HighResolutionTimer.cpp +++ b/src/util/highresolutiontimer/HighResolutionTimer.cpp @@ -27,6 +27,8 @@ uint64 HighResolutionTimer::m_freq = []() -> uint64 { LARGE_INTEGER freq; QueryPerformanceFrequency(&freq); return (uint64)(freq.QuadPart); +#elif BOOST_OS_MACOS && defined(__arm64__) + return 1000000000; #else timespec pc; clock_getres(CLOCK_MONOTONIC_RAW, &pc);