From 94cb992083c121eede5cdedfa6f8d6f3e3601eb1 Mon Sep 17 00:00:00 2001 From: GreemDev Date: Fri, 21 Nov 2025 03:36:10 -0600 Subject: [PATCH] firmware stage --- assets/locales.json | 150 ++++++++++++++++++ src/Ryujinx.Common/AsyncWorkQueue.cs | 6 +- .../Systems/SetupWizard/BaseSetupWizard.cs | 2 +- .../Systems/SetupWizard/SetupWizardPage.cs | 2 +- .../SetupWizard/SetupWizardPageView.axaml | 2 - src/Ryujinx/UI/Helpers/NotificationHelper.cs | 5 +- .../SetupWizard/Pages/SetupFirmwarePage.axaml | 27 ++++ .../Pages/SetupFirmwarePage.axaml.cs | 12 ++ .../Pages/SetupFirmwarePageViewModel.cs | 69 ++++++++ .../Pages/SetupKeysPageViewModel.cs | 21 ++- .../SetupWizard/RyujinxSetupWizard.Helpers.cs | 4 +- .../UI/SetupWizard/RyujinxSetupWizard.cs | 98 ++++++++---- .../UI/ViewModels/MainWindowViewModel.cs | 9 +- src/Ryujinx/UI/Windows/MainWindow.axaml.cs | 2 +- 14 files changed, 355 insertions(+), 54 deletions(-) create mode 100644 src/Ryujinx/UI/SetupWizard/Pages/SetupFirmwarePage.axaml create mode 100644 src/Ryujinx/UI/SetupWizard/Pages/SetupFirmwarePage.axaml.cs create mode 100644 src/Ryujinx/UI/SetupWizard/Pages/SetupFirmwarePageViewModel.cs diff --git a/assets/locales.json b/assets/locales.json index 3d43a92b3..8eaa7b4af 100644 --- a/assets/locales.json +++ b/assets/locales.json @@ -25041,6 +25041,156 @@ "zh_CN": "", "zh_TW": "" } + }, + { + "ID": "SetupWizardFirmwarePageTitle", + "Translations": { + "ar_SA": "", + "de_DE": "", + "el_GR": "", + "en_US": "Switch Firmware", + "es_ES": "", + "fr_FR": "", + "he_IL": "", + "it_IT": "", + "ja_JP": "", + "ko_KR": "", + "no_NO": "", + "pl_PL": "", + "pt_BR": "", + "ru_RU": "", + "sv_SE": "", + "th_TH": "", + "tr_TR": "", + "uk_UA": "", + "zh_CN": "", + "zh_TW": "" + } + }, + { + "ID": "SetupWizardFirmwarePageDescription", + "Translations": { + "ar_SA": "", + "de_DE": "", + "el_GR": "", + "en_US": "Please select the folder or .zip/.xci containing your dumped Nintendo Switch firmware:", + "es_ES": "", + "fr_FR": "", + "he_IL": "", + "it_IT": "", + "ja_JP": "", + "ko_KR": "", + "no_NO": "", + "pl_PL": "", + "pt_BR": "", + "ru_RU": "", + "sv_SE": "", + "th_TH": "", + "tr_TR": "", + "uk_UA": "", + "zh_CN": "", + "zh_TW": "" + } + }, + { + "ID": "SetupWizardFirmwarePageFolderPopupTitle", + "Translations": { + "ar_SA": "", + "de_DE": "", + "el_GR": "", + "en_US": "Please select the folder containing your dumped & extracted Switch firmware.", + "es_ES": "", + "fr_FR": "", + "he_IL": "", + "it_IT": "", + "ja_JP": "", + "ko_KR": "", + "no_NO": "", + "pl_PL": "", + "pt_BR": "", + "ru_RU": "", + "sv_SE": "", + "th_TH": "", + "tr_TR": "", + "uk_UA": "", + "zh_CN": "", + "zh_TW": "" + } + }, + { + "ID": "SetupWizardFirmwarePageFilePopupTitle", + "Translations": { + "ar_SA": "", + "de_DE": "", + "el_GR": "", + "en_US": "Please select the file containing your dumped Switch firmware.", + "es_ES": "", + "fr_FR": "", + "he_IL": "", + "it_IT": "", + "ja_JP": "", + "ko_KR": "", + "no_NO": "", + "pl_PL": "", + "pt_BR": "", + "ru_RU": "", + "sv_SE": "", + "th_TH": "", + "tr_TR": "", + "uk_UA": "", + "zh_CN": "", + "zh_TW": "" + } + }, + { + "ID": "SetupWizardFirmwarePageFileBrowse", + "Translations": { + "ar_SA": "", + "de_DE": "", + "el_GR": "", + "en_US": "Select .zip or .xci", + "es_ES": "", + "fr_FR": "", + "he_IL": "", + "it_IT": "", + "ja_JP": "", + "ko_KR": "", + "no_NO": "", + "pl_PL": "", + "pt_BR": "", + "ru_RU": "", + "sv_SE": "", + "th_TH": "", + "tr_TR": "", + "uk_UA": "", + "zh_CN": "", + "zh_TW": "" + } + }, + { + "ID": "SetupWizardFirmwarePageFolderBrowse", + "Translations": { + "ar_SA": "", + "de_DE": "", + "el_GR": "", + "en_US": "Select Extracted Folder", + "es_ES": "", + "fr_FR": "", + "he_IL": "", + "it_IT": "", + "ja_JP": "", + "ko_KR": "", + "no_NO": "", + "pl_PL": "", + "pt_BR": "", + "ru_RU": "", + "sv_SE": "", + "th_TH": "", + "tr_TR": "", + "uk_UA": "", + "zh_CN": "", + "zh_TW": "" + } } ] } diff --git a/src/Ryujinx.Common/AsyncWorkQueue.cs b/src/Ryujinx.Common/AsyncWorkQueue.cs index e3f91c891..5d101cd8a 100644 --- a/src/Ryujinx.Common/AsyncWorkQueue.cs +++ b/src/Ryujinx.Common/AsyncWorkQueue.cs @@ -91,7 +91,11 @@ namespace Ryujinx.Common public void Dispose() { - _queue.CompleteAdding(); + try + { + _queue.CompleteAdding(); + } catch (ObjectDisposedException) {} + _cts.Cancel(); _workerThread.Join(); diff --git a/src/Ryujinx/Systems/SetupWizard/BaseSetupWizard.cs b/src/Ryujinx/Systems/SetupWizard/BaseSetupWizard.cs index 90bed2383..afaf97fad 100644 --- a/src/Ryujinx/Systems/SetupWizard/BaseSetupWizard.cs +++ b/src/Ryujinx/Systems/SetupWizard/BaseSetupWizard.cs @@ -9,7 +9,7 @@ namespace Ryujinx.Ava.Systems.SetupWizard /// /// Define the logic and flow of this . /// - public abstract ValueTask Start(); + public abstract Task Start(); protected ValueTask FirstPage() { diff --git a/src/Ryujinx/Systems/SetupWizard/SetupWizardPage.cs b/src/Ryujinx/Systems/SetupWizard/SetupWizardPage.cs index 032f72830..5681ec90a 100644 --- a/src/Ryujinx/Systems/SetupWizard/SetupWizardPage.cs +++ b/src/Ryujinx/Systems/SetupWizard/SetupWizardPage.cs @@ -21,7 +21,7 @@ namespace Ryujinx.Ava.Systems.SetupWizard [ObservableProperty] public partial object? Content { get; set; } - [ObservableProperty] public partial object? HelpContent { get; set; } = "test"; + [ObservableProperty] public partial object? HelpContent { get; set; } [ObservableProperty] public partial object? ActionContent { get; set; } = LocaleManager.Instance[LocaleKeys.SetupWizardActionNext]; diff --git a/src/Ryujinx/Systems/SetupWizard/SetupWizardPageView.axaml b/src/Ryujinx/Systems/SetupWizard/SetupWizardPageView.axaml index 88d79ca46..99eb4d071 100644 --- a/src/Ryujinx/Systems/SetupWizard/SetupWizardPageView.axaml +++ b/src/Ryujinx/Systems/SetupWizard/SetupWizardPageView.axaml @@ -59,8 +59,6 @@ Content="{ext:Locale SetupWizardActionBack}" Margin="10,0,0,0" Command="{Binding MoveBackCommand}" /> - - + public static void ShowError(string message, bool waitingExit = false) => ShowError( LocaleManager.Instance[LocaleKeys.DialogErrorTitle], - $"{LocaleManager.Instance[LocaleKeys.DialogErrorMessage]}\n\n{message}" + $"{LocaleManager.Instance[LocaleKeys.DialogErrorMessage]}\n\n{message}", + waitingExit: waitingExit ); public static void ShowInformation(string title, string text, bool waitingExit = false, Action onClick = null, Action onClose = null) => diff --git a/src/Ryujinx/UI/SetupWizard/Pages/SetupFirmwarePage.axaml b/src/Ryujinx/UI/SetupWizard/Pages/SetupFirmwarePage.axaml new file mode 100644 index 000000000..95117dafe --- /dev/null +++ b/src/Ryujinx/UI/SetupWizard/Pages/SetupFirmwarePage.axaml @@ -0,0 +1,27 @@ + + + + + + +