diff options
author | bunnei <bunneidev@gmail.com> | 2019-12-23 00:10:59 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2020-01-04 19:48:30 +0100 |
commit | fab2607c6bae25f50912b32e1cbbfb5a6191916c (patch) | |
tree | bdcff3de0871a546f8e1399a6b1ba2869a569d04 /src/core/hle/service/time/standard_network_system_clock_core.h | |
parent | system_archive: Add a basic HLE implementation for time zone binary. (diff) | |
download | yuzu-fab2607c6bae25f50912b32e1cbbfb5a6191916c.tar yuzu-fab2607c6bae25f50912b32e1cbbfb5a6191916c.tar.gz yuzu-fab2607c6bae25f50912b32e1cbbfb5a6191916c.tar.bz2 yuzu-fab2607c6bae25f50912b32e1cbbfb5a6191916c.tar.lz yuzu-fab2607c6bae25f50912b32e1cbbfb5a6191916c.tar.xz yuzu-fab2607c6bae25f50912b32e1cbbfb5a6191916c.tar.zst yuzu-fab2607c6bae25f50912b32e1cbbfb5a6191916c.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/time/standard_network_system_clock_core.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/core/hle/service/time/standard_network_system_clock_core.h b/src/core/hle/service/time/standard_network_system_clock_core.h index 467285160..3f505c37c 100644 --- a/src/core/hle/service/time/standard_network_system_clock_core.h +++ b/src/core/hle/service/time/standard_network_system_clock_core.h @@ -8,6 +8,10 @@ #include "core/hle/service/time/steady_clock_core.h" #include "core/hle/service/time/system_clock_core.h" +namespace Core { +class System; +} + namespace Service::Time::Clock { class StandardNetworkSystemClockCore final : public SystemClockCore { @@ -19,6 +23,22 @@ public: standard_network_clock_sufficient_accuracy = value; } + bool IsStandardNetworkSystemClockAccuracySufficient(Core::System& system) { + SystemClockContext context{}; + if (GetClockContext(system, context) != RESULT_SUCCESS) { + return {}; + } + + s64 span{}; + if (context.steady_time_point.GetSpanBetween( + GetSteadyClockCore().GetCurrentTimePoint(system), span) != RESULT_SUCCESS) { + return {}; + } + + return TimeSpanType{span}.nanoseconds < + standard_network_clock_sufficient_accuracy.nanoseconds; + } + private: TimeSpanType standard_network_clock_sufficient_accuracy{}; }; |