From ca662988177b4c2dcc8f4c1253c2478a4b876725 Mon Sep 17 00:00:00 2001 From: Otozinclus <58051309+Otozinclus@users.noreply.github.com> Date: Tue, 31 Dec 2024 03:28:35 +0100 Subject: [PATCH 01/17] Update Metal Games list (#472) I tested let's go in most locations and did some battles and it runs perfectly Legends Arceus will freeze occasionally on Metal, so it was removed. --- src/Ryujinx.Common/TitleIDs.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Ryujinx.Common/TitleIDs.cs b/src/Ryujinx.Common/TitleIDs.cs index 31d895051..ab6cfeb03 100644 --- a/src/Ryujinx.Common/TitleIDs.cs +++ b/src/Ryujinx.Common/TitleIDs.cs @@ -35,7 +35,8 @@ namespace Ryujinx.Common "010028600EBDA000", // Mario 3D World "0100152000022000", // Mario Kart 8 Deluxe "01005CA01580E000", // Persona 5 - "01001f5010dfa000", // Pokemon Legends Arceus + "0100187003A36000", // Pokémon: Let's Go, Evoli! + "010003f003a34000", // Pokémon: Let's Go, Pikachu! "01008C0016544000", // Sea of Stars "01006A800016E000", // Smash Ultimate "0100000000010000", // Super Mario Odyessy From d0a344d632fd2ae401e7c251bf84b9292b694303 Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Mon, 30 Dec 2024 20:31:27 -0600 Subject: [PATCH 02/17] Validation Project v2 (#471) Original PR had issues in the CI when building. > Refactor of the Validation System for more ease of use in the future. The project now builds a standalone executable and executes it before the main project is built or published. Since it is now a standalone executable we are also able to use .NET Core features as we are no longer locked to netstandard. > The project currently includes 1 task, LocalesValidationTask, that will check if the locales.json file has any of the following issues: > - The json is invalid. > - The json has locales with missing languages. > - The json has locales with langauges that are just duplicates of the en_US field. > If the project is built or published locally it will also fix any missing languages or duplicate fields. --------- Co-authored-by: LotP1 <68976644+LotP1@users.noreply.github.com> --- Ryujinx.sln | 5 +- .../LocaleValidationTask.cs | 73 ----- .../LocalesValidationTask.cs | 117 +++++++ src/Ryujinx.BuildValidationTasks/Program.cs | 37 +++ .../Ryujinx.BuildValidationTasks.csproj | 20 +- .../ValidationTask.cs | 7 + src/Ryujinx/Assets/locales.json | 298 +++++++++--------- src/Ryujinx/Ryujinx.csproj | 7 +- 8 files changed, 325 insertions(+), 239 deletions(-) delete mode 100644 src/Ryujinx.BuildValidationTasks/LocaleValidationTask.cs create mode 100644 src/Ryujinx.BuildValidationTasks/LocalesValidationTask.cs create mode 100644 src/Ryujinx.BuildValidationTasks/Program.cs create mode 100644 src/Ryujinx.BuildValidationTasks/ValidationTask.cs diff --git a/Ryujinx.sln b/Ryujinx.sln index 373572178..9e197e85f 100644 --- a/Ryujinx.sln +++ b/Ryujinx.sln @@ -249,13 +249,12 @@ Global {B575BCDE-2FD8-4A5D-8756-31CDD7FE81F0}.Debug|Any CPU.Build.0 = Debug|Any CPU {B575BCDE-2FD8-4A5D-8756-31CDD7FE81F0}.Release|Any CPU.ActiveCfg = Release|Any CPU {B575BCDE-2FD8-4A5D-8756-31CDD7FE81F0}.Release|Any CPU.Build.0 = Release|Any CPU - {4A89A234-4F19-497D-A576-DDE8CDFC5B22}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4A89A234-4F19-497D-A576-DDE8CDFC5B22}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4A89A234-4F19-497D-A576-DDE8CDFC5B22}.Release|Any CPU.ActiveCfg = Release|Any CPU {C08931FA-1191-417A-864F-3882D93E683B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C08931FA-1191-417A-864F-3882D93E683B}.Debug|Any CPU.Build.0 = Debug|Any CPU {C08931FA-1191-417A-864F-3882D93E683B}.Release|Any CPU.ActiveCfg = Release|Any CPU {C08931FA-1191-417A-864F-3882D93E683B}.Release|Any CPU.Build.0 = Release|Any CPU + {4A89A234-4F19-497D-A576-DDE8CDFC5B22}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4A89A234-4F19-497D-A576-DDE8CDFC5B22}.Release|Any CPU.ActiveCfg = Release|Any CPU {81EA598C-DBA1-40B0-8DA4-4796B78F2037}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {81EA598C-DBA1-40B0-8DA4-4796B78F2037}.Debug|Any CPU.Build.0 = Debug|Any CPU {81EA598C-DBA1-40B0-8DA4-4796B78F2037}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/src/Ryujinx.BuildValidationTasks/LocaleValidationTask.cs b/src/Ryujinx.BuildValidationTasks/LocaleValidationTask.cs deleted file mode 100644 index 6dc3d8aa8..000000000 --- a/src/Ryujinx.BuildValidationTasks/LocaleValidationTask.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System; -using Microsoft.Build.Utilities; -using System.Collections.Generic; -using System.Linq; -using System.IO; -using Newtonsoft.Json; -using Microsoft.Build.Framework; - -namespace Ryujinx.BuildValidationTasks -{ - public class LocaleValidationTask : Task - { - public override bool Execute() - { - string path = System.Reflection.Assembly.GetExecutingAssembly().Location; - - if (path.Split(["src"], StringSplitOptions.None).Length == 1) - { - //i assume that we are in a build directory in the solution dir - path = new FileInfo(path).Directory!.Parent!.GetDirectories("src")[0].GetDirectories("Ryujinx")[0].GetDirectories("Assets")[0].GetFiles("locales.json")[0].FullName; - } - else - { - path = path.Split(["src"], StringSplitOptions.None)[0]; - path = new FileInfo(path).Directory!.GetDirectories("src")[0].GetDirectories("Ryujinx")[0].GetDirectories("Assets")[0].GetFiles("locales.json")[0].FullName; - } - - string data; - - using (StreamReader sr = new(path)) - { - data = sr.ReadToEnd(); - } - - LocalesJson json = JsonConvert.DeserializeObject(data); - - for (int i = 0; i < json.Locales.Count; i++) - { - LocalesEntry locale = json.Locales[i]; - - foreach (string langCode in json.Languages.Where(it => !locale.Translations.ContainsKey(it))) - { - locale.Translations.Add(langCode, string.Empty); - Log.LogMessage(MessageImportance.High, $"Added '{langCode}' to Locale '{locale.ID}'"); - } - - locale.Translations = locale.Translations.OrderBy(pair => pair.Key).ToDictionary(pair => pair.Key, pair => pair.Value); - json.Locales[i] = locale; - } - - string jsonString = JsonConvert.SerializeObject(json, Formatting.Indented); - - using (StreamWriter sw = new(path)) - { - sw.Write(jsonString); - } - - return true; - } - - struct LocalesJson - { - public List Languages { get; set; } - public List Locales { get; set; } - } - - struct LocalesEntry - { - public string ID { get; set; } - public Dictionary Translations { get; set; } - } - } -} diff --git a/src/Ryujinx.BuildValidationTasks/LocalesValidationTask.cs b/src/Ryujinx.BuildValidationTasks/LocalesValidationTask.cs new file mode 100644 index 000000000..05eaee539 --- /dev/null +++ b/src/Ryujinx.BuildValidationTasks/LocalesValidationTask.cs @@ -0,0 +1,117 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.IO; +using System.Text.Json; +using System.Text.Encodings.Web; + +namespace Ryujinx.BuildValidationTasks +{ + public class LocalesValidationTask : ValidationTask + { + public LocalesValidationTask() { } + + public bool Execute(string projectPath, bool isGitRunner) + { + Console.WriteLine("Running Locale Validation Task..."); + + string path = projectPath + "src/Ryujinx/Assets/locales.json"; + string data; + + using (StreamReader sr = new(path)) + { + data = sr.ReadToEnd(); + } + + LocalesJson json; + + if (isGitRunner && data.Contains("\r\n")) + throw new FormatException("locales.json is using CRLF line endings! It should be using LF line endings, build locally to fix..."); + + try + { + json = JsonSerializer.Deserialize(data); + + } + catch (JsonException e) + { + throw new JsonException(e.Message); //shorter and easier stacktrace + } + + + + bool encounteredIssue = false; + + for (int i = 0; i < json.Locales.Count; i++) + { + LocalesEntry locale = json.Locales[i]; + + foreach (string langCode in json.Languages.Where(lang => !locale.Translations.ContainsKey(lang))) + { + encounteredIssue = true; + + if (!isGitRunner) + { + locale.Translations.Add(langCode, string.Empty); + Console.WriteLine($"Added '{langCode}' to Locale '{locale.ID}'"); + } + else + { + Console.WriteLine($"Missing '{langCode}' in Locale '{locale.ID}'!"); + } + } + + foreach (string langCode in json.Languages.Where(lang => locale.Translations.ContainsKey(lang) && lang != "en_US" && locale.Translations[lang] == locale.Translations["en_US"])) + { + encounteredIssue = true; + + if (!isGitRunner) + { + locale.Translations[langCode] = string.Empty; + Console.WriteLine($"Lanugage '{langCode}' is a duplicate of en_US in Locale '{locale.ID}'! Resetting it..."); + } + else + { + Console.WriteLine($"Lanugage '{langCode}' is a duplicate of en_US in Locale '{locale.ID}'!"); + } + } + + locale.Translations = locale.Translations.OrderBy(pair => pair.Key).ToDictionary(pair => pair.Key, pair => pair.Value); + json.Locales[i] = locale; + } + + if (isGitRunner && encounteredIssue) + throw new JsonException("1 or more locales are invalid!"); + + JsonSerializerOptions jsonOptions = new JsonSerializerOptions() + { + WriteIndented = true, + NewLine = "\n", + Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping + }; + + string jsonString = JsonSerializer.Serialize(json, jsonOptions); + + using (StreamWriter sw = new(path)) + { + sw.Write(jsonString); + } + + Console.WriteLine("Finished Locale Validation Task!"); + + return true; + } + + struct LocalesJson + { + public List Languages { get; set; } + public List Locales { get; set; } + } + + struct LocalesEntry + { + public string ID { get; set; } + public Dictionary Translations { get; set; } + } + } +} diff --git a/src/Ryujinx.BuildValidationTasks/Program.cs b/src/Ryujinx.BuildValidationTasks/Program.cs new file mode 100644 index 000000000..ed1cee490 --- /dev/null +++ b/src/Ryujinx.BuildValidationTasks/Program.cs @@ -0,0 +1,37 @@ +using System; +using System.IO; +using System.Linq; + +namespace Ryujinx.BuildValidationTasks +{ + public class Program + { + static void Main(string[] args) + { + // Display the number of command line arguments. + if (args.Length == 0) + throw new ArgumentException("Error: too few arguments!"); + + string path = args[0]; + + if (string.IsNullOrEmpty(path)) + throw new ArgumentException("Error: path is null or empty!"); + + if (!Path.Exists(path)) + throw new FileLoadException($"path {{{path}}} does not exist!"); + + path = Path.GetFullPath(path); + + if (!Directory.GetDirectories(path).Contains($"{path}src")) + throw new FileLoadException($"path {{{path}}} is not a valid ryujinx project!"); + + bool isGitRunner = path.Contains("runner") || path.Contains("D:\\a\\Ryujinx\\Ryujinx"); + if (isGitRunner) + Console.WriteLine("Is Git Runner!"); + + // Run tasks + // Pass extra info needed in the task constructors + new LocalesValidationTask().Execute(path, isGitRunner); + } + } +} diff --git a/src/Ryujinx.BuildValidationTasks/Ryujinx.BuildValidationTasks.csproj b/src/Ryujinx.BuildValidationTasks/Ryujinx.BuildValidationTasks.csproj index dbd9492df..c9fea9313 100644 --- a/src/Ryujinx.BuildValidationTasks/Ryujinx.BuildValidationTasks.csproj +++ b/src/Ryujinx.BuildValidationTasks/Ryujinx.BuildValidationTasks.csproj @@ -1,19 +1,17 @@ - netstandard2.0 - true + Exe - - - - + + - - - - + - + \ No newline at end of file diff --git a/src/Ryujinx.BuildValidationTasks/ValidationTask.cs b/src/Ryujinx.BuildValidationTasks/ValidationTask.cs new file mode 100644 index 000000000..f11c87f3b --- /dev/null +++ b/src/Ryujinx.BuildValidationTasks/ValidationTask.cs @@ -0,0 +1,7 @@ +namespace Ryujinx.BuildValidationTasks +{ + public interface ValidationTask + { + public bool Execute(string projectPath, bool isGitRunner); + } +} diff --git a/src/Ryujinx/Assets/locales.json b/src/Ryujinx/Assets/locales.json index 6bede7999..31cba38dd 100644 --- a/src/Ryujinx/Assets/locales.json +++ b/src/Ryujinx/Assets/locales.json @@ -1564,7 +1564,7 @@ "pl_PL": "Wersja", "pt_BR": "Versão", "ru_RU": "Версия", - "sv_SE": "Version", + "sv_SE": "", "th_TH": "เวอร์ชั่น", "tr_TR": "Sürüm", "uk_UA": "Версія", @@ -2213,8 +2213,8 @@ "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": "ExeFS", - "sv_SE": "ExeFS", + "ru_RU": "", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -2263,8 +2263,8 @@ "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": "RomFS", - "sv_SE": "RomFS", + "ru_RU": "", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -2310,7 +2310,7 @@ "it_IT": "", "ja_JP": "ロゴ", "ko_KR": "로고", - "no_NO": "Logo", + "no_NO": "", "pl_PL": "", "pt_BR": "", "ru_RU": "Лого", @@ -3260,11 +3260,11 @@ "it_IT": "Sistema", "ja_JP": "システム", "ko_KR": "시스템", - "no_NO": "System", + "no_NO": "", "pl_PL": "", "pt_BR": "Sistema", "ru_RU": "Система", - "sv_SE": "System", + "sv_SE": "", "th_TH": "ระบบ", "tr_TR": "Sistem", "uk_UA": "Система", @@ -3335,11 +3335,11 @@ "it_IT": "Giappone", "ja_JP": "日本", "ko_KR": "일본", - "no_NO": "Japan", + "no_NO": "", "pl_PL": "Japonia", "pt_BR": "Japão", "ru_RU": "Япония", - "sv_SE": "Japan", + "sv_SE": "", "th_TH": "ญี่ปุ่น", "tr_TR": "Japonya", "uk_UA": "Японія", @@ -3360,11 +3360,11 @@ "it_IT": "Stati Uniti d'America", "ja_JP": "アメリカ", "ko_KR": "미국", - "no_NO": "USA", + "no_NO": "", "pl_PL": "Stany Zjednoczone", "pt_BR": "EUA", "ru_RU": "США", - "sv_SE": "USA", + "sv_SE": "", "th_TH": "สหรัฐอเมริกา", "tr_TR": "ABD", "uk_UA": "США", @@ -3410,7 +3410,7 @@ "it_IT": "", "ja_JP": "オーストラリア", "ko_KR": "호주", - "no_NO": "Australia", + "no_NO": "", "pl_PL": "", "pt_BR": "Austrália", "ru_RU": "Австралия", @@ -3460,11 +3460,11 @@ "it_IT": "Corea", "ja_JP": "韓国", "ko_KR": "한국", - "no_NO": "Korea", + "no_NO": "", "pl_PL": "", "pt_BR": "Coreia", "ru_RU": "Корея", - "sv_SE": "Korea", + "sv_SE": "", "th_TH": "เกาหลี", "tr_TR": "Kore", "uk_UA": "Корея", @@ -3485,11 +3485,11 @@ "it_IT": "", "ja_JP": "台湾", "ko_KR": "대만", - "no_NO": "Taiwan", + "no_NO": "", "pl_PL": "Tajwan", "pt_BR": "", "ru_RU": "Тайвань", - "sv_SE": "Taiwan", + "sv_SE": "", "th_TH": "ไต้หวัน", "tr_TR": "Tayvan", "uk_UA": "Тайвань", @@ -3955,7 +3955,7 @@ "el_GR": "Ζώνη Ώρας Συστήματος:", "en_US": "System Time Zone:", "es_ES": "Zona horaria del sistema:", - "fr_FR": "Fuseau horaire du système :", + "fr_FR": "Fuseau horaire du système\u00A0:", "he_IL": "אזור זמן מערכת:", "it_IT": "Fuso orario del sistema:", "ja_JP": "タイムゾーン:", @@ -4135,11 +4135,11 @@ "it_IT": "", "ja_JP": "ダミー", "ko_KR": "더미", - "no_NO": "Dummy", + "no_NO": "", "pl_PL": "Atrapa", "pt_BR": "Nenhuma", "ru_RU": "Без звука", - "sv_SE": "Dummy", + "sv_SE": "", "th_TH": "", "tr_TR": "Yapay", "uk_UA": "", @@ -4163,8 +4163,8 @@ "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": "OpenAL", - "sv_SE": "OpenAL", + "ru_RU": "", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -4188,8 +4188,8 @@ "no_NO": "Lyd Inn/Ut", "pl_PL": "", "pt_BR": "", - "ru_RU": "SoundIO", - "sv_SE": "SoundIO", + "ru_RU": "", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -4213,8 +4213,8 @@ "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": "SDL2", - "sv_SE": "SDL2", + "ru_RU": "", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -4230,12 +4230,12 @@ "el_GR": "Μικροδιορθώσεις", "en_US": "Hacks", "es_ES": "", - "fr_FR": "Hacks", + "fr_FR": "", "he_IL": "האצות", "it_IT": "Espedienti", "ja_JP": "ハック", "ko_KR": "핵", - "no_NO": "Hacks", + "no_NO": "", "pl_PL": "Hacki", "pt_BR": "", "ru_RU": "Хаки", @@ -4314,7 +4314,7 @@ "pl_PL": "", "pt_BR": "", "ru_RU": "4ГиБ", - "sv_SE": "4GiB", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "4Гб", @@ -4339,7 +4339,7 @@ "pl_PL": "", "pt_BR": "", "ru_RU": "6ГиБ", - "sv_SE": "6GiB", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "6Гб", @@ -4364,7 +4364,7 @@ "pl_PL": "", "pt_BR": "", "ru_RU": "8ГиБ", - "sv_SE": "8GiB", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "8Гб", @@ -4389,7 +4389,7 @@ "pl_PL": "", "pt_BR": "", "ru_RU": "12ГиБ", - "sv_SE": "12GiB", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "12Гб", @@ -4585,11 +4585,11 @@ "it_IT": "", "ja_JP": "", "ko_KR": "2배", - "no_NO": "2x", + "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": "2x", - "sv_SE": "2x", + "ru_RU": "", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -4610,11 +4610,11 @@ "it_IT": "", "ja_JP": "", "ko_KR": "4배", - "no_NO": "4x", + "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": "4x", - "sv_SE": "4x", + "ru_RU": "", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -4635,11 +4635,11 @@ "it_IT": "", "ja_JP": "", "ko_KR": "8배", - "no_NO": "8x", + "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": "8x", - "sv_SE": "8x", + "ru_RU": "", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -4660,11 +4660,11 @@ "it_IT": "", "ja_JP": "", "ko_KR": "16배", - "no_NO": "16x", + "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": "16x", - "sv_SE": "16x", + "ru_RU": "", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -4760,11 +4760,11 @@ "it_IT": "", "ja_JP": "", "ko_KR": "2배(1440p/2160p)", - "no_NO": "2x (1440p/2160p)", + "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": "2x (1440p/2160p)", - "sv_SE": "2x (1440p/2160p)", + "ru_RU": "", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -4785,11 +4785,11 @@ "it_IT": "", "ja_JP": "", "ko_KR": "3배(2160p/3240p)", - "no_NO": "3x (2160p/3240p)", + "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": "3x (2160p/3240p)", - "sv_SE": "3x (2160p/3240p)", + "ru_RU": "", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -4863,8 +4863,8 @@ "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": "4:3", - "sv_SE": "4:3", + "ru_RU": "", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -4888,8 +4888,8 @@ "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": "16:9", - "sv_SE": "16:9", + "ru_RU": "", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -4913,8 +4913,8 @@ "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": "16:10", - "sv_SE": "16:10", + "ru_RU": "", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -4938,8 +4938,8 @@ "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": "21:9", - "sv_SE": "21:9", + "ru_RU": "", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -4960,11 +4960,11 @@ "it_IT": "", "ja_JP": "", "ko_KR": "", - "no_NO": "32:9", + "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": "32:9", - "sv_SE": "32:9", + "ru_RU": "", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -5060,7 +5060,7 @@ "it_IT": "Log", "ja_JP": "ロギング", "ko_KR": "로그 기록", - "no_NO": "Logging", + "no_NO": "", "pl_PL": "Dziennik zdarzeń", "pt_BR": "Log", "ru_RU": "Журналирование", @@ -5085,7 +5085,7 @@ "it_IT": "Log", "ja_JP": "ロギング", "ko_KR": "로그 기록", - "no_NO": "Logging", + "no_NO": "", "pl_PL": "Dziennik zdarzeń", "pt_BR": "Log", "ru_RU": "Журналирование", @@ -6113,8 +6113,8 @@ "no_NO": "", "pl_PL": "Pro Kontroler", "pt_BR": "", - "ru_RU": "Pro Controller", - "sv_SE": "Pro Controller", + "ru_RU": "", + "sv_SE": "", "th_TH": "โปรคอนโทรลเลอร์", "tr_TR": "Profesyonel Kumanda", "uk_UA": "Контролер Pro", @@ -8088,8 +8088,8 @@ "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": "Enter", - "sv_SE": "Enter", + "ru_RU": "", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -8114,7 +8114,7 @@ "pl_PL": "", "pt_BR": "", "ru_RU": "Esc", - "sv_SE": "Escape", + "sv_SE": "", "th_TH": "", "tr_TR": "Esc", "uk_UA": "", @@ -8163,8 +8163,8 @@ "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": "Tab", - "sv_SE": "Tab", + "ru_RU": "", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -8188,8 +8188,8 @@ "no_NO": "Tilbaketast", "pl_PL": "", "pt_BR": "", - "ru_RU": "Backspace", - "sv_SE": "Backspace", + "ru_RU": "", + "sv_SE": "", "th_TH": "", "tr_TR": "Geri tuşu", "uk_UA": "", @@ -8213,8 +8213,8 @@ "no_NO": "Sett inn", "pl_PL": "", "pt_BR": "", - "ru_RU": "Insert", - "sv_SE": "Insert", + "ru_RU": "", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -8238,8 +8238,8 @@ "no_NO": "Slett", "pl_PL": "", "pt_BR": "", - "ru_RU": "Delete", - "sv_SE": "Delete", + "ru_RU": "", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -8263,8 +8263,8 @@ "no_NO": "Side opp", "pl_PL": "", "pt_BR": "", - "ru_RU": "Page Up", - "sv_SE": "Page Up", + "ru_RU": "", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -8288,8 +8288,8 @@ "no_NO": "Side ned", "pl_PL": "", "pt_BR": "", - "ru_RU": "Page Down", - "sv_SE": "Page Down", + "ru_RU": "", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -8313,8 +8313,8 @@ "no_NO": "Hjem", "pl_PL": "", "pt_BR": "", - "ru_RU": "Home", - "sv_SE": "Home", + "ru_RU": "", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -8338,8 +8338,8 @@ "no_NO": "Avslutt", "pl_PL": "", "pt_BR": "", - "ru_RU": "End", - "sv_SE": "End", + "ru_RU": "", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -8363,8 +8363,8 @@ "no_NO": "Skiftelås", "pl_PL": "", "pt_BR": "", - "ru_RU": "Caps Lock", - "sv_SE": "Caps Lock", + "ru_RU": "", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -8388,8 +8388,8 @@ "no_NO": "Rullelås", "pl_PL": "", "pt_BR": "", - "ru_RU": "Scroll Lock", - "sv_SE": "Scroll Lock", + "ru_RU": "", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -8413,8 +8413,8 @@ "no_NO": "Skjermbilde", "pl_PL": "", "pt_BR": "", - "ru_RU": "Print Screen", - "sv_SE": "Print Screen", + "ru_RU": "", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -8438,8 +8438,8 @@ "no_NO": "Stans midlertidig", "pl_PL": "", "pt_BR": "", - "ru_RU": "Pause", - "sv_SE": "Pause", + "ru_RU": "", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -8463,8 +8463,8 @@ "no_NO": "Numerisk Lås", "pl_PL": "", "pt_BR": "", - "ru_RU": "Num Lock", - "sv_SE": "Num Lock", + "ru_RU": "", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -8514,7 +8514,7 @@ "pl_PL": "", "pt_BR": "", "ru_RU": "Блок цифр 0", - "sv_SE": "Keypad 0", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -8539,7 +8539,7 @@ "pl_PL": "", "pt_BR": "", "ru_RU": "Блок цифр 1", - "sv_SE": "Keypad 1", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -8564,7 +8564,7 @@ "pl_PL": "", "pt_BR": "", "ru_RU": "Блок цифр 2", - "sv_SE": "Keypad 2", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -8589,7 +8589,7 @@ "pl_PL": "", "pt_BR": "", "ru_RU": "Блок цифр 3", - "sv_SE": "Keypad 3", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -8614,7 +8614,7 @@ "pl_PL": "", "pt_BR": "", "ru_RU": "Блок цифр 4", - "sv_SE": "Keypad 4", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -8639,7 +8639,7 @@ "pl_PL": "", "pt_BR": "", "ru_RU": "Блок цифр 5", - "sv_SE": "Keypad 5", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -8664,7 +8664,7 @@ "pl_PL": "", "pt_BR": "", "ru_RU": "Блок цифр 6", - "sv_SE": "Keypad 6", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -8689,7 +8689,7 @@ "pl_PL": "", "pt_BR": "", "ru_RU": "Блок цифр 7", - "sv_SE": "Keypad 7", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -8714,7 +8714,7 @@ "pl_PL": "", "pt_BR": "", "ru_RU": "Блок цифр 8", - "sv_SE": "Keypad 8", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -8739,7 +8739,7 @@ "pl_PL": "", "pt_BR": "", "ru_RU": "Блок цифр 9", - "sv_SE": "Keypad 9", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -8889,7 +8889,7 @@ "pl_PL": "", "pt_BR": "", "ru_RU": "Enter (блок цифр)", - "sv_SE": "Keypad Enter", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -8913,7 +8913,7 @@ "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": "0", + "ru_RU": "", "sv_SE": "", "th_TH": "", "tr_TR": "", @@ -8938,7 +8938,7 @@ "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": "1", + "ru_RU": "", "sv_SE": "", "th_TH": "", "tr_TR": "", @@ -8963,7 +8963,7 @@ "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": "2", + "ru_RU": "", "sv_SE": "", "th_TH": "", "tr_TR": "", @@ -8988,7 +8988,7 @@ "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": "3", + "ru_RU": "", "sv_SE": "", "th_TH": "", "tr_TR": "", @@ -9013,7 +9013,7 @@ "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": "4", + "ru_RU": "", "sv_SE": "", "th_TH": "", "tr_TR": "", @@ -9038,7 +9038,7 @@ "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": "5", + "ru_RU": "", "sv_SE": "", "th_TH": "", "tr_TR": "", @@ -9063,7 +9063,7 @@ "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": "6", + "ru_RU": "", "sv_SE": "", "th_TH": "", "tr_TR": "", @@ -9088,7 +9088,7 @@ "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": "7", + "ru_RU": "", "sv_SE": "", "th_TH": "", "tr_TR": "", @@ -9113,7 +9113,7 @@ "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": "8", + "ru_RU": "", "sv_SE": "", "th_TH": "", "tr_TR": "", @@ -9138,7 +9138,7 @@ "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": "9", + "ru_RU": "", "sv_SE": "", "th_TH": "", "tr_TR": "", @@ -9163,7 +9163,7 @@ "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": "~", + "ru_RU": "", "sv_SE": "", "th_TH": "", "tr_TR": "", @@ -9188,7 +9188,7 @@ "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": "`", + "ru_RU": "", "sv_SE": "", "th_TH": "", "tr_TR": "", @@ -9213,7 +9213,7 @@ "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": "-", + "ru_RU": "", "sv_SE": "", "th_TH": "", "tr_TR": "", @@ -9238,7 +9238,7 @@ "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": "+", + "ru_RU": "", "sv_SE": "", "th_TH": "", "tr_TR": "", @@ -9263,7 +9263,7 @@ "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": "[", + "ru_RU": "", "sv_SE": "", "th_TH": "", "tr_TR": "", @@ -9288,7 +9288,7 @@ "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": "]", + "ru_RU": "", "sv_SE": "", "th_TH": "", "tr_TR": "", @@ -9313,7 +9313,7 @@ "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": ";", + "ru_RU": "", "sv_SE": "", "th_TH": "", "tr_TR": "", @@ -9363,7 +9363,7 @@ "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": ",", + "ru_RU": "", "sv_SE": "", "th_TH": "", "tr_TR": "", @@ -9388,7 +9388,7 @@ "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": ".", + "ru_RU": "", "sv_SE": "", "th_TH": "", "tr_TR": "", @@ -9413,7 +9413,7 @@ "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": "/", + "ru_RU": "", "sv_SE": "", "th_TH": "", "tr_TR": "", @@ -9738,7 +9738,7 @@ "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": "-", + "ru_RU": "", "sv_SE": "", "th_TH": "", "tr_TR": "", @@ -9763,7 +9763,7 @@ "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": "+", + "ru_RU": "", "sv_SE": "", "th_TH": "", "tr_TR": "4", @@ -9789,7 +9789,7 @@ "pl_PL": "", "pt_BR": "", "ru_RU": "Кнопка меню", - "sv_SE": "Guide", + "sv_SE": "", "th_TH": "", "tr_TR": "Rehber", "uk_UA": "", @@ -12438,7 +12438,7 @@ "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": "{0}: {1}", + "ru_RU": "", "sv_SE": "", "th_TH": "", "tr_TR": "", @@ -14289,7 +14289,7 @@ "pl_PL": "Seria Amiibo", "pt_BR": "Franquia Amiibo", "ru_RU": "Серия Amiibo", - "sv_SE": "Amiibo Series", + "sv_SE": "", "th_TH": "", "tr_TR": "Amiibo Serisi", "uk_UA": "Серія Amiibo", @@ -15755,7 +15755,7 @@ "el_GR": "", "en_US": "Aspect Ratio applied to the renderer window.\n\nOnly change this if you're using an aspect ratio mod for your game, otherwise the graphics will be stretched.\n\nLeave on 16:9 if unsure.", "es_ES": "Relación de aspecto aplicada a la ventana del renderizador.\n\nSolamente modificar esto si estás utilizando un mod de relación de aspecto para su juego, en cualquier otro caso los gráficos se estirarán.\n\nDejar en 16:9 si no sabe que hacer.", - "fr_FR": "Format d'affichage appliqué à la fenêtre du moteur de rendu.\n\nChangez cela uniquement si vous utilisez un mod changeant le format d'affichage pour votre jeu, sinon les graphismes seront étirés.\n\nLaissez sur 16:9 si vous n'êtes pas sûr.", + "fr_FR": "Format\u00A0d'affichage appliqué à la fenêtre du moteur de rendu.\n\nChangez cela uniquement si vous utilisez un mod changeant le format\u00A0d'affichage pour votre jeu, sinon les graphismes seront étirés.\n\nLaissez sur 16:9 si vous n'êtes pas sûr.", "he_IL": "", "it_IT": "Proporzioni dello schermo applicate alla finestra di renderizzazione.\n\nCambialo solo se stai usando una mod di proporzioni per il tuo gioco, altrimenti la grafica verrà allungata.\n\nLasciare il 16:9 se incerto.", "ja_JP": "レンダリングウインドウに適用するアスペクト比です.\n\nゲームにアスペクト比を変更する mod を使用している場合のみ変更してください.\n\nわからない場合は16:9のままにしておいてください.\n", @@ -17439,7 +17439,7 @@ "pl_PL": "Wersja {0}", "pt_BR": "Versão {0}", "ru_RU": "Версия {0}", - "sv_SE": "Version {0}", + "sv_SE": "", "th_TH": "เวอร์ชั่น {0}", "tr_TR": "Sürüm {0}", "uk_UA": "Версія {0}", @@ -17664,7 +17664,7 @@ "pl_PL": "", "pt_BR": "Ryujinx - Informação", "ru_RU": "Ryujinx - Информация", - "sv_SE": "Ryujinx - Info", + "sv_SE": "", "th_TH": "Ryujinx – ข้อมูล", "tr_TR": "Ryujinx - Bilgi", "uk_UA": "Ryujin x - Інформація", @@ -18813,8 +18813,8 @@ "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": "Amiibo", - "sv_SE": "Amiibo", + "ru_RU": "", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -19435,7 +19435,7 @@ "it_IT": "", "ja_JP": "", "ko_KR": "XCI 파일 트리머", - "no_NO": "XCI File Trimmer", + "no_NO": "", "pl_PL": "", "pt_BR": "", "ru_RU": "Уменьшение размера XCI файлов", @@ -19639,7 +19639,7 @@ "pl_PL": "", "pt_BR": "", "ru_RU": "{0:n0} Мб", - "sv_SE": "{0:n0} Mb", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "{0:n0} Мб", @@ -20914,7 +20914,7 @@ "pl_PL": "Głoś", "pt_BR": "", "ru_RU": "Громкость", - "sv_SE": "Vol", + "sv_SE": "", "th_TH": "ระดับเสียง", "tr_TR": "Ses", "uk_UA": "Гуч.", @@ -21055,7 +21055,7 @@ "el_GR": "Όνομα", "en_US": "Name", "es_ES": "Nombre", - "fr_FR": "Nom ", + "fr_FR": "Nom\u00A0", "he_IL": "שם", "it_IT": "Nome", "ja_JP": "名称", @@ -21388,8 +21388,8 @@ "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": "FSR", - "sv_SE": "FSR", + "ru_RU": "", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -21888,8 +21888,8 @@ "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": "ldn_mitm", - "sv_SE": "ldn_mitm", + "ru_RU": "", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -21913,8 +21913,8 @@ "no_NO": "", "pl_PL": "", "pt_BR": "", - "ru_RU": "RyuLDN", - "sv_SE": "RyuLDN", + "ru_RU": "", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -22214,7 +22214,7 @@ "pl_PL": "", "pt_BR": "", "ru_RU": "Вертикальная синхронизация:", - "sv_SE": "VSync:", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "Вертикальна синхронізація (VSync):", @@ -22255,7 +22255,7 @@ "el_GR": "", "en_US": "Switch", "es_ES": "", - "fr_FR": "Switch", + "fr_FR": "", "he_IL": "", "it_IT": "", "ja_JP": "", @@ -22264,7 +22264,7 @@ "pl_PL": "", "pt_BR": "", "ru_RU": "Консоль", - "sv_SE": "Switch", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", @@ -22598,4 +22598,4 @@ } } ] -} +} \ No newline at end of file diff --git a/src/Ryujinx/Ryujinx.csproj b/src/Ryujinx/Ryujinx.csproj index 9d23b0909..461e556ea 100644 --- a/src/Ryujinx/Ryujinx.csproj +++ b/src/Ryujinx/Ryujinx.csproj @@ -13,9 +13,10 @@ $(DefaultItemExcludes);._* - - - + + + + From a5cde8e006ad167c0d250e487e935a62dc1ecf8f Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Mon, 30 Dec 2024 03:01:34 -0600 Subject: [PATCH 03/17] misc: Update Gommon, apply new extension --- Directory.Packages.props | 2 +- src/Ryujinx/UI/Views/Main/MainViewControls.axaml.cs | 1 - src/Ryujinx/Utilities/AppLibrary/LdnGameData.cs | 3 ++- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 59abe363c..070c1330c 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -41,7 +41,7 @@ - + diff --git a/src/Ryujinx/UI/Views/Main/MainViewControls.axaml.cs b/src/Ryujinx/UI/Views/Main/MainViewControls.axaml.cs index d5f7fbd1c..7a83a36de 100644 --- a/src/Ryujinx/UI/Views/Main/MainViewControls.axaml.cs +++ b/src/Ryujinx/UI/Views/Main/MainViewControls.axaml.cs @@ -26,7 +26,6 @@ namespace Ryujinx.Ava.UI.Views.Main { DataContext = ViewModel = window.ViewModel; } - } public void Sort_Checked(object sender, RoutedEventArgs args) diff --git a/src/Ryujinx/Utilities/AppLibrary/LdnGameData.cs b/src/Ryujinx/Utilities/AppLibrary/LdnGameData.cs index c1653df97..4b9b8fe6c 100644 --- a/src/Ryujinx/Utilities/AppLibrary/LdnGameData.cs +++ b/src/Ryujinx/Utilities/AppLibrary/LdnGameData.cs @@ -1,3 +1,4 @@ +using Gommon; using LibHac.Ns; using System; using System.Collections.Generic; @@ -22,7 +23,7 @@ namespace Ryujinx.Ava.Utilities.AppLibrary LibHac.Common.FixedArrays.Array8 communicationId = acp.LocalCommunicationId; return new Array(receivedData.Where(game => - communicationId.Items.Contains(Convert.ToUInt64(game.TitleId, 16)) + communicationId.Items.Contains(game.TitleId.ToULong()) )); } From 318498eab05f87546fb10a85bd376bdf8be33d3f Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Mon, 30 Dec 2024 20:57:18 -0600 Subject: [PATCH 04/17] misc: prefix ValidationTask with I, it's an interface Mention in PR comment script that you now need to be logged into GitHub to download artifacts. --- .github/workflows/nightly_pr_comment.yml | 2 +- .../{ValidationTask.cs => IValidationTask.cs} | 2 +- src/Ryujinx.BuildValidationTasks/LocalesValidationTask.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename src/Ryujinx.BuildValidationTasks/{ValidationTask.cs => IValidationTask.cs} (76%) diff --git a/.github/workflows/nightly_pr_comment.yml b/.github/workflows/nightly_pr_comment.yml index 6ca4710dc..fb7cdb359 100644 --- a/.github/workflows/nightly_pr_comment.yml +++ b/.github/workflows/nightly_pr_comment.yml @@ -37,7 +37,7 @@ jobs: if (!artifacts.length) { 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
Only for Developers\n`; for (const art of artifacts) { const url = `https://github.com/Ryubing/Ryujinx/actions/runs/${run_id}/artifacts/${art.id}`; diff --git a/src/Ryujinx.BuildValidationTasks/ValidationTask.cs b/src/Ryujinx.BuildValidationTasks/IValidationTask.cs similarity index 76% rename from src/Ryujinx.BuildValidationTasks/ValidationTask.cs rename to src/Ryujinx.BuildValidationTasks/IValidationTask.cs index f11c87f3b..682d79a0a 100644 --- a/src/Ryujinx.BuildValidationTasks/ValidationTask.cs +++ b/src/Ryujinx.BuildValidationTasks/IValidationTask.cs @@ -1,6 +1,6 @@ namespace Ryujinx.BuildValidationTasks { - public interface ValidationTask + public interface IValidationTask { public bool Execute(string projectPath, bool isGitRunner); } diff --git a/src/Ryujinx.BuildValidationTasks/LocalesValidationTask.cs b/src/Ryujinx.BuildValidationTasks/LocalesValidationTask.cs index 05eaee539..1f2c39e95 100644 --- a/src/Ryujinx.BuildValidationTasks/LocalesValidationTask.cs +++ b/src/Ryujinx.BuildValidationTasks/LocalesValidationTask.cs @@ -7,7 +7,7 @@ using System.Text.Encodings.Web; namespace Ryujinx.BuildValidationTasks { - public class LocalesValidationTask : ValidationTask + public class LocalesValidationTask : IValidationTask { public LocalesValidationTask() { } From e92f52e56cc2e671acb768b42b61a1e45148c743 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hack=E8=8C=B6=E3=82=93?= <120134269+Hackjjang@users.noreply.github.com> Date: Tue, 31 Dec 2024 12:13:43 +0900 Subject: [PATCH 05/17] Korean translations for new locale keys (#465) --- src/Ryujinx/Assets/locales.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Ryujinx/Assets/locales.json b/src/Ryujinx/Assets/locales.json index 31cba38dd..b3a7a51b8 100644 --- a/src/Ryujinx/Assets/locales.json +++ b/src/Ryujinx/Assets/locales.json @@ -1234,7 +1234,7 @@ "he_IL": "", "it_IT": "", "ja_JP": "", - "ko_KR": "", + "ko_KR": "자주 묻는 질문(FAQ) 및 안내", "no_NO": "", "pl_PL": "", "pt_BR": "", @@ -2609,7 +2609,7 @@ "he_IL": "", "it_IT": "", "ja_JP": "", - "ko_KR": "", + "ko_KR": "펌웨어 버전 : {0}", "no_NO": "", "pl_PL": "", "pt_BR": "Versão do firmware: {0}", @@ -4009,7 +4009,7 @@ "he_IL": "", "it_IT": "", "ja_JP": "", - "ko_KR": "", + "ko_KR": "PC 날짜와 시간에 동기화", "no_NO": "", "pl_PL": "", "pt_BR": "", @@ -15259,7 +15259,7 @@ "he_IL": "", "it_IT": "", "ja_JP": "", - "ko_KR": "", + "ko_KR": "시스템 시간을 PC의 현재 날짜 및 시간과 일치하도록 다시 동기화합니다.\n\n이 설정은 활성 설정이 아니므로 여전히 동기화되지 않을 수 있으며, 이 경우 이 버튼을 다시 클릭하면 됩니다.", "no_NO": "", "pl_PL": "", "pt_BR": "", @@ -20509,7 +20509,7 @@ "he_IL": "", "it_IT": "", "ja_JP": "", - "ko_KR": "", + "ko_KR": "자동", "no_NO": "", "pl_PL": "", "pt_BR": "", @@ -20534,7 +20534,7 @@ "he_IL": "", "it_IT": "", "ja_JP": "", - "ko_KR": "", + "ko_KR": "Vulkan을 사용합니다.\nARM 맥에서 해당 플랫폼에서 잘 실행되는 게임을 플레이하는 경우 Metal 후단부를 사용합니다.", "no_NO": "", "pl_PL": "", "pt_BR": "", From b6f88514f9937f17eddc4df9efafaebc96fd1b10 Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Mon, 30 Dec 2024 22:10:12 -0600 Subject: [PATCH 06/17] misc: Move BitTricks methods into BitUtils Cleanup DirtyHackCollection --- src/Ryujinx.Common/BitTricks.cs | 35 ---------------- .../Configuration/DirtyHacks.cs | 40 ++++++++----------- src/Ryujinx.Common/Utilities/BitUtils.cs | 30 ++++++++++++++ 3 files changed, 47 insertions(+), 58 deletions(-) delete mode 100644 src/Ryujinx.Common/BitTricks.cs diff --git a/src/Ryujinx.Common/BitTricks.cs b/src/Ryujinx.Common/BitTricks.cs deleted file mode 100644 index d0c689291..000000000 --- a/src/Ryujinx.Common/BitTricks.cs +++ /dev/null @@ -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; - } - } -} diff --git a/src/Ryujinx.Common/Configuration/DirtyHacks.cs b/src/Ryujinx.Common/Configuration/DirtyHacks.cs index 1015e95d1..e52c96cf1 100644 --- a/src/Ryujinx.Common/Configuration/DirtyHacks.cs +++ b/src/Ryujinx.Common/Configuration/DirtyHacks.cs @@ -1,4 +1,5 @@ -using System; +using Gommon; +using System; using System.Collections.Generic; using System.Linq; @@ -14,12 +15,14 @@ namespace Ryujinx.Common.Configuration public record EnabledDirtyHack(DirtyHacks Hack, int Value) { public static readonly byte[] PackedFormat = [8, 32]; - - public ulong Pack() => BitTricks.PackBitFields([(uint)Hack, (uint)Value], PackedFormat); + + private uint[] Raw => [(uint)Hack, (uint)Value.CoerceAtLeast(0)]; + + public ulong Pack() => Raw.PackBitFields(PackedFormat); public static EnabledDirtyHack Unpack(ulong packedHack) { - var unpackedFields = BitTricks.UnpackBitFields(packedHack, PackedFormat); + var unpackedFields = packedHack.UnpackBitFields(PackedFormat); if (unpackedFields is not [var hack, var value]) throw new ArgumentException(nameof(packedHack)); @@ -29,26 +32,17 @@ namespace Ryujinx.Common.Configuration public class DirtyHackCollection : Dictionary { - 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 DirtyHackCollection(IEnumerable hacks) + => hacks.ForEach(edh => Add(edh.Hack, edh.Value)); - public ulong[] PackEntries() => - this - .Select(it => - BitTricks.PackBitFields([(uint)it.Key, (uint)it.Value], EnabledDirtyHack.PackedFormat)) + public DirtyHackCollection(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 DirtyHackCollection(EnabledDirtyHack[] hacks) => new(hacks); diff --git a/src/Ryujinx.Common/Utilities/BitUtils.cs b/src/Ryujinx.Common/Utilities/BitUtils.cs index b9dae2e53..acbdde1f6 100644 --- a/src/Ryujinx.Common/Utilities/BitUtils.cs +++ b/src/Ryujinx.Common/Utilities/BitUtils.cs @@ -40,5 +40,35 @@ namespace Ryujinx.Common 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; + } } } From 172869bfba9322ddb4336ef1ec027f656a51d3bb Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Mon, 30 Dec 2024 22:11:05 -0600 Subject: [PATCH 07/17] misc: cleanup applying the current dirty hacks to the config upon loading the json --- .../ConfigurationState.Migration.cs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/Ryujinx/Utilities/Configuration/ConfigurationState.Migration.cs b/src/Ryujinx/Utilities/Configuration/ConfigurationState.Migration.cs index 210132117..828ceba57 100644 --- a/src/Ryujinx/Utilities/Configuration/ConfigurationState.Migration.cs +++ b/src/Ryujinx/Utilities/Configuration/ConfigurationState.Migration.cs @@ -1,3 +1,4 @@ +using Gommon; using Ryujinx.Ava.Utilities.Configuration.System; using Ryujinx.Ava.Utilities.Configuration.UI; using Ryujinx.Common.Configuration; @@ -9,7 +10,6 @@ using Ryujinx.Common.Logging; using Ryujinx.HLE; using System; using System.Collections.Generic; -using System.Linq; namespace Ryujinx.Ava.Utilities.Configuration { @@ -752,14 +752,12 @@ namespace Ryujinx.Ava.Utilities.Configuration Hacks.ShowDirtyHacks.Value = configurationFileFormat.ShowDirtyHacks; { - EnabledDirtyHack[] hacks = (configurationFileFormat.DirtyHacks ?? []).Select(EnabledDirtyHack.Unpack).ToArray(); - - Hacks.Xc2MenuSoftlockFix.Value = hacks.Any(it => it.Hack == DirtyHacks.Xc2MenuSoftlockFix); - - var shaderCompilationThreadSleep = hacks.FirstOrDefault(it => - it.Hack == DirtyHacks.ShaderCompilationThreadSleep); - Hacks.EnableShaderTranslationDelay.Value = shaderCompilationThreadSleep != null; - Hacks.ShaderTranslationDelay.Value = shaderCompilationThreadSleep?.Value ?? 0; + DirtyHackCollection hacks = new (configurationFileFormat.DirtyHacks ?? []); + + Hacks.Xc2MenuSoftlockFix.Value = hacks.IsEnabled(DirtyHacks.Xc2MenuSoftlockFix); + + Hacks.EnableShaderTranslationDelay.Value = hacks.IsEnabled(DirtyHacks.ShaderCompilationThreadSleep); + Hacks.ShaderTranslationDelay.Value = hacks[DirtyHacks.ShaderCompilationThreadSleep].CoerceAtLeast(0); } if (configurationFileUpdated) From f426945fec7620ac93217677104de72ab40d76f2 Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Mon, 30 Dec 2024 22:18:35 -0600 Subject: [PATCH 08/17] misc: Rename DirtyHacks to DirtyHack Rename DirtyHack.ShaderCompilationThreadSleep to ShaderTranslationDelay Changed EnabledDirtyHack to a struct rename DirtyHackCollection to DirtyHacks --- .../{DirtyHacks.cs => DirtyHack.cs} | 35 +++++++++++-------- src/Ryujinx.Graphics.Gpu/GpuContext.cs | 10 ++++-- .../DiskCache/ParallelDiskCacheLoader.cs | 4 +-- .../Services/Fs/FileSystemProxy/IStorage.cs | 2 +- src/Ryujinx.HLE/Switch.cs | 4 +-- .../ConfigurationState.Migration.cs | 8 ++--- .../Configuration/ConfigurationState.Model.cs | 6 ++-- 7 files changed, 39 insertions(+), 30 deletions(-) rename src/Ryujinx.Common/Configuration/{DirtyHacks.cs => DirtyHack.cs} (53%) diff --git a/src/Ryujinx.Common/Configuration/DirtyHacks.cs b/src/Ryujinx.Common/Configuration/DirtyHack.cs similarity index 53% rename from src/Ryujinx.Common/Configuration/DirtyHacks.cs rename to src/Ryujinx.Common/Configuration/DirtyHack.cs index e52c96cf1..6e21fe44e 100644 --- a/src/Ryujinx.Common/Configuration/DirtyHacks.cs +++ b/src/Ryujinx.Common/Configuration/DirtyHack.cs @@ -6,18 +6,19 @@ using System.Linq; namespace Ryujinx.Common.Configuration { [Flags] - public enum DirtyHacks : byte + public enum DirtyHack : byte { Xc2MenuSoftlockFix = 1, - ShaderCompilationThreadSleep = 2 + ShaderTranslationDelay = 2 } - public record EnabledDirtyHack(DirtyHacks Hack, int Value) + public readonly struct EnabledDirtyHack(DirtyHack hack, int value) { - public static readonly byte[] PackedFormat = [8, 32]; - - private uint[] Raw => [(uint)Hack, (uint)Value.CoerceAtLeast(0)]; - + public DirtyHack Hack => hack; + public int Value => value; + + + public ulong Pack() => Raw.PackBitFields(PackedFormat); public static EnabledDirtyHack Unpack(ulong packedHack) @@ -26,16 +27,20 @@ namespace Ryujinx.Common.Configuration if (unpackedFields is not [var hack, var value]) throw new ArgumentException(nameof(packedHack)); - return new EnabledDirtyHack((DirtyHacks)hack, (int)value); + 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 DirtyHackCollection : Dictionary + public class DirtyHacks : Dictionary { - public DirtyHackCollection(IEnumerable hacks) + public DirtyHacks(IEnumerable hacks) => hacks.ForEach(edh => Add(edh.Hack, edh.Value)); - public DirtyHackCollection(ulong[] packedHacks) : this(packedHacks.Select(EnabledDirtyHack.Unpack)) {} + public DirtyHacks(ulong[] packedHacks) : this(packedHacks.Select(EnabledDirtyHack.Unpack)) {} public ulong[] PackEntries() => Entries.Select(it => it.Pack()).ToArray(); @@ -45,11 +50,11 @@ namespace Ryujinx.Common.Configuration .Select(it => new EnabledDirtyHack(it.Key, it.Value)) .ToArray(); - public static implicit operator DirtyHackCollection(EnabledDirtyHack[] hacks) => new(hacks); - public static implicit operator DirtyHackCollection(ulong[] packedHacks) => new(packedHacks); + public static implicit operator DirtyHacks(EnabledDirtyHack[] hacks) => new(hacks); + public static implicit operator DirtyHacks(ulong[] packedHacks) => new(packedHacks); - public new int this[DirtyHacks hack] => TryGetValue(hack, out var value) ? value : -1; + public new int this[DirtyHack hack] => TryGetValue(hack, out var value) ? value : -1; - public bool IsEnabled(DirtyHacks hack) => ContainsKey(hack); + public bool IsEnabled(DirtyHack hack) => ContainsKey(hack); } } diff --git a/src/Ryujinx.Graphics.Gpu/GpuContext.cs b/src/Ryujinx.Graphics.Gpu/GpuContext.cs index 84bc0b9a9..f7e8f1bf8 100644 --- a/src/Ryujinx.Graphics.Gpu/GpuContext.cs +++ b/src/Ryujinx.Graphics.Gpu/GpuContext.cs @@ -92,7 +92,11 @@ namespace Ryujinx.Graphics.Gpu /// internal SupportBufferUpdater SupportBufferUpdater { get; } - internal DirtyHackCollection DirtyHacks { get; } + /// + /// Enabled dirty hacks. + /// Used for workarounds to emulator bugs we can't fix/don't know how to fix yet. + /// + internal DirtyHacks DirtyHacks { get; } /// @@ -117,7 +121,7 @@ namespace Ryujinx.Graphics.Gpu /// Creates a new instance of the GPU emulation context. /// /// Host renderer - public GpuContext(IRenderer renderer, DirtyHackCollection hackCollection) + public GpuContext(IRenderer renderer, DirtyHacks hacks) { Renderer = renderer; @@ -140,7 +144,7 @@ namespace Ryujinx.Graphics.Gpu SupportBufferUpdater = new SupportBufferUpdater(renderer); - DirtyHacks = hackCollection; + DirtyHacks = hacks; _firstTimestamp = ConvertNanosecondsToTicks((ulong)PerformanceCounter.ElapsedNanoseconds); } diff --git a/src/Ryujinx.Graphics.Gpu/Shader/DiskCache/ParallelDiskCacheLoader.cs b/src/Ryujinx.Graphics.Gpu/Shader/DiskCache/ParallelDiskCacheLoader.cs index 9aa96a76f..910e9aea0 100644 --- a/src/Ryujinx.Graphics.Gpu/Shader/DiskCache/ParallelDiskCacheLoader.cs +++ b/src/Ryujinx.Graphics.Gpu/Shader/DiskCache/ParallelDiskCacheLoader.cs @@ -367,8 +367,8 @@ namespace Ryujinx.Graphics.Gpu.Shader.DiskCache { try { - if (_context.DirtyHacks.IsEnabled(DirtyHacks.ShaderCompilationThreadSleep)) - Thread.Sleep(_context.DirtyHacks[DirtyHacks.ShaderCompilationThreadSleep]); + if (_context.DirtyHacks.IsEnabled(DirtyHack.ShaderTranslationDelay)) + Thread.Sleep(_context.DirtyHacks[DirtyHack.ShaderTranslationDelay]); AsyncProgramTranslation asyncTranslation = new(guestShaders, specState, programIndex, isCompute); _asyncTranslationQueue.Add(asyncTranslation, _cancellationToken); diff --git a/src/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IStorage.cs b/src/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IStorage.cs index ac5dc04e9..3d197ac19 100644 --- a/src/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IStorage.cs +++ b/src/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IStorage.cs @@ -39,7 +39,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy using var region = context.Memory.GetWritableRegion(bufferAddress, (int)bufferLen, true); 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 // https://web.archive.org/web/20240728045136/https://github.com/Ryujinx/Ryujinx/issues/2357 diff --git a/src/Ryujinx.HLE/Switch.cs b/src/Ryujinx.HLE/Switch.cs index 127e532e2..25e65354f 100644 --- a/src/Ryujinx.HLE/Switch.cs +++ b/src/Ryujinx.HLE/Switch.cs @@ -40,7 +40,7 @@ namespace Ryujinx.HLE public bool IsFrameAvailable => Gpu.Window.IsFrameAvailable; - public DirtyHackCollection DirtyHacks { get; } + public DirtyHacks DirtyHacks { get; } public Switch(HLEConfiguration configuration) { @@ -57,7 +57,7 @@ namespace Ryujinx.HLE : MemoryAllocationFlags.Reserve | MemoryAllocationFlags.Mirrorable; #pragma warning disable IDE0055 // Disable formatting - DirtyHacks = new DirtyHackCollection(Configuration.Hacks); + DirtyHacks = new DirtyHacks(Configuration.Hacks); AudioDeviceDriver = new CompatLayerHardwareDeviceDriver(Configuration.AudioDeviceDriver); Memory = new MemoryBlock(Configuration.MemoryConfiguration.ToDramSize(), memoryAllocationFlags); Gpu = new GpuContext(Configuration.GpuRenderer, DirtyHacks); diff --git a/src/Ryujinx/Utilities/Configuration/ConfigurationState.Migration.cs b/src/Ryujinx/Utilities/Configuration/ConfigurationState.Migration.cs index 828ceba57..551e3ab8e 100644 --- a/src/Ryujinx/Utilities/Configuration/ConfigurationState.Migration.cs +++ b/src/Ryujinx/Utilities/Configuration/ConfigurationState.Migration.cs @@ -752,12 +752,12 @@ namespace Ryujinx.Ava.Utilities.Configuration Hacks.ShowDirtyHacks.Value = configurationFileFormat.ShowDirtyHacks; { - DirtyHackCollection hacks = new (configurationFileFormat.DirtyHacks ?? []); + DirtyHacks hacks = new (configurationFileFormat.DirtyHacks ?? []); - Hacks.Xc2MenuSoftlockFix.Value = hacks.IsEnabled(DirtyHacks.Xc2MenuSoftlockFix); + Hacks.Xc2MenuSoftlockFix.Value = hacks.IsEnabled(DirtyHack.Xc2MenuSoftlockFix); - Hacks.EnableShaderTranslationDelay.Value = hacks.IsEnabled(DirtyHacks.ShaderCompilationThreadSleep); - Hacks.ShaderTranslationDelay.Value = hacks[DirtyHacks.ShaderCompilationThreadSleep].CoerceAtLeast(0); + Hacks.EnableShaderTranslationDelay.Value = hacks.IsEnabled(DirtyHack.ShaderTranslationDelay); + Hacks.ShaderTranslationDelay.Value = hacks[DirtyHack.ShaderTranslationDelay].CoerceAtLeast(0); } if (configurationFileUpdated) diff --git a/src/Ryujinx/Utilities/Configuration/ConfigurationState.Model.cs b/src/Ryujinx/Utilities/Configuration/ConfigurationState.Model.cs index 2a91bf65b..4fc25addb 100644 --- a/src/Ryujinx/Utilities/Configuration/ConfigurationState.Model.cs +++ b/src/Ryujinx/Utilities/Configuration/ConfigurationState.Model.cs @@ -666,14 +666,14 @@ namespace Ryujinx.Ava.Utilities.Configuration List enabledHacks = []; if (Xc2MenuSoftlockFix) - Apply(DirtyHacks.Xc2MenuSoftlockFix); + Apply(DirtyHack.Xc2MenuSoftlockFix); if (EnableShaderTranslationDelay) - Apply(DirtyHacks.ShaderCompilationThreadSleep, ShaderTranslationDelay); + Apply(DirtyHack.ShaderTranslationDelay, ShaderTranslationDelay); return enabledHacks.ToArray(); - void Apply(DirtyHacks hack, int value = 0) + void Apply(DirtyHack hack, int value = 0) { enabledHacks.Add(new EnabledDirtyHack(hack, value)); } From e50198b37d72d6a058bc92e4e258ded3848a7f3c Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Mon, 30 Dec 2024 23:11:59 -0600 Subject: [PATCH 09/17] Clarify DramSize XMLdoc --- src/Ryujinx/Utilities/Configuration/ConfigurationFileFormat.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ryujinx/Utilities/Configuration/ConfigurationFileFormat.cs b/src/Ryujinx/Utilities/Configuration/ConfigurationFileFormat.cs index 540024cbd..947dd5c8f 100644 --- a/src/Ryujinx/Utilities/Configuration/ConfigurationFileFormat.cs +++ b/src/Ryujinx/Utilities/Configuration/ConfigurationFileFormat.cs @@ -272,7 +272,7 @@ namespace Ryujinx.Ava.Utilities.Configuration public MemoryManagerMode MemoryManagerMode { get; set; } /// - /// Expands the RAM amount on the emulated system from 4GiB to 8GiB + /// Expands the RAM amount on the emulated system /// public MemoryConfiguration DramSize { get; set; } From df150f0788ba53ca7b3c43428961d6bfe39aad56 Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Mon, 30 Dec 2024 23:14:05 -0600 Subject: [PATCH 10/17] misc: Significantly reduce duplicated code in ConfigurationState migration logic. 300 lines removed; functionally identical. --- .../ConfigurationState.Migration.cs | 694 +++++------------- 1 file changed, 169 insertions(+), 525 deletions(-) diff --git a/src/Ryujinx/Utilities/Configuration/ConfigurationState.Migration.cs b/src/Ryujinx/Utilities/Configuration/ConfigurationState.Migration.cs index 551e3ab8e..8ff06bf26 100644 --- a/src/Ryujinx/Utilities/Configuration/ConfigurationState.Migration.cs +++ b/src/Ryujinx/Utilities/Configuration/ConfigurationState.Migration.cs @@ -9,7 +9,7 @@ using Ryujinx.Common.Configuration.Multiplayer; using Ryujinx.Common.Logging; using Ryujinx.HLE; using System; -using System.Collections.Generic; +using System.Linq; namespace Ryujinx.Ava.Utilities.Configuration { @@ -17,6 +17,7 @@ namespace Ryujinx.Ava.Utilities.Configuration { public void Load(ConfigurationFileFormat configurationFileFormat, string configurationFilePath) { + // referenced by Migrate bool configurationFileUpdated = false; if (configurationFileFormat.Version is < 0 or > ConfigurationFileFormat.CurrentVersion) @@ -25,174 +26,48 @@ namespace Ryujinx.Ava.Utilities.Configuration 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."); - - 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 + cff.ColumnSort = new ColumnSort { SortColumnId = 0, - SortAscending = false, + SortAscending = false }; - configurationFileFormat.Hotkeys = new KeyboardHotkeys - { - ToggleVSyncMode = Key.F1, - }; - - configurationFileUpdated = true; - } - - if (configurationFileFormat.Version < 10) + cff.Hotkeys = new KeyboardHotkeys { ToggleVSyncMode = Key.F1 }; + }); + Migrate(10, static cff => cff.AudioBackend = AudioBackend.OpenAl); + Migrate(11, 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) + cff.ResScale = 1; + cff.ResScaleCustom = 1.0f; + }); + Migrate(12, static cff => cff.LoggingGraphicsDebugLevel = GraphicsDebugLevel.None); + // 13 -> LDN1 + Migrate(14, static cff => cff.CheckUpdatesOnStart = true); + 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 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. - - configurationFileFormat.MultiplayerMode = MultiplayerMode.Disabled; - configurationFileFormat.MultiplayerLanInterfaceId = "0"; - - configurationFileUpdated = true; - } - - if (configurationFileFormat.Version < 22) + + cff.MultiplayerMode = MultiplayerMode.Disabled; + cff.MultiplayerLanInterfaceId = "0"; + }); + Migrate(22, static cff => cff.HideCursor = HideCursorMode.Never); + Migrate(24, static cff => { - 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 - { + cff.InputConfig = + [ new StandardKeyboardInputConfig { Version = InputConfig.CurrentVersion, @@ -240,69 +115,21 @@ namespace Ryujinx.Ava.Utilities.Configuration StickRight = Key.L, StickButton = Key.H, }, - }, - }; + } - configurationFileUpdated = true; - } - - if (configurationFileFormat.Version < 25) + ]; + }); + Migrate(26, static cff => cff.MemoryManagerMode = MemoryManagerMode.HostMappedUnsafe); + Migrate(27, static cff => cff.EnableMouse = false); + Migrate(29, static cff => cff.Hotkeys = new KeyboardHotkeys { - Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 25."); - - configurationFileUpdated = true; - } - - if (configurationFileFormat.Version < 26) + ToggleVSyncMode = Key.F1, + Screenshot = Key.F8, + ShowUI = Key.F4 + }); + Migrate(30, static cff => { - 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, - Screenshot = Key.F8, - }; - - configurationFileUpdated = true; - } - - if (configurationFileFormat.Version < 29) - { - Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 29."); - - 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) + foreach (InputConfig config in cff.InputConfig) { if (config is StandardControllerInputConfig controllerConfig) { @@ -314,342 +141,146 @@ namespace Ryujinx.Ava.Utilities.Configuration }; } } - - configurationFileUpdated = true; - } - - if (configurationFileFormat.Version < 31) + }); + Migrate(31, static cff => cff.BackendThreading = BackendThreading.Auto); + Migrate(32, static cff => cff.Hotkeys = new KeyboardHotkeys { - Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 31."); - - configurationFileFormat.BackendThreading = BackendThreading.Auto; - - configurationFileUpdated = true; - } - - if (configurationFileFormat.Version < 32) + ToggleVSyncMode = cff.Hotkeys.ToggleVSyncMode, + Screenshot = cff.Hotkeys.Screenshot, + ShowUI = cff.Hotkeys.ShowUI, + Pause = Key.F5, + }); + Migrate(33, static cff => { - Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 32."); - - configurationFileFormat.Hotkeys = new KeyboardHotkeys + cff.Hotkeys = new KeyboardHotkeys { - ToggleVSyncMode = configurationFileFormat.Hotkeys.ToggleVSyncMode, - Screenshot = configurationFileFormat.Hotkeys.Screenshot, - ShowUI = configurationFileFormat.Hotkeys.ShowUI, - Pause = Key.F5, - }; - - configurationFileUpdated = true; - } - - if (configurationFileFormat.Version < 33) - { - Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 33."); - - configurationFileFormat.Hotkeys = new KeyboardHotkeys - { - ToggleVSyncMode = configurationFileFormat.Hotkeys.ToggleVSyncMode, - Screenshot = configurationFileFormat.Hotkeys.Screenshot, - ShowUI = configurationFileFormat.Hotkeys.ShowUI, - Pause = configurationFileFormat.Hotkeys.Pause, + ToggleVSyncMode = cff.Hotkeys.ToggleVSyncMode, + Screenshot = cff.Hotkeys.Screenshot, + ShowUI = cff.Hotkeys.ShowUI, + Pause = cff.Hotkeys.Pause, ToggleMute = Key.F2, }; - configurationFileFormat.AudioVolume = 1; - - configurationFileUpdated = true; - } - - if (configurationFileFormat.Version < 34) + cff.AudioVolume = 1; + }); + Migrate(34, static cff => cff.EnableInternetAccess = false); + Migrate(35, static cff => { - Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 34."); - - configurationFileFormat.EnableInternetAccess = false; - - configurationFileUpdated = true; - } - - if (configurationFileFormat.Version < 35) - { - Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 35."); - - foreach (InputConfig config in configurationFileFormat.InputConfig) + foreach (StandardControllerInputConfig config in cff.InputConfig + .Where(it => it is StandardControllerInputConfig) + .Cast()) { - if (config is StandardControllerInputConfig controllerConfig) - { - controllerConfig.RangeLeft = 1.0f; - controllerConfig.RangeRight = 1.0f; - } + config.RangeLeft = 1.0f; + config.RangeRight = 1.0f; } - - configurationFileUpdated = true; - } - - if (configurationFileFormat.Version < 36) + }); + + 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 36."); - - configurationFileFormat.LoggingEnableTrace = false; - - configurationFileUpdated = true; - } - - if (configurationFileFormat.Version < 37) + cff.BaseStyle = "Dark"; + cff.GameListViewMode = 0; + cff.ShowNames = true; + cff.GridSize = 2; + cff.LanguageCode = "en_US"; + }); + Migrate(39, static cff => cff.Hotkeys = new KeyboardHotkeys { - 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) + ToggleVSyncMode = cff.Hotkeys.ToggleVSyncMode, + Screenshot = cff.Hotkeys.Screenshot, + ShowUI = cff.Hotkeys.ShowUI, + Pause = cff.Hotkeys.Pause, + ToggleMute = cff.Hotkeys.ToggleMute, + ResScaleUp = Key.Unbound, + ResScaleDown = Key.Unbound + }); + Migrate(40, static cff => cff.GraphicsBackend = GraphicsBackend.OpenGl); + Migrate(41, static cff => cff.Hotkeys = new KeyboardHotkeys { - 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) + ToggleVSyncMode = cff.Hotkeys.ToggleVSyncMode, + Screenshot = cff.Hotkeys.Screenshot, + ShowUI = cff.Hotkeys.ShowUI, + Pause = cff.Hotkeys.Pause, + ToggleMute = cff.Hotkeys.ToggleMute, + ResScaleUp = cff.Hotkeys.ResScaleUp, + ResScaleDown = cff.Hotkeys.ResScaleDown, + VolumeUp = Key.Unbound, + VolumeDown = Key.Unbound + }); + Migrate(42, static cff => cff.EnableMacroHLE = true); + Migrate(43, static cff => cff.UseHypervisor = true); + Migrate(44, static cff => { - 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, - ResScaleDown = Key.Unbound, - }; - - configurationFileUpdated = true; - } - - if (configurationFileFormat.Version < 40) + cff.AntiAliasing = AntiAliasing.None; + cff.ScalingFilter = ScalingFilter.Bilinear; + cff.ScalingFilterLevel = 80; + }); + Migrate(45, static cff => cff.ShownFileTypes = new ShownFileTypes { - Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 40."); - - configurationFileFormat.GraphicsBackend = GraphicsBackend.OpenGl; - - configurationFileUpdated = true; - } - - if (configurationFileFormat.Version < 41) + NSP = true, + PFS0 = true, + XCI = true, + NCA = true, + NRO = true, + NSO = true + }); + Migrate(46, static cff => cff.UseHypervisor = OperatingSystem.IsMacOS()); + Migrate(47, static cff => cff.WindowStartup = new WindowStartup { - 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, - VolumeDown = Key.Unbound, - }; - } - - if (configurationFileFormat.Version < 42) + WindowPositionX = 0, + WindowPositionY = 0, + WindowSizeHeight = 760, + WindowSizeWidth = 1280, + WindowMaximized = false + }); + Migrate(48, static cff => cff.EnableColorSpacePassthrough = false); + Migrate(49, static _ => { - Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 42."); - - configurationFileFormat.EnableMacroHLE = true; - } - - 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, - PFS0 = true, - XCI = true, - NCA = true, - NRO = true, - NSO = true, - }; - - configurationFileUpdated = true; - } - - 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, - WindowPositionY = 0, - WindowSizeHeight = 760, - WindowSizeWidth = 1280, - WindowMaximized = false, - }; - - configurationFileUpdated = true; - } - - 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()) { AppDataManager.FixMacOSConfigurationFolders(); } - - configurationFileUpdated = true; - } - - if (configurationFileFormat.Version < 50) + }); + Migrate(50, static cff => cff.EnableHardwareAcceleration = true); + Migrate(51, static cff => cff.RememberWindowState = true); + Migrate(52, static cff => cff.AutoloadDirs = []); + 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; - - 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 + cff.Hotkeys = new KeyboardHotkeys { ToggleVSyncMode = Key.F1, - 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 = configurationFileFormat.Hotkeys.VolumeUp, - VolumeDown = configurationFileFormat.Hotkeys.VolumeDown, + Screenshot = cff.Hotkeys.Screenshot, + ShowUI = cff.Hotkeys.ShowUI, + Pause = cff.Hotkeys.Pause, + ToggleMute = cff.Hotkeys.ToggleMute, + ResScaleUp = cff.Hotkeys.ResScaleUp, + ResScaleDown = cff.Hotkeys.ResScaleDown, + VolumeUp = cff.Hotkeys.VolumeUp, + VolumeDown = cff.Hotkeys.VolumeDown, CustomVSyncIntervalIncrement = Key.Unbound, CustomVSyncIntervalDecrement = Key.Unbound, }; - configurationFileFormat.CustomVSyncInterval = 120; - - configurationFileUpdated = true; - } - + cff.CustomVSyncInterval = 120; + }); // 58 migration accidentally got skipped but it worked with no issues somehow lol - - if (configurationFileFormat.Version < 59) + Migrate(59, static cff => { - 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; - configurationFileFormat.DirtyHacks = []; - - configurationFileUpdated = true; - } + // This was accidentally enabled by default when it was PRed. That is not what we want, + // so as a compromise users who want to use it will simply need to re-enable it once after updating. + cff.IgnoreApplet = false; + }); Logger.EnableFileLog.Value = configurationFileFormat.EnableFileLog; Graphics.ResScale.Value = configurationFileFormat.ResScale; @@ -766,6 +397,19 @@ namespace Ryujinx.Ava.Utilities.Configuration Ryujinx.Common.Logging.Logger.Notice.Print(LogClass.Application, $"Configuration file updated to version {ConfigurationFileFormat.CurrentVersion}"); } + + return; + + void Migrate(int newVer, Action 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; + } } } } From bd29f658b19a34227ac684cd23fda7777289fea9 Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Mon, 30 Dec 2024 23:28:32 -0600 Subject: [PATCH 11/17] misc: Forgot about OfType [ci skip] --- .../Utilities/Configuration/ConfigurationState.Migration.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Ryujinx/Utilities/Configuration/ConfigurationState.Migration.cs b/src/Ryujinx/Utilities/Configuration/ConfigurationState.Migration.cs index 8ff06bf26..f520cdac2 100644 --- a/src/Ryujinx/Utilities/Configuration/ConfigurationState.Migration.cs +++ b/src/Ryujinx/Utilities/Configuration/ConfigurationState.Migration.cs @@ -166,9 +166,7 @@ namespace Ryujinx.Ava.Utilities.Configuration Migrate(34, static cff => cff.EnableInternetAccess = false); Migrate(35, static cff => { - foreach (StandardControllerInputConfig config in cff.InputConfig - .Where(it => it is StandardControllerInputConfig) - .Cast()) + foreach (StandardControllerInputConfig config in cff.InputConfig.OfType()) { config.RangeLeft = 1.0f; config.RangeRight = 1.0f; From 4135d74e4d4f3bb46dba46fa967e98e9e5c7f589 Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Mon, 30 Dec 2024 23:50:55 -0600 Subject: [PATCH 12/17] UI: Only allow right click to create a context menu if a game is selected. --- .../UI/Controls/ApplicationGridView.axaml | 7 +-- .../UI/Controls/ApplicationGridView.axaml.cs | 6 -- .../UI/Controls/ApplicationListView.axaml | 8 +-- .../UI/Controls/ApplicationListView.axaml.cs | 6 -- .../UI/ViewModels/MainWindowViewModel.cs | 62 ++++++++++++++++++- 5 files changed, 65 insertions(+), 24 deletions(-) diff --git a/src/Ryujinx/UI/Controls/ApplicationGridView.axaml b/src/Ryujinx/UI/Controls/ApplicationGridView.axaml index 3bcb468ae..629bdebbf 100644 --- a/src/Ryujinx/UI/Controls/ApplicationGridView.axaml +++ b/src/Ryujinx/UI/Controls/ApplicationGridView.axaml @@ -15,7 +15,6 @@ x:DataType="viewModels:MainWindowViewModel"> - @@ -26,10 +25,10 @@ Padding="8" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" - ContextFlyout="{StaticResource ApplicationContextMenu}" + SelectedItem="{Binding GridSelectedApplication}" + ContextFlyout="{Binding GridAppContextMenu}" DoubleTapped="GameList_DoubleTapped" - ItemsSource="{Binding AppsObservableList}" - SelectionChanged="GameList_SelectionChanged"> + ItemsSource="{Binding AppsObservableList}"> - @@ -28,10 +26,10 @@ Padding="8" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" - ContextFlyout="{StaticResource ApplicationContextMenu}" + SelectedItem="{Binding ListSelectedApplication}" + ContextFlyout="{Binding ListAppContextMenu}" DoubleTapped="GameList_DoubleTapped" - ItemsSource="{Binding AppsObservableList}" - SelectionChanged="GameList_SelectionChanged"> + ItemsSource="{Binding AppsObservableList}"> _listSelectedApplication; + set + { + _listSelectedApplication = value; + + if (_listSelectedApplication != null && _listAppContextMenu == null) + ListAppContextMenu = new ApplicationContextMenu(); + else if (_listSelectedApplication == null && _listAppContextMenu != null) + ListAppContextMenu = null; + + OnPropertyChanged(); + } + } + + public ApplicationData GridSelectedApplication + { + get => _gridSelectedApplication; + set + { + _gridSelectedApplication = value; + + if (_gridSelectedApplication != null && _gridAppContextMenu == null) + GridAppContextMenu = new ApplicationContextMenu(); + else if (_gridSelectedApplication == null && _gridAppContextMenu != null) + GridAppContextMenu = null; + + OnPropertyChanged(); + } + } // Key is Title ID public SafeDictionary LdnData = []; @@ -218,7 +252,7 @@ namespace Ryujinx.Ava.UI.ViewModels public bool CanUpdate { - get => _canUpdate && EnableNonGameRunningControls && Updater.CanUpdate(false); + get => _canUpdate && EnableNonGameRunningControls && Updater.CanUpdate(); set { _canUpdate = value; @@ -247,6 +281,28 @@ namespace Ryujinx.Ava.UI.ViewModels } } + public ApplicationContextMenu ListAppContextMenu + { + get => _listAppContextMenu; + set + { + _listAppContextMenu = value; + + OnPropertyChanged(); + } + } + + public ApplicationContextMenu GridAppContextMenu + { + get => _gridAppContextMenu; + set + { + _gridAppContextMenu = value; + + OnPropertyChanged(); + } + } + public bool IsPaused { get => _isPaused; From 0cd09ea0c545085a5d1e649a6ed04fc6dc11f2f5 Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Tue, 31 Dec 2024 00:04:23 -0600 Subject: [PATCH 13/17] misc: Simplify ControlHolder checks in MainWindowViewModel --- src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs | 6 +++--- src/Ryujinx/Utilities/AppLibrary/ApplicationData.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs b/src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs index 74daacea5..23bd2d9e7 100644 --- a/src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs @@ -474,13 +474,13 @@ namespace Ryujinx.Ava.UI.ViewModels } } - public bool OpenUserSaveDirectoryEnabled => !SelectedApplication.ControlHolder.ByteSpan.IsZeros() && SelectedApplication.ControlHolder.Value.UserAccountSaveDataSize > 0; + public bool OpenUserSaveDirectoryEnabled => SelectedApplication.HasControlHolder && SelectedApplication.ControlHolder.Value.UserAccountSaveDataSize > 0; - public bool OpenDeviceSaveDirectoryEnabled => !SelectedApplication.ControlHolder.ByteSpan.IsZeros() && SelectedApplication.ControlHolder.Value.DeviceSaveDataSize > 0; + public bool OpenDeviceSaveDirectoryEnabled => SelectedApplication.HasControlHolder && SelectedApplication.ControlHolder.Value.DeviceSaveDataSize > 0; public bool TrimXCIEnabled => XCIFileTrimmer.CanTrim(SelectedApplication.Path, new XCITrimmerLog.MainWindow(this)); - public bool OpenBcatSaveDirectoryEnabled => !SelectedApplication.ControlHolder.ByteSpan.IsZeros() && SelectedApplication.ControlHolder.Value.BcatDeliveryCacheStorageSize > 0; + public bool OpenBcatSaveDirectoryEnabled => SelectedApplication.HasControlHolder && SelectedApplication.ControlHolder.Value.BcatDeliveryCacheStorageSize > 0; public string LoadHeading { diff --git a/src/Ryujinx/Utilities/AppLibrary/ApplicationData.cs b/src/Ryujinx/Utilities/AppLibrary/ApplicationData.cs index c87486232..a6336c257 100644 --- a/src/Ryujinx/Utilities/AppLibrary/ApplicationData.cs +++ b/src/Ryujinx/Utilities/AppLibrary/ApplicationData.cs @@ -33,7 +33,7 @@ namespace Ryujinx.Ava.Utilities.AppLibrary public string Path { get; set; } public BlitStruct ControlHolder { get; set; } - public bool HasControlHolder => ControlHolder.ByteSpan.Length > 0; + public bool HasControlHolder => ControlHolder.ByteSpan.Length > 0 && !ControlHolder.ByteSpan.IsZeros(); public string TimePlayedString => ValueFormatUtils.FormatTimeSpan(TimePlayed); From e43d899e1ddb9bc919fc107329c10db36d1712c2 Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Tue, 31 Dec 2024 00:19:23 -0600 Subject: [PATCH 14/17] misc: Use a few static helpers for Avalonia objects --- .../UI/ViewModels/DownloadableContentManagerViewModel.cs | 5 +---- src/Ryujinx/UI/ViewModels/Input/InputViewModel.cs | 4 +--- src/Ryujinx/UI/ViewModels/ModManagerViewModel.cs | 5 +---- src/Ryujinx/UI/ViewModels/TitleUpdateViewModel.cs | 5 +---- 4 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/Ryujinx/UI/ViewModels/DownloadableContentManagerViewModel.cs b/src/Ryujinx/UI/ViewModels/DownloadableContentManagerViewModel.cs index 4e9660a65..acc26decb 100644 --- a/src/Ryujinx/UI/ViewModels/DownloadableContentManagerViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/DownloadableContentManagerViewModel.cs @@ -93,10 +93,7 @@ namespace Ryujinx.Ava.UI.ViewModels _applicationData = applicationData; - if (Application.Current.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) - { - _storageProvider = desktop.MainWindow.StorageProvider; - } + _storageProvider = RyujinxApp.MainWindow.StorageProvider; LoadDownloadableContents(); } diff --git a/src/Ryujinx/UI/ViewModels/Input/InputViewModel.cs b/src/Ryujinx/UI/ViewModels/Input/InputViewModel.cs index 74b8681d5..16f8e46fa 100644 --- a/src/Ryujinx/UI/ViewModels/Input/InputViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/Input/InputViewModel.cs @@ -245,9 +245,7 @@ namespace Ryujinx.Ava.UI.ViewModels.Input { if (Program.PreviewerDetached) { - _mainWindow = - (MainWindow)((IClassicDesktopStyleApplicationLifetime)Application.Current - .ApplicationLifetime).MainWindow; + _mainWindow = RyujinxApp.MainWindow; AvaloniaKeyboardDriver = new AvaloniaKeyboardDriver(owner); diff --git a/src/Ryujinx/UI/ViewModels/ModManagerViewModel.cs b/src/Ryujinx/UI/ViewModels/ModManagerViewModel.cs index df2ef266e..9c26376ce 100644 --- a/src/Ryujinx/UI/ViewModels/ModManagerViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/ModManagerViewModel.cs @@ -86,10 +86,7 @@ namespace Ryujinx.Ava.UI.ViewModels _modJsonPath = Path.Combine(AppDataManager.GamesDirPath, applicationId.ToString("x16"), "mods.json"); - if (Application.Current.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) - { - _storageProvider = desktop.MainWindow.StorageProvider; - } + _storageProvider = RyujinxApp.MainWindow.StorageProvider; LoadMods(applicationId); } diff --git a/src/Ryujinx/UI/ViewModels/TitleUpdateViewModel.cs b/src/Ryujinx/UI/ViewModels/TitleUpdateViewModel.cs index a179218af..0748efeb4 100644 --- a/src/Ryujinx/UI/ViewModels/TitleUpdateViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/TitleUpdateViewModel.cs @@ -76,10 +76,7 @@ namespace Ryujinx.Ava.UI.ViewModels ApplicationData = applicationData; - if (Application.Current.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) - { - StorageProvider = desktop.MainWindow.StorageProvider; - } + StorageProvider = RyujinxApp.MainWindow.StorageProvider; LoadUpdates(); } From 617c03119fad86e55e52cbf830f1cf51d05abeda Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Tue, 31 Dec 2024 00:52:39 -0600 Subject: [PATCH 15/17] misc: clean vsync toggle log --- src/Ryujinx/UI/Views/Main/MainStatusBarView.axaml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ryujinx/UI/Views/Main/MainStatusBarView.axaml.cs b/src/Ryujinx/UI/Views/Main/MainStatusBarView.axaml.cs index b234f7859..78747013c 100644 --- a/src/Ryujinx/UI/Views/Main/MainStatusBarView.axaml.cs +++ b/src/Ryujinx/UI/Views/Main/MainStatusBarView.axaml.cs @@ -41,7 +41,7 @@ namespace Ryujinx.Ava.UI.Views.Main private void VSyncMode_PointerReleased(object sender, PointerReleasedEventArgs e) { Window.ViewModel.ToggleVSyncMode(); - Logger.Info?.Print(LogClass.Application, $"VSync Mode toggled to: {Window.ViewModel.AppHost.Device.VSyncMode}"); + Logger.Info?.PrintMsg(LogClass.Application, $"VSync Mode toggled to: {Window.ViewModel.AppHost.Device.VSyncMode}"); } private void DockedStatus_PointerReleased(object sender, PointerReleasedEventArgs e) From 19d2883a35799c76dcf7f1dec8ebeb6428e5057f Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Tue, 31 Dec 2024 02:51:14 -0600 Subject: [PATCH 16/17] UI: Store config migrations in a dictionary and loop through it to do migrations. --- .../ConfigurationState.Migration.cs | 739 +++++++++--------- 1 file changed, 373 insertions(+), 366 deletions(-) diff --git a/src/Ryujinx/Utilities/Configuration/ConfigurationState.Migration.cs b/src/Ryujinx/Utilities/Configuration/ConfigurationState.Migration.cs index f520cdac2..ec66bcaac 100644 --- a/src/Ryujinx/Utilities/Configuration/ConfigurationState.Migration.cs +++ b/src/Ryujinx/Utilities/Configuration/ConfigurationState.Migration.cs @@ -9,379 +9,146 @@ using Ryujinx.Common.Configuration.Multiplayer; using Ryujinx.Common.Logging; using Ryujinx.HLE; using System; +using System.Collections.Generic; using System.Linq; +using RyuLogger = Ryujinx.Common.Logging.Logger; namespace Ryujinx.Ava.Utilities.Configuration { public partial class ConfigurationState { - public void Load(ConfigurationFileFormat configurationFileFormat, string configurationFilePath) + public void Load(ConfigurationFileFormat cff, string configurationFilePath) { - // referenced by Migrate bool configurationFileUpdated = false; - if (configurationFileFormat.Version is < 0 or > ConfigurationFileFormat.CurrentVersion) + if (cff.Version is < 0 or > ConfigurationFileFormat.CurrentVersion) { - Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Unsupported configuration version {configurationFileFormat.Version}, loading default."); + RyuLogger.Warning?.Print(LogClass.Application, $"Unsupported configuration version {cff.Version}, loading default."); LoadDefault(); } - - 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 => - { - cff.ColumnSort = new ColumnSort - { - SortColumnId = 0, - SortAscending = false - }; - cff.Hotkeys = new KeyboardHotkeys { ToggleVSyncMode = Key.F1 }; - }); - Migrate(10, static cff => cff.AudioBackend = AudioBackend.OpenAl); - Migrate(11, static cff => + foreach ((int newVersion, Action migratorFunction) + in _migrations.OrderBy(x => x.Key)) { - cff.ResScale = 1; - cff.ResScaleCustom = 1.0f; - }); - Migrate(12, static cff => cff.LoggingGraphicsDebugLevel = GraphicsDebugLevel.None); - // 13 -> LDN1 - Migrate(14, static cff => cff.CheckUpdatesOnStart = true); - 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 => - { - // Initialize network config. + if (cff.Version >= newVersion) + continue; + + RyuLogger.Warning?.Print(LogClass.Application, + $"Outdated configuration version {cff.Version}, migrating to version {newVersion}."); - cff.MultiplayerMode = MultiplayerMode.Disabled; - cff.MultiplayerLanInterfaceId = "0"; - }); - Migrate(22, static cff => cff.HideCursor = HideCursorMode.Never); - Migrate(24, static cff => - { - cff.InputConfig = - [ - new StandardKeyboardInputConfig - { - Version = InputConfig.CurrentVersion, - Backend = InputBackendType.WindowKeyboard, - Id = "0", - PlayerIndex = PlayerIndex.Player1, - ControllerType = ControllerType.ProController, - LeftJoycon = new LeftJoyconCommonConfig - { - DpadUp = Key.Up, - DpadDown = Key.Down, - DpadLeft = Key.Left, - DpadRight = Key.Right, - ButtonMinus = Key.Minus, - ButtonL = Key.E, - ButtonZl = Key.Q, - ButtonSl = Key.Unbound, - ButtonSr = Key.Unbound, - }, - LeftJoyconStick = new JoyconConfigKeyboardStick - { - StickUp = Key.W, - StickDown = Key.S, - StickLeft = Key.A, - StickRight = Key.D, - StickButton = Key.F, - }, - RightJoycon = new RightJoyconCommonConfig - { - ButtonA = Key.Z, - ButtonB = Key.X, - ButtonX = Key.C, - ButtonY = Key.V, - ButtonPlus = Key.Plus, - ButtonR = Key.U, - ButtonZr = Key.O, - ButtonSl = Key.Unbound, - ButtonSr = Key.Unbound, - }, - RightJoyconStick = new JoyconConfigKeyboardStick - { - StickUp = Key.I, - StickDown = Key.K, - StickLeft = Key.J, - StickRight = Key.L, - StickButton = Key.H, - }, - } + migratorFunction(cff); - ]; - }); - Migrate(26, static cff => cff.MemoryManagerMode = MemoryManagerMode.HostMappedUnsafe); - Migrate(27, static cff => cff.EnableMouse = false); - Migrate(29, static cff => cff.Hotkeys = new KeyboardHotkeys - { - ToggleVSyncMode = Key.F1, - Screenshot = Key.F8, - ShowUI = Key.F4 - }); - Migrate(30, static cff => - { - foreach (InputConfig config in cff.InputConfig) - { - if (config is StandardControllerInputConfig controllerConfig) - { - controllerConfig.Rumble = new RumbleConfigController - { - EnableRumble = false, - StrongRumble = 1f, - WeakRumble = 1f, - }; - } - } - }); - Migrate(31, static cff => cff.BackendThreading = BackendThreading.Auto); - Migrate(32, static cff => cff.Hotkeys = new KeyboardHotkeys - { - ToggleVSyncMode = cff.Hotkeys.ToggleVSyncMode, - Screenshot = cff.Hotkeys.Screenshot, - ShowUI = cff.Hotkeys.ShowUI, - Pause = Key.F5, - }); - Migrate(33, static cff => - { - cff.Hotkeys = new KeyboardHotkeys - { - ToggleVSyncMode = cff.Hotkeys.ToggleVSyncMode, - Screenshot = cff.Hotkeys.Screenshot, - ShowUI = cff.Hotkeys.ShowUI, - Pause = cff.Hotkeys.Pause, - ToggleMute = Key.F2, - }; - - cff.AudioVolume = 1; - }); - Migrate(34, static cff => cff.EnableInternetAccess = false); - Migrate(35, static cff => - { - foreach (StandardControllerInputConfig config in cff.InputConfig.OfType()) - { - config.RangeLeft = 1.0f; - config.RangeRight = 1.0f; - } - }); + configurationFileUpdated = true; + } - Migrate(36, static cff => cff.LoggingEnableTrace = false); - Migrate(37, static cff => cff.ShowConsole = true); - Migrate(38, static cff => - { - cff.BaseStyle = "Dark"; - cff.GameListViewMode = 0; - cff.ShowNames = true; - cff.GridSize = 2; - cff.LanguageCode = "en_US"; - }); - Migrate(39, static cff => cff.Hotkeys = new KeyboardHotkeys - { - ToggleVSyncMode = cff.Hotkeys.ToggleVSyncMode, - Screenshot = cff.Hotkeys.Screenshot, - ShowUI = cff.Hotkeys.ShowUI, - Pause = cff.Hotkeys.Pause, - ToggleMute = cff.Hotkeys.ToggleMute, - ResScaleUp = Key.Unbound, - ResScaleDown = Key.Unbound - }); - Migrate(40, static cff => cff.GraphicsBackend = GraphicsBackend.OpenGl); - Migrate(41, static cff => cff.Hotkeys = new KeyboardHotkeys - { - ToggleVSyncMode = cff.Hotkeys.ToggleVSyncMode, - Screenshot = cff.Hotkeys.Screenshot, - ShowUI = cff.Hotkeys.ShowUI, - Pause = cff.Hotkeys.Pause, - ToggleMute = cff.Hotkeys.ToggleMute, - ResScaleUp = cff.Hotkeys.ResScaleUp, - ResScaleDown = cff.Hotkeys.ResScaleDown, - VolumeUp = Key.Unbound, - VolumeDown = Key.Unbound - }); - Migrate(42, static cff => cff.EnableMacroHLE = true); - Migrate(43, static cff => cff.UseHypervisor = true); - Migrate(44, static cff => - { - cff.AntiAliasing = AntiAliasing.None; - cff.ScalingFilter = ScalingFilter.Bilinear; - cff.ScalingFilterLevel = 80; - }); - Migrate(45, static cff => cff.ShownFileTypes = new ShownFileTypes - { - NSP = true, - PFS0 = true, - XCI = true, - NCA = true, - NRO = true, - NSO = true - }); - Migrate(46, static cff => cff.UseHypervisor = OperatingSystem.IsMacOS()); - Migrate(47, static cff => cff.WindowStartup = new WindowStartup - { - WindowPositionX = 0, - WindowPositionY = 0, - WindowSizeHeight = 760, - WindowSizeWidth = 1280, - WindowMaximized = false - }); - Migrate(48, static cff => cff.EnableColorSpacePassthrough = false); - Migrate(49, static _ => - { - if (OperatingSystem.IsMacOS()) - { - AppDataManager.FixMacOSConfigurationFolders(); - } - }); - Migrate(50, static cff => cff.EnableHardwareAcceleration = true); - Migrate(51, static cff => cff.RememberWindowState = true); - Migrate(52, static cff => cff.AutoloadDirs = []); - 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 => - { - cff.VSyncMode = VSyncMode.Switch; - cff.EnableCustomVSyncInterval = false; - - cff.Hotkeys = new KeyboardHotkeys - { - ToggleVSyncMode = Key.F1, - Screenshot = cff.Hotkeys.Screenshot, - ShowUI = cff.Hotkeys.ShowUI, - Pause = cff.Hotkeys.Pause, - ToggleMute = cff.Hotkeys.ToggleMute, - ResScaleUp = cff.Hotkeys.ResScaleUp, - ResScaleDown = cff.Hotkeys.ResScaleDown, - VolumeUp = cff.Hotkeys.VolumeUp, - VolumeDown = cff.Hotkeys.VolumeDown, - CustomVSyncIntervalIncrement = Key.Unbound, - CustomVSyncIntervalDecrement = Key.Unbound, - }; - - cff.CustomVSyncInterval = 120; - }); - // 58 migration accidentally got skipped but it worked with no issues somehow lol - Migrate(59, static cff => - { - cff.ShowDirtyHacks = false; - cff.DirtyHacks = []; - - // This was accidentally enabled by default when it was PRed. That is not what we want, - // so as a compromise users who want to use it will simply need to re-enable it once after updating. - cff.IgnoreApplet = false; - }); - - Logger.EnableFileLog.Value = configurationFileFormat.EnableFileLog; - Graphics.ResScale.Value = configurationFileFormat.ResScale; - Graphics.ResScaleCustom.Value = configurationFileFormat.ResScaleCustom; - Graphics.MaxAnisotropy.Value = configurationFileFormat.MaxAnisotropy; - Graphics.AspectRatio.Value = configurationFileFormat.AspectRatio; - Graphics.ShadersDumpPath.Value = configurationFileFormat.GraphicsShadersDumpPath; - Graphics.BackendThreading.Value = configurationFileFormat.BackendThreading; - Graphics.GraphicsBackend.Value = configurationFileFormat.GraphicsBackend; - Graphics.PreferredGpu.Value = configurationFileFormat.PreferredGpu; - Graphics.AntiAliasing.Value = configurationFileFormat.AntiAliasing; - Graphics.ScalingFilter.Value = configurationFileFormat.ScalingFilter; - Graphics.ScalingFilterLevel.Value = configurationFileFormat.ScalingFilterLevel; - Logger.EnableDebug.Value = configurationFileFormat.LoggingEnableDebug; - Logger.EnableStub.Value = configurationFileFormat.LoggingEnableStub; - Logger.EnableInfo.Value = configurationFileFormat.LoggingEnableInfo; - Logger.EnableWarn.Value = configurationFileFormat.LoggingEnableWarn; - Logger.EnableError.Value = configurationFileFormat.LoggingEnableError; - Logger.EnableTrace.Value = configurationFileFormat.LoggingEnableTrace; - Logger.EnableGuest.Value = configurationFileFormat.LoggingEnableGuest; - Logger.EnableFsAccessLog.Value = configurationFileFormat.LoggingEnableFsAccessLog; - Logger.FilteredClasses.Value = configurationFileFormat.LoggingFilteredClasses; - Logger.GraphicsDebugLevel.Value = configurationFileFormat.LoggingGraphicsDebugLevel; - System.Language.Value = configurationFileFormat.SystemLanguage; - System.Region.Value = configurationFileFormat.SystemRegion; - System.TimeZone.Value = configurationFileFormat.SystemTimeZone; - System.SystemTimeOffset.Value = configurationFileFormat.SystemTimeOffset; - System.EnableDockedMode.Value = configurationFileFormat.DockedMode; - EnableDiscordIntegration.Value = configurationFileFormat.EnableDiscordIntegration; - CheckUpdatesOnStart.Value = configurationFileFormat.CheckUpdatesOnStart; - ShowConfirmExit.Value = configurationFileFormat.ShowConfirmExit; - IgnoreApplet.Value = configurationFileFormat.IgnoreApplet; - RememberWindowState.Value = configurationFileFormat.RememberWindowState; - ShowTitleBar.Value = configurationFileFormat.ShowTitleBar; - EnableHardwareAcceleration.Value = configurationFileFormat.EnableHardwareAcceleration; - HideCursor.Value = configurationFileFormat.HideCursor; - Graphics.VSyncMode.Value = configurationFileFormat.VSyncMode; - Graphics.EnableCustomVSyncInterval.Value = configurationFileFormat.EnableCustomVSyncInterval; - Graphics.CustomVSyncInterval.Value = configurationFileFormat.CustomVSyncInterval; - Graphics.EnableShaderCache.Value = configurationFileFormat.EnableShaderCache; - Graphics.EnableTextureRecompression.Value = configurationFileFormat.EnableTextureRecompression; - Graphics.EnableMacroHLE.Value = configurationFileFormat.EnableMacroHLE; - Graphics.EnableColorSpacePassthrough.Value = configurationFileFormat.EnableColorSpacePassthrough; - System.EnablePtc.Value = configurationFileFormat.EnablePtc; - System.EnableLowPowerPtc.Value = configurationFileFormat.EnableLowPowerPtc; - System.EnableInternetAccess.Value = configurationFileFormat.EnableInternetAccess; - System.EnableFsIntegrityChecks.Value = configurationFileFormat.EnableFsIntegrityChecks; - System.FsGlobalAccessLogMode.Value = configurationFileFormat.FsGlobalAccessLogMode; - System.AudioBackend.Value = configurationFileFormat.AudioBackend; - System.AudioVolume.Value = configurationFileFormat.AudioVolume; - System.MemoryManagerMode.Value = configurationFileFormat.MemoryManagerMode; - System.DramSize.Value = configurationFileFormat.DramSize; - System.IgnoreMissingServices.Value = configurationFileFormat.IgnoreMissingServices; - System.UseHypervisor.Value = configurationFileFormat.UseHypervisor; - UI.GuiColumns.FavColumn.Value = configurationFileFormat.GuiColumns.FavColumn; - UI.GuiColumns.IconColumn.Value = configurationFileFormat.GuiColumns.IconColumn; - UI.GuiColumns.AppColumn.Value = configurationFileFormat.GuiColumns.AppColumn; - UI.GuiColumns.DevColumn.Value = configurationFileFormat.GuiColumns.DevColumn; - UI.GuiColumns.VersionColumn.Value = configurationFileFormat.GuiColumns.VersionColumn; - UI.GuiColumns.TimePlayedColumn.Value = configurationFileFormat.GuiColumns.TimePlayedColumn; - UI.GuiColumns.LastPlayedColumn.Value = configurationFileFormat.GuiColumns.LastPlayedColumn; - UI.GuiColumns.FileExtColumn.Value = configurationFileFormat.GuiColumns.FileExtColumn; - UI.GuiColumns.FileSizeColumn.Value = configurationFileFormat.GuiColumns.FileSizeColumn; - UI.GuiColumns.PathColumn.Value = configurationFileFormat.GuiColumns.PathColumn; - UI.ColumnSort.SortColumnId.Value = configurationFileFormat.ColumnSort.SortColumnId; - UI.ColumnSort.SortAscending.Value = configurationFileFormat.ColumnSort.SortAscending; - UI.GameDirs.Value = configurationFileFormat.GameDirs; - UI.AutoloadDirs.Value = configurationFileFormat.AutoloadDirs ?? []; - UI.ShownFileTypes.NSP.Value = configurationFileFormat.ShownFileTypes.NSP; - UI.ShownFileTypes.PFS0.Value = configurationFileFormat.ShownFileTypes.PFS0; - UI.ShownFileTypes.XCI.Value = configurationFileFormat.ShownFileTypes.XCI; - UI.ShownFileTypes.NCA.Value = configurationFileFormat.ShownFileTypes.NCA; - UI.ShownFileTypes.NRO.Value = configurationFileFormat.ShownFileTypes.NRO; - UI.ShownFileTypes.NSO.Value = configurationFileFormat.ShownFileTypes.NSO; - UI.LanguageCode.Value = configurationFileFormat.LanguageCode; - UI.BaseStyle.Value = configurationFileFormat.BaseStyle; - UI.GameListViewMode.Value = configurationFileFormat.GameListViewMode; - UI.ShowNames.Value = configurationFileFormat.ShowNames; - UI.IsAscendingOrder.Value = configurationFileFormat.IsAscendingOrder; - UI.GridSize.Value = configurationFileFormat.GridSize; - UI.ApplicationSort.Value = configurationFileFormat.ApplicationSort; - UI.StartFullscreen.Value = configurationFileFormat.StartFullscreen; - UI.ShowConsole.Value = configurationFileFormat.ShowConsole; - UI.WindowStartup.WindowSizeWidth.Value = configurationFileFormat.WindowStartup.WindowSizeWidth; - UI.WindowStartup.WindowSizeHeight.Value = configurationFileFormat.WindowStartup.WindowSizeHeight; - UI.WindowStartup.WindowPositionX.Value = configurationFileFormat.WindowStartup.WindowPositionX; - UI.WindowStartup.WindowPositionY.Value = configurationFileFormat.WindowStartup.WindowPositionY; - UI.WindowStartup.WindowMaximized.Value = configurationFileFormat.WindowStartup.WindowMaximized; - Hid.EnableKeyboard.Value = configurationFileFormat.EnableKeyboard; - Hid.EnableMouse.Value = configurationFileFormat.EnableMouse; - Hid.Hotkeys.Value = configurationFileFormat.Hotkeys; - Hid.InputConfig.Value = configurationFileFormat.InputConfig ?? []; - - Multiplayer.LanInterfaceId.Value = configurationFileFormat.MultiplayerLanInterfaceId; - Multiplayer.Mode.Value = configurationFileFormat.MultiplayerMode; - Multiplayer.DisableP2p.Value = configurationFileFormat.MultiplayerDisableP2p; - Multiplayer.LdnPassphrase.Value = configurationFileFormat.MultiplayerLdnPassphrase; - Multiplayer.LdnServer.Value = configurationFileFormat.LdnServer; + EnableDiscordIntegration.Value = cff.EnableDiscordIntegration; + CheckUpdatesOnStart.Value = cff.CheckUpdatesOnStart; + ShowConfirmExit.Value = cff.ShowConfirmExit; + IgnoreApplet.Value = cff.IgnoreApplet; + RememberWindowState.Value = cff.RememberWindowState; + ShowTitleBar.Value = cff.ShowTitleBar; + EnableHardwareAcceleration.Value = cff.EnableHardwareAcceleration; + HideCursor.Value = cff.HideCursor; - Hacks.ShowDirtyHacks.Value = configurationFileFormat.ShowDirtyHacks; + Logger.EnableFileLog.Value = cff.EnableFileLog; + Logger.EnableDebug.Value = cff.LoggingEnableDebug; + Logger.EnableStub.Value = cff.LoggingEnableStub; + Logger.EnableInfo.Value = cff.LoggingEnableInfo; + Logger.EnableWarn.Value = cff.LoggingEnableWarn; + Logger.EnableError.Value = cff.LoggingEnableError; + Logger.EnableTrace.Value = cff.LoggingEnableTrace; + Logger.EnableGuest.Value = cff.LoggingEnableGuest; + Logger.EnableFsAccessLog.Value = cff.LoggingEnableFsAccessLog; + Logger.FilteredClasses.Value = cff.LoggingFilteredClasses; + Logger.GraphicsDebugLevel.Value = cff.LoggingGraphicsDebugLevel; + + Graphics.ResScale.Value = cff.ResScale; + Graphics.ResScaleCustom.Value = cff.ResScaleCustom; + Graphics.MaxAnisotropy.Value = cff.MaxAnisotropy; + Graphics.AspectRatio.Value = cff.AspectRatio; + Graphics.ShadersDumpPath.Value = cff.GraphicsShadersDumpPath; + Graphics.BackendThreading.Value = cff.BackendThreading; + Graphics.GraphicsBackend.Value = cff.GraphicsBackend; + Graphics.PreferredGpu.Value = cff.PreferredGpu; + Graphics.AntiAliasing.Value = cff.AntiAliasing; + Graphics.ScalingFilter.Value = cff.ScalingFilter; + Graphics.ScalingFilterLevel.Value = cff.ScalingFilterLevel; + Graphics.VSyncMode.Value = cff.VSyncMode; + Graphics.EnableCustomVSyncInterval.Value = cff.EnableCustomVSyncInterval; + Graphics.CustomVSyncInterval.Value = cff.CustomVSyncInterval; + Graphics.EnableShaderCache.Value = cff.EnableShaderCache; + Graphics.EnableTextureRecompression.Value = cff.EnableTextureRecompression; + Graphics.EnableMacroHLE.Value = cff.EnableMacroHLE; + Graphics.EnableColorSpacePassthrough.Value = cff.EnableColorSpacePassthrough; + + System.Language.Value = cff.SystemLanguage; + System.Region.Value = cff.SystemRegion; + System.TimeZone.Value = cff.SystemTimeZone; + System.SystemTimeOffset.Value = cff.SystemTimeOffset; + System.EnableDockedMode.Value = cff.DockedMode; + System.EnablePtc.Value = cff.EnablePtc; + System.EnableLowPowerPtc.Value = cff.EnableLowPowerPtc; + System.EnableInternetAccess.Value = cff.EnableInternetAccess; + System.EnableFsIntegrityChecks.Value = cff.EnableFsIntegrityChecks; + System.FsGlobalAccessLogMode.Value = cff.FsGlobalAccessLogMode; + System.AudioBackend.Value = cff.AudioBackend; + System.AudioVolume.Value = cff.AudioVolume; + System.MemoryManagerMode.Value = cff.MemoryManagerMode; + System.DramSize.Value = cff.DramSize; + System.IgnoreMissingServices.Value = cff.IgnoreMissingServices; + System.UseHypervisor.Value = cff.UseHypervisor; + + UI.GuiColumns.FavColumn.Value = cff.GuiColumns.FavColumn; + UI.GuiColumns.IconColumn.Value = cff.GuiColumns.IconColumn; + UI.GuiColumns.AppColumn.Value = cff.GuiColumns.AppColumn; + UI.GuiColumns.DevColumn.Value = cff.GuiColumns.DevColumn; + UI.GuiColumns.VersionColumn.Value = cff.GuiColumns.VersionColumn; + UI.GuiColumns.TimePlayedColumn.Value = cff.GuiColumns.TimePlayedColumn; + UI.GuiColumns.LastPlayedColumn.Value = cff.GuiColumns.LastPlayedColumn; + UI.GuiColumns.FileExtColumn.Value = cff.GuiColumns.FileExtColumn; + UI.GuiColumns.FileSizeColumn.Value = cff.GuiColumns.FileSizeColumn; + UI.GuiColumns.PathColumn.Value = cff.GuiColumns.PathColumn; + UI.ColumnSort.SortColumnId.Value = cff.ColumnSort.SortColumnId; + UI.ColumnSort.SortAscending.Value = cff.ColumnSort.SortAscending; + UI.GameDirs.Value = cff.GameDirs; + UI.AutoloadDirs.Value = cff.AutoloadDirs ?? []; + UI.ShownFileTypes.NSP.Value = cff.ShownFileTypes.NSP; + UI.ShownFileTypes.PFS0.Value = cff.ShownFileTypes.PFS0; + UI.ShownFileTypes.XCI.Value = cff.ShownFileTypes.XCI; + UI.ShownFileTypes.NCA.Value = cff.ShownFileTypes.NCA; + UI.ShownFileTypes.NRO.Value = cff.ShownFileTypes.NRO; + UI.ShownFileTypes.NSO.Value = cff.ShownFileTypes.NSO; + UI.LanguageCode.Value = cff.LanguageCode; + UI.BaseStyle.Value = cff.BaseStyle; + UI.GameListViewMode.Value = cff.GameListViewMode; + UI.ShowNames.Value = cff.ShowNames; + UI.IsAscendingOrder.Value = cff.IsAscendingOrder; + UI.GridSize.Value = cff.GridSize; + UI.ApplicationSort.Value = cff.ApplicationSort; + UI.StartFullscreen.Value = cff.StartFullscreen; + UI.ShowConsole.Value = cff.ShowConsole; + UI.WindowStartup.WindowSizeWidth.Value = cff.WindowStartup.WindowSizeWidth; + UI.WindowStartup.WindowSizeHeight.Value = cff.WindowStartup.WindowSizeHeight; + UI.WindowStartup.WindowPositionX.Value = cff.WindowStartup.WindowPositionX; + UI.WindowStartup.WindowPositionY.Value = cff.WindowStartup.WindowPositionY; + UI.WindowStartup.WindowMaximized.Value = cff.WindowStartup.WindowMaximized; + + Hid.EnableKeyboard.Value = cff.EnableKeyboard; + Hid.EnableMouse.Value = cff.EnableMouse; + Hid.Hotkeys.Value = cff.Hotkeys; + Hid.InputConfig.Value = cff.InputConfig ?? []; + Multiplayer.LanInterfaceId.Value = cff.MultiplayerLanInterfaceId; + Multiplayer.Mode.Value = cff.MultiplayerMode; + Multiplayer.DisableP2p.Value = cff.MultiplayerDisableP2p; + Multiplayer.LdnPassphrase.Value = cff.MultiplayerLdnPassphrase; + Multiplayer.LdnServer.Value = cff.LdnServer; + { - DirtyHacks hacks = new (configurationFileFormat.DirtyHacks ?? []); + Hacks.ShowDirtyHacks.Value = cff.ShowDirtyHacks; + + DirtyHacks hacks = new (cff.DirtyHacks ?? []); Hacks.Xc2MenuSoftlockFix.Value = hacks.IsEnabled(DirtyHack.Xc2MenuSoftlockFix); @@ -393,21 +160,261 @@ namespace Ryujinx.Ava.Utilities.Configuration { ToFileFormat().SaveConfig(configurationFilePath); - Ryujinx.Common.Logging.Logger.Notice.Print(LogClass.Application, $"Configuration file updated to version {ConfigurationFileFormat.CurrentVersion}"); - } - - return; - - void Migrate(int newVer, Action 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; + RyuLogger.Notice.Print(LogClass.Application, $"Configuration file updated to version {ConfigurationFileFormat.CurrentVersion}"); } } + + private static readonly Dictionary> _migrations = + Collections.NewDictionary>( + (2, static cff => cff.SystemRegion = Region.USA), + (3, static cff => cff.SystemTimeZone = "UTC"), + (4, static cff => cff.MaxAnisotropy = -1), + (5, static cff => cff.SystemTimeOffset = 0), + (8, static cff => cff.EnablePtc = true), + (9, static cff => + { + cff.ColumnSort = new ColumnSort { SortColumnId = 0, SortAscending = false }; + cff.Hotkeys = new KeyboardHotkeys { ToggleVSyncMode = Key.F1 }; + }), + (10, static cff => cff.AudioBackend = AudioBackend.OpenAl), + (11, static cff => + { + cff.ResScale = 1; + cff.ResScaleCustom = 1.0f; + }), + (12, static cff => cff.LoggingGraphicsDebugLevel = GraphicsDebugLevel.None), + // 13 -> LDN1 + (14, static cff => cff.CheckUpdatesOnStart = true), + (16, static cff => cff.EnableShaderCache = true), + (17, static cff => cff.StartFullscreen = false), + (18, static cff => cff.AspectRatio = AspectRatio.Fixed16x9), + // 19 -> LDN2 + (20, static cff => cff.ShowConfirmExit = true), + (21, static cff => + { + // Initialize network config. + + cff.MultiplayerMode = MultiplayerMode.Disabled; + cff.MultiplayerLanInterfaceId = "0"; + }), + (22, static cff => cff.HideCursor = HideCursorMode.Never), + (24, static cff => + { + cff.InputConfig = + [ + new StandardKeyboardInputConfig + { + Version = InputConfig.CurrentVersion, + Backend = InputBackendType.WindowKeyboard, + Id = "0", + PlayerIndex = PlayerIndex.Player1, + ControllerType = ControllerType.ProController, + LeftJoycon = new LeftJoyconCommonConfig + { + DpadUp = Key.Up, + DpadDown = Key.Down, + DpadLeft = Key.Left, + DpadRight = Key.Right, + ButtonMinus = Key.Minus, + ButtonL = Key.E, + ButtonZl = Key.Q, + ButtonSl = Key.Unbound, + ButtonSr = Key.Unbound, + }, + LeftJoyconStick = new JoyconConfigKeyboardStick + { + StickUp = Key.W, + StickDown = Key.S, + StickLeft = Key.A, + StickRight = Key.D, + StickButton = Key.F, + }, + RightJoycon = new RightJoyconCommonConfig + { + ButtonA = Key.Z, + ButtonB = Key.X, + ButtonX = Key.C, + ButtonY = Key.V, + ButtonPlus = Key.Plus, + ButtonR = Key.U, + ButtonZr = Key.O, + ButtonSl = Key.Unbound, + ButtonSr = Key.Unbound, + }, + RightJoyconStick = new JoyconConfigKeyboardStick + { + StickUp = Key.I, + StickDown = Key.K, + StickLeft = Key.J, + StickRight = Key.L, + StickButton = Key.H, + }, + } + ]; + }), + (26, static cff => cff.MemoryManagerMode = MemoryManagerMode.HostMappedUnsafe), + (27, static cff => cff.EnableMouse = false), + (29, + static cff => + cff.Hotkeys = new KeyboardHotkeys + { + ToggleVSyncMode = Key.F1, Screenshot = Key.F8, ShowUI = Key.F4 + }), + (30, static cff => + { + foreach (InputConfig config in cff.InputConfig) + { + if (config is StandardControllerInputConfig controllerConfig) + { + controllerConfig.Rumble = new RumbleConfigController + { + EnableRumble = false, StrongRumble = 1f, WeakRumble = 1f, + }; + } + } + }), + (31, static cff => cff.BackendThreading = BackendThreading.Auto), + (32, static cff => cff.Hotkeys = new KeyboardHotkeys + { + ToggleVSyncMode = cff.Hotkeys.ToggleVSyncMode, + Screenshot = cff.Hotkeys.Screenshot, + ShowUI = cff.Hotkeys.ShowUI, + Pause = Key.F5, + }), + (33, static cff => + { + cff.Hotkeys = new KeyboardHotkeys + { + ToggleVSyncMode = cff.Hotkeys.ToggleVSyncMode, + Screenshot = cff.Hotkeys.Screenshot, + ShowUI = cff.Hotkeys.ShowUI, + Pause = cff.Hotkeys.Pause, + ToggleMute = Key.F2, + }; + + cff.AudioVolume = 1; + }), + (34, static cff => cff.EnableInternetAccess = false), + (35, static cff => + { + foreach (StandardControllerInputConfig config in cff.InputConfig + .OfType()) + { + config.RangeLeft = 1.0f; + config.RangeRight = 1.0f; + } + }), + + (36, static cff => cff.LoggingEnableTrace = false), + (37, static cff => cff.ShowConsole = true), + (38, static cff => + { + cff.BaseStyle = "Dark"; + cff.GameListViewMode = 0; + cff.ShowNames = true; + cff.GridSize = 2; + cff.LanguageCode = "en_US"; + }), + (39, + static cff => cff.Hotkeys = new KeyboardHotkeys + { + ToggleVSyncMode = cff.Hotkeys.ToggleVSyncMode, + Screenshot = cff.Hotkeys.Screenshot, + ShowUI = cff.Hotkeys.ShowUI, + Pause = cff.Hotkeys.Pause, + ToggleMute = cff.Hotkeys.ToggleMute, + ResScaleUp = Key.Unbound, + ResScaleDown = Key.Unbound + }), + (40, static cff => cff.GraphicsBackend = GraphicsBackend.OpenGl), + (41, + static cff => cff.Hotkeys = new KeyboardHotkeys + { + ToggleVSyncMode = cff.Hotkeys.ToggleVSyncMode, + Screenshot = cff.Hotkeys.Screenshot, + ShowUI = cff.Hotkeys.ShowUI, + Pause = cff.Hotkeys.Pause, + ToggleMute = cff.Hotkeys.ToggleMute, + ResScaleUp = cff.Hotkeys.ResScaleUp, + ResScaleDown = cff.Hotkeys.ResScaleDown, + VolumeUp = Key.Unbound, + VolumeDown = Key.Unbound + }), + (42, static cff => cff.EnableMacroHLE = true), + (43, static cff => cff.UseHypervisor = true), + (44, static cff => + { + cff.AntiAliasing = AntiAliasing.None; + cff.ScalingFilter = ScalingFilter.Bilinear; + cff.ScalingFilterLevel = 80; + }), + (45, + static cff => cff.ShownFileTypes = new ShownFileTypes + { + NSP = true, + PFS0 = true, + XCI = true, + NCA = true, + NRO = true, + NSO = true + }), + (46, static cff => cff.UseHypervisor = OperatingSystem.IsMacOS()), + (47, + static cff => cff.WindowStartup = new WindowStartup + { + WindowPositionX = 0, + WindowPositionY = 0, + WindowSizeHeight = 760, + WindowSizeWidth = 1280, + WindowMaximized = false + }), + (48, static cff => cff.EnableColorSpacePassthrough = false), + (49, static _ => + { + if (OperatingSystem.IsMacOS()) + { + AppDataManager.FixMacOSConfigurationFolders(); + } + }), + (50, static cff => cff.EnableHardwareAcceleration = true), + (51, static cff => cff.RememberWindowState = true), + (52, static cff => cff.AutoloadDirs = []), + (53, static cff => cff.EnableLowPowerPtc = false), + (54, static cff => cff.DramSize = MemoryConfiguration.MemoryConfiguration4GiB), + (55, static cff => cff.IgnoreApplet = false), + (56, static cff => cff.ShowTitleBar = !OperatingSystem.IsWindows()), + (57, static cff => + { + cff.VSyncMode = VSyncMode.Switch; + cff.EnableCustomVSyncInterval = false; + + cff.Hotkeys = new KeyboardHotkeys + { + ToggleVSyncMode = Key.F1, + Screenshot = cff.Hotkeys.Screenshot, + ShowUI = cff.Hotkeys.ShowUI, + Pause = cff.Hotkeys.Pause, + ToggleMute = cff.Hotkeys.ToggleMute, + ResScaleUp = cff.Hotkeys.ResScaleUp, + ResScaleDown = cff.Hotkeys.ResScaleDown, + VolumeUp = cff.Hotkeys.VolumeUp, + VolumeDown = cff.Hotkeys.VolumeDown, + CustomVSyncIntervalIncrement = Key.Unbound, + CustomVSyncIntervalDecrement = Key.Unbound, + }; + + cff.CustomVSyncInterval = 120; + }), + // 58 migration accidentally got skipped, but it worked with no issues somehow lol + (59, static cff => + { + cff.ShowDirtyHacks = false; + cff.DirtyHacks = []; + + // This was accidentally enabled by default when it was PRed. That is not what we want, + // so as a compromise users who want to use it will simply need to re-enable it once after updating. + cff.IgnoreApplet = false; + }) + ); } } From 61ae427a4d757b7c3502d407d74ce2a06db6d9e9 Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Tue, 31 Dec 2024 03:29:08 -0600 Subject: [PATCH 17/17] misc: Add CommunityToolkit.Mvvm for observable property generation; apply it to MainWindowViewModel for now. --- Directory.Packages.props | 1 + src/Ryujinx/AppHost.cs | 2 +- src/Ryujinx/Ryujinx.csproj | 3 +- src/Ryujinx/UI/ViewModels/BaseModel.cs | 12 +- .../UI/ViewModels/MainWindowViewModel.cs | 621 ++---------------- 5 files changed, 76 insertions(+), 563 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 070c1330c..7054dcd7d 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -17,6 +17,7 @@ + diff --git a/src/Ryujinx/AppHost.cs b/src/Ryujinx/AppHost.cs index b90f8b801..c728ee9c9 100644 --- a/src/Ryujinx/AppHost.cs +++ b/src/Ryujinx/AppHost.cs @@ -314,7 +314,7 @@ namespace Ryujinx.Ava _renderer.Window?.ChangeVSyncMode(e.NewValue); - _viewModel.ShowCustomVSyncIntervalPicker = (e.NewValue == VSyncMode.Custom); + _viewModel.UpdateVSyncIntervalPicker(); } public void VSyncModeToggle() diff --git a/src/Ryujinx/Ryujinx.csproj b/src/Ryujinx/Ryujinx.csproj index 461e556ea..0991cf9ce 100644 --- a/src/Ryujinx/Ryujinx.csproj +++ b/src/Ryujinx/Ryujinx.csproj @@ -49,6 +49,7 @@ + @@ -162,4 +163,4 @@ - \ No newline at end of file + diff --git a/src/Ryujinx/UI/ViewModels/BaseModel.cs b/src/Ryujinx/UI/ViewModels/BaseModel.cs index e27c52867..c0ccfcae1 100644 --- a/src/Ryujinx/UI/ViewModels/BaseModel.cs +++ b/src/Ryujinx/UI/ViewModels/BaseModel.cs @@ -1,18 +1,10 @@ +using CommunityToolkit.Mvvm.ComponentModel; using System; -using System.ComponentModel; -using System.Runtime.CompilerServices; namespace Ryujinx.Ava.UI.ViewModels { - public class BaseModel : INotifyPropertyChanged + public class BaseModel : ObservableObject { - public event PropertyChangedEventHandler PropertyChanged; - - protected void OnPropertyChanged([CallerMemberName] string propertyName = null) - { - PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); - } - protected void OnPropertiesChanged(string firstPropertyName, params ReadOnlySpan propertyNames) { OnPropertyChanged(firstPropertyName); diff --git a/src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs b/src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs index 23bd2d9e7..6df1f76ad 100644 --- a/src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs @@ -6,6 +6,7 @@ using Avalonia.Media; using Avalonia.Media.Imaging; using Avalonia.Platform.Storage; using Avalonia.Threading; +using CommunityToolkit.Mvvm.ComponentModel; using DynamicData; using DynamicData.Binding; using FluentAvalonia.UI.Controls; @@ -54,80 +55,76 @@ using ShaderCacheLoadingState = Ryujinx.Graphics.Gpu.Shader.ShaderCacheState; namespace Ryujinx.Ava.UI.ViewModels { - public class MainWindowViewModel : BaseModel + public partial class MainWindowViewModel : BaseModel { private const int HotKeyPressDelayMs = 500; private delegate int LoadContentFromFolderDelegate(List dirs, out int numRemoved); - private ObservableCollectionExtended _applications; - private string _aspectStatusText; - - private string _loadHeading; - private string _cacheLoadStatus; - private string _searchText; - private Timer _searchTimer; - private string _dockedStatusText; - private string _vSyncModeText; - private string _fifoStatusText; - private string _gameStatusText; - private string _volumeStatusText; - private string _gpuStatusText; - private string _shaderCountText; + [ObservableProperty] private ObservableCollectionExtended _applications; + [ObservableProperty] private string _aspectRatioStatusText; + [ObservableProperty] private string _loadHeading; + [ObservableProperty] private string _cacheLoadStatus; + [ObservableProperty] private string _dockedStatusText; + [ObservableProperty] private string _fifoStatusText; + [ObservableProperty] private string _gameStatusText; + [ObservableProperty] private string _volumeStatusText; + [ObservableProperty] private string _gpuNameText; + [ObservableProperty] private string _backendText; + [ObservableProperty] private string _shaderCountText; + [ObservableProperty] private bool _showShaderCompilationHint; + [ObservableProperty] private bool _isFullScreen; + [ObservableProperty] private int _progressMaximum; + [ObservableProperty] private int _progressValue; + [ObservableProperty] private bool _showMenuAndStatusBar = true; + [ObservableProperty] private bool _showStatusSeparator; + [ObservableProperty] private Brush _progressBarForegroundColor; + [ObservableProperty] private Brush _progressBarBackgroundColor; + [ObservableProperty] private Brush _vSyncModeColor; + [ObservableProperty] private byte[] _selectedIcon; + [ObservableProperty] private int _statusBarProgressMaximum; + [ObservableProperty] private int _statusBarProgressValue; + [ObservableProperty] private string _statusBarProgressStatusText; + [ObservableProperty] private bool _statusBarProgressStatusVisible; + [ObservableProperty] private bool _isPaused; + [ObservableProperty] private bool _isLoadingIndeterminate = true; + [ObservableProperty] private bool _showAll; + [ObservableProperty] private string _lastScannedAmiiboId; + [ObservableProperty] private ReadOnlyObservableCollection _appsObservableList; + [ObservableProperty] private long _lastFullscreenToggle = Environment.TickCount64; + [ObservableProperty] private bool _showContent = true; + [ObservableProperty] private float _volumeBeforeMute; + [ObservableProperty] private bool _areMimeTypesRegistered = FileAssociationHelper.AreMimeTypesRegistered; + [ObservableProperty] private Cursor _cursor; + [ObservableProperty] private string _title; + [ObservableProperty] private WindowState _windowState; + [ObservableProperty] private double _windowWidth; + [ObservableProperty] private double _windowHeight; + [ObservableProperty] private bool _isActive; + [ObservableProperty] private bool _isSubMenuOpen; + [ObservableProperty] private ApplicationContextMenu _listAppContextMenu; + [ObservableProperty] private ApplicationContextMenu _gridAppContextMenu; + + private bool _showLoadProgress; + private bool _isGameRunning; private bool _isAmiiboRequested; private bool _isAmiiboBinRequested; - private bool _showShaderCompilationHint; - private bool _isGameRunning; - private bool _isFullScreen; - private int _progressMaximum; - private int _progressValue; - private long _lastFullscreenToggle = Environment.TickCount64; - private bool _showLoadProgress; - private bool _showMenuAndStatusBar = true; - private bool _showStatusSeparator; - private Brush _progressBarForegroundColor; - private Brush _progressBarBackgroundColor; - private Brush _vSyncModeColor; - private byte[] _selectedIcon; - private bool _isAppletMenuActive; - private int _statusBarProgressMaximum; - private int _statusBarProgressValue; - private string _statusBarProgressStatusText; - private bool _statusBarProgressStatusVisible; - private bool _isPaused; - private bool _showContent = true; - private bool _isLoadingIndeterminate = true; - private bool _showAll; - private string _lastScannedAmiiboId; - private bool _statusBarVisible; - private ReadOnlyObservableCollection _appsObservableList; - + private string _searchText; + private Timer _searchTimer; + private string _vSyncModeText; private string _showUiKey = "F4"; private string _pauseKey = "F5"; private string _screenshotKey = "F8"; private float _volume; - private float _volumeBeforeMute; - private string _backendText; - - private bool _areMimeTypesRegistered = FileAssociationHelper.AreMimeTypesRegistered; + private bool _isAppletMenuActive; + private bool _statusBarVisible; private bool _canUpdate = true; - private Cursor _cursor; - private string _title; private ApplicationData _currentApplicationData; private readonly AutoResetEvent _rendererWaitEvent; - private WindowState _windowState; - private double _windowWidth; - private double _windowHeight; private int _customVSyncInterval; private int _customVSyncIntervalPercentageProxy; - - private bool _isActive; - private bool _isSubMenuOpen; - private ApplicationData _listSelectedApplication; private ApplicationData _gridSelectedApplication; - private ApplicationContextMenu _listAppContextMenu; - private ApplicationContextMenu _gridAppContextMenu; - + public ApplicationData ListSelectedApplication { get => _listSelectedApplication; @@ -135,10 +132,13 @@ namespace Ryujinx.Ava.UI.ViewModels { _listSelectedApplication = value; +#pragma warning disable MVVMTK0034 if (_listSelectedApplication != null && _listAppContextMenu == null) + ListAppContextMenu = new ApplicationContextMenu(); else if (_listSelectedApplication == null && _listAppContextMenu != null) - ListAppContextMenu = null; + ListAppContextMenu = null!; +#pragma warning restore MVVMTK0034 OnPropertyChanged(); } @@ -151,10 +151,12 @@ namespace Ryujinx.Ava.UI.ViewModels { _gridSelectedApplication = value; +#pragma warning disable MVVMTK0034 if (_gridSelectedApplication != null && _gridAppContextMenu == null) GridAppContextMenu = new ApplicationContextMenu(); else if (_gridSelectedApplication == null && _gridAppContextMenu != null) - GridAppContextMenu = null; + GridAppContextMenu = null!; +#pragma warning restore MVVMTK0034 OnPropertyChanged(); } @@ -260,71 +262,6 @@ namespace Ryujinx.Ava.UI.ViewModels } } - public Cursor Cursor - { - get => _cursor; - set - { - _cursor = value; - OnPropertyChanged(); - } - } - - public ReadOnlyObservableCollection AppsObservableList - { - get => _appsObservableList; - set - { - _appsObservableList = value; - - OnPropertyChanged(); - } - } - - public ApplicationContextMenu ListAppContextMenu - { - get => _listAppContextMenu; - set - { - _listAppContextMenu = value; - - OnPropertyChanged(); - } - } - - public ApplicationContextMenu GridAppContextMenu - { - get => _gridAppContextMenu; - set - { - _gridAppContextMenu = value; - - OnPropertyChanged(); - } - } - - public bool IsPaused - { - get => _isPaused; - set - { - _isPaused = value; - - OnPropertyChanged(); - } - } - - public long LastFullscreenToggle - { - get => _lastFullscreenToggle; - set - { - _lastFullscreenToggle = value; - - OnPropertyChanged(); - } - } - public bool StatusBarVisible { get => _statusBarVisible && EnableNonGameRunningControls; @@ -340,17 +277,6 @@ namespace Ryujinx.Ava.UI.ViewModels public bool ShowFirmwareStatus => !ShowLoadProgress; - public bool ShowShaderCompilationHint - { - get => _showShaderCompilationHint; - set - { - _showShaderCompilationHint = value; - - OnPropertyChanged(); - } - } - public bool IsGameRunning { get => _isGameRunning; @@ -393,7 +319,7 @@ namespace Ryujinx.Ava.UI.ViewModels } public bool CanScanAmiiboBinaries => AmiiboBinReader.HasAmiiboKeyFile; - + public bool ShowLoadProgress { get => _showLoadProgress; @@ -406,61 +332,6 @@ namespace Ryujinx.Ava.UI.ViewModels } } - public string GameStatusText - { - get => _gameStatusText; - set - { - _gameStatusText = value; - - OnPropertyChanged(); - } - } - - public bool IsFullScreen - { - get => _isFullScreen; - set - { - _isFullScreen = value; - - OnPropertyChanged(); - } - } - - public bool IsSubMenuOpen - { - get => _isSubMenuOpen; - set - { - _isSubMenuOpen = value; - - OnPropertyChanged(); - } - } - - public bool ShowAll - { - get => _showAll; - set - { - _showAll = value; - - OnPropertyChanged(); - } - } - - public string LastScannedAmiiboId - { - get => _lastScannedAmiiboId; - set - { - _lastScannedAmiiboId = value; - - OnPropertyChanged(); - } - } - public ApplicationData SelectedApplication { get @@ -482,79 +353,12 @@ namespace Ryujinx.Ava.UI.ViewModels public bool OpenBcatSaveDirectoryEnabled => SelectedApplication.HasControlHolder && SelectedApplication.ControlHolder.Value.BcatDeliveryCacheStorageSize > 0; - public string LoadHeading + public bool ShowCustomVSyncIntervalPicker + => _isGameRunning && AppHost.Device.VSyncMode == VSyncMode.Custom; + + public void UpdateVSyncIntervalPicker() { - get => _loadHeading; - set - { - _loadHeading = value; - - OnPropertyChanged(); - } - } - - public string CacheLoadStatus - { - get => _cacheLoadStatus; - set - { - _cacheLoadStatus = value; - - OnPropertyChanged(); - } - } - - public Brush ProgressBarBackgroundColor - { - get => _progressBarBackgroundColor; - set - { - _progressBarBackgroundColor = value; - - OnPropertyChanged(); - } - } - - public Brush ProgressBarForegroundColor - { - get => _progressBarForegroundColor; - set - { - _progressBarForegroundColor = value; - - OnPropertyChanged(); - } - } - - public Brush VSyncModeColor - { - get => _vSyncModeColor; - set - { - _vSyncModeColor = value; - - OnPropertyChanged(); - } - } - - public bool ShowCustomVSyncIntervalPicker - { - get - { - if (_isGameRunning) - { - return AppHost.Device.VSyncMode == - VSyncMode.Custom; - } - else - { - return false; - } - } - set - { - OnPropertyChanged(); - } + OnPropertyChanged(nameof(ShowCustomVSyncIntervalPicker)); } public int CustomVSyncIntervalPercentageProxy @@ -607,126 +411,6 @@ namespace Ryujinx.Ava.UI.ViewModels } } - public byte[] SelectedIcon - { - get => _selectedIcon; - set - { - _selectedIcon = value; - - OnPropertyChanged(); - } - } - - public int ProgressMaximum - { - get => _progressMaximum; - set - { - _progressMaximum = value; - - OnPropertyChanged(); - } - } - - public int ProgressValue - { - get => _progressValue; - set - { - _progressValue = value; - - OnPropertyChanged(); - } - } - - public int StatusBarProgressMaximum - { - get => _statusBarProgressMaximum; - set - { - _statusBarProgressMaximum = value; - - OnPropertyChanged(); - } - } - - public int StatusBarProgressValue - { - get => _statusBarProgressValue; - set - { - _statusBarProgressValue = value; - - OnPropertyChanged(); - } - } - - public bool StatusBarProgressStatusVisible - { - get => _statusBarProgressStatusVisible; - set - { - _statusBarProgressStatusVisible = value; - - OnPropertyChanged(); - } - } - - public string StatusBarProgressStatusText - { - get => _statusBarProgressStatusText; - set - { - _statusBarProgressStatusText = value; - - OnPropertyChanged(); - } - } - - public string FifoStatusText - { - get => _fifoStatusText; - set - { - _fifoStatusText = value; - - OnPropertyChanged(); - } - } - - public string GpuNameText - { - get => _gpuStatusText; - set - { - _gpuStatusText = value; - - OnPropertyChanged(); - } - } - - public string ShaderCountText - { - get => _shaderCountText; - set - { - _shaderCountText = value; - OnPropertyChanged(); - } - } - - public string BackendText - { - get => _backendText; - set - { - _backendText = value; - - OnPropertyChanged(); - } - } - public string VSyncModeText { get => _vSyncModeText; @@ -735,39 +419,7 @@ namespace Ryujinx.Ava.UI.ViewModels _vSyncModeText = value; OnPropertyChanged(); - } - } - - public string DockedStatusText - { - get => _dockedStatusText; - set - { - _dockedStatusText = value; - - OnPropertyChanged(); - } - } - - public string AspectRatioStatusText - { - get => _aspectStatusText; - set - { - _aspectStatusText = value; - - OnPropertyChanged(); - } - } - - public string VolumeStatusText - { - get => _volumeStatusText; - set - { - _volumeStatusText = value; - - OnPropertyChanged(); + OnPropertyChanged(nameof(ShowCustomVSyncIntervalPicker)); } } @@ -791,73 +443,6 @@ namespace Ryujinx.Ava.UI.ViewModels } } - public float VolumeBeforeMute - { - get => _volumeBeforeMute; - set - { - _volumeBeforeMute = value; - - OnPropertyChanged(); - } - } - - public bool ShowStatusSeparator - { - get => _showStatusSeparator; - set - { - _showStatusSeparator = value; - - OnPropertyChanged(); - } - } - - public bool ShowMenuAndStatusBar - { - get => _showMenuAndStatusBar; - set - { - _showMenuAndStatusBar = value; - - OnPropertyChanged(); - } - } - - public bool IsLoadingIndeterminate - { - get => _isLoadingIndeterminate; - set - { - _isLoadingIndeterminate = value; - - OnPropertyChanged(); - } - } - - public bool IsActive - { - get => _isActive; - set - { - _isActive = value; - - OnPropertyChanged(); - } - } - - - public bool ShowContent - { - get => _showContent; - set - { - _showContent = value; - - OnPropertyChanged(); - } - } - public bool IsAppletMenuActive { get => _isAppletMenuActive && EnableNonGameRunningControls; @@ -869,39 +454,6 @@ namespace Ryujinx.Ava.UI.ViewModels } } - public WindowState WindowState - { - get => _windowState; - internal set - { - _windowState = value; - - OnPropertyChanged(); - } - } - - public double WindowWidth - { - get => _windowWidth; - set - { - _windowWidth = value; - - OnPropertyChanged(); - } - } - - public double WindowHeight - { - get => _windowHeight; - set - { - _windowHeight = value; - - OnPropertyChanged(); - } - } - public bool IsGrid => Glyph == Glyph.Grid; public bool IsList => Glyph == Glyph.List; @@ -945,17 +497,6 @@ namespace Ryujinx.Ava.UI.ViewModels } } - public string Title - { - get => _title; - set - { - _title = value; - - OnPropertyChanged(); - } - } - public bool ShowConsoleVisible { get => ConsoleHelper.SetConsoleWindowStateSupported; @@ -966,27 +507,6 @@ namespace Ryujinx.Ava.UI.ViewModels get => FileAssociationHelper.IsTypeAssociationSupported; } - public bool AreMimeTypesRegistered - { - get => _areMimeTypesRegistered; - set { - _areMimeTypesRegistered = value; - - OnPropertyChanged(); - } - } - - public ObservableCollectionExtended Applications - { - get => _applications; - set - { - _applications = value; - - OnPropertyChanged(); - } - } - public Glyph Glyph { get => (Glyph)ConfigurationState.Instance.UI.GameListViewMode.Value; @@ -1004,7 +524,8 @@ namespace Ryujinx.Ava.UI.ViewModels public bool ShowNames { - get => ConfigurationState.Instance.UI.ShowNames && ConfigurationState.Instance.UI.GridSize > 1; set + get => ConfigurationState.Instance.UI.ShowNames && ConfigurationState.Instance.UI.GridSize > 1; + set { ConfigurationState.Instance.UI.ShowNames.Value = value; @@ -1564,8 +1085,6 @@ namespace Ryujinx.Ava.UI.ViewModels } VSyncModeText = args.VSyncMode == "Custom" ? "Custom" : "VSync"; - ShowCustomVSyncIntervalPicker = - args.VSyncMode == VSyncMode.Custom.ToString(); DockedStatusText = args.DockedMode; AspectRatioStatusText = args.AspectRatio; GameStatusText = args.GameStatus;