From ad058403271dfab6659cce9b09e6f6a08c38f7f4 Mon Sep 17 00:00:00 2001 From: greggameplayer <33609333+greggameplayer@users.noreply.github.com> Date: Fri, 22 Jun 2018 04:34:04 +0200 Subject: [PATCH 1/3] Implement RequestUpdateAudioRendererAuto with a method --- .../OsHle/Services/Aud/IAudioRenderer.cs | 29 +++++++++++++------ 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/Ryujinx.HLE/OsHle/Services/Aud/IAudioRenderer.cs b/Ryujinx.HLE/OsHle/Services/Aud/IAudioRenderer.cs index 9c495db5a0..61b5b70184 100644 --- a/Ryujinx.HLE/OsHle/Services/Aud/IAudioRenderer.cs +++ b/Ryujinx.HLE/OsHle/Services/Aud/IAudioRenderer.cs @@ -18,10 +18,11 @@ namespace Ryujinx.HLE.OsHle.Services.Aud { m_Commands = new Dictionary() { - { 4, RequestUpdateAudioRenderer }, - { 5, StartAudioRenderer }, - { 6, StopAudioRenderer }, - { 7, QuerySystemEvent } + { 4, RequestUpdateAudioRenderer }, + { 5, StartAudioRenderer }, + { 6, StopAudioRenderer }, + { 7, QuerySystemEvent }, + { 10, RequestUpdateAudioRendererAuto } }; UpdateEvent = new KEvent(); @@ -29,9 +30,21 @@ namespace Ryujinx.HLE.OsHle.Services.Aud public long RequestUpdateAudioRenderer(ServiceCtx Context) { - //(buffer) -> (buffer, buffer) + RequestUpdateAudioRendererMethod(Context, Context.Request.ReceiveBuff[0].Position); - long Position = Context.Request.ReceiveBuff[0].Position; + return 0; + } + + public long RequestUpdateAudioRendererAuto(ServiceCtx Context) + { + RequestUpdateAudioRendererMethod(Context, Context.Request.GetBufferType0x21().Position); + + return 0; + } + + public void RequestUpdateAudioRendererMethod(ServiceCtx Context, long Position) + { + //(buffer) -> (buffer, buffer) //0x40 bytes header Context.Memory.WriteInt32(Position + 0x4, 0xb0); //Behavior Out State Size? (note: this is the last section) @@ -49,8 +62,6 @@ namespace Ryujinx.HLE.OsHle.Services.Aud //TODO: We shouldn't be signaling this here. UpdateEvent.WaitEvent.Set(); - - return 0; } public long StartAudioRenderer(ServiceCtx Context) @@ -89,4 +100,4 @@ namespace Ryujinx.HLE.OsHle.Services.Aud } } } -} \ No newline at end of file +} From 2edb8e55825875d5549da25c2ad5c21d83e63e54 Mon Sep 17 00:00:00 2001 From: greggameplayer <33609333+greggameplayer@users.noreply.github.com> Date: Fri, 22 Jun 2018 04:56:01 +0200 Subject: [PATCH 2/3] optimizing coding style --- Ryujinx.HLE/OsHle/Services/Aud/IAudioRenderer.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Ryujinx.HLE/OsHle/Services/Aud/IAudioRenderer.cs b/Ryujinx.HLE/OsHle/Services/Aud/IAudioRenderer.cs index 61b5b70184..25c5d44625 100644 --- a/Ryujinx.HLE/OsHle/Services/Aud/IAudioRenderer.cs +++ b/Ryujinx.HLE/OsHle/Services/Aud/IAudioRenderer.cs @@ -30,16 +30,12 @@ namespace Ryujinx.HLE.OsHle.Services.Aud public long RequestUpdateAudioRenderer(ServiceCtx Context) { - RequestUpdateAudioRendererMethod(Context, Context.Request.ReceiveBuff[0].Position); - - return 0; + return RequestUpdateAudioRendererMethod(Context, Context.Request.ReceiveBuff[0].Position); } public long RequestUpdateAudioRendererAuto(ServiceCtx Context) { - RequestUpdateAudioRendererMethod(Context, Context.Request.GetBufferType0x21().Position); - - return 0; + return RequestUpdateAudioRendererMethod(Context, Context.Request.GetBufferType0x21().Position); } public void RequestUpdateAudioRendererMethod(ServiceCtx Context, long Position) @@ -62,6 +58,8 @@ namespace Ryujinx.HLE.OsHle.Services.Aud //TODO: We shouldn't be signaling this here. UpdateEvent.WaitEvent.Set(); + + return 0; } public long StartAudioRenderer(ServiceCtx Context) From dd54e684fe9bc3bc9445e3d42154328c39728a0b Mon Sep 17 00:00:00 2001 From: greggameplayer <33609333+greggameplayer@users.noreply.github.com> Date: Fri, 22 Jun 2018 05:00:07 +0200 Subject: [PATCH 3/3] convert method to long --- Ryujinx.HLE/OsHle/Services/Aud/IAudioRenderer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ryujinx.HLE/OsHle/Services/Aud/IAudioRenderer.cs b/Ryujinx.HLE/OsHle/Services/Aud/IAudioRenderer.cs index 25c5d44625..8c56fac01b 100644 --- a/Ryujinx.HLE/OsHle/Services/Aud/IAudioRenderer.cs +++ b/Ryujinx.HLE/OsHle/Services/Aud/IAudioRenderer.cs @@ -38,7 +38,7 @@ namespace Ryujinx.HLE.OsHle.Services.Aud return RequestUpdateAudioRendererMethod(Context, Context.Request.GetBufferType0x21().Position); } - public void RequestUpdateAudioRendererMethod(ServiceCtx Context, long Position) + public long RequestUpdateAudioRendererMethod(ServiceCtx Context, long Position) { //(buffer) -> (buffer, buffer)