aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2018-06-23 03:17:07 -0300
committergdkchan <gab.dark.100@gmail.com>2018-06-23 03:17:07 -0300
commit69697957e6406235d512a89d9144c160fe7efbfd (patch)
tree2f0bc0c6ffb4c593d0ca5f89546aed10680b1d32
parentc26ddd6259796e5b0b187989ce3e21b52edb00a8 (diff)
Workaround for recent audren regression
-rw-r--r--Ryujinx.HLE/OsHle/Services/Aud/IAudioRenderer.cs28
-rw-r--r--Ryujinx.HLE/OsHle/Services/Aud/MemoryPoolState.cs13
-rw-r--r--Ryujinx.HLE/OsHle/Services/Aud/MemoryPoolStates.cs13
3 files changed, 29 insertions, 25 deletions
diff --git a/Ryujinx.HLE/OsHle/Services/Aud/IAudioRenderer.cs b/Ryujinx.HLE/OsHle/Services/Aud/IAudioRenderer.cs
index 70601202..d0a7cfc2 100644
--- a/Ryujinx.HLE/OsHle/Services/Aud/IAudioRenderer.cs
+++ b/Ryujinx.HLE/OsHle/Services/Aud/IAudioRenderer.cs
@@ -36,6 +36,9 @@ namespace Ryujinx.HLE.OsHle.Services.Aud
public long RequestUpdateAudioRenderer(ServiceCtx Context)
{
long OutputPosition = Context.Request.ReceiveBuff[0].Position;
+ long OutputSize = Context.Request.ReceiveBuff[0].Size;
+
+ AMemoryHelper.FillWithZeros(Context.Memory, OutputPosition, (int)OutputSize);
long InputPosition = Context.Request.SendBuff[0].Position;
@@ -52,26 +55,28 @@ namespace Ryujinx.HLE.OsHle.Services.Aud
OutputDataHeader.EffectsSize = Params.EffectCount * 0x10;
OutputDataHeader.SinksSize = Params.SinkCount * 0x20;
OutputDataHeader.PerformanceManagerSize = 0x10;
- OutputDataHeader.TotalSize = Marshal.SizeOf(OutputDataHeader) + OutputDataHeader.BehaviorSize + OutputDataHeader.MemoryPoolsSize +
- OutputDataHeader.VoicesSize + OutputDataHeader.EffectsSize + OutputDataHeader.SinksSize + OutputDataHeader.PerformanceManagerSize;
+ OutputDataHeader.TotalSize = Marshal.SizeOf(OutputDataHeader) +
+ OutputDataHeader.BehaviorSize +
+ OutputDataHeader.MemoryPoolsSize +
+ OutputDataHeader.VoicesSize +
+ OutputDataHeader.EffectsSize +
+ OutputDataHeader.SinksSize +
+ OutputDataHeader.PerformanceManagerSize;
AMemoryHelper.Write(Context.Memory, OutputPosition, OutputDataHeader);
for (int Offset = 0x40; Offset < 0x40 + OutputDataHeader.MemoryPoolsSize; Offset += 0x10, MemoryPoolOffset += 0x20)
{
- MemoryPoolStates PoolState = (MemoryPoolStates) Context.Memory.ReadInt32(InputPosition + MemoryPoolOffset + 0x10);
+ MemoryPoolState PoolState = (MemoryPoolState)Context.Memory.ReadInt32(InputPosition + MemoryPoolOffset + 0x10);
- if (PoolState == MemoryPoolStates.RequestAttach)
- {
- Context.Memory.WriteInt32(OutputPosition + Offset, (int)MemoryPoolStates.Attached);
- }
- else if (PoolState == MemoryPoolStates.RequestDetach)
+ //TODO: Figure out what the other values does.
+ if (PoolState == MemoryPoolState.RequestAttach)
{
- Context.Memory.WriteInt32(OutputPosition + Offset, (int)MemoryPoolStates.Detached);
+ Context.Memory.WriteInt32(OutputPosition + Offset, (int)MemoryPoolState.Attached);
}
- else
+ else if (PoolState == MemoryPoolState.RequestDetach)
{
- Context.Memory.WriteInt32(OutputPosition + Offset, (int)PoolState);
+ Context.Memory.WriteInt32(OutputPosition + Offset, (int)MemoryPoolState.Detached);
}
}
@@ -118,4 +123,3 @@ namespace Ryujinx.HLE.OsHle.Services.Aud
}
}
}
- \ No newline at end of file
diff --git a/Ryujinx.HLE/OsHle/Services/Aud/MemoryPoolState.cs b/Ryujinx.HLE/OsHle/Services/Aud/MemoryPoolState.cs
new file mode 100644
index 00000000..892cde49
--- /dev/null
+++ b/Ryujinx.HLE/OsHle/Services/Aud/MemoryPoolState.cs
@@ -0,0 +1,13 @@
+namespace Ryujinx.HLE.OsHle.Services.Aud
+{
+ enum MemoryPoolState : int
+ {
+ Invalid = 0,
+ Unknown = 1,
+ RequestDetach = 2,
+ Detached = 3,
+ RequestAttach = 4,
+ Attached = 5,
+ Released = 6
+ }
+}
diff --git a/Ryujinx.HLE/OsHle/Services/Aud/MemoryPoolStates.cs b/Ryujinx.HLE/OsHle/Services/Aud/MemoryPoolStates.cs
deleted file mode 100644
index 20f9ce79..00000000
--- a/Ryujinx.HLE/OsHle/Services/Aud/MemoryPoolStates.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-namespace Ryujinx.HLE.OsHle.Services.Aud
-{
- enum MemoryPoolStates : int
- {
- Invalid = 0x0,
- Unknown = 0x1,
- RequestDetach = 0x2,
- Detached = 0x3,
- RequestAttach = 0x4,
- Attached = 0x5,
- Released = 0x6,
- }
-}