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:
parent
d254548548
commit
54b79dffa8
13 changed files with 518 additions and 205 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue