IApplicationProxy.cs 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. using Ryujinx.OsHle.Ipc;
  2. using Ryujinx.OsHle.Objects.Am;
  3. using System.Collections.Generic;
  4. using static Ryujinx.OsHle.Objects.ObjHelper;
  5. namespace Ryujinx.OsHle.Objects
  6. {
  7. class IApplicationProxy : IIpcInterface
  8. {
  9. private Dictionary<int, ServiceProcessRequest> m_Commands;
  10. public IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands;
  11. public IApplicationProxy()
  12. {
  13. m_Commands = new Dictionary<int, ServiceProcessRequest>()
  14. {
  15. { 0, GetCommonStateGetter },
  16. { 1, GetSelfController },
  17. { 2, GetWindowController },
  18. { 3, GetAudioController },
  19. { 4, GetDisplayController },
  20. { 11, GetLibraryAppletCreator },
  21. { 20, GetApplicationFunctions },
  22. { 1000, GetDebugFunctions }
  23. };
  24. }
  25. public long GetCommonStateGetter(ServiceCtx Context)
  26. {
  27. MakeObject(Context, new ICommonStateGetter());
  28. return 0;
  29. }
  30. public long GetSelfController(ServiceCtx Context)
  31. {
  32. MakeObject(Context, new ISelfController());
  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 GetApplicationFunctions(ServiceCtx Context)
  56. {
  57. MakeObject(Context, new IApplicationFunctions());
  58. return 0;
  59. }
  60. public long GetDebugFunctions(ServiceCtx Context)
  61. {
  62. MakeObject(Context, new IDebugFunctions());
  63. return 0;
  64. }
  65. }
  66. }