ISystemAppletProxy.cs 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. using Ryujinx.HLE.HOS.Ipc;
  2. using System.Collections.Generic;
  3. namespace Ryujinx.HLE.HOS.Services.Am
  4. {
  5. class ISystemAppletProxy : IpcService
  6. {
  7. private Dictionary<int, ServiceProcessRequest> _commands;
  8. public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => _commands;
  9. public ISystemAppletProxy()
  10. {
  11. _commands = new Dictionary<int, ServiceProcessRequest>
  12. {
  13. { 0, GetCommonStateGetter },
  14. { 1, GetSelfController },
  15. { 2, GetWindowController },
  16. { 3, GetAudioController },
  17. { 4, GetDisplayController },
  18. { 11, GetLibraryAppletCreator },
  19. { 20, GetHomeMenuFunctions },
  20. { 21, GetGlobalStateController },
  21. { 22, GetApplicationCreator },
  22. { 1000, GetDebugFunctions }
  23. };
  24. }
  25. public long GetCommonStateGetter(ServiceCtx context)
  26. {
  27. MakeObject(context, new ICommonStateGetter(context.Device.System));
  28. return 0;
  29. }
  30. public long GetSelfController(ServiceCtx context)
  31. {
  32. MakeObject(context, new ISelfController(context.Device.System));
  33. return 0;
  34. }
  35. public long GetWindowController(ServiceCtx context)
  36. {
  37. MakeObject(context, new IWindowController());
  38. return 0;
  39. }
  40. public long GetAudioController(ServiceCtx context)
  41. {
  42. MakeObject(context, new IAudioController());
  43. return 0;
  44. }
  45. public long GetDisplayController(ServiceCtx context)
  46. {
  47. MakeObject(context, new IDisplayController());
  48. return 0;
  49. }
  50. public long GetLibraryAppletCreator(ServiceCtx context)
  51. {
  52. MakeObject(context, new ILibraryAppletCreator());
  53. return 0;
  54. }
  55. public long GetHomeMenuFunctions(ServiceCtx context)
  56. {
  57. MakeObject(context, new IHomeMenuFunctions(context.Device.System));
  58. return 0;
  59. }
  60. public long GetGlobalStateController(ServiceCtx context)
  61. {
  62. MakeObject(context, new IGlobalStateController());
  63. return 0;
  64. }
  65. public long GetApplicationCreator(ServiceCtx context)
  66. {
  67. MakeObject(context, new IApplicationCreator());
  68. return 0;
  69. }
  70. public long GetDebugFunctions(ServiceCtx context)
  71. {
  72. MakeObject(context, new IDebugFunctions());
  73. return 0;
  74. }
  75. }
  76. }