aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Audio/Renderer/Dsp/DataSourceHelper.cs
diff options
context:
space:
mode:
authorMary <mary@mary.zone>2022-04-06 09:12:38 +0200
committerGitHub <noreply@github.com>2022-04-06 09:12:38 +0200
commit3f4fb8f73a6635dbdca9dd11738c3a793f53ac65 (patch)
treeadab6a0c08efac674982ded8ca915ff5069462ea /Ryujinx.Audio/Renderer/Dsp/DataSourceHelper.cs
parent56c56aa34d40327cf045d7198fe0f40492a5dbc3 (diff)
amadeus: Update to REV11 (#3230)1.1.91
This should implement all ABI changes from REV11 on 14.0.0 As Nintendo changed the channel disposition for "legacy" effects (Delay, Reverb and Reverb 3D) to match the standard channel mapping, I took the liberty to just remap to the old disposition for now. The proper changes will be handled at a later date with a complete rewriting of those 3 effects to be more readable (see https://github.com/Ryujinx/Ryujinx/pull/3205 for the first iteration of it).
Diffstat (limited to 'Ryujinx.Audio/Renderer/Dsp/DataSourceHelper.cs')
-rw-r--r--Ryujinx.Audio/Renderer/Dsp/DataSourceHelper.cs34
1 files changed, 34 insertions, 0 deletions
diff --git a/Ryujinx.Audio/Renderer/Dsp/DataSourceHelper.cs b/Ryujinx.Audio/Renderer/Dsp/DataSourceHelper.cs
index 4732f504..5c413ee1 100644
--- a/Ryujinx.Audio/Renderer/Dsp/DataSourceHelper.cs
+++ b/Ryujinx.Audio/Renderer/Dsp/DataSourceHelper.cs
@@ -445,5 +445,39 @@ namespace Ryujinx.Audio.Renderer.Dsp
ToIntSlow(output, input, sampleCount);
}
}
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static void RemapLegacyChannelEffectMappingToChannelResourceMapping(bool isSupported, Span<ushort> bufferIndices)
+ {
+ if (!isSupported && bufferIndices.Length == 6)
+ {
+ ushort backLeft = bufferIndices[2];
+ ushort backRight = bufferIndices[3];
+ ushort frontCenter = bufferIndices[4];
+ ushort lowFrequency = bufferIndices[5];
+
+ bufferIndices[2] = frontCenter;
+ bufferIndices[3] = lowFrequency;
+ bufferIndices[4] = backLeft;
+ bufferIndices[5] = backRight;
+ }
+ }
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static void RemapChannelResourceMappingToLegacy(bool isSupported, Span<ushort> bufferIndices)
+ {
+ if (isSupported && bufferIndices.Length == 6)
+ {
+ ushort frontCenter = bufferIndices[2];
+ ushort lowFrequency = bufferIndices[3];
+ ushort backLeft = bufferIndices[4];
+ ushort backRight = bufferIndices[5];
+
+ bufferIndices[2] = backLeft;
+ bufferIndices[3] = backRight;
+ bufferIndices[4] = frontCenter;
+ bufferIndices[5] = lowFrequency;
+ }
+ }
}
}