IRequest.cs 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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, $"Stubbed. Unknown0: {unknown0} - " +
  31. $"Unknown1: {unknown1} - Unknown2: {unknown2}");
  32. return 0;
  33. }
  34. // FinalizeOld(u32)
  35. public long FinalizeOld(ServiceCtx context)
  36. {
  37. context.Device.Gpu.UninitializeVideoDecoder();
  38. Logger.PrintStub(LogClass.ServiceMm, "Stubbed.");
  39. return 0;
  40. }
  41. // SetAndWaitOld(u32, u32, u32)
  42. public long SetAndWaitOld(ServiceCtx context)
  43. {
  44. int unknown0 = context.RequestData.ReadInt32();
  45. int unknown1 = context.RequestData.ReadInt32();
  46. int unknown2 = context.RequestData.ReadInt32();
  47. Logger.PrintStub(LogClass.ServiceMm, $"Stubbed. Unknown0: {unknown0} - " +
  48. $"Unknown1: {unknown1} - Unknown2: {unknown2}");
  49. return 0;
  50. }
  51. // GetOld(u32) -> u32
  52. public long GetOld(ServiceCtx context)
  53. {
  54. int unknown0 = context.RequestData.ReadInt32();
  55. Logger.PrintStub(LogClass.ServiceMm, $"Stubbed. Unknown0: {unknown0}");
  56. context.ResponseData.Write(0);
  57. return 0;
  58. }
  59. // Initialize()
  60. public long Initialize(ServiceCtx context)
  61. {
  62. Logger.PrintStub(LogClass.ServiceMm, "Stubbed.");
  63. return 0;
  64. }
  65. // Finalize(u32)
  66. public long Finalize(ServiceCtx context)
  67. {
  68. context.Device.Gpu.UninitializeVideoDecoder();
  69. Logger.PrintStub(LogClass.ServiceMm, "Stubbed.");
  70. return 0;
  71. }
  72. // SetAndWait(u32, u32, u32)
  73. public long SetAndWait(ServiceCtx context)
  74. {
  75. int unknown0 = context.RequestData.ReadInt32();
  76. int unknown1 = context.RequestData.ReadInt32();
  77. int unknown2 = context.RequestData.ReadInt32();
  78. Logger.PrintStub(LogClass.ServiceMm, $"Stubbed. Unknown0: {unknown0} - " +
  79. $"Unknown1: {unknown1} - Unknown2: {unknown2}");
  80. return 0;
  81. }
  82. // Get(u32) -> u32
  83. public long Get(ServiceCtx context)
  84. {
  85. int unknown0 = context.RequestData.ReadInt32();
  86. Logger.PrintStub(LogClass.ServiceMm, $"Stubbed. Unknown0: {unknown0}");
  87. context.ResponseData.Write(0);
  88. return 0;
  89. }
  90. }
  91. }