Replace 'Expand DRAM' option with dropdown menu

This commit is contained in:
KeatonTheBot 2024-10-16 21:17:28 -05:00
parent 2d36a23252
commit e221f7dbfc
30 changed files with 174 additions and 61 deletions

View file

@ -6,6 +6,7 @@ using Ryujinx.Common.Configuration.Hid.Keyboard;
using Ryujinx.Common.Configuration.Multiplayer;
using Ryujinx.Common.Logging;
using Ryujinx.Graphics.Vulkan;
using Ryujinx.HLE;
using Ryujinx.UI.Common.Configuration.System;
using Ryujinx.UI.Common.Configuration.UI;
using Ryujinx.UI.Common.Helper;
@ -354,7 +355,7 @@ namespace Ryujinx.UI.Common.Configuration
/// <summary>
/// Defines the amount of RAM available on the emulated system, and how it is distributed
/// </summary>
public ReactiveObject<bool> ExpandRam { get; private set; }
public ReactiveObject<MemoryConfiguration> DramSize { get; private set; }
/// <summary>
/// Enable or disable ignoring missing services
@ -386,8 +387,8 @@ namespace Ryujinx.UI.Common.Configuration
AudioBackend.Event += static (sender, e) => LogValueChange(e, nameof(AudioBackend));
MemoryManagerMode = new ReactiveObject<MemoryManagerMode>();
MemoryManagerMode.Event += static (sender, e) => LogValueChange(e, nameof(MemoryManagerMode));
ExpandRam = new ReactiveObject<bool>();
ExpandRam.Event += static (sender, e) => LogValueChange(e, nameof(ExpandRam));
DramSize = new ReactiveObject<MemoryConfiguration>();
DramSize.Event += static (sender, e) => LogValueChange(e, nameof(DramSize));
IgnoreMissingServices = new ReactiveObject<bool>();
IgnoreMissingServices.Event += static (sender, e) => LogValueChange(e, nameof(IgnoreMissingServices));
AudioVolume = new ReactiveObject<float>();
@ -706,7 +707,7 @@ namespace Ryujinx.UI.Common.Configuration
AudioBackend = System.AudioBackend,
AudioVolume = System.AudioVolume,
MemoryManagerMode = System.MemoryManagerMode,
ExpandRam = System.ExpandRam,
DramSize = System.DramSize,
IgnoreMissingServices = System.IgnoreMissingServices,
UseHypervisor = System.UseHypervisor,
GuiColumns = new GuiColumns
@ -818,7 +819,7 @@ namespace Ryujinx.UI.Common.Configuration
System.AudioBackend.Value = AudioBackend.SDL2;
System.AudioVolume.Value = 1;
System.MemoryManagerMode.Value = MemoryManagerMode.HostMappedUnsafe;
System.ExpandRam.Value = false;
System.DramSize.Value = MemoryConfiguration.MemoryConfiguration4GiB;
System.IgnoreMissingServices.Value = false;
System.UseHypervisor.Value = true;
Multiplayer.LanInterfaceId.Value = "0";
@ -1477,6 +1478,15 @@ namespace Ryujinx.UI.Common.Configuration
configurationFileUpdated = true;
}
if (configurationFileFormat.Version < 52)
{
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 52.");
configurationFileFormat.DramSize = MemoryConfiguration.MemoryConfiguration4GiB;
configurationFileUpdated = true;
}
Logger.EnableFileLog.Value = configurationFileFormat.EnableFileLog;
Graphics.ResScale.Value = configurationFileFormat.ResScale;
Graphics.ResScaleCustom.Value = configurationFileFormat.ResScaleCustom;
@ -1522,7 +1532,7 @@ namespace Ryujinx.UI.Common.Configuration
System.AudioBackend.Value = configurationFileFormat.AudioBackend;
System.AudioVolume.Value = configurationFileFormat.AudioVolume;
System.MemoryManagerMode.Value = configurationFileFormat.MemoryManagerMode;
System.ExpandRam.Value = configurationFileFormat.ExpandRam;
System.DramSize.Value = configurationFileFormat.DramSize;
System.IgnoreMissingServices.Value = configurationFileFormat.IgnoreMissingServices;
System.UseHypervisor.Value = configurationFileFormat.UseHypervisor;
UI.GuiColumns.FavColumn.Value = configurationFileFormat.GuiColumns.FavColumn;