IApplicationProxy.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. using Ryujinx.Core.OsHle.Ipc;
  2. using System.Collections.Generic;
  3. using static Ryujinx.Core.OsHle.Objects.ObjHelper;
  4. namespace Ryujinx.Core.OsHle.Objects.Am
  5. {
  6. class IApplicationProxy : IIpcInterface
  7. {
  8. private Dictionary<int, ServiceProcessRequest> m_Commands;
  9. public IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands;
  10. public IApplicationProxy()
  11. {
  12. m_Commands = new Dictionary<int, ServiceProcessRequest>()
  13. {
  14. { 0, GetCommonStateGetter },
  15. { 1, GetSelfController },
  16. { 2, GetWindowController },
  17. { 3, GetAudioController },
  18. { 4, GetDisplayController },
  19. { 11, GetLibraryAppletCreator },
  20. { 20, GetApplicationFunctions },
  21. { 1000, GetDebugFunctions }
  22. };
  23. }
  24. public long GetCommonStateGetter(ServiceCtx Context)
  25. {
  26. MakeObject(Context, new ICommonStateGetter());
  27. return 0;
  28. }
  29. public long GetSelfController(ServiceCtx Context)
  30. {
  31. MakeObject(Context, new ISelfController());
  32. return 0;
  33. }
  34. public long GetWindowController(ServiceCtx Context)
  35. {
  36. MakeObject(Context, new IWindowController());
  37. return 0;
  38. }
  39. public long GetAudioController(ServiceCtx Context)
  40. {
  41. MakeObject(Context, new IAudioController());
  42. return 0;
  43. }
  44. public long GetDisplayController(ServiceCtx Context)
  45. {
  46. MakeObject(Context, new IDisplayController());
  47. return 0;
  48. }
  49. public long GetLibraryAppletCreator(ServiceCtx Context)
  50. {
  51. MakeObject(Context, new ILibraryAppletCreator());
  52. return 0;
  53. }
  54. public long GetApplicationFunctions(ServiceCtx Context)
  55. {
  56. MakeObject(Context, new IApplicationFunctions());
  57. return 0;
  58. }
  59. public long GetDebugFunctions(ServiceCtx Context)
  60. {
  61. MakeObject(Context, new IDebugFunctions());
  62. return 0;
  63. }
  64. }
  65. }