From 470a8031a44145f906b50919ce1a4e01d51c15ff Mon Sep 17 00:00:00 2001 From: Mary Date: Mon, 8 May 2023 00:15:58 +0200 Subject: time: Update for 15.0.0 changes and fixes long standing issues (#4822) * time: Update for 15.0.0 changes Last time we did an upgrade on the time service was during 9.x era, it was about time to take back that reverse again! 15.0.0 added a new structure on the shared memory to get steady clock raw timepoints with a granularity in nanoseconds. This commit implements this new part. I plan to write a follow up with a bit of refactoring of this ancient part of the emulator. As always, reverse and work done by your truly. PS: As a reminder, if this change is reused anywhere else, work should be credited as Ryujinx and not my person. * time: Do not set setup value to posix time This should fix local and network clock returning 0 under usage with shared memory. This probably fix #2430. * Address gdkchan's comment * Fix internal offset not working since changes and ensure that user clock have a valid clock id * time: Report auto correcting clock and hardcode steady clock unique id Fix Pokemon Sword Pokejobs for real. * Address gdkchan's comment --- .../Time/Clock/Types/ContinuousAdjustmentTimePoint.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/Ryujinx.HLE/HOS/Services/Time/Clock/Types/ContinuousAdjustmentTimePoint.cs (limited to 'src/Ryujinx.HLE/HOS/Services/Time/Clock') diff --git a/src/Ryujinx.HLE/HOS/Services/Time/Clock/Types/ContinuousAdjustmentTimePoint.cs b/src/Ryujinx.HLE/HOS/Services/Time/Clock/Types/ContinuousAdjustmentTimePoint.cs new file mode 100644 index 00000000..b57dfaa0 --- /dev/null +++ b/src/Ryujinx.HLE/HOS/Services/Time/Clock/Types/ContinuousAdjustmentTimePoint.cs @@ -0,0 +1,13 @@ +using System.Runtime.InteropServices; + +namespace Ryujinx.HLE.HOS.Services.Time.Clock.Types +{ + [StructLayout(LayoutKind.Sequential, Pack = 1)] + struct ContinuousAdjustmentTimePoint + { + public ulong ClockOffset; + public long Multiplier; + public long DivisorLog2; + public SystemClockContext Context; + } +} -- cgit v1.2.3