ISelfController.cs 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. using Ryujinx.Core.Logging;
  2. using Ryujinx.Core.OsHle.Ipc;
  3. using System.Collections.Generic;
  4. namespace Ryujinx.Core.OsHle.Services.Am
  5. {
  6. class ISelfController : IpcService
  7. {
  8. private Dictionary<int, ServiceProcessRequest> m_Commands;
  9. public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands;
  10. public ISelfController()
  11. {
  12. m_Commands = new Dictionary<int, ServiceProcessRequest>()
  13. {
  14. { 1, LockExit },
  15. { 10, SetScreenShotPermission },
  16. { 11, SetOperationModeChangedNotification },
  17. { 12, SetPerformanceModeChangedNotification },
  18. { 13, SetFocusHandlingMode },
  19. { 14, SetRestartMessageEnabled },
  20. { 16, SetOutOfFocusSuspendingEnabled },
  21. { 50, SetHandlesRequestToDisplay }
  22. };
  23. }
  24. public long LockExit(ServiceCtx Context)
  25. {
  26. return 0;
  27. }
  28. public long SetScreenShotPermission(ServiceCtx Context)
  29. {
  30. bool Enable = Context.RequestData.ReadByte() != 0 ? true : false;
  31. Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
  32. return 0;
  33. }
  34. public long SetOperationModeChangedNotification(ServiceCtx Context)
  35. {
  36. bool Enable = Context.RequestData.ReadByte() != 0 ? true : false;
  37. Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
  38. return 0;
  39. }
  40. public long SetPerformanceModeChangedNotification(ServiceCtx Context)
  41. {
  42. bool Enable = Context.RequestData.ReadByte() != 0 ? true : false;
  43. Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
  44. return 0;
  45. }
  46. public long SetFocusHandlingMode(ServiceCtx Context)
  47. {
  48. bool Flag1 = Context.RequestData.ReadByte() != 0 ? true : false;
  49. bool Flag2 = Context.RequestData.ReadByte() != 0 ? true : false;
  50. bool Flag3 = Context.RequestData.ReadByte() != 0 ? true : false;
  51. Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
  52. return 0;
  53. }
  54. public long SetRestartMessageEnabled(ServiceCtx Context)
  55. {
  56. bool Enable = Context.RequestData.ReadByte() != 0 ? true : false;
  57. Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
  58. return 0;
  59. }
  60. public long SetOutOfFocusSuspendingEnabled(ServiceCtx Context)
  61. {
  62. bool Enable = Context.RequestData.ReadByte() != 0 ? true : false;
  63. Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
  64. return 0;
  65. }
  66. public long SetHandlesRequestToDisplay(ServiceCtx Context)
  67. {
  68. bool Enable = Context.RequestData.ReadByte() != 0 ? true : false;
  69. Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
  70. return 0;
  71. }
  72. }
  73. }