mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-07-30 17:49:57 -06:00
Some things for time:* (#211)
- Fully implement ISystemClock - Implement ISteadyClock 1.0 cmds - Add cmd 300 to IStaticService - Add EphemeralNetwork to SystemClockType
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
using Ryujinx.HLE.OsHle.Ipc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Ryujinx.HLE.OsHle.Services.Time
|
||||
@ -9,15 +10,18 @@ namespace Ryujinx.HLE.OsHle.Services.Time
|
||||
|
||||
public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands;
|
||||
|
||||
private static readonly DateTime StartupDate = DateTime.UtcNow;
|
||||
|
||||
public IStaticService()
|
||||
{
|
||||
m_Commands = new Dictionary<int, ServiceProcessRequest>()
|
||||
{
|
||||
{ 0, GetStandardUserSystemClock },
|
||||
{ 1, GetStandardNetworkSystemClock },
|
||||
{ 2, GetStandardSteadyClock },
|
||||
{ 3, GetTimeZoneService },
|
||||
{ 4, GetStandardLocalSystemClock }
|
||||
{ 0, GetStandardUserSystemClock },
|
||||
{ 1, GetStandardNetworkSystemClock },
|
||||
{ 2, GetStandardSteadyClock },
|
||||
{ 3, GetTimeZoneService },
|
||||
{ 4, GetStandardLocalSystemClock },
|
||||
{ 300, CalculateMonotonicSystemClockBaseTimePoint }
|
||||
};
|
||||
}
|
||||
|
||||
@ -56,5 +60,15 @@ namespace Ryujinx.HLE.OsHle.Services.Time
|
||||
return 0;
|
||||
}
|
||||
|
||||
public long CalculateMonotonicSystemClockBaseTimePoint(ServiceCtx Context)
|
||||
{
|
||||
long TimeOffset = (long)(DateTime.UtcNow - StartupDate).TotalSeconds;
|
||||
long SystemClockContextEpoch = Context.RequestData.ReadInt64();
|
||||
|
||||
Context.ResponseData.Write(TimeOffset + SystemClockContextEpoch);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user