IStaticService.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using Ryujinx.Core.OsHle.Ipc;
  2. using System.Collections.Generic;
  3. namespace Ryujinx.Core.OsHle.Services.Time
  4. {
  5. class IStaticService : IpcService
  6. {
  7. private Dictionary<int, ServiceProcessRequest> m_Commands;
  8. public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands;
  9. public IStaticService()
  10. {
  11. m_Commands = new Dictionary<int, ServiceProcessRequest>()
  12. {
  13. { 0, GetStandardUserSystemClock },
  14. { 1, GetStandardNetworkSystemClock },
  15. { 2, GetStandardSteadyClock },
  16. { 3, GetTimeZoneService },
  17. { 4, GetStandardLocalSystemClock }
  18. };
  19. }
  20. public long GetStandardUserSystemClock(ServiceCtx Context)
  21. {
  22. MakeObject(Context, new ISystemClock(SystemClockType.User));
  23. return 0;
  24. }
  25. public long GetStandardNetworkSystemClock(ServiceCtx Context)
  26. {
  27. MakeObject(Context, new ISystemClock(SystemClockType.Network));
  28. return 0;
  29. }
  30. public long GetStandardSteadyClock(ServiceCtx Context)
  31. {
  32. MakeObject(Context, new ISteadyClock());
  33. return 0;
  34. }
  35. public long GetTimeZoneService(ServiceCtx Context)
  36. {
  37. MakeObject(Context, new ITimeZoneService());
  38. return 0;
  39. }
  40. public long GetStandardLocalSystemClock(ServiceCtx Context)
  41. {
  42. MakeObject(Context, new ISystemClock(SystemClockType.Local));
  43. return 0;
  44. }
  45. }
  46. }