From 54b79dffa8eafe9da9765329930e8832ae90ae83 Mon Sep 17 00:00:00 2001 From: Thomas Guillemard Date: Thu, 25 Jul 2019 16:44:51 +0200 Subject: Implement time:* 4.0.0 commands (#736) * Abstract SteadyClockCore to follow Nintendo changes in 4.x This is the ground work for 4.0.0 support * Implement TickBasedSteadyClockCore Preparation for the ephemeral clock. * Refactor SystemClockCore to follow 4.0.0 changes * Implement EphemeralNetworkSystemClock * Implement GetSnapshotClock & GetSnapshotClockFromSystemClockContext * Implement CalculateStandardUserSystemClockDifferenceByUser & CalculateSpanBetween * Remove an outdated comment & unused import * Fix a nit and GetClockSnapshot * Address comment --- .../Time/Clock/StandardLocalSystemClockCore.cs | 42 ++++------------------ 1 file changed, 6 insertions(+), 36 deletions(-) (limited to 'Ryujinx.HLE/HOS/Services/Time/Clock/StandardLocalSystemClockCore.cs') diff --git a/Ryujinx.HLE/HOS/Services/Time/Clock/StandardLocalSystemClockCore.cs b/Ryujinx.HLE/HOS/Services/Time/Clock/StandardLocalSystemClockCore.cs index 16550199..a1727976 100644 --- a/Ryujinx.HLE/HOS/Services/Time/Clock/StandardLocalSystemClockCore.cs +++ b/Ryujinx.HLE/HOS/Services/Time/Clock/StandardLocalSystemClockCore.cs @@ -1,34 +1,23 @@ -using Ryujinx.HLE.HOS.Kernel.Threading; - -namespace Ryujinx.HLE.HOS.Services.Time.Clock +namespace Ryujinx.HLE.HOS.Services.Time.Clock { class StandardLocalSystemClockCore : SystemClockCore { - private SteadyClockCore _steadyClockCore; - private SystemClockContext _context; - - private static StandardLocalSystemClockCore instance; + private static StandardLocalSystemClockCore _instance; public static StandardLocalSystemClockCore Instance { get { - if (instance == null) + if (_instance == null) { - instance = new StandardLocalSystemClockCore(SteadyClockCore.Instance); + _instance = new StandardLocalSystemClockCore(StandardSteadyClockCore.Instance); } - return instance; + return _instance; } } - public StandardLocalSystemClockCore(SteadyClockCore steadyClockCore) - { - _steadyClockCore = steadyClockCore; - _context = new SystemClockContext(); - - _context.SteadyTimePoint.ClockSourceId = steadyClockCore.GetClockSourceId(); - } + public StandardLocalSystemClockCore(StandardSteadyClockCore steadyClockCore) : base(steadyClockCore) {} public override ResultCode Flush(SystemClockContext context) { @@ -36,24 +25,5 @@ namespace Ryujinx.HLE.HOS.Services.Time.Clock return ResultCode.Success; } - - public override SteadyClockCore GetSteadyClockCore() - { - return _steadyClockCore; - } - - public override ResultCode GetSystemClockContext(KThread thread, out SystemClockContext context) - { - context = _context; - - return ResultCode.Success; - } - - public override ResultCode SetSystemClockContext(SystemClockContext context) - { - _context = context; - - return ResultCode.Success; - } } } -- cgit v1.2.3