diff --git a/Ryujinx.HLE/OsHle/Services/Aud/AudioRendererConfig.cs b/Ryujinx.HLE/OsHle/Services/Aud/AudioRendererConfig.cs deleted file mode 100644 index a9937442be..0000000000 --- a/Ryujinx.HLE/OsHle/Services/Aud/AudioRendererConfig.cs +++ /dev/null @@ -1,22 +0,0 @@ -namespace Ryujinx.HLE.OsHle.Services.Aud -{ - struct AudioRendererConfig - { - public int Revision; - public int BehaviourSize; - public int MemoryPoolsSize; - public int VoicesSize; - public int VoiceResourceSize; - public int EffectsSize; - public int MixesSize; - public int SinksSize; - public int PerformanceBufferSize; - public int Unknown24; - public int Unknown28; - public int Unknown2C; - public int Unknown30; - public int Unknown34; - public int Unknown38; - public int TotalSize; - } -} diff --git a/Ryujinx.HLE/OsHle/Services/Aud/AudioRendererParameters.cs b/Ryujinx.HLE/OsHle/Services/Aud/AudioRendererParameter.cs similarity index 93% rename from Ryujinx.HLE/OsHle/Services/Aud/AudioRendererParameters.cs rename to Ryujinx.HLE/OsHle/Services/Aud/AudioRendererParameter.cs index dbe8bed292..0a0792ec5b 100644 --- a/Ryujinx.HLE/OsHle/Services/Aud/AudioRendererParameters.cs +++ b/Ryujinx.HLE/OsHle/Services/Aud/AudioRendererParameter.cs @@ -3,7 +3,7 @@ namespace Ryujinx.HLE.OsHle.Services.Aud { [StructLayout(LayoutKind.Sequential)] - struct AudioRendererParameters + struct AudioRendererParameter { public int SampleRate; public int SampleCount; diff --git a/Ryujinx.HLE/OsHle/Services/Aud/IAudioRenderer.cs b/Ryujinx.HLE/OsHle/Services/Aud/IAudioRenderer.cs index 2309a67fcd..4ad7e6cfdf 100644 --- a/Ryujinx.HLE/OsHle/Services/Aud/IAudioRenderer.cs +++ b/Ryujinx.HLE/OsHle/Services/Aud/IAudioRenderer.cs @@ -16,9 +16,9 @@ namespace Ryujinx.HLE.OsHle.Services.Aud private KEvent UpdateEvent; - private AudioRendererParameters Params; + private AudioRendererParameter Params; - public IAudioRenderer(AudioRendererParameters WorkerParams) + public IAudioRenderer(AudioRendererParameter Params) { m_Commands = new Dictionary() { @@ -30,7 +30,7 @@ namespace Ryujinx.HLE.OsHle.Services.Aud UpdateEvent = new KEvent(); - this.Params = WorkerParams; + this.Params = Params; } public long RequestUpdateAudioRenderer(ServiceCtx Context) @@ -38,25 +38,25 @@ namespace Ryujinx.HLE.OsHle.Services.Aud long OutputPosition = Context.Request.GetBufferType0x22().Position; long InputPosition = Context.Request.GetBufferType0x21().Position; - AudioRendererConfig InputData = AMemoryHelper.Read(Context.Memory, InputPosition); + UpdateDataHeader InputDataHeader = AMemoryHelper.Read(Context.Memory, InputPosition); - int MemoryPoolOffset = Marshal.SizeOf(InputData) + InputData.BehaviourSize; + int MemoryPoolOffset = Marshal.SizeOf(InputDataHeader) + InputDataHeader.BehaviorSize; - AudioRendererOutput OutputData = new AudioRendererOutput(); + UpdateDataHeader OutputDataHeader = new UpdateDataHeader(); - OutputData.Revision = Params.Revision; - OutputData.ErrorInfoSize = 0xb0; - OutputData.MemoryPoolsSize = (Params.EffectCount + (Params.VoiceCount * 4)) * 0x10; - OutputData.VoicesSize = Params.VoiceCount * 0x10; - OutputData.EffectsSize = Params.EffectCount * 0x10; - OutputData.SinksSize = Params.SinkCount * 0x20; - OutputData.PerformanceManagerSize = 0x10; - OutputData.TotalSize = Marshal.SizeOf(OutputData) + OutputData.ErrorInfoSize + OutputData.MemoryPoolsSize + - OutputData.VoicesSize + OutputData.EffectsSize + OutputData.SinksSize + OutputData.PerformanceManagerSize; + OutputDataHeader.Revision = Params.Revision; + OutputDataHeader.BehaviorSize = 0xb0; + 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.BehaviorSize + OutputDataHeader.MemoryPoolsSize + + OutputDataHeader.VoicesSize + OutputDataHeader.EffectsSize + OutputDataHeader.SinksSize + OutputDataHeader.PerformanceManagerSize; - AMemoryHelper.Write(Context.Memory, OutputPosition, OutputData); + AMemoryHelper.Write(Context.Memory, OutputPosition, OutputDataHeader); - for (int Offset = 0x40; Offset < 0x40 + OutputData.MemoryPoolsSize; Offset += 0x10, MemoryPoolOffset += 0x20) + for (int Offset = 0x40; Offset < 0x40 + OutputDataHeader.MemoryPoolsSize; Offset += 0x10, MemoryPoolOffset += 0x20) { MemoryPoolStates PoolState = (MemoryPoolStates) Context.Memory.ReadInt32(InputPosition + MemoryPoolOffset + 0x10); diff --git a/Ryujinx.HLE/OsHle/Services/Aud/IAudioRendererManager.cs b/Ryujinx.HLE/OsHle/Services/Aud/IAudioRendererManager.cs index 98af794ad2..a7daeedd58 100644 --- a/Ryujinx.HLE/OsHle/Services/Aud/IAudioRendererManager.cs +++ b/Ryujinx.HLE/OsHle/Services/Aud/IAudioRendererManager.cs @@ -30,7 +30,7 @@ namespace Ryujinx.HLE.OsHle.Services.Aud { //Same buffer as GetAudioRendererWorkBufferSize is receive here. - AudioRendererParameters Params = new AudioRendererParameters(); + AudioRendererParameter Params = new AudioRendererParameter(); Params.SampleRate = Context.RequestData.ReadInt32(); Params.SampleCount = Context.RequestData.ReadInt32(); diff --git a/Ryujinx.HLE/OsHle/Services/Aud/AudioRendererOutput.cs b/Ryujinx.HLE/OsHle/Services/Aud/UpdateDataHeader.cs similarity index 89% rename from Ryujinx.HLE/OsHle/Services/Aud/AudioRendererOutput.cs rename to Ryujinx.HLE/OsHle/Services/Aud/UpdateDataHeader.cs index 6781c3bd76..f944b302e0 100644 --- a/Ryujinx.HLE/OsHle/Services/Aud/AudioRendererOutput.cs +++ b/Ryujinx.HLE/OsHle/Services/Aud/UpdateDataHeader.cs @@ -1,9 +1,9 @@ namespace Ryujinx.HLE.OsHle.Services.Aud { - struct AudioRendererOutput + struct UpdateDataHeader { public int Revision; - public int ErrorInfoSize; + public int BehaviorSize; public int MemoryPoolsSize; public int VoicesSize; public int VoiceResourceSize;