Compare commits

...

6 Commits

Author SHA1 Message Date
Ben. S. 0eddfd34c3 Merge bd483507f1 into a23c6bf547 2025-03-05 02:23:52 +01:00
Evan Husted a23c6bf547 misc: chore: [ci skip] fix redundant qualified name 2025-03-04 19:07:39 -06:00
Evan Husted 27cdf876a2 misc: chore: make some cleaner extensions for converting to/from ui/hle enums 2025-03-04 18:24:24 -06:00
Evan Husted b0c0e8f7ad misc: chore: Move Fs Integrity Checks getter to ConfigurationState 2025-03-04 18:23:57 -06:00
Evan Husted bd483507f1 Merge branch 'master' into master 2025-03-04 15:07:28 -06:00
Benoit S. d19324f687 sdl2 guid, remove the 2 CRC bytes when creating guid 2025-03-04 21:58:47 +01:00
12 changed files with 46 additions and 38 deletions
+5 -2
View File
@@ -50,6 +50,9 @@ namespace Ryujinx.Input.SDL2
{ {
Guid guid = SDL_JoystickGetDeviceGUID(joystickIndex); Guid guid = SDL_JoystickGetDeviceGUID(joystickIndex);
// Remove the first 4 char of the guid (CRC part) to make it stable
string guidString = "0000" + guid.ToString().Substring(4);
// Add a unique identifier to the start of the GUID in case of duplicates. // Add a unique identifier to the start of the GUID in case of duplicates.
if (guid == Guid.Empty) if (guid == Guid.Empty)
@@ -62,11 +65,11 @@ namespace Ryujinx.Input.SDL2
lock (_lock) lock (_lock)
{ {
int guidIndex = 0; int guidIndex = 0;
id = guidIndex + "-" + guid; id = guidIndex + "-" + guidString;
while (_gamepadsIds.Contains(id)) while (_gamepadsIds.Contains(id))
{ {
id = (++guidIndex) + "-" + guid; id = (++guidIndex) + "-" + guidString;
} }
} }
+1 -5
View File
@@ -216,11 +216,7 @@ namespace Ryujinx.Ava.Common
return; return;
} }
IntegrityCheckLevel checkLevel = ConfigurationState.Instance.System.EnableFsIntegrityChecks (Nca updatePatchNca, _) = mainNca.GetUpdateData(_virtualFileSystem, ConfigurationState.Instance.System.IntegrityCheckLevel, programIndex, out _);
? IntegrityCheckLevel.ErrorOnInvalid
: IntegrityCheckLevel.None;
(Nca updatePatchNca, _) = mainNca.GetUpdateData(_virtualFileSystem, checkLevel, programIndex, out _);
if (updatePatchNca is not null) if (updatePatchNca is not null)
{ {
patchNca = updatePatchNca; patchNca = updatePatchNca;
+4 -3
View File
@@ -1,6 +1,7 @@
using CommandLine; using CommandLine;
using Gommon; using Gommon;
using Ryujinx.Ava.Systems.Configuration; using Ryujinx.Ava.Systems.Configuration;
using Ryujinx.Ava.Systems.Configuration.System;
using Ryujinx.Common.Configuration; using Ryujinx.Common.Configuration;
using Ryujinx.Common.Configuration.Hid; using Ryujinx.Common.Configuration.Hid;
using Ryujinx.HLE; using Ryujinx.HLE;
@@ -37,7 +38,7 @@ namespace Ryujinx.Headless
EnableInternetAccess = configurationState.System.EnableInternetAccess; EnableInternetAccess = configurationState.System.EnableInternetAccess;
if (NeedsOverride(nameof(DisableFsIntegrityChecks))) if (NeedsOverride(nameof(DisableFsIntegrityChecks)))
DisableFsIntegrityChecks = configurationState.System.EnableFsIntegrityChecks; DisableFsIntegrityChecks = !configurationState.System.EnableFsIntegrityChecks;
if (NeedsOverride(nameof(FsGlobalAccessLogMode))) if (NeedsOverride(nameof(FsGlobalAccessLogMode)))
FsGlobalAccessLogMode = configurationState.System.FsGlobalAccessLogMode; FsGlobalAccessLogMode = configurationState.System.FsGlobalAccessLogMode;
@@ -58,10 +59,10 @@ namespace Ryujinx.Headless
DisableDockedMode = !configurationState.System.EnableDockedMode; DisableDockedMode = !configurationState.System.EnableDockedMode;
if (NeedsOverride(nameof(SystemLanguage))) if (NeedsOverride(nameof(SystemLanguage)))
SystemLanguage = (SystemLanguage)(int)configurationState.System.Language.Value; SystemLanguage = configurationState.System.Language.Value.ToHLE();
if (NeedsOverride(nameof(SystemRegion))) if (NeedsOverride(nameof(SystemRegion)))
SystemRegion = (RegionCode)(int)configurationState.System.Region.Value; SystemRegion = configurationState.System.Region.Value.ToHLE();
if (NeedsOverride(nameof(SystemTimeZone))) if (NeedsOverride(nameof(SystemTimeZone)))
SystemTimeZone = configurationState.System.TimeZone; SystemTimeZone = configurationState.System.TimeZone;
+5 -4
View File
@@ -9,6 +9,7 @@ using Ryujinx.Ava.UI.Helpers;
using Ryujinx.Ava.UI.Windows; using Ryujinx.Ava.UI.Windows;
using Ryujinx.Ava.Utilities; using Ryujinx.Ava.Utilities;
using Ryujinx.Ava.Systems.Configuration; using Ryujinx.Ava.Systems.Configuration;
using Ryujinx.Ava.Systems.Configuration.System;
using Ryujinx.Ava.Utilities.SystemInfo; using Ryujinx.Ava.Utilities.SystemInfo;
using Ryujinx.Common; using Ryujinx.Common;
using Ryujinx.Common.Configuration; using Ryujinx.Common.Configuration;
@@ -282,16 +283,16 @@ namespace Ryujinx.Ava
// Check if region was overridden. // Check if region was overridden.
if (CommandLineState.OverrideSystemRegion is not null) if (CommandLineState.OverrideSystemRegion is not null)
if (Enum.TryParse(CommandLineState.OverrideSystemRegion, true, out Ryujinx.HLE.HOS.SystemState.RegionCode result)) if (Enum.TryParse(CommandLineState.OverrideSystemRegion, true, out HLE.HOS.SystemState.RegionCode result))
{ {
ConfigurationState.Instance.System.Region.Value = (Systems.Configuration.System.Region)result; ConfigurationState.Instance.System.Region.Value = result.ToUI();
} }
//Check if language was overridden. //Check if language was overridden.
if (CommandLineState.OverrideSystemLanguage is not null) if (CommandLineState.OverrideSystemLanguage is not null)
if (Enum.TryParse(CommandLineState.OverrideSystemLanguage, true, out Ryujinx.HLE.HOS.SystemState.SystemLanguage result)) if (Enum.TryParse(CommandLineState.OverrideSystemLanguage, true, out HLE.HOS.SystemState.SystemLanguage result))
{ {
ConfigurationState.Instance.System.Language.Value = (Systems.Configuration.System.Language)result; ConfigurationState.Instance.System.Language.Value = result.ToUI();
} }
// Check if hardware-acceleration was overridden. // Check if hardware-acceleration was overridden.
@@ -618,15 +618,11 @@ namespace Ryujinx.Ava.Systems.AppLibrary
case ".xci": case ".xci":
case ".nsp": case ".nsp":
{ {
IntegrityCheckLevel checkLevel = ConfigurationState.Instance.System.EnableFsIntegrityChecks
? IntegrityCheckLevel.ErrorOnInvalid
: IntegrityCheckLevel.None;
using IFileSystem pfs = using IFileSystem pfs =
PartitionFileSystemUtils.OpenApplicationFileSystem(filePath, _virtualFileSystem); PartitionFileSystemUtils.OpenApplicationFileSystem(filePath, _virtualFileSystem);
Dictionary<ulong, ContentMetaData> updates = Dictionary<ulong, ContentMetaData> updates =
pfs.GetContentData(ContentMetaType.Patch, _virtualFileSystem, checkLevel); pfs.GetContentData(ContentMetaType.Patch, _virtualFileSystem, ConfigurationState.Instance.System.IntegrityCheckLevel);
if (updates.Count == 0) if (updates.Count == 0)
{ {
@@ -352,6 +352,10 @@ namespace Ryujinx.Ava.Systems.Configuration
/// </summary> /// </summary>
public ReactiveObject<bool> EnableFsIntegrityChecks { get; private set; } public ReactiveObject<bool> EnableFsIntegrityChecks { get; private set; }
public IntegrityCheckLevel IntegrityCheckLevel => EnableFsIntegrityChecks
? IntegrityCheckLevel.ErrorOnInvalid
: IntegrityCheckLevel.None;
/// <summary> /// <summary>
/// Enables FS access log output to the console. Possible modes are 0-3 /// Enables FS access log output to the console. Possible modes are 0-3
/// </summary> /// </summary>
@@ -843,8 +847,8 @@ namespace Ryujinx.Ava.Systems.Configuration
public HleConfiguration CreateHleConfiguration() => public HleConfiguration CreateHleConfiguration() =>
new( new(
System.DramSize, System.DramSize,
(SystemLanguage)System.Language.Value, System.Language.Value.ToHLE(),
(RegionCode)System.Region.Value, System.Region.Value.ToHLE(),
Graphics.VSyncMode, Graphics.VSyncMode,
System.EnableDockedMode, System.EnableDockedMode,
System.EnablePtc, System.EnablePtc,
@@ -17,12 +17,12 @@ namespace Ryujinx.Ava.Systems.Configuration
public static class FileTypesExtensions public static class FileTypesExtensions
{ {
/// <summary> /// <summary>
/// Gets the current <see cref="ConfigurationState.UISection.ShownFileTypeSettings"/> value for the correlating FileType name. /// Gets the current <see cref="ShownFileTypeSettings"/> value for the correlating FileType name.
/// </summary> /// </summary>
/// <param name="type">The name of the <see cref="ConfigurationState.UISection.ShownFileTypeSettings"/> parameter to get the value of.</param> /// <param name="type">The name of the <see cref="ShownFileTypeSettings"/> parameter to get the value of.</param>
/// <param name="config">The config instance to get the value from.</param> /// <param name="config">The config instance to get the value from.</param>
/// <returns>The current value of the setting. Value is <see langword="true"/> if the file type is to be shown on the games list, <see langword="false"/> otherwise.</returns> /// <returns>The current value of the setting. Value is <see langword="true"/> if the file type is to be shown on the games list, <see langword="false"/> otherwise.</returns>
public static bool GetConfigValue(this FileTypes type, ConfigurationState.UISection.ShownFileTypeSettings config) => type switch public static bool GetConfigValue(this FileTypes type, ShownFileTypeSettings config) => type switch
{ {
FileTypes.NSP => config.NSP.Value, FileTypes.NSP => config.NSP.Value,
FileTypes.PFS0 => config.PFS0.Value, FileTypes.PFS0 => config.PFS0.Value,
@@ -25,4 +25,13 @@ namespace Ryujinx.Ava.Systems.Configuration.System
TraditionalChinese, TraditionalChinese,
BrazilianPortuguese, BrazilianPortuguese,
} }
public static class LanguageEnumHelper
{
public static Language ToUI(this HLE.HOS.SystemState.SystemLanguage hleLanguage)
=> (Language)hleLanguage;
public static HLE.HOS.SystemState.SystemLanguage ToHLE(this Language uiLanguage)
=> (HLE.HOS.SystemState.SystemLanguage)uiLanguage;
}
} }
@@ -14,4 +14,13 @@ namespace Ryujinx.Ava.Systems.Configuration.System
Korea, Korea,
Taiwan, Taiwan,
} }
public static class RegionEnumHelper
{
public static Region ToUI(this HLE.HOS.SystemState.RegionCode hleRegion)
=> (Region)hleRegion;
public static HLE.HOS.SystemState.RegionCode ToHLE(this Region uiRegion)
=> (HLE.HOS.SystemState.RegionCode)uiRegion;
}
} }
+1 -4
View File
@@ -38,12 +38,9 @@ namespace Ryujinx.Ava.UI.Windows
MinHeight = 650; MinHeight = 650;
LoadedCheats = []; LoadedCheats = [];
IntegrityCheckLevel checkLevel = ConfigurationState.Instance.System.EnableFsIntegrityChecks
? IntegrityCheckLevel.ErrorOnInvalid
: IntegrityCheckLevel.None;
Heading = LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.CheatWindowHeading, titleName, titleId.ToUpper()); Heading = LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.CheatWindowHeading, titleName, titleId.ToUpper());
BuildId = ApplicationData.GetBuildId(virtualFileSystem, checkLevel, titlePath); BuildId = ApplicationData.GetBuildId(virtualFileSystem, ConfigurationState.Instance.System.IntegrityCheckLevel, titlePath);
InitializeComponent(); InitializeComponent();
+1 -5
View File
@@ -273,11 +273,7 @@ namespace Ryujinx.Ava.UI.Windows
LibHacHorizonManager.InitializeBcatServer(); LibHacHorizonManager.InitializeBcatServer();
LibHacHorizonManager.InitializeSystemClients(); LibHacHorizonManager.InitializeSystemClients();
IntegrityCheckLevel checkLevel = ConfigurationState.Instance.System.EnableFsIntegrityChecks ApplicationLibrary = new ApplicationLibrary(VirtualFileSystem, ConfigurationState.Instance.System.IntegrityCheckLevel)
? IntegrityCheckLevel.ErrorOnInvalid
: IntegrityCheckLevel.None;
ApplicationLibrary = new ApplicationLibrary(VirtualFileSystem, checkLevel)
{ {
DesiredLanguage = ConfigurationState.Instance.System.Language, DesiredLanguage = ConfigurationState.Instance.System.Language,
}; };
+1 -5
View File
@@ -81,10 +81,6 @@ namespace Ryujinx.Ava.Utilities
{ {
List<(TitleUpdateModel, bool IsSelected)> result = []; List<(TitleUpdateModel, bool IsSelected)> result = [];
IntegrityCheckLevel checkLevel = ConfigurationState.Instance.System.EnableFsIntegrityChecks
? IntegrityCheckLevel.ErrorOnInvalid
: IntegrityCheckLevel.None;
foreach (string path in titleUpdateMetadata.Paths) foreach (string path in titleUpdateMetadata.Paths)
{ {
if (!File.Exists(path)) if (!File.Exists(path))
@@ -95,7 +91,7 @@ namespace Ryujinx.Ava.Utilities
using IFileSystem pfs = PartitionFileSystemUtils.OpenApplicationFileSystem(path, vfs); using IFileSystem pfs = PartitionFileSystemUtils.OpenApplicationFileSystem(path, vfs);
Dictionary<ulong, ContentMetaData> updates = Dictionary<ulong, ContentMetaData> updates =
pfs.GetContentData(ContentMetaType.Patch, vfs, checkLevel); pfs.GetContentData(ContentMetaType.Patch, vfs, ConfigurationState.Instance.System.IntegrityCheckLevel);
if (!updates.TryGetValue(applicationIdBase, out ContentMetaData content)) if (!updates.TryGetValue(applicationIdBase, out ContentMetaData content))
continue; continue;