IApplicationProxy.cs 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. using Ryujinx.HLE.HOS.Ipc;
  2. using System.Collections.Generic;
  3. namespace Ryujinx.HLE.HOS.Services.Am
  4. {
  5. class IApplicationProxy : IpcService
  6. {
  7. private Dictionary<int, ServiceProcessRequest> _commands;
  8. public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => _commands;
  9. public IApplicationProxy()
  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, GetApplicationFunctions },
  20. { 1000, GetDebugFunctions }
  21. };
  22. }
  23. public long GetCommonStateGetter(ServiceCtx context)
  24. {
  25. MakeObject(context, new ICommonStateGetter(context.Device.System));
  26. return 0;
  27. }
  28. public long GetSelfController(ServiceCtx context)
  29. {
  30. MakeObject(context, new ISelfController(context.Device.System));
  31. return 0;
  32. }
  33. public long GetWindowController(ServiceCtx context)
  34. {
  35. MakeObject(context, new IWindowController());
  36. return 0;
  37. }
  38. public long GetAudioController(ServiceCtx context)
  39. {
  40. MakeObject(context, new IAudioController());
  41. return 0;
  42. }
  43. public long GetDisplayController(ServiceCtx context)
  44. {
  45. MakeObject(context, new IDisplayController());
  46. return 0;
  47. }
  48. public long GetLibraryAppletCreator(ServiceCtx context)
  49. {
  50. MakeObject(context, new ILibraryAppletCreator());
  51. return 0;
  52. }
  53. public long GetApplicationFunctions(ServiceCtx context)
  54. {
  55. MakeObject(context, new IApplicationFunctions());
  56. return 0;
  57. }
  58. public long GetDebugFunctions(ServiceCtx context)
  59. {
  60. MakeObject(context, new IDebugFunctions());
  61. return 0;
  62. }
  63. }
  64. }