Compare commits
8 Commits
Canary-1.2
...
Canary-1.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
df150f0788 | ||
|
|
e50198b37d | ||
|
|
f426945fec | ||
|
|
172869bfba | ||
|
|
b6f88514f9 | ||
|
|
e92f52e56c | ||
|
|
318498eab0 | ||
|
|
a5cde8e006 |
2
.github/workflows/nightly_pr_comment.yml
vendored
2
.github/workflows/nightly_pr_comment.yml
vendored
@@ -37,7 +37,7 @@ jobs:
|
|||||||
if (!artifacts.length) {
|
if (!artifacts.length) {
|
||||||
return core.error(`No artifacts found`);
|
return core.error(`No artifacts found`);
|
||||||
}
|
}
|
||||||
let body = `Download the artifacts for this pull request:\n`;
|
let body = `*You need to be logged into GitHub to download these files.*\n\nDownload the artifacts for this pull request:\n`;
|
||||||
let hidden_debug_artifacts = `\n\n <details><summary>Only for Developers</summary>\n`;
|
let hidden_debug_artifacts = `\n\n <details><summary>Only for Developers</summary>\n`;
|
||||||
for (const art of artifacts) {
|
for (const art of artifacts) {
|
||||||
const url = `https://github.com/Ryubing/Ryujinx/actions/runs/${run_id}/artifacts/${art.id}`;
|
const url = `https://github.com/Ryubing/Ryujinx/actions/runs/${run_id}/artifacts/${art.id}`;
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
<PackageVersion Include="Ryujinx.Graphics.Nvdec.Dependencies" Version="5.0.3-build14" />
|
<PackageVersion Include="Ryujinx.Graphics.Nvdec.Dependencies" Version="5.0.3-build14" />
|
||||||
<PackageVersion Include="Ryujinx.Graphics.Vulkan.Dependencies.MoltenVK" Version="1.2.0" />
|
<PackageVersion Include="Ryujinx.Graphics.Vulkan.Dependencies.MoltenVK" Version="1.2.0" />
|
||||||
<PackageVersion Include="Ryujinx.SDL2-CS" Version="2.30.0-build32" />
|
<PackageVersion Include="Ryujinx.SDL2-CS" Version="2.30.0-build32" />
|
||||||
<PackageVersion Include="Gommon" Version="2.6.8" />
|
<PackageVersion Include="Gommon" Version="2.7.0" />
|
||||||
<PackageVersion Include="securifybv.ShellLink" Version="0.1.0" />
|
<PackageVersion Include="securifybv.ShellLink" Version="0.1.0" />
|
||||||
<PackageVersion Include="shaderc.net" Version="0.1.0" />
|
<PackageVersion Include="shaderc.net" Version="0.1.0" />
|
||||||
<PackageVersion Include="SharpMetal" Version="1.0.0-preview21" />
|
<PackageVersion Include="SharpMetal" Version="1.0.0-preview21" />
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace Ryujinx.BuildValidationTasks
|
namespace Ryujinx.BuildValidationTasks
|
||||||
{
|
{
|
||||||
public interface ValidationTask
|
public interface IValidationTask
|
||||||
{
|
{
|
||||||
public bool Execute(string projectPath, bool isGitRunner);
|
public bool Execute(string projectPath, bool isGitRunner);
|
||||||
}
|
}
|
||||||
@@ -7,7 +7,7 @@ using System.Text.Encodings.Web;
|
|||||||
|
|
||||||
namespace Ryujinx.BuildValidationTasks
|
namespace Ryujinx.BuildValidationTasks
|
||||||
{
|
{
|
||||||
public class LocalesValidationTask : ValidationTask
|
public class LocalesValidationTask : IValidationTask
|
||||||
{
|
{
|
||||||
public LocalesValidationTask() { }
|
public LocalesValidationTask() { }
|
||||||
|
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
namespace Ryujinx.Common
|
|
||||||
{
|
|
||||||
public class BitTricks
|
|
||||||
{
|
|
||||||
// Never actually written bit packing logic before, so I looked it up.
|
|
||||||
// This code is from https://gist.github.com/Alan-FGR/04938e93e2bffdf5802ceb218a37c195
|
|
||||||
|
|
||||||
public static ulong PackBitFields(uint[] values, byte[] bitFields)
|
|
||||||
{
|
|
||||||
ulong retVal = values[0]; //we set the first value right away
|
|
||||||
for (int f = 1; f < values.Length; f++)
|
|
||||||
{
|
|
||||||
retVal <<= bitFields[f]; // we shift the previous value
|
|
||||||
retVal += values[f];// and add our current value
|
|
||||||
}
|
|
||||||
return retVal;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static uint[] UnpackBitFields(ulong packed, byte[] bitFields)
|
|
||||||
{
|
|
||||||
int fields = bitFields.Length - 1; // number of fields to unpack
|
|
||||||
uint[] retArr = new uint[fields + 1]; // init return array
|
|
||||||
int curPos = 0; // current field bit position (start)
|
|
||||||
int lastEnd; // position where last field ended
|
|
||||||
for (int f = fields; f >= 0; f--) // loop from last
|
|
||||||
{
|
|
||||||
lastEnd = curPos; // we store where the last value ended
|
|
||||||
curPos += bitFields[f]; // we get where the current value starts
|
|
||||||
int leftShift = 64 - curPos; // we figure how much left shift we gotta apply for the other numbers to overflow into oblivion
|
|
||||||
retArr[f] = (uint)((packed << leftShift) >> leftShift + lastEnd); // we do magic
|
|
||||||
}
|
|
||||||
return retArr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
60
src/Ryujinx.Common/Configuration/DirtyHack.cs
Normal file
60
src/Ryujinx.Common/Configuration/DirtyHack.cs
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
using Gommon;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
namespace Ryujinx.Common.Configuration
|
||||||
|
{
|
||||||
|
[Flags]
|
||||||
|
public enum DirtyHack : byte
|
||||||
|
{
|
||||||
|
Xc2MenuSoftlockFix = 1,
|
||||||
|
ShaderTranslationDelay = 2
|
||||||
|
}
|
||||||
|
|
||||||
|
public readonly struct EnabledDirtyHack(DirtyHack hack, int value)
|
||||||
|
{
|
||||||
|
public DirtyHack Hack => hack;
|
||||||
|
public int Value => value;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public ulong Pack() => Raw.PackBitFields(PackedFormat);
|
||||||
|
|
||||||
|
public static EnabledDirtyHack Unpack(ulong packedHack)
|
||||||
|
{
|
||||||
|
var unpackedFields = packedHack.UnpackBitFields(PackedFormat);
|
||||||
|
if (unpackedFields is not [var hack, var value])
|
||||||
|
throw new ArgumentException(nameof(packedHack));
|
||||||
|
|
||||||
|
return new EnabledDirtyHack((DirtyHack)hack, (int)value);
|
||||||
|
}
|
||||||
|
|
||||||
|
private uint[] Raw => [(uint)Hack, (uint)Value.CoerceAtLeast(0)];
|
||||||
|
|
||||||
|
public static readonly byte[] PackedFormat = [8, 32];
|
||||||
|
}
|
||||||
|
|
||||||
|
public class DirtyHacks : Dictionary<DirtyHack, int>
|
||||||
|
{
|
||||||
|
public DirtyHacks(IEnumerable<EnabledDirtyHack> hacks)
|
||||||
|
=> hacks.ForEach(edh => Add(edh.Hack, edh.Value));
|
||||||
|
|
||||||
|
public DirtyHacks(ulong[] packedHacks) : this(packedHacks.Select(EnabledDirtyHack.Unpack)) {}
|
||||||
|
|
||||||
|
public ulong[] PackEntries()
|
||||||
|
=> Entries.Select(it => it.Pack()).ToArray();
|
||||||
|
|
||||||
|
public EnabledDirtyHack[] Entries
|
||||||
|
=> this
|
||||||
|
.Select(it => new EnabledDirtyHack(it.Key, it.Value))
|
||||||
|
.ToArray();
|
||||||
|
|
||||||
|
public static implicit operator DirtyHacks(EnabledDirtyHack[] hacks) => new(hacks);
|
||||||
|
public static implicit operator DirtyHacks(ulong[] packedHacks) => new(packedHacks);
|
||||||
|
|
||||||
|
public new int this[DirtyHack hack] => TryGetValue(hack, out var value) ? value : -1;
|
||||||
|
|
||||||
|
public bool IsEnabled(DirtyHack hack) => ContainsKey(hack);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
namespace Ryujinx.Common.Configuration
|
|
||||||
{
|
|
||||||
[Flags]
|
|
||||||
public enum DirtyHacks : byte
|
|
||||||
{
|
|
||||||
Xc2MenuSoftlockFix = 1,
|
|
||||||
ShaderCompilationThreadSleep = 2
|
|
||||||
}
|
|
||||||
|
|
||||||
public record EnabledDirtyHack(DirtyHacks Hack, int Value)
|
|
||||||
{
|
|
||||||
public static readonly byte[] PackedFormat = [8, 32];
|
|
||||||
|
|
||||||
public ulong Pack() => BitTricks.PackBitFields([(uint)Hack, (uint)Value], PackedFormat);
|
|
||||||
|
|
||||||
public static EnabledDirtyHack Unpack(ulong packedHack)
|
|
||||||
{
|
|
||||||
var unpackedFields = BitTricks.UnpackBitFields(packedHack, PackedFormat);
|
|
||||||
if (unpackedFields is not [var hack, var value])
|
|
||||||
throw new ArgumentException(nameof(packedHack));
|
|
||||||
|
|
||||||
return new EnabledDirtyHack((DirtyHacks)hack, (int)value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class DirtyHackCollection : Dictionary<DirtyHacks, int>
|
|
||||||
{
|
|
||||||
public DirtyHackCollection(EnabledDirtyHack[] hacks)
|
|
||||||
{
|
|
||||||
foreach ((DirtyHacks dirtyHacks, int value) in hacks)
|
|
||||||
{
|
|
||||||
Add(dirtyHacks, value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public DirtyHackCollection(ulong[] packedHacks)
|
|
||||||
{
|
|
||||||
foreach ((DirtyHacks dirtyHacks, int value) in packedHacks.Select(EnabledDirtyHack.Unpack))
|
|
||||||
{
|
|
||||||
Add(dirtyHacks, value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public ulong[] PackEntries() =>
|
|
||||||
this
|
|
||||||
.Select(it =>
|
|
||||||
BitTricks.PackBitFields([(uint)it.Key, (uint)it.Value], EnabledDirtyHack.PackedFormat))
|
|
||||||
.ToArray();
|
|
||||||
|
|
||||||
public static implicit operator DirtyHackCollection(EnabledDirtyHack[] hacks) => new(hacks);
|
|
||||||
public static implicit operator DirtyHackCollection(ulong[] packedHacks) => new(packedHacks);
|
|
||||||
|
|
||||||
public new int this[DirtyHacks hack] => TryGetValue(hack, out var value) ? value : -1;
|
|
||||||
|
|
||||||
public bool IsEnabled(DirtyHacks hack) => ContainsKey(hack);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -40,5 +40,35 @@ namespace Ryujinx.Common
|
|||||||
|
|
||||||
return (value >> 32) | (value << 32);
|
return (value >> 32) | (value << 32);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Never actually written bit packing logic before, so I looked it up.
|
||||||
|
// This code is from https://gist.github.com/Alan-FGR/04938e93e2bffdf5802ceb218a37c195
|
||||||
|
|
||||||
|
public static ulong PackBitFields(this uint[] values, byte[] bitFields)
|
||||||
|
{
|
||||||
|
ulong retVal = values[0]; //we set the first value right away
|
||||||
|
for (int f = 1; f < values.Length; f++)
|
||||||
|
{
|
||||||
|
retVal <<= bitFields[f]; // we shift the previous value
|
||||||
|
retVal += values[f];// and add our current value
|
||||||
|
}
|
||||||
|
return retVal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static uint[] UnpackBitFields(this ulong packed, byte[] bitFields)
|
||||||
|
{
|
||||||
|
int fields = bitFields.Length - 1; // number of fields to unpack
|
||||||
|
uint[] retArr = new uint[fields + 1]; // init return array
|
||||||
|
int curPos = 0; // current field bit position (start)
|
||||||
|
int lastEnd; // position where last field ended
|
||||||
|
for (int f = fields; f >= 0; f--) // loop from last
|
||||||
|
{
|
||||||
|
lastEnd = curPos; // we store where the last value ended
|
||||||
|
curPos += bitFields[f]; // we get where the current value starts
|
||||||
|
int leftShift = 64 - curPos; // we figure how much left shift we gotta apply for the other numbers to overflow into oblivion
|
||||||
|
retArr[f] = (uint)((packed << leftShift) >> leftShift + lastEnd); // we do magic
|
||||||
|
}
|
||||||
|
return retArr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,7 +92,11 @@ namespace Ryujinx.Graphics.Gpu
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
internal SupportBufferUpdater SupportBufferUpdater { get; }
|
internal SupportBufferUpdater SupportBufferUpdater { get; }
|
||||||
|
|
||||||
internal DirtyHackCollection DirtyHacks { get; }
|
/// <summary>
|
||||||
|
/// Enabled dirty hacks.
|
||||||
|
/// Used for workarounds to emulator bugs we can't fix/don't know how to fix yet.
|
||||||
|
/// </summary>
|
||||||
|
internal DirtyHacks DirtyHacks { get; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -117,7 +121,7 @@ namespace Ryujinx.Graphics.Gpu
|
|||||||
/// Creates a new instance of the GPU emulation context.
|
/// Creates a new instance of the GPU emulation context.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="renderer">Host renderer</param>
|
/// <param name="renderer">Host renderer</param>
|
||||||
public GpuContext(IRenderer renderer, DirtyHackCollection hackCollection)
|
public GpuContext(IRenderer renderer, DirtyHacks hacks)
|
||||||
{
|
{
|
||||||
Renderer = renderer;
|
Renderer = renderer;
|
||||||
|
|
||||||
@@ -140,7 +144,7 @@ namespace Ryujinx.Graphics.Gpu
|
|||||||
|
|
||||||
SupportBufferUpdater = new SupportBufferUpdater(renderer);
|
SupportBufferUpdater = new SupportBufferUpdater(renderer);
|
||||||
|
|
||||||
DirtyHacks = hackCollection;
|
DirtyHacks = hacks;
|
||||||
|
|
||||||
_firstTimestamp = ConvertNanosecondsToTicks((ulong)PerformanceCounter.ElapsedNanoseconds);
|
_firstTimestamp = ConvertNanosecondsToTicks((ulong)PerformanceCounter.ElapsedNanoseconds);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -367,8 +367,8 @@ namespace Ryujinx.Graphics.Gpu.Shader.DiskCache
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (_context.DirtyHacks.IsEnabled(DirtyHacks.ShaderCompilationThreadSleep))
|
if (_context.DirtyHacks.IsEnabled(DirtyHack.ShaderTranslationDelay))
|
||||||
Thread.Sleep(_context.DirtyHacks[DirtyHacks.ShaderCompilationThreadSleep]);
|
Thread.Sleep(_context.DirtyHacks[DirtyHack.ShaderTranslationDelay]);
|
||||||
|
|
||||||
AsyncProgramTranslation asyncTranslation = new(guestShaders, specState, programIndex, isCompute);
|
AsyncProgramTranslation asyncTranslation = new(guestShaders, specState, programIndex, isCompute);
|
||||||
_asyncTranslationQueue.Add(asyncTranslation, _cancellationToken);
|
_asyncTranslationQueue.Add(asyncTranslation, _cancellationToken);
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy
|
|||||||
using var region = context.Memory.GetWritableRegion(bufferAddress, (int)bufferLen, true);
|
using var region = context.Memory.GetWritableRegion(bufferAddress, (int)bufferLen, true);
|
||||||
Result result = _baseStorage.Get.Read((long)offset, new OutBuffer(region.Memory.Span), (long)size);
|
Result result = _baseStorage.Get.Read((long)offset, new OutBuffer(region.Memory.Span), (long)size);
|
||||||
|
|
||||||
if (context.Device.DirtyHacks.IsEnabled(DirtyHacks.Xc2MenuSoftlockFix) && TitleIDs.CurrentApplication.Value == Xc2TitleId)
|
if (context.Device.DirtyHacks.IsEnabled(DirtyHack.Xc2MenuSoftlockFix) && TitleIDs.CurrentApplication.Value == Xc2TitleId)
|
||||||
{
|
{
|
||||||
// Add a load-bearing sleep to avoid XC2 softlock
|
// Add a load-bearing sleep to avoid XC2 softlock
|
||||||
// https://web.archive.org/web/20240728045136/https://github.com/Ryujinx/Ryujinx/issues/2357
|
// https://web.archive.org/web/20240728045136/https://github.com/Ryujinx/Ryujinx/issues/2357
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ namespace Ryujinx.HLE
|
|||||||
|
|
||||||
public bool IsFrameAvailable => Gpu.Window.IsFrameAvailable;
|
public bool IsFrameAvailable => Gpu.Window.IsFrameAvailable;
|
||||||
|
|
||||||
public DirtyHackCollection DirtyHacks { get; }
|
public DirtyHacks DirtyHacks { get; }
|
||||||
|
|
||||||
public Switch(HLEConfiguration configuration)
|
public Switch(HLEConfiguration configuration)
|
||||||
{
|
{
|
||||||
@@ -57,7 +57,7 @@ namespace Ryujinx.HLE
|
|||||||
: MemoryAllocationFlags.Reserve | MemoryAllocationFlags.Mirrorable;
|
: MemoryAllocationFlags.Reserve | MemoryAllocationFlags.Mirrorable;
|
||||||
|
|
||||||
#pragma warning disable IDE0055 // Disable formatting
|
#pragma warning disable IDE0055 // Disable formatting
|
||||||
DirtyHacks = new DirtyHackCollection(Configuration.Hacks);
|
DirtyHacks = new DirtyHacks(Configuration.Hacks);
|
||||||
AudioDeviceDriver = new CompatLayerHardwareDeviceDriver(Configuration.AudioDeviceDriver);
|
AudioDeviceDriver = new CompatLayerHardwareDeviceDriver(Configuration.AudioDeviceDriver);
|
||||||
Memory = new MemoryBlock(Configuration.MemoryConfiguration.ToDramSize(), memoryAllocationFlags);
|
Memory = new MemoryBlock(Configuration.MemoryConfiguration.ToDramSize(), memoryAllocationFlags);
|
||||||
Gpu = new GpuContext(Configuration.GpuRenderer, DirtyHacks);
|
Gpu = new GpuContext(Configuration.GpuRenderer, DirtyHacks);
|
||||||
|
|||||||
@@ -1234,7 +1234,7 @@
|
|||||||
"he_IL": "",
|
"he_IL": "",
|
||||||
"it_IT": "",
|
"it_IT": "",
|
||||||
"ja_JP": "",
|
"ja_JP": "",
|
||||||
"ko_KR": "",
|
"ko_KR": "자주 묻는 질문(FAQ) 및 안내",
|
||||||
"no_NO": "",
|
"no_NO": "",
|
||||||
"pl_PL": "",
|
"pl_PL": "",
|
||||||
"pt_BR": "",
|
"pt_BR": "",
|
||||||
@@ -2609,7 +2609,7 @@
|
|||||||
"he_IL": "",
|
"he_IL": "",
|
||||||
"it_IT": "",
|
"it_IT": "",
|
||||||
"ja_JP": "",
|
"ja_JP": "",
|
||||||
"ko_KR": "",
|
"ko_KR": "펌웨어 버전 : {0}",
|
||||||
"no_NO": "",
|
"no_NO": "",
|
||||||
"pl_PL": "",
|
"pl_PL": "",
|
||||||
"pt_BR": "Versão do firmware: {0}",
|
"pt_BR": "Versão do firmware: {0}",
|
||||||
@@ -4009,7 +4009,7 @@
|
|||||||
"he_IL": "",
|
"he_IL": "",
|
||||||
"it_IT": "",
|
"it_IT": "",
|
||||||
"ja_JP": "",
|
"ja_JP": "",
|
||||||
"ko_KR": "",
|
"ko_KR": "PC 날짜와 시간에 동기화",
|
||||||
"no_NO": "",
|
"no_NO": "",
|
||||||
"pl_PL": "",
|
"pl_PL": "",
|
||||||
"pt_BR": "",
|
"pt_BR": "",
|
||||||
@@ -15259,7 +15259,7 @@
|
|||||||
"he_IL": "",
|
"he_IL": "",
|
||||||
"it_IT": "",
|
"it_IT": "",
|
||||||
"ja_JP": "",
|
"ja_JP": "",
|
||||||
"ko_KR": "",
|
"ko_KR": "시스템 시간을 PC의 현재 날짜 및 시간과 일치하도록 다시 동기화합니다.\n\n이 설정은 활성 설정이 아니므로 여전히 동기화되지 않을 수 있으며, 이 경우 이 버튼을 다시 클릭하면 됩니다.",
|
||||||
"no_NO": "",
|
"no_NO": "",
|
||||||
"pl_PL": "",
|
"pl_PL": "",
|
||||||
"pt_BR": "",
|
"pt_BR": "",
|
||||||
@@ -20509,7 +20509,7 @@
|
|||||||
"he_IL": "",
|
"he_IL": "",
|
||||||
"it_IT": "",
|
"it_IT": "",
|
||||||
"ja_JP": "",
|
"ja_JP": "",
|
||||||
"ko_KR": "",
|
"ko_KR": "자동",
|
||||||
"no_NO": "",
|
"no_NO": "",
|
||||||
"pl_PL": "",
|
"pl_PL": "",
|
||||||
"pt_BR": "",
|
"pt_BR": "",
|
||||||
@@ -20534,7 +20534,7 @@
|
|||||||
"he_IL": "",
|
"he_IL": "",
|
||||||
"it_IT": "",
|
"it_IT": "",
|
||||||
"ja_JP": "",
|
"ja_JP": "",
|
||||||
"ko_KR": "",
|
"ko_KR": "Vulkan을 사용합니다.\nARM 맥에서 해당 플랫폼에서 잘 실행되는 게임을 플레이하는 경우 Metal 후단부를 사용합니다.",
|
||||||
"no_NO": "",
|
"no_NO": "",
|
||||||
"pl_PL": "",
|
"pl_PL": "",
|
||||||
"pt_BR": "",
|
"pt_BR": "",
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ namespace Ryujinx.Ava.UI.Views.Main
|
|||||||
{
|
{
|
||||||
DataContext = ViewModel = window.ViewModel;
|
DataContext = ViewModel = window.ViewModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Sort_Checked(object sender, RoutedEventArgs args)
|
public void Sort_Checked(object sender, RoutedEventArgs args)
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
using Gommon;
|
||||||
using LibHac.Ns;
|
using LibHac.Ns;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -22,7 +23,7 @@ namespace Ryujinx.Ava.Utilities.AppLibrary
|
|||||||
LibHac.Common.FixedArrays.Array8<ulong> communicationId = acp.LocalCommunicationId;
|
LibHac.Common.FixedArrays.Array8<ulong> communicationId = acp.LocalCommunicationId;
|
||||||
|
|
||||||
return new Array(receivedData.Where(game =>
|
return new Array(receivedData.Where(game =>
|
||||||
communicationId.Items.Contains(Convert.ToUInt64(game.TitleId, 16))
|
communicationId.Items.Contains(game.TitleId.ToULong())
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -272,7 +272,7 @@ namespace Ryujinx.Ava.Utilities.Configuration
|
|||||||
public MemoryManagerMode MemoryManagerMode { get; set; }
|
public MemoryManagerMode MemoryManagerMode { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Expands the RAM amount on the emulated system from 4GiB to 8GiB
|
/// Expands the RAM amount on the emulated system
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public MemoryConfiguration DramSize { get; set; }
|
public MemoryConfiguration DramSize { get; set; }
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
using Gommon;
|
||||||
using Ryujinx.Ava.Utilities.Configuration.System;
|
using Ryujinx.Ava.Utilities.Configuration.System;
|
||||||
using Ryujinx.Ava.Utilities.Configuration.UI;
|
using Ryujinx.Ava.Utilities.Configuration.UI;
|
||||||
using Ryujinx.Common.Configuration;
|
using Ryujinx.Common.Configuration;
|
||||||
@@ -8,7 +9,6 @@ using Ryujinx.Common.Configuration.Multiplayer;
|
|||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
using Ryujinx.HLE;
|
using Ryujinx.HLE;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace Ryujinx.Ava.Utilities.Configuration
|
namespace Ryujinx.Ava.Utilities.Configuration
|
||||||
@@ -17,6 +17,7 @@ namespace Ryujinx.Ava.Utilities.Configuration
|
|||||||
{
|
{
|
||||||
public void Load(ConfigurationFileFormat configurationFileFormat, string configurationFilePath)
|
public void Load(ConfigurationFileFormat configurationFileFormat, string configurationFilePath)
|
||||||
{
|
{
|
||||||
|
// referenced by Migrate
|
||||||
bool configurationFileUpdated = false;
|
bool configurationFileUpdated = false;
|
||||||
|
|
||||||
if (configurationFileFormat.Version is < 0 or > ConfigurationFileFormat.CurrentVersion)
|
if (configurationFileFormat.Version is < 0 or > ConfigurationFileFormat.CurrentVersion)
|
||||||
@@ -26,173 +27,47 @@ namespace Ryujinx.Ava.Utilities.Configuration
|
|||||||
LoadDefault();
|
LoadDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 2)
|
Migrate(2, static cff => cff.SystemRegion = Region.USA);
|
||||||
|
Migrate(3, static cff => cff.SystemTimeZone = "UTC");
|
||||||
|
Migrate(4, static cff => cff.MaxAnisotropy = -1);
|
||||||
|
Migrate(5, static cff => cff.SystemTimeOffset = 0);
|
||||||
|
Migrate(8, static cff => cff.EnablePtc = true);
|
||||||
|
Migrate(9, static cff =>
|
||||||
{
|
{
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 2.");
|
cff.ColumnSort = new ColumnSort
|
||||||
|
|
||||||
configurationFileFormat.SystemRegion = Region.USA;
|
|
||||||
|
|
||||||
configurationFileUpdated = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 3)
|
|
||||||
{
|
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 3.");
|
|
||||||
|
|
||||||
configurationFileFormat.SystemTimeZone = "UTC";
|
|
||||||
|
|
||||||
configurationFileUpdated = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 4)
|
|
||||||
{
|
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 4.");
|
|
||||||
|
|
||||||
configurationFileFormat.MaxAnisotropy = -1;
|
|
||||||
|
|
||||||
configurationFileUpdated = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 5)
|
|
||||||
{
|
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 5.");
|
|
||||||
|
|
||||||
configurationFileFormat.SystemTimeOffset = 0;
|
|
||||||
|
|
||||||
configurationFileUpdated = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 8)
|
|
||||||
{
|
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 8.");
|
|
||||||
|
|
||||||
configurationFileFormat.EnablePtc = true;
|
|
||||||
|
|
||||||
configurationFileUpdated = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 9)
|
|
||||||
{
|
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 9.");
|
|
||||||
|
|
||||||
configurationFileFormat.ColumnSort = new ColumnSort
|
|
||||||
{
|
{
|
||||||
SortColumnId = 0,
|
SortColumnId = 0,
|
||||||
SortAscending = false,
|
SortAscending = false
|
||||||
};
|
};
|
||||||
|
|
||||||
configurationFileFormat.Hotkeys = new KeyboardHotkeys
|
cff.Hotkeys = new KeyboardHotkeys { ToggleVSyncMode = Key.F1 };
|
||||||
|
});
|
||||||
|
Migrate(10, static cff => cff.AudioBackend = AudioBackend.OpenAl);
|
||||||
|
Migrate(11, static cff =>
|
||||||
{
|
{
|
||||||
ToggleVSyncMode = Key.F1,
|
cff.ResScale = 1;
|
||||||
};
|
cff.ResScaleCustom = 1.0f;
|
||||||
|
});
|
||||||
configurationFileUpdated = true;
|
Migrate(12, static cff => cff.LoggingGraphicsDebugLevel = GraphicsDebugLevel.None);
|
||||||
}
|
// 13 -> LDN1
|
||||||
|
Migrate(14, static cff => cff.CheckUpdatesOnStart = true);
|
||||||
if (configurationFileFormat.Version < 10)
|
Migrate(16, static cff => cff.EnableShaderCache = true);
|
||||||
|
Migrate(17, static cff => cff.StartFullscreen = false);
|
||||||
|
Migrate(18, static cff => cff.AspectRatio = AspectRatio.Fixed16x9);
|
||||||
|
// 19 -> LDN2
|
||||||
|
Migrate(20, static cff => cff.ShowConfirmExit = true);
|
||||||
|
Migrate(21, static cff =>
|
||||||
{
|
{
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 10.");
|
|
||||||
|
|
||||||
configurationFileFormat.AudioBackend = AudioBackend.OpenAl;
|
|
||||||
|
|
||||||
configurationFileUpdated = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 11)
|
|
||||||
{
|
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 11.");
|
|
||||||
|
|
||||||
configurationFileFormat.ResScale = 1;
|
|
||||||
configurationFileFormat.ResScaleCustom = 1.0f;
|
|
||||||
|
|
||||||
configurationFileUpdated = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 12)
|
|
||||||
{
|
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 12.");
|
|
||||||
|
|
||||||
configurationFileFormat.LoggingGraphicsDebugLevel = GraphicsDebugLevel.None;
|
|
||||||
|
|
||||||
configurationFileUpdated = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// configurationFileFormat.Version == 13 -> LDN1
|
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 14)
|
|
||||||
{
|
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 14.");
|
|
||||||
|
|
||||||
configurationFileFormat.CheckUpdatesOnStart = true;
|
|
||||||
|
|
||||||
configurationFileUpdated = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 16)
|
|
||||||
{
|
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 16.");
|
|
||||||
|
|
||||||
configurationFileFormat.EnableShaderCache = true;
|
|
||||||
|
|
||||||
configurationFileUpdated = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 17)
|
|
||||||
{
|
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 17.");
|
|
||||||
|
|
||||||
configurationFileFormat.StartFullscreen = false;
|
|
||||||
|
|
||||||
configurationFileUpdated = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 18)
|
|
||||||
{
|
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 18.");
|
|
||||||
|
|
||||||
configurationFileFormat.AspectRatio = AspectRatio.Fixed16x9;
|
|
||||||
|
|
||||||
configurationFileUpdated = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// configurationFileFormat.Version == 19 -> LDN2
|
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 20)
|
|
||||||
{
|
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 20.");
|
|
||||||
|
|
||||||
configurationFileFormat.ShowConfirmExit = true;
|
|
||||||
|
|
||||||
configurationFileUpdated = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 21)
|
|
||||||
{
|
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 21.");
|
|
||||||
|
|
||||||
// Initialize network config.
|
// Initialize network config.
|
||||||
|
|
||||||
configurationFileFormat.MultiplayerMode = MultiplayerMode.Disabled;
|
cff.MultiplayerMode = MultiplayerMode.Disabled;
|
||||||
configurationFileFormat.MultiplayerLanInterfaceId = "0";
|
cff.MultiplayerLanInterfaceId = "0";
|
||||||
|
});
|
||||||
configurationFileUpdated = true;
|
Migrate(22, static cff => cff.HideCursor = HideCursorMode.Never);
|
||||||
}
|
Migrate(24, static cff =>
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 22)
|
|
||||||
{
|
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 22.");
|
|
||||||
|
|
||||||
configurationFileFormat.HideCursor = HideCursorMode.Never;
|
|
||||||
|
|
||||||
configurationFileUpdated = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 24)
|
|
||||||
{
|
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 24.");
|
|
||||||
|
|
||||||
configurationFileFormat.InputConfig = new List<InputConfig>
|
|
||||||
{
|
{
|
||||||
|
cff.InputConfig =
|
||||||
|
[
|
||||||
new StandardKeyboardInputConfig
|
new StandardKeyboardInputConfig
|
||||||
{
|
{
|
||||||
Version = InputConfig.CurrentVersion,
|
Version = InputConfig.CurrentVersion,
|
||||||
@@ -240,69 +115,21 @@ namespace Ryujinx.Ava.Utilities.Configuration
|
|||||||
StickRight = Key.L,
|
StickRight = Key.L,
|
||||||
StickButton = Key.H,
|
StickButton = Key.H,
|
||||||
},
|
},
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
configurationFileUpdated = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 25)
|
];
|
||||||
{
|
});
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 25.");
|
Migrate(26, static cff => cff.MemoryManagerMode = MemoryManagerMode.HostMappedUnsafe);
|
||||||
|
Migrate(27, static cff => cff.EnableMouse = false);
|
||||||
configurationFileUpdated = true;
|
Migrate(29, static cff => cff.Hotkeys = new KeyboardHotkeys
|
||||||
}
|
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 26)
|
|
||||||
{
|
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 26.");
|
|
||||||
|
|
||||||
configurationFileFormat.MemoryManagerMode = MemoryManagerMode.HostMappedUnsafe;
|
|
||||||
|
|
||||||
configurationFileUpdated = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 27)
|
|
||||||
{
|
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 27.");
|
|
||||||
|
|
||||||
configurationFileFormat.EnableMouse = false;
|
|
||||||
|
|
||||||
configurationFileUpdated = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 28)
|
|
||||||
{
|
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 28.");
|
|
||||||
|
|
||||||
configurationFileFormat.Hotkeys = new KeyboardHotkeys
|
|
||||||
{
|
{
|
||||||
ToggleVSyncMode = Key.F1,
|
ToggleVSyncMode = Key.F1,
|
||||||
Screenshot = Key.F8,
|
Screenshot = Key.F8,
|
||||||
};
|
ShowUI = Key.F4
|
||||||
|
});
|
||||||
configurationFileUpdated = true;
|
Migrate(30, static cff =>
|
||||||
}
|
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 29)
|
|
||||||
{
|
{
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 29.");
|
foreach (InputConfig config in cff.InputConfig)
|
||||||
|
|
||||||
configurationFileFormat.Hotkeys = new KeyboardHotkeys
|
|
||||||
{
|
|
||||||
ToggleVSyncMode = Key.F1,
|
|
||||||
Screenshot = Key.F8,
|
|
||||||
ShowUI = Key.F4,
|
|
||||||
};
|
|
||||||
|
|
||||||
configurationFileUpdated = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 30)
|
|
||||||
{
|
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 30.");
|
|
||||||
|
|
||||||
foreach (InputConfig config in configurationFileFormat.InputConfig)
|
|
||||||
{
|
{
|
||||||
if (config is StandardControllerInputConfig controllerConfig)
|
if (config is StandardControllerInputConfig controllerConfig)
|
||||||
{
|
{
|
||||||
@@ -314,342 +141,146 @@ namespace Ryujinx.Ava.Utilities.Configuration
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
});
|
||||||
configurationFileUpdated = true;
|
Migrate(31, static cff => cff.BackendThreading = BackendThreading.Auto);
|
||||||
}
|
Migrate(32, static cff => cff.Hotkeys = new KeyboardHotkeys
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 31)
|
|
||||||
{
|
{
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 31.");
|
ToggleVSyncMode = cff.Hotkeys.ToggleVSyncMode,
|
||||||
|
Screenshot = cff.Hotkeys.Screenshot,
|
||||||
configurationFileFormat.BackendThreading = BackendThreading.Auto;
|
ShowUI = cff.Hotkeys.ShowUI,
|
||||||
|
|
||||||
configurationFileUpdated = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 32)
|
|
||||||
{
|
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 32.");
|
|
||||||
|
|
||||||
configurationFileFormat.Hotkeys = new KeyboardHotkeys
|
|
||||||
{
|
|
||||||
ToggleVSyncMode = configurationFileFormat.Hotkeys.ToggleVSyncMode,
|
|
||||||
Screenshot = configurationFileFormat.Hotkeys.Screenshot,
|
|
||||||
ShowUI = configurationFileFormat.Hotkeys.ShowUI,
|
|
||||||
Pause = Key.F5,
|
Pause = Key.F5,
|
||||||
};
|
});
|
||||||
|
Migrate(33, static cff =>
|
||||||
configurationFileUpdated = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 33)
|
|
||||||
{
|
{
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 33.");
|
cff.Hotkeys = new KeyboardHotkeys
|
||||||
|
|
||||||
configurationFileFormat.Hotkeys = new KeyboardHotkeys
|
|
||||||
{
|
{
|
||||||
ToggleVSyncMode = configurationFileFormat.Hotkeys.ToggleVSyncMode,
|
ToggleVSyncMode = cff.Hotkeys.ToggleVSyncMode,
|
||||||
Screenshot = configurationFileFormat.Hotkeys.Screenshot,
|
Screenshot = cff.Hotkeys.Screenshot,
|
||||||
ShowUI = configurationFileFormat.Hotkeys.ShowUI,
|
ShowUI = cff.Hotkeys.ShowUI,
|
||||||
Pause = configurationFileFormat.Hotkeys.Pause,
|
Pause = cff.Hotkeys.Pause,
|
||||||
ToggleMute = Key.F2,
|
ToggleMute = Key.F2,
|
||||||
};
|
};
|
||||||
|
|
||||||
configurationFileFormat.AudioVolume = 1;
|
cff.AudioVolume = 1;
|
||||||
|
});
|
||||||
configurationFileUpdated = true;
|
Migrate(34, static cff => cff.EnableInternetAccess = false);
|
||||||
|
Migrate(35, static cff =>
|
||||||
|
{
|
||||||
|
foreach (StandardControllerInputConfig config in cff.InputConfig
|
||||||
|
.Where(it => it is StandardControllerInputConfig)
|
||||||
|
.Cast<StandardControllerInputConfig>())
|
||||||
|
{
|
||||||
|
config.RangeLeft = 1.0f;
|
||||||
|
config.RangeRight = 1.0f;
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 34)
|
Migrate(36, static cff => cff.LoggingEnableTrace = false);
|
||||||
|
Migrate(37, static cff => cff.ShowConsole = true);
|
||||||
|
Migrate(38, static cff =>
|
||||||
{
|
{
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 34.");
|
cff.BaseStyle = "Dark";
|
||||||
|
cff.GameListViewMode = 0;
|
||||||
configurationFileFormat.EnableInternetAccess = false;
|
cff.ShowNames = true;
|
||||||
|
cff.GridSize = 2;
|
||||||
configurationFileUpdated = true;
|
cff.LanguageCode = "en_US";
|
||||||
}
|
});
|
||||||
|
Migrate(39, static cff => cff.Hotkeys = new KeyboardHotkeys
|
||||||
if (configurationFileFormat.Version < 35)
|
|
||||||
{
|
{
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 35.");
|
ToggleVSyncMode = cff.Hotkeys.ToggleVSyncMode,
|
||||||
|
Screenshot = cff.Hotkeys.Screenshot,
|
||||||
foreach (InputConfig config in configurationFileFormat.InputConfig)
|
ShowUI = cff.Hotkeys.ShowUI,
|
||||||
{
|
Pause = cff.Hotkeys.Pause,
|
||||||
if (config is StandardControllerInputConfig controllerConfig)
|
ToggleMute = cff.Hotkeys.ToggleMute,
|
||||||
{
|
|
||||||
controllerConfig.RangeLeft = 1.0f;
|
|
||||||
controllerConfig.RangeRight = 1.0f;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
configurationFileUpdated = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 36)
|
|
||||||
{
|
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 36.");
|
|
||||||
|
|
||||||
configurationFileFormat.LoggingEnableTrace = false;
|
|
||||||
|
|
||||||
configurationFileUpdated = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 37)
|
|
||||||
{
|
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 37.");
|
|
||||||
|
|
||||||
configurationFileFormat.ShowConsole = true;
|
|
||||||
|
|
||||||
configurationFileUpdated = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 38)
|
|
||||||
{
|
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 38.");
|
|
||||||
|
|
||||||
configurationFileFormat.BaseStyle = "Dark";
|
|
||||||
configurationFileFormat.GameListViewMode = 0;
|
|
||||||
configurationFileFormat.ShowNames = true;
|
|
||||||
configurationFileFormat.GridSize = 2;
|
|
||||||
configurationFileFormat.LanguageCode = "en_US";
|
|
||||||
|
|
||||||
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
|
|
||||||
{
|
|
||||||
ToggleVSyncMode = configurationFileFormat.Hotkeys.ToggleVSyncMode,
|
|
||||||
Screenshot = configurationFileFormat.Hotkeys.Screenshot,
|
|
||||||
ShowUI = configurationFileFormat.Hotkeys.ShowUI,
|
|
||||||
Pause = configurationFileFormat.Hotkeys.Pause,
|
|
||||||
ToggleMute = configurationFileFormat.Hotkeys.ToggleMute,
|
|
||||||
ResScaleUp = Key.Unbound,
|
ResScaleUp = Key.Unbound,
|
||||||
ResScaleDown = Key.Unbound,
|
ResScaleDown = Key.Unbound
|
||||||
};
|
});
|
||||||
|
Migrate(40, static cff => cff.GraphicsBackend = GraphicsBackend.OpenGl);
|
||||||
configurationFileUpdated = true;
|
Migrate(41, static cff => cff.Hotkeys = new KeyboardHotkeys
|
||||||
}
|
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 40)
|
|
||||||
{
|
{
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 40.");
|
ToggleVSyncMode = cff.Hotkeys.ToggleVSyncMode,
|
||||||
|
Screenshot = cff.Hotkeys.Screenshot,
|
||||||
configurationFileFormat.GraphicsBackend = GraphicsBackend.OpenGl;
|
ShowUI = cff.Hotkeys.ShowUI,
|
||||||
|
Pause = cff.Hotkeys.Pause,
|
||||||
configurationFileUpdated = true;
|
ToggleMute = cff.Hotkeys.ToggleMute,
|
||||||
}
|
ResScaleUp = cff.Hotkeys.ResScaleUp,
|
||||||
|
ResScaleDown = cff.Hotkeys.ResScaleDown,
|
||||||
if (configurationFileFormat.Version < 41)
|
|
||||||
{
|
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 41.");
|
|
||||||
|
|
||||||
configurationFileFormat.Hotkeys = new KeyboardHotkeys
|
|
||||||
{
|
|
||||||
ToggleVSyncMode = configurationFileFormat.Hotkeys.ToggleVSyncMode,
|
|
||||||
Screenshot = configurationFileFormat.Hotkeys.Screenshot,
|
|
||||||
ShowUI = configurationFileFormat.Hotkeys.ShowUI,
|
|
||||||
Pause = configurationFileFormat.Hotkeys.Pause,
|
|
||||||
ToggleMute = configurationFileFormat.Hotkeys.ToggleMute,
|
|
||||||
ResScaleUp = configurationFileFormat.Hotkeys.ResScaleUp,
|
|
||||||
ResScaleDown = configurationFileFormat.Hotkeys.ResScaleDown,
|
|
||||||
VolumeUp = Key.Unbound,
|
VolumeUp = Key.Unbound,
|
||||||
VolumeDown = Key.Unbound,
|
VolumeDown = Key.Unbound
|
||||||
};
|
});
|
||||||
}
|
Migrate(42, static cff => cff.EnableMacroHLE = true);
|
||||||
|
Migrate(43, static cff => cff.UseHypervisor = true);
|
||||||
if (configurationFileFormat.Version < 42)
|
Migrate(44, static cff =>
|
||||||
{
|
{
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 42.");
|
cff.AntiAliasing = AntiAliasing.None;
|
||||||
|
cff.ScalingFilter = ScalingFilter.Bilinear;
|
||||||
configurationFileFormat.EnableMacroHLE = true;
|
cff.ScalingFilterLevel = 80;
|
||||||
}
|
});
|
||||||
|
Migrate(45, static cff => cff.ShownFileTypes = new ShownFileTypes
|
||||||
if (configurationFileFormat.Version < 43)
|
|
||||||
{
|
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 43.");
|
|
||||||
|
|
||||||
configurationFileFormat.UseHypervisor = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 44)
|
|
||||||
{
|
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 44.");
|
|
||||||
|
|
||||||
configurationFileFormat.AntiAliasing = AntiAliasing.None;
|
|
||||||
configurationFileFormat.ScalingFilter = ScalingFilter.Bilinear;
|
|
||||||
configurationFileFormat.ScalingFilterLevel = 80;
|
|
||||||
|
|
||||||
configurationFileUpdated = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 45)
|
|
||||||
{
|
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 45.");
|
|
||||||
|
|
||||||
configurationFileFormat.ShownFileTypes = new ShownFileTypes
|
|
||||||
{
|
{
|
||||||
NSP = true,
|
NSP = true,
|
||||||
PFS0 = true,
|
PFS0 = true,
|
||||||
XCI = true,
|
XCI = true,
|
||||||
NCA = true,
|
NCA = true,
|
||||||
NRO = true,
|
NRO = true,
|
||||||
NSO = true,
|
NSO = true
|
||||||
};
|
});
|
||||||
|
Migrate(46, static cff => cff.UseHypervisor = OperatingSystem.IsMacOS());
|
||||||
configurationFileUpdated = true;
|
Migrate(47, static cff => cff.WindowStartup = new WindowStartup
|
||||||
}
|
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 46)
|
|
||||||
{
|
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 46.");
|
|
||||||
|
|
||||||
configurationFileFormat.MultiplayerLanInterfaceId = "0";
|
|
||||||
|
|
||||||
configurationFileUpdated = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 47)
|
|
||||||
{
|
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 47.");
|
|
||||||
|
|
||||||
configurationFileFormat.WindowStartup = new WindowStartup
|
|
||||||
{
|
{
|
||||||
WindowPositionX = 0,
|
WindowPositionX = 0,
|
||||||
WindowPositionY = 0,
|
WindowPositionY = 0,
|
||||||
WindowSizeHeight = 760,
|
WindowSizeHeight = 760,
|
||||||
WindowSizeWidth = 1280,
|
WindowSizeWidth = 1280,
|
||||||
WindowMaximized = false,
|
WindowMaximized = false
|
||||||
};
|
});
|
||||||
|
Migrate(48, static cff => cff.EnableColorSpacePassthrough = false);
|
||||||
configurationFileUpdated = true;
|
Migrate(49, static _ =>
|
||||||
}
|
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 48)
|
|
||||||
{
|
{
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 48.");
|
|
||||||
|
|
||||||
configurationFileFormat.EnableColorSpacePassthrough = false;
|
|
||||||
|
|
||||||
configurationFileUpdated = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 49)
|
|
||||||
{
|
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 49.");
|
|
||||||
|
|
||||||
if (OperatingSystem.IsMacOS())
|
if (OperatingSystem.IsMacOS())
|
||||||
{
|
{
|
||||||
AppDataManager.FixMacOSConfigurationFolders();
|
AppDataManager.FixMacOSConfigurationFolders();
|
||||||
}
|
}
|
||||||
|
});
|
||||||
configurationFileUpdated = true;
|
Migrate(50, static cff => cff.EnableHardwareAcceleration = true);
|
||||||
}
|
Migrate(51, static cff => cff.RememberWindowState = true);
|
||||||
|
Migrate(52, static cff => cff.AutoloadDirs = []);
|
||||||
if (configurationFileFormat.Version < 50)
|
Migrate(53, static cff => cff.EnableLowPowerPtc = false);
|
||||||
|
Migrate(54, static cff => cff.DramSize = MemoryConfiguration.MemoryConfiguration4GiB);
|
||||||
|
Migrate(55, static cff => cff.IgnoreApplet = false);
|
||||||
|
Migrate(56, static cff => cff.ShowTitleBar = !OperatingSystem.IsWindows());
|
||||||
|
Migrate(57, static cff =>
|
||||||
{
|
{
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 50.");
|
cff.VSyncMode = VSyncMode.Switch;
|
||||||
|
cff.EnableCustomVSyncInterval = false;
|
||||||
|
|
||||||
configurationFileFormat.EnableHardwareAcceleration = true;
|
cff.Hotkeys = new KeyboardHotkeys
|
||||||
|
|
||||||
configurationFileUpdated = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 51)
|
|
||||||
{
|
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 51.");
|
|
||||||
|
|
||||||
configurationFileFormat.RememberWindowState = true;
|
|
||||||
|
|
||||||
configurationFileUpdated = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 52)
|
|
||||||
{
|
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 52.");
|
|
||||||
|
|
||||||
configurationFileFormat.AutoloadDirs = [];
|
|
||||||
|
|
||||||
configurationFileUpdated = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 53)
|
|
||||||
{
|
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 53.");
|
|
||||||
|
|
||||||
configurationFileFormat.EnableLowPowerPtc = false;
|
|
||||||
|
|
||||||
configurationFileUpdated = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 54)
|
|
||||||
{
|
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 54.");
|
|
||||||
|
|
||||||
configurationFileFormat.DramSize = MemoryConfiguration.MemoryConfiguration4GiB;
|
|
||||||
|
|
||||||
configurationFileUpdated = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 55)
|
|
||||||
{
|
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 55.");
|
|
||||||
|
|
||||||
configurationFileFormat.IgnoreApplet = false;
|
|
||||||
|
|
||||||
configurationFileUpdated = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 56)
|
|
||||||
{
|
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 56.");
|
|
||||||
|
|
||||||
configurationFileFormat.ShowTitleBar = !OperatingSystem.IsWindows();
|
|
||||||
|
|
||||||
configurationFileUpdated = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configurationFileFormat.Version < 57)
|
|
||||||
{
|
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 57.");
|
|
||||||
|
|
||||||
configurationFileFormat.VSyncMode = VSyncMode.Switch;
|
|
||||||
configurationFileFormat.EnableCustomVSyncInterval = false;
|
|
||||||
|
|
||||||
configurationFileFormat.Hotkeys = new KeyboardHotkeys
|
|
||||||
{
|
{
|
||||||
ToggleVSyncMode = Key.F1,
|
ToggleVSyncMode = Key.F1,
|
||||||
Screenshot = configurationFileFormat.Hotkeys.Screenshot,
|
Screenshot = cff.Hotkeys.Screenshot,
|
||||||
ShowUI = configurationFileFormat.Hotkeys.ShowUI,
|
ShowUI = cff.Hotkeys.ShowUI,
|
||||||
Pause = configurationFileFormat.Hotkeys.Pause,
|
Pause = cff.Hotkeys.Pause,
|
||||||
ToggleMute = configurationFileFormat.Hotkeys.ToggleMute,
|
ToggleMute = cff.Hotkeys.ToggleMute,
|
||||||
ResScaleUp = configurationFileFormat.Hotkeys.ResScaleUp,
|
ResScaleUp = cff.Hotkeys.ResScaleUp,
|
||||||
ResScaleDown = configurationFileFormat.Hotkeys.ResScaleDown,
|
ResScaleDown = cff.Hotkeys.ResScaleDown,
|
||||||
VolumeUp = configurationFileFormat.Hotkeys.VolumeUp,
|
VolumeUp = cff.Hotkeys.VolumeUp,
|
||||||
VolumeDown = configurationFileFormat.Hotkeys.VolumeDown,
|
VolumeDown = cff.Hotkeys.VolumeDown,
|
||||||
CustomVSyncIntervalIncrement = Key.Unbound,
|
CustomVSyncIntervalIncrement = Key.Unbound,
|
||||||
CustomVSyncIntervalDecrement = Key.Unbound,
|
CustomVSyncIntervalDecrement = Key.Unbound,
|
||||||
};
|
};
|
||||||
|
|
||||||
configurationFileFormat.CustomVSyncInterval = 120;
|
cff.CustomVSyncInterval = 120;
|
||||||
|
});
|
||||||
configurationFileUpdated = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 58 migration accidentally got skipped but it worked with no issues somehow lol
|
// 58 migration accidentally got skipped but it worked with no issues somehow lol
|
||||||
|
Migrate(59, static cff =>
|
||||||
if (configurationFileFormat.Version < 59)
|
|
||||||
{
|
{
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 59.");
|
cff.ShowDirtyHacks = false;
|
||||||
|
cff.DirtyHacks = [];
|
||||||
|
|
||||||
configurationFileFormat.ShowDirtyHacks = false;
|
// This was accidentally enabled by default when it was PRed. That is not what we want,
|
||||||
configurationFileFormat.DirtyHacks = [];
|
// so as a compromise users who want to use it will simply need to re-enable it once after updating.
|
||||||
|
cff.IgnoreApplet = false;
|
||||||
configurationFileUpdated = true;
|
});
|
||||||
}
|
|
||||||
|
|
||||||
Logger.EnableFileLog.Value = configurationFileFormat.EnableFileLog;
|
Logger.EnableFileLog.Value = configurationFileFormat.EnableFileLog;
|
||||||
Graphics.ResScale.Value = configurationFileFormat.ResScale;
|
Graphics.ResScale.Value = configurationFileFormat.ResScale;
|
||||||
@@ -752,14 +383,12 @@ namespace Ryujinx.Ava.Utilities.Configuration
|
|||||||
Hacks.ShowDirtyHacks.Value = configurationFileFormat.ShowDirtyHacks;
|
Hacks.ShowDirtyHacks.Value = configurationFileFormat.ShowDirtyHacks;
|
||||||
|
|
||||||
{
|
{
|
||||||
EnabledDirtyHack[] hacks = (configurationFileFormat.DirtyHacks ?? []).Select(EnabledDirtyHack.Unpack).ToArray();
|
DirtyHacks hacks = new (configurationFileFormat.DirtyHacks ?? []);
|
||||||
|
|
||||||
Hacks.Xc2MenuSoftlockFix.Value = hacks.Any(it => it.Hack == DirtyHacks.Xc2MenuSoftlockFix);
|
Hacks.Xc2MenuSoftlockFix.Value = hacks.IsEnabled(DirtyHack.Xc2MenuSoftlockFix);
|
||||||
|
|
||||||
var shaderCompilationThreadSleep = hacks.FirstOrDefault(it =>
|
Hacks.EnableShaderTranslationDelay.Value = hacks.IsEnabled(DirtyHack.ShaderTranslationDelay);
|
||||||
it.Hack == DirtyHacks.ShaderCompilationThreadSleep);
|
Hacks.ShaderTranslationDelay.Value = hacks[DirtyHack.ShaderTranslationDelay].CoerceAtLeast(0);
|
||||||
Hacks.EnableShaderTranslationDelay.Value = shaderCompilationThreadSleep != null;
|
|
||||||
Hacks.ShaderTranslationDelay.Value = shaderCompilationThreadSleep?.Value ?? 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (configurationFileUpdated)
|
if (configurationFileUpdated)
|
||||||
@@ -768,6 +397,19 @@ namespace Ryujinx.Ava.Utilities.Configuration
|
|||||||
|
|
||||||
Ryujinx.Common.Logging.Logger.Notice.Print(LogClass.Application, $"Configuration file updated to version {ConfigurationFileFormat.CurrentVersion}");
|
Ryujinx.Common.Logging.Logger.Notice.Print(LogClass.Application, $"Configuration file updated to version {ConfigurationFileFormat.CurrentVersion}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
|
||||||
|
void Migrate(int newVer, Action<ConfigurationFileFormat> migrator)
|
||||||
|
{
|
||||||
|
if (configurationFileFormat.Version >= newVer) return;
|
||||||
|
|
||||||
|
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version {newVer}.");
|
||||||
|
|
||||||
|
migrator(configurationFileFormat);
|
||||||
|
|
||||||
|
configurationFileUpdated = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -666,14 +666,14 @@ namespace Ryujinx.Ava.Utilities.Configuration
|
|||||||
List<EnabledDirtyHack> enabledHacks = [];
|
List<EnabledDirtyHack> enabledHacks = [];
|
||||||
|
|
||||||
if (Xc2MenuSoftlockFix)
|
if (Xc2MenuSoftlockFix)
|
||||||
Apply(DirtyHacks.Xc2MenuSoftlockFix);
|
Apply(DirtyHack.Xc2MenuSoftlockFix);
|
||||||
|
|
||||||
if (EnableShaderTranslationDelay)
|
if (EnableShaderTranslationDelay)
|
||||||
Apply(DirtyHacks.ShaderCompilationThreadSleep, ShaderTranslationDelay);
|
Apply(DirtyHack.ShaderTranslationDelay, ShaderTranslationDelay);
|
||||||
|
|
||||||
return enabledHacks.ToArray();
|
return enabledHacks.ToArray();
|
||||||
|
|
||||||
void Apply(DirtyHacks hack, int value = 0)
|
void Apply(DirtyHack hack, int value = 0)
|
||||||
{
|
{
|
||||||
enabledHacks.Add(new EnabledDirtyHack(hack, value));
|
enabledHacks.Add(new EnabledDirtyHack(hack, value));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user