AudIAudioRenderer.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using Ryujinx.OsHle.Handles;
  2. using Ryujinx.OsHle.Ipc;
  3. namespace Ryujinx.OsHle.Objects
  4. {
  5. class AudIAudioRenderer
  6. {
  7. public static long RequestUpdateAudioRenderer(ServiceCtx Context)
  8. {
  9. //buffer < unknown, 5, 0 >) -> (buffer < unknown, 6, 0 >, buffer < unknown, 6, 0 >
  10. long Position = Context.Request.ReceiveBuff[0].Position;
  11. //0x40 bytes header
  12. Context.Memory.WriteInt32(Position + 0x4, 0xb0); //Behavior Out State Size? (note: this is the last section)
  13. Context.Memory.WriteInt32(Position + 0x8, 0x18e0); //Memory Pool Out State Size?
  14. Context.Memory.WriteInt32(Position + 0xc, 0x600); //Voice Out State Size?
  15. Context.Memory.WriteInt32(Position + 0x14, 0xe0); //Effect Out State Size?
  16. Context.Memory.WriteInt32(Position + 0x1c, 0x20); //Sink Out State Size?
  17. Context.Memory.WriteInt32(Position + 0x20, 0x10); //Performance Out State Size?
  18. Context.Memory.WriteInt32(Position + 0x3c, 0x20e0); //Total Size (including 0x40 bytes header)
  19. for (int Offset = 0x40; Offset < 0x40 + 0x18e0; Offset += 0x10)
  20. {
  21. Context.Memory.WriteInt32(Position + Offset, 5);
  22. }
  23. return 0;
  24. }
  25. public static long StartAudioRenderer(ServiceCtx Context)
  26. {
  27. return 0;
  28. }
  29. public static long StopAudioRenderer(ServiceCtx Context)
  30. {
  31. return 0;
  32. }
  33. public static long QuerySystemEvent(ServiceCtx Context)
  34. {
  35. int Handle = Context.Ns.Os.Handles.GenerateId(new HEvent());
  36. Context.Response.HandleDesc = IpcHandleDesc.MakeCopy(Handle);
  37. return 0;
  38. }
  39. }
  40. }