aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Services/Time/Clock/SystemClockCore.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/SystemClockCore.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/SystemClockCore.cs')
-rw-r--r--Ryujinx.HLE/HOS/Services/Time/Clock/SystemClockCore.cs30
1 files changed, 27 insertions, 3 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Time/Clock/SystemClockCore.cs b/Ryujinx.HLE/HOS/Services/Time/Clock/SystemClockCore.cs
index d3a056e4..52f3c908 100644
--- a/Ryujinx.HLE/HOS/Services/Time/Clock/SystemClockCore.cs
+++ b/Ryujinx.HLE/HOS/Services/Time/Clock/SystemClockCore.cs
@@ -4,11 +4,35 @@ namespace Ryujinx.HLE.HOS.Services.Time.Clock
{
abstract class SystemClockCore
{
- public abstract SteadyClockCore GetSteadyClockCore();
+ private SteadyClockCore _steadyClockCore;
+ private SystemClockContext _context;
- public abstract ResultCode GetSystemClockContext(KThread thread, out SystemClockContext context);
+ public SystemClockCore(SteadyClockCore steadyClockCore)
+ {
+ _steadyClockCore = steadyClockCore;
+ _context = new SystemClockContext();
+
+ _context.SteadyTimePoint.ClockSourceId = steadyClockCore.GetClockSourceId();
+ }
- public abstract ResultCode SetSystemClockContext(SystemClockContext context);
+ public virtual SteadyClockCore GetSteadyClockCore()
+ {
+ return _steadyClockCore;
+ }
+
+ public virtual ResultCode GetSystemClockContext(KThread thread, out SystemClockContext context)
+ {
+ context = _context;
+
+ return ResultCode.Success;
+ }
+
+ public virtual ResultCode SetSystemClockContext(SystemClockContext context)
+ {
+ _context = context;
+
+ return ResultCode.Success;
+ }
public abstract ResultCode Flush(SystemClockContext context);