From b0d96342e87ff28935f881e603337e2b00b84e59 Mon Sep 17 00:00:00 2001 From: fincs Date: Sat, 11 Apr 2020 00:08:46 +0200 Subject: [PATCH] time: Add timeGetStandardSteadyClockInternalOffset [3.0.0+] --- nx/include/switch/services/time.h | 7 +++++++ nx/source/services/time.c | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/nx/include/switch/services/time.h b/nx/include/switch/services/time.h index b570045f..fdcaa86f 100644 --- a/nx/include/switch/services/time.h +++ b/nx/include/switch/services/time.h @@ -96,6 +96,13 @@ void* timeGetSharedmemAddr(void); */ Result timeGetStandardSteadyClockTimePoint(TimeSteadyClockTimePoint *out); +/** + * @brief [3.0.0+] Gets the internal offset for the standard steady clock. + * @param[out] out Output internal offset. + * @return Result code. + */ +Result timeGetStandardSteadyClockInternalOffset(s64 *out); + /** * @brief Gets the time for the specified clock. * @param[in] type Clock to use. diff --git a/nx/source/services/time.c b/nx/source/services/time.c index 3a86a0b3..dabca8c5 100644 --- a/nx/source/services/time.c +++ b/nx/source/services/time.c @@ -170,6 +170,13 @@ Result timeGetStandardSteadyClockTimePoint(TimeSteadyClockTimePoint *out) { return 0; } +Result timeGetStandardSteadyClockInternalOffset(s64 *out) { + if (hosversionBefore(3,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return serviceDispatchOut(&g_timeSteadyClock, 200, *out); +} + Result timeGetCurrentTime(TimeType type, u64 *timestamp) { Service *srv = timeGetServiceSession_SystemClock(type);