Переглянути джерело

Amadeus: Fix multi-channel PCM sources on REV8 (#1536)

This add a missing offset on the output buffer of the DataSourceVersion2Command.

This fix music only playing on the left channel on Fairy Tail, Family Mysteries: Poisonous Promises, SEGA AGES Sonic the Hedgehog 2 and probably more.
Mary 5 роки тому
батько
коміт
6aef271661

+ 1 - 1
Ryujinx.Audio.Renderer/Dsp/Command/DataSourceVersion2Command.cs

@@ -63,7 +63,7 @@ namespace Ryujinx.Audio.Renderer.Dsp.Command
             SrcQuality = serverState.SrcQuality;
             CommandType = GetCommandTypeBySampleFormat(SampleFormat);
 
-            OutputBufferIndex = outputBufferIndex;
+            OutputBufferIndex = (ushort)(channelIndex + outputBufferIndex);
             SampleRate = serverState.SampleRate;
             Pitch = serverState.Pitch;
 

+ 2 - 0
Ryujinx.Audio.Renderer/Server/CommandGenerator.cs

@@ -107,6 +107,8 @@ namespace Ryujinx.Audio.Renderer.Server
 
             if (!voiceState.WasPlaying)
             {
+                Debug.Assert(voiceState.SampleFormat != SampleFormat.Adpcm || channelIndex == 0);
+
                 if (_rendererContext.BehaviourContext.IsWaveBufferVersion2Supported())
                 {
                     _commandBuffer.GenerateDataSourceVersion2(ref voiceState,