aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Services/Time/IStaticService.cs
diff options
context:
space:
mode:
authorAc_K <Acoustik666@gmail.com>2019-07-12 03:13:43 +0200
committergdkchan <gab.dark.100@gmail.com>2019-07-11 22:13:43 -0300
commit560ccbeb2d55a4426ad2827bf7534d4a695431c2 (patch)
tree7e224acbd6c023ea56ff80c6207aa0966aa06ee5 /Ryujinx.HLE/HOS/Services/Time/IStaticService.cs
parentf723f6f39aaf7b1cebc0224a055058d62e3b689c (diff)
Refactoring commands handling (#728)
* Refactoring commands handling - Use Reflection to handle commands ID. - Add all symbols (from SwIPC so not all time accurate). - Re-sort some services commands methods. - Some cleanup. - Keep some empty constructor for consistency. * Fix order in IProfile
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/Time/IStaticService.cs')
-rw-r--r--Ryujinx.HLE/HOS/Services/Time/IStaticService.cs39
1 files changed, 8 insertions, 31 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Time/IStaticService.cs b/Ryujinx.HLE/HOS/Services/Time/IStaticService.cs
index 1406c2b5..f45b6c25 100644
--- a/Ryujinx.HLE/HOS/Services/Time/IStaticService.cs
+++ b/Ryujinx.HLE/HOS/Services/Time/IStaticService.cs
@@ -1,7 +1,6 @@
using Ryujinx.HLE.HOS.Ipc;
using Ryujinx.HLE.HOS.Kernel.Common;
using System;
-using System.Collections.Generic;
namespace Ryujinx.HLE.HOS.Services.Time
{
@@ -12,39 +11,11 @@ namespace Ryujinx.HLE.HOS.Services.Time
{
private int _timeSharedMemoryNativeHandle = 0;
- private Dictionary<int, ServiceProcessRequest> _commands;
-
- public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => _commands;
-
private static readonly DateTime StartupDate = DateTime.UtcNow;
- public IStaticService(ServiceCtx context)
- {
- _commands = new Dictionary<int, ServiceProcessRequest>
- {
- { 0, GetStandardUserSystemClock },
- { 1, GetStandardNetworkSystemClock },
- { 2, GetStandardSteadyClock },
- { 3, GetTimeZoneService },
- { 4, GetStandardLocalSystemClock },
- //{ 5, GetEphemeralNetworkSystemClock }, // 4.0.0+
- { 20, GetSharedMemoryNativeHandle }, // 6.0.0+
- //{ 30, GetStandardNetworkClockOperationEventReadableHandle }, // 6.0.0+
- //{ 31, GetEphemeralNetworkClockOperationEventReadableHandle }, // 6.0.0+
- //{ 50, SetStandardSteadyClockInternalOffset }, // 4.0.0+
- //{ 100, IsStandardUserSystemClockAutomaticCorrectionEnabled },
- //{ 101, SetStandardUserSystemClockAutomaticCorrectionEnabled },
- //{ 102, GetStandardUserSystemClockInitialYear }, // 5.0.0+
- //{ 200, IsStandardNetworkSystemClockAccuracySufficient }, // 3.0.0+
- //{ 201, GetStandardUserSystemClockAutomaticCorrectionUpdatedTime }, // 6.0.0+
- { 300, CalculateMonotonicSystemClockBaseTimePoint }, // 4.0.0+
- //{ 400, GetClockSnapshot }, // 4.0.0+
- //{ 401, GetClockSnapshotFromSystemClockContext }, // 4.0.0+
- //{ 500, CalculateStandardUserSystemClockDifferenceByUser }, // 4.0.0+
- //{ 501, CalculateSpanBetween }, // 4.0.0+
- };
- }
+ public IStaticService(ServiceCtx context) { }
+ [Command(0)]
// GetStandardUserSystemClock() -> object<nn::timesrv::detail::service::ISystemClock>
public long GetStandardUserSystemClock(ServiceCtx context)
{
@@ -53,6 +24,7 @@ namespace Ryujinx.HLE.HOS.Services.Time
return 0;
}
+ [Command(1)]
// GetStandardNetworkSystemClock() -> object<nn::timesrv::detail::service::ISystemClock>
public long GetStandardNetworkSystemClock(ServiceCtx context)
{
@@ -61,6 +33,7 @@ namespace Ryujinx.HLE.HOS.Services.Time
return 0;
}
+ [Command(2)]
// GetStandardSteadyClock() -> object<nn::timesrv::detail::service::ISteadyClock>
public long GetStandardSteadyClock(ServiceCtx context)
{
@@ -69,6 +42,7 @@ namespace Ryujinx.HLE.HOS.Services.Time
return 0;
}
+ [Command(3)]
// GetTimeZoneService() -> object<nn::timesrv::detail::service::ITimeZoneService>
public long GetTimeZoneService(ServiceCtx context)
{
@@ -77,6 +51,7 @@ namespace Ryujinx.HLE.HOS.Services.Time
return 0;
}
+ [Command(4)]
// GetStandardLocalSystemClock() -> object<nn::timesrv::detail::service::ISystemClock>
public long GetStandardLocalSystemClock(ServiceCtx context)
{
@@ -85,6 +60,7 @@ namespace Ryujinx.HLE.HOS.Services.Time
return 0;
}
+ [Command(20)] // 6.0.0+
// GetSharedMemoryNativeHandle() -> handle<copy>
public long GetSharedMemoryNativeHandle(ServiceCtx context)
{
@@ -101,6 +77,7 @@ namespace Ryujinx.HLE.HOS.Services.Time
return 0;
}
+ [Command(300)] // 4.0.0+
// CalculateMonotonicSystemClockBaseTimePoint(nn::time::SystemClockContext) -> u64
public long CalculateMonotonicSystemClockBaseTimePoint(ServiceCtx context)
{