IApplicationProxy.cs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. using Ryujinx.HLE.OsHle.Ipc;
  2. using System.Collections.Generic;
  3. namespace Ryujinx.HLE.OsHle.Services.Am
  4. {
  5. class IApplicationProxy : IpcService
  6. {
  7. private Dictionary<int, ServiceProcessRequest> m_Commands;
  8. public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands;
  9. public IApplicationProxy()
  10. {
  11. m_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());
  26. return 0;
  27. }
  28. public long GetSelfController(ServiceCtx Context)
  29. {
  30. MakeObject(Context, new ISelfController());
  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. }