ServiceAud.cs 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. using ChocolArm64.Memory;
  2. using Ryujinx.Core.OsHle.Objects.Aud;
  3. using System.Text;
  4. using static Ryujinx.Core.OsHle.Objects.ObjHelper;
  5. namespace Ryujinx.Core.OsHle.Services
  6. {
  7. static partial class Service
  8. {
  9. public static long AudOutListAudioOuts(ServiceCtx Context)
  10. {
  11. long Position = Context.Request.ReceiveBuff[0].Position;
  12. AMemoryHelper.WriteBytes(Context.Memory, Position, Encoding.ASCII.GetBytes("iface"));
  13. Context.ResponseData.Write(1);
  14. return 0;
  15. }
  16. public static long AudOutOpenAudioOut(ServiceCtx Context)
  17. {
  18. MakeObject(Context, new IAudioOut());
  19. Context.ResponseData.Write(48000); //Sample Rate
  20. Context.ResponseData.Write(2); //Channel Count
  21. Context.ResponseData.Write(2); //PCM Format
  22. /*
  23. 0 - Invalid
  24. 1 - INT8
  25. 2 - INT16
  26. 3 - INT24
  27. 4 - INT32
  28. 5 - PCM Float
  29. 6 - ADPCM
  30. */
  31. Context.ResponseData.Write(0); //Unknown
  32. return 0;
  33. }
  34. public static long AudRenOpenAudioRenderer(ServiceCtx Context)
  35. {
  36. MakeObject(Context, new IAudioRenderer());
  37. return 0;
  38. }
  39. public static long AudRenGetAudioRendererWorkBufferSize(ServiceCtx Context)
  40. {
  41. int SampleRate = Context.RequestData.ReadInt32();
  42. int Unknown4 = Context.RequestData.ReadInt32();
  43. int Unknown8 = Context.RequestData.ReadInt32();
  44. int UnknownC = Context.RequestData.ReadInt32();
  45. int Unknown10 = Context.RequestData.ReadInt32();
  46. int Unknown14 = Context.RequestData.ReadInt32();
  47. int Unknown18 = Context.RequestData.ReadInt32();
  48. int Unknown1c = Context.RequestData.ReadInt32();
  49. int Unknown20 = Context.RequestData.ReadInt32();
  50. int Unknown24 = Context.RequestData.ReadInt32();
  51. int Unknown28 = Context.RequestData.ReadInt32();
  52. int Unknown2c = Context.RequestData.ReadInt32();
  53. int Rev1Magic = Context.RequestData.ReadInt32();
  54. Context.ResponseData.Write(0x400L);
  55. return 0;
  56. }
  57. }
  58. }