ISelfController.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. };
  21. }
  22. public long LockExit(ServiceCtx Context)
  23. {
  24. return 0;
  25. }
  26. public long SetScreenShotPermission(ServiceCtx Context)
  27. {
  28. bool Enable = Context.RequestData.ReadByte() != 0 ? true : false;
  29. return 0;
  30. }
  31. public long SetOperationModeChangedNotification(ServiceCtx Context)
  32. {
  33. bool Enable = Context.RequestData.ReadByte() != 0 ? true : false;
  34. return 0;
  35. }
  36. public long SetPerformanceModeChangedNotification(ServiceCtx Context)
  37. {
  38. bool Enable = Context.RequestData.ReadByte() != 0 ? true : false;
  39. return 0;
  40. }
  41. public long SetFocusHandlingMode(ServiceCtx Context)
  42. {
  43. bool Flag1 = Context.RequestData.ReadByte() != 0 ? true : false;
  44. bool Flag2 = Context.RequestData.ReadByte() != 0 ? true : false;
  45. bool Flag3 = Context.RequestData.ReadByte() != 0 ? true : false;
  46. return 0;
  47. }
  48. public long SetRestartMessageEnabled(ServiceCtx Context)
  49. {
  50. bool Enable = Context.RequestData.ReadByte() != 0 ? true : false;
  51. return 0;
  52. }
  53. public long SetOutOfFocusSuspendingEnabled(ServiceCtx Context)
  54. {
  55. bool Enable = Context.RequestData.ReadByte() != 0 ? true : false;
  56. return 0;
  57. }
  58. }
  59. }