diff options
author | Fernando S <fsahmkow27@gmail.com> | 2023-05-13 03:51:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-13 03:51:05 +0200 |
commit | 9c739f1506dd549df314ccef386218cdf2e5f3a8 (patch) | |
tree | c0149b204b55e2fc513462201d1911eb00ccccba /src/core/hle/service/time/time_sharedmemory.cpp | |
parent | Merge pull request #10243 from Kelebek1/red_dot (diff) | |
parent | time: implement ContinuousAdjustmentTimePoint (diff) | |
download | yuzu-9c739f1506dd549df314ccef386218cdf2e5f3a8.tar yuzu-9c739f1506dd549df314ccef386218cdf2e5f3a8.tar.gz yuzu-9c739f1506dd549df314ccef386218cdf2e5f3a8.tar.bz2 yuzu-9c739f1506dd549df314ccef386218cdf2e5f3a8.tar.lz yuzu-9c739f1506dd549df314ccef386218cdf2e5f3a8.tar.xz yuzu-9c739f1506dd549df314ccef386218cdf2e5f3a8.tar.zst yuzu-9c739f1506dd549df314ccef386218cdf2e5f3a8.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/time/time_sharedmemory.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/core/hle/service/time/time_sharedmemory.cpp b/src/core/hle/service/time/time_sharedmemory.cpp index ff53a7d6f..ce1c85bcc 100644 --- a/src/core/hle/service/time/time_sharedmemory.cpp +++ b/src/core/hle/service/time/time_sharedmemory.cpp @@ -30,6 +30,25 @@ void SharedMemory::SetupStandardSteadyClock(const Common::UUID& clock_source_id, } void SharedMemory::UpdateLocalSystemClockContext(const Clock::SystemClockContext& context) { + // lower and upper are related to the measurement point for the steady time point, + // and compare equal on boot + const s64 time_point_ns = context.steady_time_point.time_point * 1'000'000'000LL; + + // This adjusts for some sort of time skew + // Both 0 on boot + const s64 diff_scale = 0; + const u32 shift_amount = 0; + + const Clock::ContinuousAdjustmentTimePoint adjustment{ + .measurement_offset = system.CoreTiming().GetGlobalTimeNs().count(), + .diff_scale = diff_scale, + .shift_amount = shift_amount, + .lower = time_point_ns, + .upper = time_point_ns, + .clock_source_id = context.steady_time_point.clock_source_id, + }; + + StoreToLockFreeAtomicType(&GetFormat()->continuous_adjustment_timepoint, adjustment); StoreToLockFreeAtomicType(&GetFormat()->standard_local_system_clock_context, context); } |