mirror of
https://git.743378673.xyz/MeloNX/MeloNX.git
synced 2025-06-29 20:06:25 +02:00
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
|
@ -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();
|
||||
|
||||
public abstract ResultCode SetSystemClockContext(SystemClockContext context);
|
||||
_context.SteadyTimePoint.ClockSourceId = steadyClockCore.GetClockSourceId();
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue