Implement GetReleasedAudioOutBufferAuto properly
This commit is contained in:
parent
edfd4bc860
commit
70dca7aaa4
1 changed files with 37 additions and 32 deletions
|
@ -24,15 +24,15 @@ namespace Ryujinx.HLE.OsHle.Services.Aud
|
||||||
{
|
{
|
||||||
m_Commands = new Dictionary<int, ServiceProcessRequest>()
|
m_Commands = new Dictionary<int, ServiceProcessRequest>()
|
||||||
{
|
{
|
||||||
{ 0, GetAudioOutState },
|
{ 0, GetAudioOutState },
|
||||||
{ 1, StartAudioOut },
|
{ 1, StartAudioOut },
|
||||||
{ 2, StopAudioOut },
|
{ 2, StopAudioOut },
|
||||||
{ 3, AppendAudioOutBuffer },
|
{ 3, AppendAudioOutBuffer },
|
||||||
{ 4, RegisterBufferEvent },
|
{ 4, RegisterBufferEvent },
|
||||||
{ 5, GetReleasedAudioOutBuffer },
|
{ 5, GetReleasedAudioOutBuffer },
|
||||||
{ 6, ContainsAudioOutBuffer },
|
{ 6, ContainsAudioOutBuffer },
|
||||||
{ 7, AppendAudioOutBufferEx },
|
{ 7, AppendAudioOutBufferEx },
|
||||||
{ 8, GetReleasedAudioOutBufferEx }
|
{ 8, GetReleasedAudioOutBufferAuto }
|
||||||
};
|
};
|
||||||
|
|
||||||
this.AudioOut = AudioOut;
|
this.AudioOut = AudioOut;
|
||||||
|
@ -92,6 +92,34 @@ namespace Ryujinx.HLE.OsHle.Services.Aud
|
||||||
long Position = Context.Request.ReceiveBuff[0].Position;
|
long Position = Context.Request.ReceiveBuff[0].Position;
|
||||||
long Size = Context.Request.ReceiveBuff[0].Size;
|
long Size = Context.Request.ReceiveBuff[0].Size;
|
||||||
|
|
||||||
|
return GetReleasedAudioOutBufferImpl(Context, Position, Size);
|
||||||
|
}
|
||||||
|
|
||||||
|
public long ContainsAudioOutBuffer(ServiceCtx Context)
|
||||||
|
{
|
||||||
|
long Tag = Context.RequestData.ReadInt64();
|
||||||
|
|
||||||
|
Context.ResponseData.Write(AudioOut.ContainsBuffer(Track, Tag) ? 1 : 0);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long AppendAudioOutBufferEx(ServiceCtx Context)
|
||||||
|
{
|
||||||
|
Context.Ns.Log.PrintStub(LogClass.ServiceAudio, "Stubbed.");
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long GetReleasedAudioOutBufferAuto(ServiceCtx Context)
|
||||||
|
{
|
||||||
|
(long Position, long Size) = Context.Request.GetBufferType0x22();
|
||||||
|
|
||||||
|
return GetReleasedAudioOutBufferImpl(Context, Position, Size);
|
||||||
|
}
|
||||||
|
|
||||||
|
public long GetReleasedAudioOutBufferImpl(ServiceCtx Context, long Position, long Size)
|
||||||
|
{
|
||||||
uint Count = (uint)((ulong)Size >> 3);
|
uint Count = (uint)((ulong)Size >> 3);
|
||||||
|
|
||||||
long[] ReleasedBuffers = AudioOut.GetReleasedBuffers(Track, (int)Count);
|
long[] ReleasedBuffers = AudioOut.GetReleasedBuffers(Track, (int)Count);
|
||||||
|
@ -113,29 +141,6 @@ namespace Ryujinx.HLE.OsHle.Services.Aud
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long ContainsAudioOutBuffer(ServiceCtx Context)
|
|
||||||
{
|
|
||||||
long Tag = Context.RequestData.ReadInt64();
|
|
||||||
|
|
||||||
Context.ResponseData.Write(AudioOut.ContainsBuffer(Track, Tag) ? 1 : 0);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long AppendAudioOutBufferEx(ServiceCtx Context)
|
|
||||||
{
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAudio, "Stubbed.");
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long GetReleasedAudioOutBufferEx(ServiceCtx Context)
|
|
||||||
{
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceAudio, "Stubbed.");
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
Dispose(true);
|
Dispose(true);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue