aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Services/Time/Clock/StandardLocalSystemClockCore.cs
diff options
context:
space:
mode:
authorThomas Guillemard <me@thog.eu>2019-07-25 16:44:51 +0200
committergdkchan <gab.dark.100@gmail.com>2019-07-25 11:44:51 -0300
commit54b79dffa8eafe9da9765329930e8832ae90ae83 (patch)
tree1ba6b60288997c8ce21a72bbd28e3efb7b8db2d7 /Ryujinx.HLE/HOS/Services/Time/Clock/StandardLocalSystemClockCore.cs
parentd254548548398977a45dbfc03f2cc091c5a74f03 (diff)
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
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/Time/Clock/StandardLocalSystemClockCore.cs')
-rw-r--r--Ryujinx.HLE/HOS/Services/Time/Clock/StandardLocalSystemClockCore.cs42
1 files changed, 6 insertions, 36 deletions
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;
- }
}
}