|
|
@@ -604,61 +604,59 @@ namespace Ryujinx.Ava
|
|
|
|
|
|
SystemVersion firmwareVersion = ContentManager.GetCurrentFirmwareVersion();
|
|
|
|
|
|
- if (Application.Current.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
|
|
|
+ if (Application.Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime)
|
|
|
{
|
|
|
if (!SetupValidator.CanStartApplication(ContentManager, ApplicationPath, out UserError userError))
|
|
|
- {
|
|
|
+ {
|
|
|
+ if (SetupValidator.CanFixStartApplication(ContentManager, ApplicationPath, userError, out firmwareVersion))
|
|
|
{
|
|
|
- if (SetupValidator.CanFixStartApplication(ContentManager, ApplicationPath, userError, out firmwareVersion))
|
|
|
+ if (userError is UserError.NoFirmware)
|
|
|
{
|
|
|
- if (userError == UserError.NoFirmware)
|
|
|
- {
|
|
|
- UserResult result = await ContentDialogHelper.CreateConfirmationDialog(
|
|
|
- LocaleManager.Instance[LocaleKeys.DialogFirmwareNoFirmwareInstalledMessage],
|
|
|
- LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.DialogFirmwareInstallEmbeddedMessage, firmwareVersion.VersionString),
|
|
|
- LocaleManager.Instance[LocaleKeys.InputDialogYes],
|
|
|
- LocaleManager.Instance[LocaleKeys.InputDialogNo],
|
|
|
- "");
|
|
|
-
|
|
|
- if (result != UserResult.Yes)
|
|
|
- {
|
|
|
- await UserErrorDialog.ShowUserErrorDialog(userError);
|
|
|
- Device.Dispose();
|
|
|
-
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (!SetupValidator.TryFixStartApplication(ContentManager, ApplicationPath, userError, out _))
|
|
|
+ UserResult result = await ContentDialogHelper.CreateConfirmationDialog(
|
|
|
+ LocaleManager.Instance[LocaleKeys.DialogFirmwareNoFirmwareInstalledMessage],
|
|
|
+ LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.DialogFirmwareInstallEmbeddedMessage, firmwareVersion.VersionString),
|
|
|
+ LocaleManager.Instance[LocaleKeys.InputDialogYes],
|
|
|
+ LocaleManager.Instance[LocaleKeys.InputDialogNo],
|
|
|
+ string.Empty);
|
|
|
+
|
|
|
+ if (result != UserResult.Yes)
|
|
|
{
|
|
|
await UserErrorDialog.ShowUserErrorDialog(userError);
|
|
|
Device.Dispose();
|
|
|
|
|
|
return false;
|
|
|
}
|
|
|
-
|
|
|
- // Tell the user that we installed a firmware for them.
|
|
|
- if (userError == UserError.NoFirmware)
|
|
|
- {
|
|
|
- firmwareVersion = ContentManager.GetCurrentFirmwareVersion();
|
|
|
-
|
|
|
- _viewModel.RefreshFirmwareStatus();
|
|
|
-
|
|
|
- await ContentDialogHelper.CreateInfoDialog(
|
|
|
- LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.DialogFirmwareInstalledMessage, firmwareVersion.VersionString),
|
|
|
- LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.DialogFirmwareInstallEmbeddedSuccessMessage, firmwareVersion.VersionString),
|
|
|
- LocaleManager.Instance[LocaleKeys.InputDialogOk],
|
|
|
- "",
|
|
|
- LocaleManager.Instance[LocaleKeys.RyujinxInfo]);
|
|
|
- }
|
|
|
}
|
|
|
- else
|
|
|
+
|
|
|
+ if (!SetupValidator.TryFixStartApplication(ContentManager, ApplicationPath, userError, out _))
|
|
|
{
|
|
|
await UserErrorDialog.ShowUserErrorDialog(userError);
|
|
|
Device.Dispose();
|
|
|
|
|
|
return false;
|
|
|
}
|
|
|
+
|
|
|
+ // Tell the user that we installed a firmware for them.
|
|
|
+ if (userError is UserError.NoFirmware)
|
|
|
+ {
|
|
|
+ firmwareVersion = ContentManager.GetCurrentFirmwareVersion();
|
|
|
+
|
|
|
+ _viewModel.RefreshFirmwareStatus();
|
|
|
+
|
|
|
+ await ContentDialogHelper.CreateInfoDialog(
|
|
|
+ LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.DialogFirmwareInstalledMessage, firmwareVersion.VersionString),
|
|
|
+ LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.DialogFirmwareInstallEmbeddedSuccessMessage, firmwareVersion.VersionString),
|
|
|
+ LocaleManager.Instance[LocaleKeys.InputDialogOk],
|
|
|
+ string.Empty,
|
|
|
+ LocaleManager.Instance[LocaleKeys.RyujinxInfo]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ await UserErrorDialog.ShowUserErrorDialog(userError);
|
|
|
+ Device.Dispose();
|
|
|
+
|
|
|
+ return false;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -820,20 +818,12 @@ namespace Ryujinx.Ava
|
|
|
VirtualFileSystem.ReloadKeySet();
|
|
|
|
|
|
// Initialize Renderer.
|
|
|
- IRenderer renderer;
|
|
|
-
|
|
|
- if (ConfigurationState.Instance.Graphics.GraphicsBackend.Value == GraphicsBackend.Vulkan)
|
|
|
- {
|
|
|
- renderer = new VulkanRenderer(
|
|
|
- Vk.GetApi(),
|
|
|
+ IRenderer renderer = ConfigurationState.Instance.Graphics.GraphicsBackend.Value == GraphicsBackend.OpenGl
|
|
|
+ ? new OpenGLRenderer()
|
|
|
+ : VulkanRenderer.Create(
|
|
|
+ ConfigurationState.Instance.Graphics.PreferredGpu,
|
|
|
(RendererHost.EmbeddedWindow as EmbeddedWindowVulkan)!.CreateSurface,
|
|
|
- VulkanHelper.GetRequiredInstanceExtensions,
|
|
|
- ConfigurationState.Instance.Graphics.PreferredGpu.Value);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- renderer = new OpenGLRenderer();
|
|
|
- }
|
|
|
+ VulkanHelper.GetRequiredInstanceExtensions);
|
|
|
|
|
|
BackendThreading threadingMode = ConfigurationState.Instance.Graphics.BackendThreading;
|
|
|
|