2018-02-05 00:08:20 +01:00
|
|
|
using ChocolArm64.Memory;
|
2018-02-20 21:09:23 +01:00
|
|
|
using Ryujinx.Core.OsHle.Objects.Aud;
|
2018-02-05 00:08:20 +01:00
|
|
|
using System.Text;
|
|
|
|
|
2018-02-20 21:09:23 +01:00
|
|
|
using static Ryujinx.Core.OsHle.Objects.ObjHelper;
|
2018-02-05 00:08:20 +01:00
|
|
|
|
2018-02-20 21:09:23 +01:00
|
|
|
namespace Ryujinx.Core.OsHle.Services
|
2018-02-05 00:08:20 +01:00
|
|
|
{
|
|
|
|
static partial class Service
|
|
|
|
{
|
|
|
|
public static long AudOutListAudioOuts(ServiceCtx Context)
|
|
|
|
{
|
|
|
|
long Position = Context.Request.ReceiveBuff[0].Position;
|
|
|
|
|
|
|
|
AMemoryHelper.WriteBytes(Context.Memory, Position, Encoding.ASCII.GetBytes("iface"));
|
|
|
|
|
|
|
|
Context.ResponseData.Write(1);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static long AudOutOpenAudioOut(ServiceCtx Context)
|
|
|
|
{
|
2018-02-10 01:14:55 +01:00
|
|
|
MakeObject(Context, new IAudioOut());
|
2018-02-08 17:52:02 +01:00
|
|
|
|
|
|
|
Context.ResponseData.Write(48000); //Sample Rate
|
|
|
|
Context.ResponseData.Write(2); //Channel Count
|
|
|
|
Context.ResponseData.Write(2); //PCM Format
|
|
|
|
/*
|
|
|
|
0 - Invalid
|
|
|
|
1 - INT8
|
|
|
|
2 - INT16
|
|
|
|
3 - INT24
|
|
|
|
4 - INT32
|
|
|
|
5 - PCM Float
|
|
|
|
6 - ADPCM
|
|
|
|
*/
|
|
|
|
Context.ResponseData.Write(0); //Unknown
|
2018-02-05 00:08:20 +01:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static long AudRenOpenAudioRenderer(ServiceCtx Context)
|
|
|
|
{
|
2018-02-10 01:14:55 +01:00
|
|
|
MakeObject(Context, new IAudioRenderer());
|
2018-02-05 00:08:20 +01:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static long AudRenGetAudioRendererWorkBufferSize(ServiceCtx Context)
|
|
|
|
{
|
|
|
|
int SampleRate = Context.RequestData.ReadInt32();
|
|
|
|
int Unknown4 = Context.RequestData.ReadInt32();
|
|
|
|
int Unknown8 = Context.RequestData.ReadInt32();
|
|
|
|
int UnknownC = Context.RequestData.ReadInt32();
|
|
|
|
int Unknown10 = Context.RequestData.ReadInt32();
|
|
|
|
int Unknown14 = Context.RequestData.ReadInt32();
|
|
|
|
int Unknown18 = Context.RequestData.ReadInt32();
|
|
|
|
int Unknown1c = Context.RequestData.ReadInt32();
|
|
|
|
int Unknown20 = Context.RequestData.ReadInt32();
|
|
|
|
int Unknown24 = Context.RequestData.ReadInt32();
|
|
|
|
int Unknown28 = Context.RequestData.ReadInt32();
|
|
|
|
int Unknown2c = Context.RequestData.ReadInt32();
|
|
|
|
int Rev1Magic = Context.RequestData.ReadInt32();
|
|
|
|
|
|
|
|
Context.ResponseData.Write(0x400L);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|