ISelfController.cs 3.1 KB

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