Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
1825bd87b4 | ||
|
62f8ceb60b |
@@ -81,7 +81,7 @@ namespace Ryujinx.Audio.Backends.CompatLayer
|
|||||||
{
|
{
|
||||||
BufferTag = buffer.BufferTag,
|
BufferTag = buffer.BufferTag,
|
||||||
DataPointer = buffer.DataPointer,
|
DataPointer = buffer.DataPointer,
|
||||||
DataSize = (ulong)downmixedBuffer.Length
|
DataSize = (ulong)downmixedBuffer.Length
|
||||||
};
|
};
|
||||||
|
|
||||||
bool result = _realSession.RegisterBuffer(fakeBuffer, downmixedBuffer);
|
bool result = _realSession.RegisterBuffer(fakeBuffer, downmixedBuffer);
|
||||||
|
@@ -24,11 +24,11 @@ namespace Ryujinx.Audio.Backends.CompatLayer
|
|||||||
public short Right;
|
public short Right;
|
||||||
}
|
}
|
||||||
|
|
||||||
private const int Q15Bits = 16;
|
private const int Q15Bits = 16;
|
||||||
private const int RawQ15One = 1 << Q15Bits;
|
private const int RawQ15One = 1 << Q15Bits;
|
||||||
private const int RawQ15HalfOne = (int)(0.5f * RawQ15One);
|
private const int RawQ15HalfOne = (int)(0.5f * RawQ15One);
|
||||||
private const int Minus3dBInQ15 = (int)(0.707f * RawQ15One);
|
private const int Minus3dBInQ15 = (int)(0.707f * RawQ15One);
|
||||||
private const int Minus6dBInQ15 = (int)(0.501f * RawQ15One);
|
private const int Minus6dBInQ15 = (int)(0.501f * RawQ15One);
|
||||||
private const int Minus12dBInQ15 = (int)(0.251f * RawQ15One);
|
private const int Minus12dBInQ15 = (int)(0.251f * RawQ15One);
|
||||||
|
|
||||||
private static readonly int[] DefaultSurroundToStereoCoefficients = new int[4]
|
private static readonly int[] DefaultSurroundToStereoCoefficients = new int[4]
|
||||||
@@ -46,8 +46,8 @@ namespace Ryujinx.Audio.Backends.CompatLayer
|
|||||||
};
|
};
|
||||||
|
|
||||||
private const int SurroundChannelCount = 6;
|
private const int SurroundChannelCount = 6;
|
||||||
private const int StereoChannelCount = 2;
|
private const int StereoChannelCount = 2;
|
||||||
private const int MonoChannelCount = 1;
|
private const int MonoChannelCount = 1;
|
||||||
|
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
private static ReadOnlySpan<Channel51FormatPCM16> GetSurroundBuffer(ReadOnlySpan<short> data)
|
private static ReadOnlySpan<Channel51FormatPCM16> GetSurroundBuffer(ReadOnlySpan<short> data)
|
||||||
@@ -86,7 +86,7 @@ namespace Ryujinx.Audio.Backends.CompatLayer
|
|||||||
{
|
{
|
||||||
Channel51FormatPCM16 channel = channels[i];
|
Channel51FormatPCM16 channel = channels[i];
|
||||||
|
|
||||||
downmixedBuffer[i * 2] = DownMixSurroundToStereo(coefficients, channel.BackLeft, channel.LowFrequency, channel.FrontCenter, channel.FrontLeft);
|
downmixedBuffer[i * 2] = DownMixSurroundToStereo(coefficients, channel.BackLeft, channel.LowFrequency, channel.FrontCenter, channel.FrontLeft);
|
||||||
downmixedBuffer[i * 2 + 1] = DownMixSurroundToStereo(coefficients, channel.BackRight, channel.LowFrequency, channel.FrontCenter, channel.FrontRight);
|
downmixedBuffer[i * 2 + 1] = DownMixSurroundToStereo(coefficients, channel.BackRight, channel.LowFrequency, channel.FrontCenter, channel.FrontRight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -214,9 +214,9 @@ namespace Ryujinx.Audio.Input
|
|||||||
outputDeviceName = audioIn.DeviceName;
|
outputDeviceName = audioIn.DeviceName;
|
||||||
outputConfiguration = new AudioOutputConfiguration
|
outputConfiguration = new AudioOutputConfiguration
|
||||||
{
|
{
|
||||||
ChannelCount = audioIn.ChannelCount,
|
ChannelCount = audioIn.ChannelCount,
|
||||||
SampleFormat = audioIn.SampleFormat,
|
SampleFormat = audioIn.SampleFormat,
|
||||||
SampleRate = audioIn.SampleRate,
|
SampleRate = audioIn.SampleRate,
|
||||||
AudioOutState = audioIn.GetState(),
|
AudioOutState = audioIn.GetState(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -32,8 +32,8 @@ namespace Ryujinx.Audio.Integration
|
|||||||
_session.QueueBuffer(new AudioBuffer
|
_session.QueueBuffer(new AudioBuffer
|
||||||
{
|
{
|
||||||
DataPointer = _currentBufferTag++,
|
DataPointer = _currentBufferTag++,
|
||||||
Data = _buffer,
|
Data = _buffer,
|
||||||
DataSize = (ulong)_buffer.Length,
|
DataSize = (ulong)_buffer.Length,
|
||||||
});
|
});
|
||||||
|
|
||||||
_currentBufferTag = _currentBufferTag % 4;
|
_currentBufferTag = _currentBufferTag % 4;
|
||||||
|
@@ -209,9 +209,9 @@ namespace Ryujinx.Audio.Output
|
|||||||
outputDeviceName = audioOut.DeviceName;
|
outputDeviceName = audioOut.DeviceName;
|
||||||
outputConfiguration = new AudioOutputConfiguration
|
outputConfiguration = new AudioOutputConfiguration
|
||||||
{
|
{
|
||||||
ChannelCount = audioOut.ChannelCount,
|
ChannelCount = audioOut.ChannelCount,
|
||||||
SampleFormat = audioOut.SampleFormat,
|
SampleFormat = audioOut.SampleFormat,
|
||||||
SampleRate = audioOut.SampleRate,
|
SampleRate = audioOut.SampleRate,
|
||||||
AudioOutState = audioOut.GetState(),
|
AudioOutState = audioOut.GetState(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -169,7 +169,7 @@ namespace Ryujinx.Audio.Output
|
|||||||
}
|
}
|
||||||
|
|
||||||
SampleFormat = sampleFormat;
|
SampleFormat = sampleFormat;
|
||||||
SampleRate = Constants.TargetSampleRate;
|
SampleRate = Constants.TargetSampleRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@@ -187,9 +187,9 @@ namespace Ryujinx.Audio.Output
|
|||||||
{
|
{
|
||||||
AudioBuffer buffer = new AudioBuffer
|
AudioBuffer buffer = new AudioBuffer
|
||||||
{
|
{
|
||||||
BufferTag = bufferTag,
|
BufferTag = bufferTag,
|
||||||
DataPointer = userBuffer.Data,
|
DataPointer = userBuffer.Data,
|
||||||
DataSize = userBuffer.DataSize
|
DataSize = userBuffer.DataSize
|
||||||
};
|
};
|
||||||
|
|
||||||
if (_session.AppendBuffer(buffer))
|
if (_session.AppendBuffer(buffer))
|
||||||
@@ -291,7 +291,7 @@ namespace Ryujinx.Audio.Output
|
|||||||
{
|
{
|
||||||
lock (_parentLock)
|
lock (_parentLock)
|
||||||
{
|
{
|
||||||
_session.SetVolume(volume);
|
_session.SetVolume(volume);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -41,7 +41,7 @@ namespace Ryujinx.Audio.Renderer.Common
|
|||||||
return Memory<byte>.Empty;
|
return Memory<byte>.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Memory<T> Allocate<T>(ulong count, int align) where T: unmanaged
|
public Memory<T> Allocate<T>(ulong count, int align) where T : unmanaged
|
||||||
{
|
{
|
||||||
Memory<byte> allocatedMemory = Allocate((ulong)Unsafe.SizeOf<T>() * count, align);
|
Memory<byte> allocatedMemory = Allocate((ulong)Unsafe.SizeOf<T>() * count, align);
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ namespace Ryujinx.Audio.Renderer.Common
|
|||||||
return SpanMemoryManager<T>.Cast(allocatedMemory);
|
return SpanMemoryManager<T>.Cast(allocatedMemory);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ulong GetTargetSize<T>(ulong currentSize, ulong count, int align) where T: unmanaged
|
public static ulong GetTargetSize<T>(ulong currentSize, ulong count, int align) where T : unmanaged
|
||||||
{
|
{
|
||||||
return BitUtils.AlignUp(currentSize, align) + (ulong)Unsafe.SizeOf<T>() * count;
|
return BitUtils.AlignUp(currentSize, align) + (ulong)Unsafe.SizeOf<T>() * count;
|
||||||
}
|
}
|
||||||
|
@@ -87,7 +87,7 @@ namespace Ryujinx.Audio.Renderer.Dsp.Command
|
|||||||
float dryGain = FixedPointHelper.ToFloat(Parameter.DryGain, FixedPointPrecision);
|
float dryGain = FixedPointHelper.ToFloat(Parameter.DryGain, FixedPointPrecision);
|
||||||
float outGain = FixedPointHelper.ToFloat(Parameter.OutGain, FixedPointPrecision);
|
float outGain = FixedPointHelper.ToFloat(Parameter.OutGain, FixedPointPrecision);
|
||||||
|
|
||||||
Matrix2x2 delayFeedback = new Matrix2x2(delayFeedbackBaseGain , delayFeedbackCrossGain,
|
Matrix2x2 delayFeedback = new Matrix2x2(delayFeedbackBaseGain, delayFeedbackCrossGain,
|
||||||
delayFeedbackCrossGain, delayFeedbackBaseGain);
|
delayFeedbackCrossGain, delayFeedbackBaseGain);
|
||||||
|
|
||||||
for (int i = 0; i < sampleCount; i++)
|
for (int i = 0; i < sampleCount; i++)
|
||||||
@@ -124,10 +124,10 @@ namespace Ryujinx.Audio.Renderer.Dsp.Command
|
|||||||
float dryGain = FixedPointHelper.ToFloat(Parameter.DryGain, FixedPointPrecision);
|
float dryGain = FixedPointHelper.ToFloat(Parameter.DryGain, FixedPointPrecision);
|
||||||
float outGain = FixedPointHelper.ToFloat(Parameter.OutGain, FixedPointPrecision);
|
float outGain = FixedPointHelper.ToFloat(Parameter.OutGain, FixedPointPrecision);
|
||||||
|
|
||||||
Matrix4x4 delayFeedback = new Matrix4x4(delayFeedbackBaseGain , delayFeedbackCrossGain, delayFeedbackCrossGain, 0.0f,
|
Matrix4x4 delayFeedback = new Matrix4x4(delayFeedbackBaseGain, delayFeedbackCrossGain, delayFeedbackCrossGain, 0.0f,
|
||||||
delayFeedbackCrossGain, delayFeedbackBaseGain , 0.0f , delayFeedbackCrossGain,
|
delayFeedbackCrossGain, delayFeedbackBaseGain, 0.0f, delayFeedbackCrossGain,
|
||||||
delayFeedbackCrossGain, 0.0f , delayFeedbackBaseGain , delayFeedbackCrossGain,
|
delayFeedbackCrossGain, 0.0f, delayFeedbackBaseGain, delayFeedbackCrossGain,
|
||||||
0.0f , delayFeedbackCrossGain, delayFeedbackCrossGain, delayFeedbackBaseGain);
|
0.0f, delayFeedbackCrossGain, delayFeedbackCrossGain, delayFeedbackBaseGain);
|
||||||
|
|
||||||
|
|
||||||
for (int i = 0; i < sampleCount; i++)
|
for (int i = 0; i < sampleCount; i++)
|
||||||
@@ -171,12 +171,12 @@ namespace Ryujinx.Audio.Renderer.Dsp.Command
|
|||||||
float dryGain = FixedPointHelper.ToFloat(Parameter.DryGain, FixedPointPrecision);
|
float dryGain = FixedPointHelper.ToFloat(Parameter.DryGain, FixedPointPrecision);
|
||||||
float outGain = FixedPointHelper.ToFloat(Parameter.OutGain, FixedPointPrecision);
|
float outGain = FixedPointHelper.ToFloat(Parameter.OutGain, FixedPointPrecision);
|
||||||
|
|
||||||
Matrix6x6 delayFeedback = new Matrix6x6(delayFeedbackBaseGain , 0.0f , 0.0f , 0.0f , delayFeedbackCrossGain, delayFeedbackCrossGain,
|
Matrix6x6 delayFeedback = new Matrix6x6(delayFeedbackBaseGain, 0.0f, 0.0f, 0.0f, delayFeedbackCrossGain, delayFeedbackCrossGain,
|
||||||
0.0f , delayFeedbackBaseGain , 0.0f , delayFeedbackCrossGain, delayFeedbackCrossGain, 0.0f ,
|
0.0f, delayFeedbackBaseGain, 0.0f, delayFeedbackCrossGain, delayFeedbackCrossGain, 0.0f,
|
||||||
delayFeedbackCrossGain, 0.0f , delayFeedbackBaseGain , delayFeedbackCrossGain, 0.0f , 0.0f ,
|
delayFeedbackCrossGain, 0.0f, delayFeedbackBaseGain, delayFeedbackCrossGain, 0.0f, 0.0f,
|
||||||
0.0f , delayFeedbackCrossGain, delayFeedbackCrossGain, delayFeedbackBaseGain , 0.0f , 0.0f ,
|
0.0f, delayFeedbackCrossGain, delayFeedbackCrossGain, delayFeedbackBaseGain, 0.0f, 0.0f,
|
||||||
delayFeedbackCrossGain, delayFeedbackCrossGain, 0.0f , 0.0f , delayFeedbackBaseGain , 0.0f ,
|
delayFeedbackCrossGain, delayFeedbackCrossGain, 0.0f, 0.0f, delayFeedbackBaseGain, 0.0f,
|
||||||
0.0f , 0.0f , 0.0f , 0.0f , 0.0f , feedbackGain);
|
0.0f, 0.0f, 0.0f, 0.0f, 0.0f, feedbackGain);
|
||||||
|
|
||||||
for (int i = 0; i < sampleCount; i++)
|
for (int i = 0; i < sampleCount; i++)
|
||||||
{
|
{
|
||||||
|
@@ -25,6 +25,6 @@ namespace Ryujinx.Audio.Renderer.Dsp.State
|
|||||||
UpdateParameter(ref parameter);
|
UpdateParameter(ref parameter);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateParameter(ref LimiterParameter parameter) {}
|
public void UpdateParameter(ref LimiterParameter parameter) { }
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -29,34 +29,34 @@ namespace Ryujinx.Audio.Renderer.Server
|
|||||||
private object _lock = new object();
|
private object _lock = new object();
|
||||||
|
|
||||||
private AudioRendererExecutionMode _executionMode;
|
private AudioRendererExecutionMode _executionMode;
|
||||||
private IWritableEvent _systemEvent;
|
private IWritableEvent _systemEvent;
|
||||||
private ManualResetEvent _terminationEvent;
|
private ManualResetEvent _terminationEvent;
|
||||||
private MemoryPoolState _dspMemoryPoolState;
|
private MemoryPoolState _dspMemoryPoolState;
|
||||||
private VoiceContext _voiceContext;
|
private VoiceContext _voiceContext;
|
||||||
private MixContext _mixContext;
|
private MixContext _mixContext;
|
||||||
private SinkContext _sinkContext;
|
private SinkContext _sinkContext;
|
||||||
private SplitterContext _splitterContext;
|
private SplitterContext _splitterContext;
|
||||||
private EffectContext _effectContext;
|
private EffectContext _effectContext;
|
||||||
private PerformanceManager _performanceManager;
|
private PerformanceManager _performanceManager;
|
||||||
private UpsamplerManager _upsamplerManager;
|
private UpsamplerManager _upsamplerManager;
|
||||||
private bool _isActive;
|
private bool _isActive;
|
||||||
private BehaviourContext _behaviourContext;
|
private BehaviourContext _behaviourContext;
|
||||||
private ulong _totalElapsedTicksUpdating;
|
private ulong _totalElapsedTicksUpdating;
|
||||||
private ulong _totalElapsedTicks;
|
private ulong _totalElapsedTicks;
|
||||||
private int _sessionId;
|
private int _sessionId;
|
||||||
private Memory<MemoryPoolState> _memoryPools;
|
private Memory<MemoryPoolState> _memoryPools;
|
||||||
|
|
||||||
private uint _sampleRate;
|
private uint _sampleRate;
|
||||||
private uint _sampleCount;
|
private uint _sampleCount;
|
||||||
private uint _mixBufferCount;
|
private uint _mixBufferCount;
|
||||||
private uint _voiceChannelCountMax;
|
private uint _voiceChannelCountMax;
|
||||||
private uint _upsamplerCount;
|
private uint _upsamplerCount;
|
||||||
private uint _memoryPoolCount;
|
private uint _memoryPoolCount;
|
||||||
private uint _processHandle;
|
private uint _processHandle;
|
||||||
private ulong _appletResourceId;
|
private ulong _appletResourceId;
|
||||||
|
|
||||||
private WritableRegion _workBufferRegion;
|
private WritableRegion _workBufferRegion;
|
||||||
private MemoryHandle _workBufferMemoryPin;
|
private MemoryHandle _workBufferMemoryPin;
|
||||||
|
|
||||||
private Memory<float> _mixBuffer;
|
private Memory<float> _mixBuffer;
|
||||||
private Memory<float> _depopBuffer;
|
private Memory<float> _depopBuffer;
|
||||||
@@ -81,21 +81,21 @@ namespace Ryujinx.Audio.Renderer.Server
|
|||||||
|
|
||||||
public AudioRenderSystem(AudioRendererManager manager, IWritableEvent systemEvent)
|
public AudioRenderSystem(AudioRendererManager manager, IWritableEvent systemEvent)
|
||||||
{
|
{
|
||||||
_manager = manager;
|
_manager = manager;
|
||||||
_terminationEvent = new ManualResetEvent(false);
|
_terminationEvent = new ManualResetEvent(false);
|
||||||
_dspMemoryPoolState = MemoryPoolState.Create(MemoryPoolState.LocationType.Dsp);
|
_dspMemoryPoolState = MemoryPoolState.Create(MemoryPoolState.LocationType.Dsp);
|
||||||
_voiceContext = new VoiceContext();
|
_voiceContext = new VoiceContext();
|
||||||
_mixContext = new MixContext();
|
_mixContext = new MixContext();
|
||||||
_sinkContext = new SinkContext();
|
_sinkContext = new SinkContext();
|
||||||
_splitterContext = new SplitterContext();
|
_splitterContext = new SplitterContext();
|
||||||
_effectContext = new EffectContext();
|
_effectContext = new EffectContext();
|
||||||
|
|
||||||
_commandProcessingTimeEstimator = null;
|
_commandProcessingTimeEstimator = null;
|
||||||
_systemEvent = systemEvent;
|
_systemEvent = systemEvent;
|
||||||
_behaviourContext = new BehaviourContext();
|
_behaviourContext = new BehaviourContext();
|
||||||
|
|
||||||
_totalElapsedTicksUpdating = 0;
|
_totalElapsedTicksUpdating = 0;
|
||||||
_sessionId = 0;
|
_sessionId = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResultCode Initialize(ref AudioRendererConfiguration parameter, uint processHandle, CpuAddress workBuffer, ulong workBufferSize, int sessionId, ulong appletResourceId, IVirtualMemoryManager memoryManager)
|
public ResultCode Initialize(ref AudioRendererConfiguration parameter, uint processHandle, CpuAddress workBuffer, ulong workBufferSize, int sessionId, ulong appletResourceId, IVirtualMemoryManager memoryManager)
|
||||||
@@ -116,7 +116,7 @@ namespace Ryujinx.Audio.Renderer.Server
|
|||||||
|
|
||||||
_behaviourContext.SetUserRevision(parameter.Revision);
|
_behaviourContext.SetUserRevision(parameter.Revision);
|
||||||
|
|
||||||
_sampleRate = parameter.SampleRate;
|
_sampleRate = parameter.SampleRate;
|
||||||
_sampleCount = parameter.SampleCount;
|
_sampleCount = parameter.SampleCount;
|
||||||
_mixBufferCount = parameter.MixBufferCount;
|
_mixBufferCount = parameter.MixBufferCount;
|
||||||
_voiceChannelCountMax = Constants.VoiceChannelCountMax;
|
_voiceChannelCountMax = Constants.VoiceChannelCountMax;
|
||||||
@@ -203,7 +203,7 @@ namespace Ryujinx.Audio.Renderer.Server
|
|||||||
{
|
{
|
||||||
ref VoiceChannelResource voiceChannelResource = ref voiceChannelResources.Span[(int)id];
|
ref VoiceChannelResource voiceChannelResource = ref voiceChannelResources.Span[(int)id];
|
||||||
|
|
||||||
voiceChannelResource.Id = id;
|
voiceChannelResource.Id = id;
|
||||||
voiceChannelResource.IsUsed = false;
|
voiceChannelResource.IsUsed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -141,8 +141,8 @@ namespace Ryujinx.Audio.Renderer.Server
|
|||||||
public BehaviourContext()
|
public BehaviourContext()
|
||||||
{
|
{
|
||||||
UserRevision = 0;
|
UserRevision = 0;
|
||||||
_errorInfos = new ErrorInfo[Constants.MaxErrorInfos];
|
_errorInfos = new ErrorInfo[Constants.MaxErrorInfos];
|
||||||
_errorIndex = 0;
|
_errorIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@@ -81,7 +81,7 @@ namespace Ryujinx.Audio.Renderer.Server.Effect
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="parameter">The user parameter.</param>
|
/// <param name="parameter">The user parameter.</param>
|
||||||
/// <returns>Returns true if the <see cref="EffectType"/> sent by the user matches the internal <see cref="EffectType"/>.</returns>
|
/// <returns>Returns true if the <see cref="EffectType"/> sent by the user matches the internal <see cref="EffectType"/>.</returns>
|
||||||
public bool IsTypeValid<T>(ref T parameter) where T: unmanaged, IEffectInParameter
|
public bool IsTypeValid<T>(ref T parameter) where T : unmanaged, IEffectInParameter
|
||||||
{
|
{
|
||||||
return parameter.Type == TargetEffectType;
|
return parameter.Type == TargetEffectType;
|
||||||
}
|
}
|
||||||
@@ -140,14 +140,14 @@ namespace Ryujinx.Audio.Renderer.Server.Effect
|
|||||||
/// Initialize the given <paramref name="state"/> result state.
|
/// Initialize the given <paramref name="state"/> result state.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="state">The state to initalize</param>
|
/// <param name="state">The state to initalize</param>
|
||||||
public virtual void InitializeResultState(ref EffectResultState state) {}
|
public virtual void InitializeResultState(ref EffectResultState state) { }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Update the <paramref name="destState"/> result state with <paramref name="srcState"/>.
|
/// Update the <paramref name="destState"/> result state with <paramref name="srcState"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="destState">The destination result state</param>
|
/// <param name="destState">The destination result state</param>
|
||||||
/// <param name="srcState">The source result state</param>
|
/// <param name="srcState">The source result state</param>
|
||||||
public virtual void UpdateResultState(ref EffectResultState destState, ref EffectResultState srcState) {}
|
public virtual void UpdateResultState(ref EffectResultState destState, ref EffectResultState srcState) { }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Update the internal state from a user version 1 parameter.
|
/// Update the internal state from a user version 1 parameter.
|
||||||
@@ -215,7 +215,7 @@ namespace Ryujinx.Audio.Renderer.Server.Effect
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="outStatus">The given user output.</param>
|
/// <param name="outStatus">The given user output.</param>
|
||||||
/// <param name="isAudioRendererActive">If set to true, the <see cref="AudioRenderSystem"/> is active.</param>
|
/// <param name="isAudioRendererActive">If set to true, the <see cref="AudioRenderSystem"/> is active.</param>
|
||||||
public void StoreStatus<T>(ref T outStatus, bool isAudioRendererActive) where T: unmanaged, IEffectOutStatus
|
public void StoreStatus<T>(ref T outStatus, bool isAudioRendererActive) where T : unmanaged, IEffectOutStatus
|
||||||
{
|
{
|
||||||
if (isAudioRendererActive)
|
if (isAudioRendererActive)
|
||||||
{
|
{
|
||||||
|
@@ -46,7 +46,7 @@ namespace Ryujinx.Audio.Renderer.Server.Effect
|
|||||||
Update(out updateErrorInfo, ref parameter, mapper);
|
Update(out updateErrorInfo, ref parameter, mapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Update<T>(out BehaviourParameter.ErrorInfo updateErrorInfo, ref T parameter, PoolMapper mapper) where T: unmanaged, IEffectInParameter
|
public void Update<T>(out BehaviourParameter.ErrorInfo updateErrorInfo, ref T parameter, PoolMapper mapper) where T : unmanaged, IEffectInParameter
|
||||||
{
|
{
|
||||||
Debug.Assert(IsTypeValid(ref parameter));
|
Debug.Assert(IsTypeValid(ref parameter));
|
||||||
|
|
||||||
|
@@ -1,8 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
using DspAddress = System.UInt64;
|
|
||||||
using CpuAddress = System.UInt64;
|
using CpuAddress = System.UInt64;
|
||||||
|
using DspAddress = System.UInt64;
|
||||||
|
|
||||||
namespace Ryujinx.Audio.Renderer.Server.MemoryPool
|
namespace Ryujinx.Audio.Renderer.Server.MemoryPool
|
||||||
{
|
{
|
||||||
@@ -53,9 +52,9 @@ namespace Ryujinx.Audio.Renderer.Server.MemoryPool
|
|||||||
{
|
{
|
||||||
return new AddressInfo
|
return new AddressInfo
|
||||||
{
|
{
|
||||||
CpuAddress = cpuAddress,
|
CpuAddress = cpuAddress,
|
||||||
_memoryPools = MemoryPoolState.Null,
|
_memoryPools = MemoryPoolState.Null,
|
||||||
Size = size,
|
Size = size,
|
||||||
ForceMappedDspAddress = 0
|
ForceMappedDspAddress = 0
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -68,8 +67,8 @@ namespace Ryujinx.Audio.Renderer.Server.MemoryPool
|
|||||||
/// <param name="size">The size of the region.</param>
|
/// <param name="size">The size of the region.</param>
|
||||||
public void Setup(CpuAddress cpuAddress, ulong size)
|
public void Setup(CpuAddress cpuAddress, ulong size)
|
||||||
{
|
{
|
||||||
CpuAddress = cpuAddress;
|
CpuAddress = cpuAddress;
|
||||||
Size = size;
|
Size = size;
|
||||||
ForceMappedDspAddress = 0;
|
ForceMappedDspAddress = 0;
|
||||||
|
|
||||||
unsafe
|
unsafe
|
||||||
|
@@ -1,8 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
using DspAddress = System.UInt64;
|
|
||||||
using CpuAddress = System.UInt64;
|
using CpuAddress = System.UInt64;
|
||||||
|
using DspAddress = System.UInt64;
|
||||||
|
|
||||||
namespace Ryujinx.Audio.Renderer.Server.MemoryPool
|
namespace Ryujinx.Audio.Renderer.Server.MemoryPool
|
||||||
{
|
{
|
||||||
@@ -69,8 +68,8 @@ namespace Ryujinx.Audio.Renderer.Server.MemoryPool
|
|||||||
{
|
{
|
||||||
CpuAddress = 0,
|
CpuAddress = 0,
|
||||||
DspAddress = 0,
|
DspAddress = 0,
|
||||||
Size = 0,
|
Size = 0,
|
||||||
Location = location
|
Location = location
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,7 +81,7 @@ namespace Ryujinx.Audio.Renderer.Server.MemoryPool
|
|||||||
public void SetCpuAddress(CpuAddress cpuAddress, ulong size)
|
public void SetCpuAddress(CpuAddress cpuAddress, ulong size)
|
||||||
{
|
{
|
||||||
CpuAddress = cpuAddress;
|
CpuAddress = cpuAddress;
|
||||||
Size = size;
|
Size = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@@ -229,14 +229,14 @@ namespace Ryujinx.Audio.Renderer.Server.MemoryPool
|
|||||||
|
|
||||||
if (AssignDspAddress(ref addressInfo))
|
if (AssignDspAddress(ref addressInfo))
|
||||||
{
|
{
|
||||||
errorInfo.ErrorCode = 0x0;
|
errorInfo.ErrorCode = 0x0;
|
||||||
errorInfo.ExtraErrorInfo = 0x0;
|
errorInfo.ExtraErrorInfo = 0x0;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
errorInfo.ErrorCode = ResultCode.InvalidAddressInfo;
|
errorInfo.ErrorCode = ResultCode.InvalidAddressInfo;
|
||||||
errorInfo.ExtraErrorInfo = addressInfo.CpuAddress;
|
errorInfo.ExtraErrorInfo = addressInfo.CpuAddress;
|
||||||
|
|
||||||
return _isForceMapEnabled;
|
return _isForceMapEnabled;
|
||||||
|
@@ -13,7 +13,7 @@ namespace Ryujinx.Audio.Renderer.Server.Performance
|
|||||||
/// <typeparam name="THeader">The header implementation of the performance frame.</typeparam>
|
/// <typeparam name="THeader">The header implementation of the performance frame.</typeparam>
|
||||||
/// <typeparam name="TEntry">The entry implementation of the performance frame.</typeparam>
|
/// <typeparam name="TEntry">The entry implementation of the performance frame.</typeparam>
|
||||||
/// <typeparam name="TEntryDetail">A detailed implementation of the performance frame.</typeparam>
|
/// <typeparam name="TEntryDetail">A detailed implementation of the performance frame.</typeparam>
|
||||||
public class PerformanceManagerGeneric<THeader, TEntry, TEntryDetail> : PerformanceManager where THeader: unmanaged, IPerformanceHeader where TEntry : unmanaged, IPerformanceEntry where TEntryDetail: unmanaged, IPerformanceDetailEntry
|
public class PerformanceManagerGeneric<THeader, TEntry, TEntryDetail> : PerformanceManager where THeader : unmanaged, IPerformanceHeader where TEntry : unmanaged, IPerformanceEntry where TEntryDetail : unmanaged, IPerformanceDetailEntry
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The magic used for the <see cref="THeader"/>.
|
/// The magic used for the <see cref="THeader"/>.
|
||||||
|
@@ -172,7 +172,7 @@ namespace Ryujinx.Audio.Renderer.Server.Splitter
|
|||||||
{
|
{
|
||||||
unsafe
|
unsafe
|
||||||
{
|
{
|
||||||
fixed (SplitterDestination *nextPtr = &next)
|
fixed (SplitterDestination* nextPtr = &next)
|
||||||
{
|
{
|
||||||
_next = nextPtr;
|
_next = nextPtr;
|
||||||
}
|
}
|
||||||
|
@@ -21,7 +21,7 @@ namespace Ryujinx.Audio.Renderer.Server
|
|||||||
public class StateUpdater
|
public class StateUpdater
|
||||||
{
|
{
|
||||||
private readonly ReadOnlyMemory<byte> _inputOrigin;
|
private readonly ReadOnlyMemory<byte> _inputOrigin;
|
||||||
private ReadOnlyMemory <byte> _outputOrigin;
|
private ReadOnlyMemory<byte> _outputOrigin;
|
||||||
private ReadOnlyMemory<byte> _input;
|
private ReadOnlyMemory<byte> _input;
|
||||||
|
|
||||||
private Memory<byte> _output;
|
private Memory<byte> _output;
|
||||||
@@ -207,7 +207,7 @@ namespace Ryujinx.Audio.Renderer.Server
|
|||||||
return ResultCode.Success;
|
return ResultCode.Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void ResetEffect<T>(ref BaseEffect effect, ref T parameter, PoolMapper mapper) where T: unmanaged, IEffectInParameter
|
private static void ResetEffect<T>(ref BaseEffect effect, ref T parameter, PoolMapper mapper) where T : unmanaged, IEffectInParameter
|
||||||
{
|
{
|
||||||
effect.ForceUnmapBuffers(mapper);
|
effect.ForceUnmapBuffers(mapper);
|
||||||
|
|
||||||
|
@@ -200,7 +200,7 @@ namespace Ryujinx.Audio.Renderer.Server.Voice
|
|||||||
SampleFormat = SampleFormat.Invalid;
|
SampleFormat = SampleFormat.Invalid;
|
||||||
ChannelsCount = 0;
|
ChannelsCount = 0;
|
||||||
Pitch = 0.0f;
|
Pitch = 0.0f;
|
||||||
Volume= 0.0f;
|
Volume = 0.0f;
|
||||||
PreviousVolume = 0.0f;
|
PreviousVolume = 0.0f;
|
||||||
BiquadFilters.ToSpan().Fill(new BiquadFilterParameter());
|
BiquadFilters.ToSpan().Fill(new BiquadFilterParameter());
|
||||||
WaveBuffersCount = 0;
|
WaveBuffersCount = 0;
|
||||||
@@ -260,7 +260,7 @@ namespace Ryujinx.Audio.Renderer.Server.Voice
|
|||||||
}
|
}
|
||||||
|
|
||||||
return DataSourceStateAddressInfo.CpuAddress != parameter.DataSourceStateAddress ||
|
return DataSourceStateAddressInfo.CpuAddress != parameter.DataSourceStateAddress ||
|
||||||
DataSourceStateAddressInfo.Size != parameter.DataSourceStateSize ||
|
DataSourceStateAddressInfo.Size != parameter.DataSourceStateSize ||
|
||||||
DataSourceStateUnmapped;
|
DataSourceStateUnmapped;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
|
|
||||||
using DspAddress = System.UInt64;
|
|
||||||
using CpuAddress = System.UInt64;
|
using CpuAddress = System.UInt64;
|
||||||
|
using DspAddress = System.UInt64;
|
||||||
|
|
||||||
namespace Ryujinx.Audio.Renderer.Utils
|
namespace Ryujinx.Audio.Renderer.Utils
|
||||||
{
|
{
|
||||||
|
@@ -2,20 +2,20 @@ namespace Ryujinx.Audio
|
|||||||
{
|
{
|
||||||
public enum ResultCode
|
public enum ResultCode
|
||||||
{
|
{
|
||||||
ModuleId = 153,
|
ModuleId = 153,
|
||||||
ErrorCodeShift = 9,
|
ErrorCodeShift = 9,
|
||||||
|
|
||||||
Success = 0,
|
Success = 0,
|
||||||
|
|
||||||
DeviceNotFound = (1 << ErrorCodeShift) | ModuleId,
|
DeviceNotFound = (1 << ErrorCodeShift) | ModuleId,
|
||||||
OperationFailed = (2 << ErrorCodeShift) | ModuleId,
|
OperationFailed = (2 << ErrorCodeShift) | ModuleId,
|
||||||
UnsupportedSampleRate = (3 << ErrorCodeShift) | ModuleId,
|
UnsupportedSampleRate = (3 << ErrorCodeShift) | ModuleId,
|
||||||
WorkBufferTooSmall = (4 << ErrorCodeShift) | ModuleId,
|
WorkBufferTooSmall = (4 << ErrorCodeShift) | ModuleId,
|
||||||
BufferRingFull = (8 << ErrorCodeShift) | ModuleId,
|
BufferRingFull = (8 << ErrorCodeShift) | ModuleId,
|
||||||
UnsupportedChannelConfiguration = (10 << ErrorCodeShift) | ModuleId,
|
UnsupportedChannelConfiguration = (10 << ErrorCodeShift) | ModuleId,
|
||||||
InvalidUpdateInfo = (41 << ErrorCodeShift) | ModuleId,
|
InvalidUpdateInfo = (41 << ErrorCodeShift) | ModuleId,
|
||||||
InvalidAddressInfo = (42 << ErrorCodeShift) | ModuleId,
|
InvalidAddressInfo = (42 << ErrorCodeShift) | ModuleId,
|
||||||
InvalidMixSorting = (43 << ErrorCodeShift) | ModuleId,
|
InvalidMixSorting = (43 << ErrorCodeShift) | ModuleId,
|
||||||
UnsupportedOperation = (513 << ErrorCodeShift) | ModuleId,
|
UnsupportedOperation = (513 << ErrorCodeShift) | ModuleId,
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -53,6 +53,7 @@ namespace Ryujinx.Ava
|
|||||||
internal class AppHost
|
internal class AppHost
|
||||||
{
|
{
|
||||||
private const int CursorHideIdleTime = 8; // Hide Cursor seconds
|
private const int CursorHideIdleTime = 8; // Hide Cursor seconds
|
||||||
|
private const float MaxResolutionScale = 4.0f; // Max resolution hotkeys can scale to before wrapping.
|
||||||
|
|
||||||
private static readonly Cursor InvisibleCursor = new Cursor(StandardCursorType.None);
|
private static readonly Cursor InvisibleCursor = new Cursor(StandardCursorType.None);
|
||||||
|
|
||||||
@@ -976,6 +977,13 @@ namespace Ryujinx.Ava
|
|||||||
|
|
||||||
_parent.ViewModel.Volume = Device.GetVolume();
|
_parent.ViewModel.Volume = Device.GetVolume();
|
||||||
break;
|
break;
|
||||||
|
case KeyboardHotkeyState.ResScaleUp:
|
||||||
|
GraphicsConfig.ResScale = GraphicsConfig.ResScale % MaxResolutionScale + 1;
|
||||||
|
break;
|
||||||
|
case KeyboardHotkeyState.ResScaleDown:
|
||||||
|
GraphicsConfig.ResScale =
|
||||||
|
(MaxResolutionScale + GraphicsConfig.ResScale - 2) % MaxResolutionScale + 1;
|
||||||
|
break;
|
||||||
case KeyboardHotkeyState.None:
|
case KeyboardHotkeyState.None:
|
||||||
(_keyboardInterface as AvaloniaKeyboard).Clear();
|
(_keyboardInterface as AvaloniaKeyboard).Clear();
|
||||||
break;
|
break;
|
||||||
@@ -1033,6 +1041,14 @@ namespace Ryujinx.Ava
|
|||||||
{
|
{
|
||||||
state = KeyboardHotkeyState.ToggleMute;
|
state = KeyboardHotkeyState.ToggleMute;
|
||||||
}
|
}
|
||||||
|
else if (_keyboardInterface.IsPressed((Key)ConfigurationState.Instance.Hid.Hotkeys.Value.ResScaleUp))
|
||||||
|
{
|
||||||
|
state = KeyboardHotkeyState.ResScaleUp;
|
||||||
|
}
|
||||||
|
else if (_keyboardInterface.IsPressed((Key)ConfigurationState.Instance.Hid.Hotkeys.Value.ResScaleDown))
|
||||||
|
{
|
||||||
|
state = KeyboardHotkeyState.ResScaleDown;
|
||||||
|
}
|
||||||
|
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
@@ -556,5 +556,7 @@
|
|||||||
"SettingsSelectThemeFileDialogTitle" : "Wähle ein benutzerdefiniertes Thema",
|
"SettingsSelectThemeFileDialogTitle" : "Wähle ein benutzerdefiniertes Thema",
|
||||||
"SettingsXamlThemeFile" : "Xaml Thema-Datei",
|
"SettingsXamlThemeFile" : "Xaml Thema-Datei",
|
||||||
"SettingsTabGraphicsBackend" : "Grafik-Backend",
|
"SettingsTabGraphicsBackend" : "Grafik-Backend",
|
||||||
"GraphicsBackendTooltip" : "Ändert das Grafik-Backend"
|
"GraphicsBackendTooltip" : "Ändert das Grafik-Backend",
|
||||||
|
"SettingsTabHotkeysResScaleUpHotkey": "Auflösung erhöhen:",
|
||||||
|
"SettingsTabHotkeysResScaleDownHotkey": "Auflösung vermindern:"
|
||||||
}
|
}
|
||||||
|
@@ -575,5 +575,7 @@
|
|||||||
"UserProfilesSetProfileImage": "Set Profile Image",
|
"UserProfilesSetProfileImage": "Set Profile Image",
|
||||||
"UserProfileEmptyNameError": "Name is required",
|
"UserProfileEmptyNameError": "Name is required",
|
||||||
"UserProfileNoImageError": "Profile image must be set",
|
"UserProfileNoImageError": "Profile image must be set",
|
||||||
"GameUpdateWindowHeading": "Updates Available for {0} [{1}]"
|
"GameUpdateWindowHeading": "Updates Available for {0} [{1}]",
|
||||||
|
"SettingsTabHotkeysResScaleUpHotkey": "Increase resolution:",
|
||||||
|
"SettingsTabHotkeysResScaleDownHotkey": "Decrease resolution:"
|
||||||
}
|
}
|
||||||
|
@@ -568,5 +568,7 @@
|
|||||||
"UpdateWindowTitle": "Administrar actualizaciones",
|
"UpdateWindowTitle": "Administrar actualizaciones",
|
||||||
"CheatWindowHeading": "Cheats disponibles para {0} [{1}]",
|
"CheatWindowHeading": "Cheats disponibles para {0} [{1}]",
|
||||||
"DlcWindowHeading": "Contenido descargable disponible para {0} [{1}]",
|
"DlcWindowHeading": "Contenido descargable disponible para {0} [{1}]",
|
||||||
"GameUpdateWindowHeading": "Actualizaciones disponibles para {0} [{1}]"
|
"GameUpdateWindowHeading": "Actualizaciones disponibles para {0} [{1}]",
|
||||||
|
"SettingsTabHotkeysResScaleUpHotkey": "Aumentar la resolución:",
|
||||||
|
"SettingsTabHotkeysResScaleDownHotkey": "Disminuir la resolución:"
|
||||||
}
|
}
|
||||||
|
@@ -554,5 +554,7 @@
|
|||||||
"ControllerMotionTitle": "Impostazioni dei sensori di movimento",
|
"ControllerMotionTitle": "Impostazioni dei sensori di movimento",
|
||||||
"ControllerRumbleTitle": "Impostazioni di vibrazione",
|
"ControllerRumbleTitle": "Impostazioni di vibrazione",
|
||||||
"SettingsSelectThemeFileDialogTitle" : "Seleziona file del tema",
|
"SettingsSelectThemeFileDialogTitle" : "Seleziona file del tema",
|
||||||
"SettingsXamlThemeFile" : "File del tema xaml"
|
"SettingsXamlThemeFile" : "File del tema xaml",
|
||||||
|
"SettingsTabHotkeysResScaleUpHotkey": "Aumentare la risoluzione:",
|
||||||
|
"SettingsTabHotkeysResScaleDownHotkey": "Diminuire la risoluzione:"
|
||||||
}
|
}
|
||||||
|
@@ -554,5 +554,7 @@
|
|||||||
"ControllerMotionTitle": "Configurações do controle de movimento",
|
"ControllerMotionTitle": "Configurações do controle de movimento",
|
||||||
"ControllerRumbleTitle": "Configurações de vibração",
|
"ControllerRumbleTitle": "Configurações de vibração",
|
||||||
"SettingsSelectThemeFileDialogTitle" : "Selecionar arquivo do tema",
|
"SettingsSelectThemeFileDialogTitle" : "Selecionar arquivo do tema",
|
||||||
"SettingsXamlThemeFile" : "Arquivo de tema Xaml"
|
"SettingsXamlThemeFile" : "Arquivo de tema Xaml",
|
||||||
|
"SettingsTabHotkeysResScaleUpHotkey": "Aumentar a resolução:",
|
||||||
|
"SettingsTabHotkeysResScaleDownHotkey": "Diminuir a resolução:"
|
||||||
}
|
}
|
||||||
|
@@ -554,5 +554,7 @@
|
|||||||
"ControllerMotionTitle": "Hareket Kontrol Seçenekleri",
|
"ControllerMotionTitle": "Hareket Kontrol Seçenekleri",
|
||||||
"ControllerRumbleTitle": "Titreşim Seçenekleri",
|
"ControllerRumbleTitle": "Titreşim Seçenekleri",
|
||||||
"SettingsSelectThemeFileDialogTitle" : "Tema Dosyası Seçin",
|
"SettingsSelectThemeFileDialogTitle" : "Tema Dosyası Seçin",
|
||||||
"SettingsXamlThemeFile" : "Xaml Tema Dosyası"
|
"SettingsXamlThemeFile" : "Xaml Tema Dosyası",
|
||||||
|
"SettingsTabHotkeysResScaleUpHotkey": "Çözünürlüğü artırın:",
|
||||||
|
"SettingsTabHotkeysResScaleDownHotkey": "Çözünürlüğü azaltın:"
|
||||||
}
|
}
|
||||||
|
@@ -568,5 +568,7 @@
|
|||||||
"UpdateWindowTitle": "管理游戏更新",
|
"UpdateWindowTitle": "管理游戏更新",
|
||||||
"CheatWindowHeading": "适用于 {0} [{1}] 的金手指",
|
"CheatWindowHeading": "适用于 {0} [{1}] 的金手指",
|
||||||
"DlcWindowHeading": "适用于 {0} [{1}] 的 DLC",
|
"DlcWindowHeading": "适用于 {0} [{1}] 的 DLC",
|
||||||
"GameUpdateWindowHeading": "适用于 {0} [{1}] 的更新"
|
"GameUpdateWindowHeading": "适用于 {0} [{1}] 的更新",
|
||||||
|
"SettingsTabHotkeysResScaleUpHotkey": "分辨率提高",
|
||||||
|
"SettingsTabHotkeysResScaleDownHotkey": "降低分辨率"
|
||||||
}
|
}
|
||||||
|
@@ -7,6 +7,8 @@
|
|||||||
Screenshot,
|
Screenshot,
|
||||||
ShowUi,
|
ShowUi,
|
||||||
Pause,
|
Pause,
|
||||||
ToggleMute
|
ToggleMute,
|
||||||
|
ResScaleUp,
|
||||||
|
ResScaleDown
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -241,6 +241,22 @@
|
|||||||
TextAlignment="Center" />
|
TextAlignment="Center" />
|
||||||
</ToggleButton>
|
</ToggleButton>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
<StackPanel Margin="10,0,0,0" Orientation="Horizontal">
|
||||||
|
<TextBlock VerticalAlignment="Center" Text="{locale:Locale SettingsTabHotkeysResScaleUpHotkey}" Width="230" />
|
||||||
|
<ToggleButton Width="90" Height="27" Checked="Button_Checked" Unchecked="Button_Unchecked">
|
||||||
|
<TextBlock
|
||||||
|
Text="{Binding KeyboardHotkeys.ResScaleUp, Mode=TwoWay, Converter={StaticResource Key}}"
|
||||||
|
TextAlignment="Center" />
|
||||||
|
</ToggleButton>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Margin="10,0,0,0" Orientation="Horizontal">
|
||||||
|
<TextBlock VerticalAlignment="Center" Text="{locale:Locale SettingsTabHotkeysResScaleDownHotkey}" Width="230" />
|
||||||
|
<ToggleButton Width="90" Height="27" Checked="Button_Checked" Unchecked="Button_Unchecked">
|
||||||
|
<TextBlock
|
||||||
|
Text="{Binding KeyboardHotkeys.ResScaleDown, Mode=TwoWay, Converter={StaticResource Key}}"
|
||||||
|
TextAlignment="Center" />
|
||||||
|
</ToggleButton>
|
||||||
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
|
@@ -7,5 +7,7 @@
|
|||||||
public Key ShowUi { get; set; }
|
public Key ShowUi { get; set; }
|
||||||
public Key Pause { get; set; }
|
public Key Pause { get; set; }
|
||||||
public Key ToggleMute { get; set; }
|
public Key ToggleMute { get; set; }
|
||||||
|
public Key ResScaleUp { get; set; }
|
||||||
|
public Key ResScaleDown { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -14,7 +14,7 @@ namespace Ryujinx.Ui.Common.Configuration
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The current version of the file format
|
/// The current version of the file format
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const int CurrentVersion = 38;
|
public const int CurrentVersion = 39;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Version of the configuration file format
|
/// Version of the configuration file format
|
||||||
|
@@ -648,7 +648,9 @@ namespace Ryujinx.Ui.Common.Configuration
|
|||||||
ToggleMute = Key.F2,
|
ToggleMute = Key.F2,
|
||||||
Screenshot = Key.F8,
|
Screenshot = Key.F8,
|
||||||
ShowUi = Key.F4,
|
ShowUi = Key.F4,
|
||||||
Pause = Key.F5
|
Pause = Key.F5,
|
||||||
|
ResScaleUp = Key.Unbound,
|
||||||
|
ResScaleDown = Key.Unbound
|
||||||
};
|
};
|
||||||
Hid.InputConfig.Value = new List<InputConfig>
|
Hid.InputConfig.Value = new List<InputConfig>
|
||||||
{
|
{
|
||||||
@@ -1096,6 +1098,22 @@ namespace Ryujinx.Ui.Common.Configuration
|
|||||||
configurationFileUpdated = true;
|
configurationFileUpdated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (configurationFileFormat.Version < 39)
|
||||||
|
{
|
||||||
|
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 39.");
|
||||||
|
|
||||||
|
configurationFileFormat.Hotkeys = new KeyboardHotkeys
|
||||||
|
{
|
||||||
|
ToggleVsync = configurationFileFormat.Hotkeys.ToggleVsync,
|
||||||
|
Screenshot = configurationFileFormat.Hotkeys.Screenshot,
|
||||||
|
ShowUi = configurationFileFormat.Hotkeys.ShowUi,
|
||||||
|
Pause = configurationFileFormat.Hotkeys.Pause,
|
||||||
|
ToggleMute = configurationFileFormat.Hotkeys.ToggleMute,
|
||||||
|
ResScaleUp = Key.Unbound,
|
||||||
|
ResScaleDown = Key.Unbound
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
Logger.EnableFileLog.Value = configurationFileFormat.EnableFileLog;
|
Logger.EnableFileLog.Value = configurationFileFormat.EnableFileLog;
|
||||||
Graphics.ResScale.Value = configurationFileFormat.ResScale;
|
Graphics.ResScale.Value = configurationFileFormat.ResScale;
|
||||||
Graphics.ResScaleCustom.Value = configurationFileFormat.ResScaleCustom;
|
Graphics.ResScaleCustom.Value = configurationFileFormat.ResScaleCustom;
|
||||||
|
@@ -6,6 +6,7 @@ using Ryujinx.Common;
|
|||||||
using Ryujinx.Common.Configuration;
|
using Ryujinx.Common.Configuration;
|
||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
using Ryujinx.Ui.Common.Configuration;
|
using Ryujinx.Ui.Common.Configuration;
|
||||||
|
using Ryujinx.Graphics.Gpu;
|
||||||
using Ryujinx.Graphics.GAL;
|
using Ryujinx.Graphics.GAL;
|
||||||
using Ryujinx.Graphics.GAL.Multithreading;
|
using Ryujinx.Graphics.GAL.Multithreading;
|
||||||
using Ryujinx.Input;
|
using Ryujinx.Input;
|
||||||
@@ -33,6 +34,7 @@ namespace Ryujinx.Ui
|
|||||||
private const int SwitchPanelWidth = 1280;
|
private const int SwitchPanelWidth = 1280;
|
||||||
private const int SwitchPanelHeight = 720;
|
private const int SwitchPanelHeight = 720;
|
||||||
private const int TargetFps = 60;
|
private const int TargetFps = 60;
|
||||||
|
private const float MaxResolutionScale = 4.0f; // Max resolution hotkeys can scale to before wrapping.
|
||||||
|
|
||||||
public ManualResetEvent WaitEvent { get; set; }
|
public ManualResetEvent WaitEvent { get; set; }
|
||||||
public NpadManager NpadManager { get; }
|
public NpadManager NpadManager { get; }
|
||||||
@@ -618,6 +620,19 @@ namespace Ryujinx.Ui
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (currentHotkeyState.HasFlag(KeyboardHotkeyState.ResScaleUp) &&
|
||||||
|
!_prevHotkeyState.HasFlag(KeyboardHotkeyState.ResScaleUp))
|
||||||
|
{
|
||||||
|
GraphicsConfig.ResScale = GraphicsConfig.ResScale % MaxResolutionScale + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (currentHotkeyState.HasFlag(KeyboardHotkeyState.ResScaleDown) &&
|
||||||
|
!_prevHotkeyState.HasFlag(KeyboardHotkeyState.ResScaleDown))
|
||||||
|
{
|
||||||
|
GraphicsConfig.ResScale =
|
||||||
|
(MaxResolutionScale + GraphicsConfig.ResScale - 2) % MaxResolutionScale + 1;
|
||||||
|
}
|
||||||
|
|
||||||
_prevHotkeyState = currentHotkeyState;
|
_prevHotkeyState = currentHotkeyState;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -648,7 +663,9 @@ namespace Ryujinx.Ui
|
|||||||
Screenshot = 1 << 1,
|
Screenshot = 1 << 1,
|
||||||
ShowUi = 1 << 2,
|
ShowUi = 1 << 2,
|
||||||
Pause = 1 << 3,
|
Pause = 1 << 3,
|
||||||
ToggleMute = 1 << 4
|
ToggleMute = 1 << 4,
|
||||||
|
ResScaleUp = 1 << 5,
|
||||||
|
ResScaleDown = 1 << 6
|
||||||
}
|
}
|
||||||
|
|
||||||
private KeyboardHotkeyState GetHotkeyState()
|
private KeyboardHotkeyState GetHotkeyState()
|
||||||
@@ -680,6 +697,16 @@ namespace Ryujinx.Ui
|
|||||||
state |= KeyboardHotkeyState.ToggleMute;
|
state |= KeyboardHotkeyState.ToggleMute;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_keyboardInterface.IsPressed((Key)ConfigurationState.Instance.Hid.Hotkeys.Value.ResScaleUp))
|
||||||
|
{
|
||||||
|
state |= KeyboardHotkeyState.ResScaleUp;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_keyboardInterface.IsPressed((Key)ConfigurationState.Instance.Hid.Hotkeys.Value.ResScaleDown))
|
||||||
|
{
|
||||||
|
state |= KeyboardHotkeyState.ResScaleDown;
|
||||||
|
}
|
||||||
|
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user