aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2018-06-25 02:04:19 -0300
committergdkchan <gab.dark.100@gmail.com>2018-06-25 02:04:19 -0300
commit7c7ee8f8ca0dddcc7c16c16d8a14527e4557fd82 (patch)
tree5cf17928c905e678436d7ea912c011cea0e9b9c6
parente7559f128f99058774a8d53aa45213b51c085e76 (diff)
Aways write voice state as finished playing while proper audren support is not in place
-rw-r--r--Ryujinx.HLE/OsHle/Services/Aud/IAudioRenderer.cs27
-rw-r--r--Ryujinx.HLE/OsHle/Services/Aud/VoiceState.cs9
2 files changed, 28 insertions, 8 deletions
diff --git a/Ryujinx.HLE/OsHle/Services/Aud/IAudioRenderer.cs b/Ryujinx.HLE/OsHle/Services/Aud/IAudioRenderer.cs
index d0a7cfc2..bd9188c3 100644
--- a/Ryujinx.HLE/OsHle/Services/Aud/IAudioRenderer.cs
+++ b/Ryujinx.HLE/OsHle/Services/Aud/IAudioRenderer.cs
@@ -44,18 +44,18 @@ namespace Ryujinx.HLE.OsHle.Services.Aud
UpdateDataHeader InputDataHeader = AMemoryHelper.Read<UpdateDataHeader>(Context.Memory, InputPosition);
- int MemoryPoolOffset = Marshal.SizeOf(InputDataHeader) + InputDataHeader.BehaviorSize;
-
UpdateDataHeader OutputDataHeader = new UpdateDataHeader();
+ int UpdateHeaderSize = Marshal.SizeOf<UpdateDataHeader>();
+
OutputDataHeader.Revision = Params.Revision;
OutputDataHeader.BehaviorSize = 0xb0;
- OutputDataHeader.MemoryPoolsSize = (Params.EffectCount + (Params.VoiceCount * 4)) * 0x10;
+ OutputDataHeader.MemoryPoolsSize = (Params.EffectCount + Params.VoiceCount * 4) * 0x10;
OutputDataHeader.VoicesSize = Params.VoiceCount * 0x10;
OutputDataHeader.EffectsSize = Params.EffectCount * 0x10;
OutputDataHeader.SinksSize = Params.SinkCount * 0x20;
OutputDataHeader.PerformanceManagerSize = 0x10;
- OutputDataHeader.TotalSize = Marshal.SizeOf(OutputDataHeader) +
+ OutputDataHeader.TotalSize = UpdateHeaderSize +
OutputDataHeader.BehaviorSize +
OutputDataHeader.MemoryPoolsSize +
OutputDataHeader.VoicesSize +
@@ -65,21 +65,32 @@ namespace Ryujinx.HLE.OsHle.Services.Aud
AMemoryHelper.Write(Context.Memory, OutputPosition, OutputDataHeader);
- for (int Offset = 0x40; Offset < 0x40 + OutputDataHeader.MemoryPoolsSize; Offset += 0x10, MemoryPoolOffset += 0x20)
+ int InMemoryPoolOffset = UpdateHeaderSize + InputDataHeader.BehaviorSize;
+
+ int OutMemoryPoolOffset = UpdateHeaderSize;
+
+ for (int Offset = 0; Offset < OutputDataHeader.MemoryPoolsSize; Offset += 0x10, InMemoryPoolOffset += 0x20)
{
- MemoryPoolState PoolState = (MemoryPoolState)Context.Memory.ReadInt32(InputPosition + MemoryPoolOffset + 0x10);
+ MemoryPoolState PoolState = (MemoryPoolState)Context.Memory.ReadInt32(InputPosition + InMemoryPoolOffset + 0x10);
//TODO: Figure out what the other values does.
if (PoolState == MemoryPoolState.RequestAttach)
{
- Context.Memory.WriteInt32(OutputPosition + Offset, (int)MemoryPoolState.Attached);
+ Context.Memory.WriteInt32(OutputPosition + OutMemoryPoolOffset + Offset, (int)MemoryPoolState.Attached);
}
else if (PoolState == MemoryPoolState.RequestDetach)
{
- Context.Memory.WriteInt32(OutputPosition + Offset, (int)MemoryPoolState.Detached);
+ Context.Memory.WriteInt32(OutputPosition + OutMemoryPoolOffset + Offset, (int)MemoryPoolState.Detached);
}
}
+ int OutVoicesOffset = OutMemoryPoolOffset + OutputDataHeader.MemoryPoolsSize;
+
+ for (int Offset = 0; Offset < OutputDataHeader.VoicesSize; Offset += 0x10)
+ {
+ Context.Memory.WriteInt32(OutputPosition + OutVoicesOffset + Offset + 8, (int)VoicePlaybackState.Finished);
+ }
+
//TODO: We shouldn't be signaling this here.
UpdateEvent.WaitEvent.Set();
diff --git a/Ryujinx.HLE/OsHle/Services/Aud/VoiceState.cs b/Ryujinx.HLE/OsHle/Services/Aud/VoiceState.cs
new file mode 100644
index 00000000..8b343323
--- /dev/null
+++ b/Ryujinx.HLE/OsHle/Services/Aud/VoiceState.cs
@@ -0,0 +1,9 @@
+namespace Ryujinx.HLE.OsHle.Services.Aud
+{
+ enum VoicePlaybackState : int
+ {
+ Playing = 0,
+ Finished = 1,
+ Paused = 2
+ }
+}