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
This commit is contained in:
Thomas Guillemard
2019-07-25 16:44:51 +02:00
committed by gdkchan
parent d254548548
commit 54b79dffa8
13 changed files with 518 additions and 205 deletions

View File

@ -8,22 +8,22 @@ namespace Ryujinx.HLE.HOS.Services.Time.Clock
private StandardNetworkSystemClockCore _networkSystemClockCore;
private bool _autoCorrectionEnabled;
private static StandardUserSystemClockCore instance;
private static StandardUserSystemClockCore _instance;
public static StandardUserSystemClockCore Instance
{
get
{
if (instance == null)
if (_instance == null)
{
instance = new StandardUserSystemClockCore(StandardLocalSystemClockCore.Instance, StandardNetworkSystemClockCore.Instance);
_instance = new StandardUserSystemClockCore(StandardLocalSystemClockCore.Instance, StandardNetworkSystemClockCore.Instance);
}
return instance;
return _instance;
}
}
public StandardUserSystemClockCore(StandardLocalSystemClockCore localSystemClockCore, StandardNetworkSystemClockCore networkSystemClockCore)
public StandardUserSystemClockCore(StandardLocalSystemClockCore localSystemClockCore, StandardNetworkSystemClockCore networkSystemClockCore) : base(localSystemClockCore.GetSteadyClockCore())
{
_localSystemClockCore = localSystemClockCore;
_networkSystemClockCore = networkSystemClockCore;
@ -35,11 +35,6 @@ namespace Ryujinx.HLE.HOS.Services.Time.Clock
return ResultCode.NotImplemented;
}
public override SteadyClockCore GetSteadyClockCore()
{
return _localSystemClockCore.GetSteadyClockCore();
}
public override ResultCode GetSystemClockContext(KThread thread, out SystemClockContext context)
{
ResultCode result = ApplyAutomaticCorrection(thread, false);