mirror of
https://git.ryujinx.app/kenji-nx/ryujinx.git
synced 2025-12-14 07:37:04 +00:00
* Fixed an issue where games would boot loop because of an incorrect HID state.
* Turns out the SamplingNumber of the atomic input storage doesn't match the SamplingNumber of the input state held by the atomic storage, instead it is exactly double the value in the input state.
* Added new Condition struct to the HID Shared memory and populate it with dummy data to fix the no-controller crash (already merged).
* The audio renderer has been mostly updated to rev15, allowing rev15 games to launch.
* Biquad filters now use floats.
* Several structures have been renamed to match the SDK names, making it easier to compare functionality. A few names are still missing and will be changed at a later date.
* The new commands from rev15 have been added to the CommandType enum, but they are still missing from the code itself.
* Due to changes in the SDK layout, the time estimation functions are either missing or very well hidden (or Ghidra search functionality is useless). We can't fully implement the new commands until the timing data has been located.
* A few minor tweaks to the code have been made to more accurately match the SDK.
79 lines
2.7 KiB
C#
79 lines
2.7 KiB
C#
using Ryujinx.Audio.Common;
|
|
using Ryujinx.Audio.Renderer.Common;
|
|
using Ryujinx.Audio.Renderer.Server.Voice;
|
|
using System;
|
|
using Ryujinx.Audio.Renderer.Parameter;
|
|
using WaveBuffer = Ryujinx.Audio.Renderer.Common.WaveBuffer;
|
|
|
|
namespace Ryujinx.Audio.Renderer.Dsp.Command
|
|
{
|
|
public class AdpcmDataSourceCommandVersion1 : ICommand
|
|
{
|
|
public bool Enabled { get; set; }
|
|
|
|
public int NodeId { get; }
|
|
|
|
public CommandType CommandType => CommandType.AdpcmDataSourceVersion1;
|
|
|
|
public uint EstimatedProcessingTime { get; set; }
|
|
|
|
public ushort OutputBufferIndex { get; }
|
|
public uint SampleRate { get; }
|
|
|
|
public float Pitch { get; }
|
|
|
|
public WaveBuffer[] WaveBuffers { get; }
|
|
|
|
public Memory<VoiceState> State { get; }
|
|
|
|
public ulong AdpcmParameter { get; }
|
|
public ulong AdpcmParameterSize { get; }
|
|
|
|
public DecodingBehaviour DecodingBehaviour { get; }
|
|
|
|
public AdpcmDataSourceCommandVersion1(ref VoiceInfo serverInfo, Memory<VoiceState> state, ushort outputBufferIndex, int nodeId)
|
|
{
|
|
Enabled = true;
|
|
NodeId = nodeId;
|
|
|
|
OutputBufferIndex = outputBufferIndex;
|
|
SampleRate = serverInfo.SampleRate;
|
|
Pitch = serverInfo.Pitch;
|
|
|
|
Span<Server.Voice.WaveBuffer> waveBufferSpan = serverInfo.WaveBuffers.AsSpan();
|
|
|
|
WaveBuffers = new WaveBuffer[Constants.VoiceWaveBufferCount];
|
|
|
|
for (int i = 0; i < WaveBuffers.Length; i++)
|
|
{
|
|
ref Server.Voice.WaveBuffer voiceWaveBuffer = ref waveBufferSpan[i];
|
|
|
|
WaveBuffers[i] = voiceWaveBuffer.ToCommon(1);
|
|
}
|
|
|
|
AdpcmParameter = serverInfo.DataSourceStateAddressInfo.GetReference(true);
|
|
AdpcmParameterSize = serverInfo.DataSourceStateAddressInfo.Size;
|
|
State = state;
|
|
DecodingBehaviour = serverInfo.DecodingBehaviour;
|
|
}
|
|
|
|
public void Process(CommandList context)
|
|
{
|
|
Span<float> outputBuffer = context.GetBuffer(OutputBufferIndex);
|
|
|
|
DataSourceHelper.WaveBufferInformation info = new()
|
|
{
|
|
SourceSampleRate = SampleRate,
|
|
SampleFormat = SampleFormat.Adpcm,
|
|
Pitch = Pitch,
|
|
DecodingBehaviour = DecodingBehaviour,
|
|
ExtraParameter = AdpcmParameter,
|
|
ExtraParameterSize = AdpcmParameterSize,
|
|
ChannelIndex = 0,
|
|
ChannelCount = 1,
|
|
};
|
|
|
|
DataSourceHelper.ProcessWaveBuffers(context.MemoryManager, outputBuffer, ref info, WaveBuffers, ref State.Span[0], context.SampleRate, (int)context.SampleCount);
|
|
}
|
|
}
|
|
}
|