IRequest.cs 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. using Ryujinx.Common.Logging;
  2. using Ryujinx.HLE.HOS.Ipc;
  3. using System.Collections.Generic;
  4. namespace Ryujinx.HLE.HOS.Services.Mm
  5. {
  6. class IRequest : IpcService
  7. {
  8. private Dictionary<int, ServiceProcessRequest> _commands;
  9. public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => _commands;
  10. public IRequest()
  11. {
  12. _commands = new Dictionary<int, ServiceProcessRequest>()
  13. {
  14. { 0, InitializeOld },
  15. { 1, FinalizeOld },
  16. { 2, SetAndWaitOld },
  17. { 3, GetOld },
  18. { 4, Initialize },
  19. { 5, Finalize },
  20. { 6, SetAndWait },
  21. { 7, Get }
  22. };
  23. }
  24. // InitializeOld(u32, u32, u32)
  25. public long InitializeOld(ServiceCtx context)
  26. {
  27. int unknown0 = context.RequestData.ReadInt32();
  28. int unknown1 = context.RequestData.ReadInt32();
  29. int unknown2 = context.RequestData.ReadInt32();
  30. Logger.PrintStub(LogClass.ServiceMm, new { unknown0, unknown1, unknown2 });
  31. return 0;
  32. }
  33. // FinalizeOld(u32)
  34. public long FinalizeOld(ServiceCtx context)
  35. {
  36. context.Device.Gpu.UninitializeVideoDecoder();
  37. Logger.PrintStub(LogClass.ServiceMm);
  38. return 0;
  39. }
  40. // SetAndWaitOld(u32, u32, u32)
  41. public long SetAndWaitOld(ServiceCtx context)
  42. {
  43. int unknown0 = context.RequestData.ReadInt32();
  44. int unknown1 = context.RequestData.ReadInt32();
  45. int unknown2 = context.RequestData.ReadInt32();
  46. Logger.PrintStub(LogClass.ServiceMm, new { unknown0, unknown1, unknown2 });
  47. return 0;
  48. }
  49. // GetOld(u32) -> u32
  50. public long GetOld(ServiceCtx context)
  51. {
  52. int unknown0 = context.RequestData.ReadInt32();
  53. Logger.PrintStub(LogClass.ServiceMm, new { unknown0 });
  54. context.ResponseData.Write(0);
  55. return 0;
  56. }
  57. // Initialize()
  58. public long Initialize(ServiceCtx context)
  59. {
  60. Logger.PrintStub(LogClass.ServiceMm);
  61. return 0;
  62. }
  63. // Finalize(u32)
  64. public long Finalize(ServiceCtx context)
  65. {
  66. context.Device.Gpu.UninitializeVideoDecoder();
  67. Logger.PrintStub(LogClass.ServiceMm);
  68. return 0;
  69. }
  70. // SetAndWait(u32, u32, u32)
  71. public long SetAndWait(ServiceCtx context)
  72. {
  73. int unknown0 = context.RequestData.ReadInt32();
  74. int unknown1 = context.RequestData.ReadInt32();
  75. int unknown2 = context.RequestData.ReadInt32();
  76. Logger.PrintStub(LogClass.ServiceMm, new { unknown0, unknown1, unknown2 });
  77. return 0;
  78. }
  79. // Get(u32) -> u32
  80. public long Get(ServiceCtx context)
  81. {
  82. int unknown0 = context.RequestData.ReadInt32();
  83. Logger.PrintStub(LogClass.ServiceMm, new { unknown0 });
  84. context.ResponseData.Write(0);
  85. return 0;
  86. }
  87. }
  88. }