From c105dcb93c0e40187592497eb901ea774d3adf8c Mon Sep 17 00:00:00 2001 From: Elad <18193363+elad335@users.noreply.github.com> Date: Sun, 21 Dec 2025 17:49:57 +0200 Subject: [PATCH] sysinfo.cpp: Relax TSC calibration constraints --- rpcs3/util/sysinfo.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/rpcs3/util/sysinfo.cpp b/rpcs3/util/sysinfo.cpp index 94563e8d10..b1b97cd3cd 100755 --- a/rpcs3/util/sysinfo.cpp +++ b/rpcs3/util/sysinfo.cpp @@ -812,17 +812,23 @@ static const bool s_tsc_freq_evaluated = []() -> bool } #ifdef _WIN32 - LARGE_INTEGER freq; + LARGE_INTEGER freq{}; if (!QueryPerformanceFrequency(&freq)) { return 0; } - if (freq.QuadPart <= 9'999'999) + if (!freq.QuadPart) { return 0; } + if (freq.QuadPart <= 50'000) + { + // Bad precision + return 0; + } + const ullong timer_freq = freq.QuadPart; #else @@ -890,7 +896,7 @@ static const bool s_tsc_freq_evaluated = []() -> bool const ullong sec_base = ts0.tv_sec; #endif - constexpr usz sleep_time_ms = 40; + const usz sleep_time_ms = timer_freq <= 300'000 ? (300'000 * 50) / timer_freq : 50; for (usz sample = 0; sample < sample_count; sample++) {