From f35fd80ebe15b0afe4167aa1382d0884a03ef8b4 Mon Sep 17 00:00:00 2001 From: PabloMK7 Date: Thu, 25 Jan 2024 23:50:17 +0100 Subject: [PATCH] Add HOST_TICK to svcGetSystemInfo CITRA_INFORMATION type --- src/core/hle/kernel/svc.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 4cc2c0ad0..126aea75f 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp @@ -4,6 +4,7 @@ #include #include +#include #include #include "common/archives.h" #include "common/logging/log.h" @@ -268,6 +269,7 @@ enum class SystemInfoMemUsageRegion { */ enum class SystemInfoCitraInformation { IS_CITRA = 0, // Always set the output to 1, signaling the app is running on Citra. + HOST_TICK = 1, // Tick reference from the host in ns, unaffected by lag or cpu speed. BUILD_NAME = 10, // (ie: Nightly, Canary). BUILD_VERSION = 11, // Build version. BUILD_DATE_PART1 = 20, // Build date first 7 characters. @@ -1740,6 +1742,11 @@ Result SVC::GetSystemInfo(s64* out, u32 type, s32 param) { case SystemInfoCitraInformation::IS_CITRA: *out = 1; break; + case SystemInfoCitraInformation::HOST_TICK: + *out = (s64)std::chrono::duration_cast( + std::chrono::steady_clock::now().time_since_epoch()) + .count(); + break; case SystemInfoCitraInformation::BUILD_NAME: CopyStringPart(reinterpret_cast(out), Common::g_build_name, 0, sizeof(s64)); break;