From a53cfdab78c382677eb826bd5bedb58b3b838796 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Sun, 29 Jan 2023 08:37:52 -0300 Subject: Initial Apple Hypervisor based CPU emulation (#4332) * Initial Apple Hypervisor based CPU emulation implementation * Add UseHypervisor Setting * Add basic MacOS support to Avalonia * Fix initialization * Fix GTK build * Fix/silence warnings * Change exceptions to asserts on HvAddressSpaceRange * Replace DllImport with LibraryImport * Fix LibraryImport * Remove unneeded usings * Revert outdated change * Set DiskCacheLoadState when using hypervisor too * Fix HvExecutionContext PC value * Address PR feedback * Use existing entitlements.xml file on distribution folder --------- Co-authored-by: riperiperi --- Ryujinx.Ui.Common/Configuration/ConfigurationState.cs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'Ryujinx.Ui.Common/Configuration/ConfigurationState.cs') diff --git a/Ryujinx.Ui.Common/Configuration/ConfigurationState.cs b/Ryujinx.Ui.Common/Configuration/ConfigurationState.cs index e64c69ad..f193b157 100644 --- a/Ryujinx.Ui.Common/Configuration/ConfigurationState.cs +++ b/Ryujinx.Ui.Common/Configuration/ConfigurationState.cs @@ -301,6 +301,11 @@ namespace Ryujinx.Ui.Common.Configuration /// public ReactiveObject IgnoreMissingServices { get; private set; } + /// + /// Uses Hypervisor over JIT if available + /// + public ReactiveObject UseHypervisor { get; private set; } + public SystemSection() { Language = new ReactiveObject(); @@ -327,6 +332,8 @@ namespace Ryujinx.Ui.Common.Configuration IgnoreMissingServices.Event += static (sender, e) => LogValueChange(sender, e, nameof(IgnoreMissingServices)); AudioVolume = new ReactiveObject(); AudioVolume.Event += static (sender, e) => LogValueChange(sender, e, nameof(AudioVolume)); + UseHypervisor = new ReactiveObject(); + UseHypervisor.Event += static (sender, e) => LogValueChange(sender, e, nameof(UseHypervisor)); } } @@ -566,6 +573,7 @@ namespace Ryujinx.Ui.Common.Configuration MemoryManagerMode = System.MemoryManagerMode, ExpandRam = System.ExpandRam, IgnoreMissingServices = System.IgnoreMissingServices, + UseHypervisor = System.UseHypervisor, GuiColumns = new GuiColumns { FavColumn = Ui.GuiColumns.FavColumn, @@ -652,6 +660,7 @@ namespace Ryujinx.Ui.Common.Configuration System.MemoryManagerMode.Value = MemoryManagerMode.HostMappedUnsafe; System.ExpandRam.Value = false; System.IgnoreMissingServices.Value = false; + System.UseHypervisor.Value = true; Ui.GuiColumns.FavColumn.Value = true; Ui.GuiColumns.IconColumn.Value = true; Ui.GuiColumns.AppColumn.Value = true; @@ -1192,6 +1201,13 @@ namespace Ryujinx.Ui.Common.Configuration 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; + } + Logger.EnableFileLog.Value = configurationFileFormat.EnableFileLog; Graphics.ResScale.Value = configurationFileFormat.ResScale; Graphics.ResScaleCustom.Value = configurationFileFormat.ResScaleCustom; @@ -1233,6 +1249,7 @@ namespace Ryujinx.Ui.Common.Configuration System.MemoryManagerMode.Value = configurationFileFormat.MemoryManagerMode; System.ExpandRam.Value = configurationFileFormat.ExpandRam; 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; @@ -1292,4 +1309,4 @@ namespace Ryujinx.Ui.Common.Configuration Instance = new ConfigurationState(); } } -} +} \ No newline at end of file -- cgit v1.2.3