From 16b4a23340f3c2563d5062e2f2e03301b5568f6e Mon Sep 17 00:00:00 2001
From: MrKev312 <34964788+MrKev312@users.noreply.github.com>
Date: Fri, 1 Aug 2025 22:20:19 +0200
Subject: [PATCH 01/12] Remove extra blank lines
---
src/Ryujinx.Common/Configuration/AspectRatioExtensions.cs | 2 --
src/Ryujinx.Common/Configuration/DirtyHack.cs | 2 --
src/Ryujinx.Common/ReleaseInformation.cs | 1 -
src/Ryujinx.Common/Utilities/Rainbow.cs | 1 -
src/Ryujinx.Cpu/TickSource.cs | 1 -
src/Ryujinx.Graphics.Gpu/GpuContext.cs | 1 -
.../HOS/Services/Nfc/AmiiboDecryption/AmiiboBinReader.cs | 1 -
src/Ryujinx.HLE/StructHelpers.cs | 1 -
src/Ryujinx.HLE/UI/IHostUIHandler.cs | 1 -
src/Ryujinx/Program.cs | 3 ---
src/Ryujinx/Systems/AppLibrary/ApplicationData.cs | 1 -
src/Ryujinx/Systems/AppLibrary/LdnGameDataReceivedEventArgs.cs | 1 -
.../Systems/Configuration/ConfigurationState.Migration.cs | 1 -
src/Ryujinx/Systems/Configuration/ConfigurationState.Model.cs | 1 -
src/Ryujinx/Systems/Updater/Updater.GitLab.cs | 3 +--
src/Ryujinx/UI/Renderer/RendererHost.cs | 1 -
src/Ryujinx/UI/ViewModels/CompatibilityViewModel.cs | 2 --
src/Ryujinx/UI/ViewModels/Input/InputViewModel.cs | 2 --
src/Ryujinx/UI/ViewModels/SettingsViewModel.cs | 2 --
19 files changed, 1 insertion(+), 27 deletions(-)
diff --git a/src/Ryujinx.Common/Configuration/AspectRatioExtensions.cs b/src/Ryujinx.Common/Configuration/AspectRatioExtensions.cs
index f3a9e1646..bae6e35de 100644
--- a/src/Ryujinx.Common/Configuration/AspectRatioExtensions.cs
+++ b/src/Ryujinx.Common/Configuration/AspectRatioExtensions.cs
@@ -36,8 +36,6 @@ namespace Ryujinx.Common.Configuration
};
}
-
-
public static float ToFloatY(this AspectRatio aspectRatio)
{
return aspectRatio switch
diff --git a/src/Ryujinx.Common/Configuration/DirtyHack.cs b/src/Ryujinx.Common/Configuration/DirtyHack.cs
index ae3416a27..d0565c88a 100644
--- a/src/Ryujinx.Common/Configuration/DirtyHack.cs
+++ b/src/Ryujinx.Common/Configuration/DirtyHack.cs
@@ -18,8 +18,6 @@ namespace Ryujinx.Common.Configuration
public DirtyHack Hack => hack;
public int Value => value;
-
-
public ulong Pack() => Raw.PackBitFields(PackedFormat);
public static EnabledDirtyHack Unpack(ulong packedHack)
diff --git a/src/Ryujinx.Common/ReleaseInformation.cs b/src/Ryujinx.Common/ReleaseInformation.cs
index a5beb1009..c9cc87a21 100644
--- a/src/Ryujinx.Common/ReleaseInformation.cs
+++ b/src/Ryujinx.Common/ReleaseInformation.cs
@@ -38,5 +38,4 @@ namespace Ryujinx.Common
: $"https://git.ryujinx.app/ryubing/ryujinx/-/releases/{newVersion}";
}
-
}
diff --git a/src/Ryujinx.Common/Utilities/Rainbow.cs b/src/Ryujinx.Common/Utilities/Rainbow.cs
index 93129bf10..57177c76d 100644
--- a/src/Ryujinx.Common/Utilities/Rainbow.cs
+++ b/src/Ryujinx.Common/Utilities/Rainbow.cs
@@ -32,7 +32,6 @@ namespace Ryujinx.Common.Utilities
CyclingEnabled = false;
}
-
public static float Speed { get; set; } = 1;
private static readonly Lock _lock = new();
diff --git a/src/Ryujinx.Cpu/TickSource.cs b/src/Ryujinx.Cpu/TickSource.cs
index 3aa616a8d..c50fedf61 100644
--- a/src/Ryujinx.Cpu/TickSource.cs
+++ b/src/Ryujinx.Cpu/TickSource.cs
@@ -15,7 +15,6 @@ namespace Ryujinx.Cpu
///
public ulong Counter => (ulong)(ElapsedSeconds * Frequency);
-
public long TickScalar { get; set; }
private static long _acumElapsedTicks;
diff --git a/src/Ryujinx.Graphics.Gpu/GpuContext.cs b/src/Ryujinx.Graphics.Gpu/GpuContext.cs
index d0b8277da..979ae226a 100644
--- a/src/Ryujinx.Graphics.Gpu/GpuContext.cs
+++ b/src/Ryujinx.Graphics.Gpu/GpuContext.cs
@@ -98,7 +98,6 @@ namespace Ryujinx.Graphics.Gpu
///
internal DirtyHacks DirtyHacks { get; }
-
///
/// Host hardware capabilities.
///
diff --git a/src/Ryujinx.HLE/HOS/Services/Nfc/AmiiboDecryption/AmiiboBinReader.cs b/src/Ryujinx.HLE/HOS/Services/Nfc/AmiiboDecryption/AmiiboBinReader.cs
index 0e11493d5..06e283f6b 100644
--- a/src/Ryujinx.HLE/HOS/Services/Nfc/AmiiboDecryption/AmiiboBinReader.cs
+++ b/src/Ryujinx.HLE/HOS/Services/Nfc/AmiiboDecryption/AmiiboBinReader.cs
@@ -339,7 +339,6 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption
public static bool HasAmiiboKeyFile => File.Exists(GetKeyRetailBinPath());
-
public static DateTime DateTimeFromTag(ushort dateTimeTag)
{
try
diff --git a/src/Ryujinx.HLE/StructHelpers.cs b/src/Ryujinx.HLE/StructHelpers.cs
index dc9c6d727..ee299896d 100644
--- a/src/Ryujinx.HLE/StructHelpers.cs
+++ b/src/Ryujinx.HLE/StructHelpers.cs
@@ -17,7 +17,6 @@ namespace Ryujinx.HLE
const int SizeOfApplicationTitle = 0x300;
const int OffsetOfApplicationPublisherStrings = 0x200;
-
BlitStruct nacpData = new(1);
// name and publisher buffer
diff --git a/src/Ryujinx.HLE/UI/IHostUIHandler.cs b/src/Ryujinx.HLE/UI/IHostUIHandler.cs
index b5c5cb168..68140dd54 100644
--- a/src/Ryujinx.HLE/UI/IHostUIHandler.cs
+++ b/src/Ryujinx.HLE/UI/IHostUIHandler.cs
@@ -63,7 +63,6 @@ namespace Ryujinx.HLE.UI
///
IHostUITheme HostUITheme { get; }
-
///
/// Displays the player select dialog and returns the selected profile.
///
diff --git a/src/Ryujinx/Program.cs b/src/Ryujinx/Program.cs
index 09759d7cc..47e1d2564 100644
--- a/src/Ryujinx/Program.cs
+++ b/src/Ryujinx/Program.cs
@@ -119,7 +119,6 @@ namespace Ryujinx.Ava
=> ProcessUnhandledException(sender, e.Exception, false);
AppDomain.CurrentDomain.ProcessExit += (_, _) => Exit();
-
// Setup base data directory.
AppDataManager.Initialize(CommandLineState.BaseDirPathArg);
@@ -160,7 +159,6 @@ namespace Ryujinx.Ava
}
}
-
public static string GetDirGameUserConfig(string gameId, bool changeFolderForGame = false)
{
if (string.IsNullOrEmpty(gameId))
@@ -342,7 +340,6 @@ namespace Ryujinx.Ava
log.PrintMsg(LogClass.Application, message);
}
-
if (isTerminating)
Exit();
}
diff --git a/src/Ryujinx/Systems/AppLibrary/ApplicationData.cs b/src/Ryujinx/Systems/AppLibrary/ApplicationData.cs
index 5656d6e73..0b4909783 100644
--- a/src/Ryujinx/Systems/AppLibrary/ApplicationData.cs
+++ b/src/Ryujinx/Systems/AppLibrary/ApplicationData.cs
@@ -98,7 +98,6 @@ namespace Ryujinx.Ava.Systems.AppLibrary
}]
).OrElse(string.Empty);
-
[JsonIgnore] public string IdString => Id.ToString("x16");
[JsonIgnore] public ulong IdBase => Id & ~0x1FFFUL;
diff --git a/src/Ryujinx/Systems/AppLibrary/LdnGameDataReceivedEventArgs.cs b/src/Ryujinx/Systems/AppLibrary/LdnGameDataReceivedEventArgs.cs
index 8b207c6bd..38d42b5d4 100644
--- a/src/Ryujinx/Systems/AppLibrary/LdnGameDataReceivedEventArgs.cs
+++ b/src/Ryujinx/Systems/AppLibrary/LdnGameDataReceivedEventArgs.cs
@@ -11,7 +11,6 @@ namespace Ryujinx.Ava.Systems.AppLibrary
LdnData = ldnData ?? [];
}
-
public LdnGameData[] LdnData { get; set; }
}
}
diff --git a/src/Ryujinx/Systems/Configuration/ConfigurationState.Migration.cs b/src/Ryujinx/Systems/Configuration/ConfigurationState.Migration.cs
index afabdb4e3..6374ec85a 100644
--- a/src/Ryujinx/Systems/Configuration/ConfigurationState.Migration.cs
+++ b/src/Ryujinx/Systems/Configuration/ConfigurationState.Migration.cs
@@ -44,7 +44,6 @@ namespace Ryujinx.Ava.Systems.Configuration
configurationFileUpdated = true;
}
-
EnableDiscordIntegration.Value = cff.EnableDiscordIntegration;
UpdateCheckerType.Value = shouldLoadFromFile ? cff.UpdateCheckerType : UpdateCheckerType.Value; // Get from global config only
FocusLostActionType.Value = cff.FocusLostActionType;
diff --git a/src/Ryujinx/Systems/Configuration/ConfigurationState.Model.cs b/src/Ryujinx/Systems/Configuration/ConfigurationState.Model.cs
index 29a390b26..8a7bc81a1 100644
--- a/src/Ryujinx/Systems/Configuration/ConfigurationState.Model.cs
+++ b/src/Ryujinx/Systems/Configuration/ConfigurationState.Model.cs
@@ -326,7 +326,6 @@ namespace Ryujinx.Ava.Systems.Configuration
///
public ReactiveObject MatchSystemTime { get; private set; }
-
///
/// Enable or disable use global input config (Independent from controllers binding)
///
diff --git a/src/Ryujinx/Systems/Updater/Updater.GitLab.cs b/src/Ryujinx/Systems/Updater/Updater.GitLab.cs
index 3411daa5d..787c3c4b3 100644
--- a/src/Ryujinx/Systems/Updater/Updater.GitLab.cs
+++ b/src/Ryujinx/Systems/Updater/Updater.GitLab.cs
@@ -1,4 +1,4 @@
-using Gommon;
+using Gommon;
using Ryujinx.Ava.Common.Locale;
using Ryujinx.Ava.UI.Helpers;
using Ryujinx.Common;
@@ -86,7 +86,6 @@ namespace Ryujinx.Ava.Systems
return default;
}
-
if (!Version.TryParse(_versionResponse.Version, out Version newVersion))
{
Logger.Error?.Print(LogClass.Application,
diff --git a/src/Ryujinx/UI/Renderer/RendererHost.cs b/src/Ryujinx/UI/Renderer/RendererHost.cs
index 9d24fbbad..7df02629e 100644
--- a/src/Ryujinx/UI/Renderer/RendererHost.cs
+++ b/src/Ryujinx/UI/Renderer/RendererHost.cs
@@ -37,7 +37,6 @@ namespace Ryujinx.Ava.UI.Renderer
_ => throw new NotImplementedException()
};
-
private void Initialize()
{
EmbeddedWindow.WindowCreated += CurrentWindow_WindowCreated;
diff --git a/src/Ryujinx/UI/ViewModels/CompatibilityViewModel.cs b/src/Ryujinx/UI/ViewModels/CompatibilityViewModel.cs
index 8a5ae441b..93e6ab5d4 100644
--- a/src/Ryujinx/UI/ViewModels/CompatibilityViewModel.cs
+++ b/src/Ryujinx/UI/ViewModels/CompatibilityViewModel.cs
@@ -30,7 +30,6 @@ namespace Ryujinx.Ava.UI.ViewModels
public string BootsInfoText { get; set; }
public string NothingInfoText { get; set; }
-
private IEnumerable _currentEntries = CompatibilityDatabase.Entries;
private string[] _ownedGameTitleIds = [];
@@ -87,7 +86,6 @@ namespace Ryujinx.Ava.UI.ViewModels
}
}
-
public void NameSorting(int nameSort = 0)
{
_sorting.Name = nameSort;
diff --git a/src/Ryujinx/UI/ViewModels/Input/InputViewModel.cs b/src/Ryujinx/UI/ViewModels/Input/InputViewModel.cs
index 81aae6b74..66a2e1349 100644
--- a/src/Ryujinx/UI/ViewModels/Input/InputViewModel.cs
+++ b/src/Ryujinx/UI/ViewModels/Input/InputViewModel.cs
@@ -327,8 +327,6 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
PlayerIndexes.Add(new(PlayerIndex.Handheld, LocaleManager.Instance[LocaleKeys.ControllerSettingsHandheld]));
}
-
-
private void LoadConfiguration(InputConfig inputConfig = null)
{
if (UseGlobalConfig && Program.UseExtraConfig)
diff --git a/src/Ryujinx/UI/ViewModels/SettingsViewModel.cs b/src/Ryujinx/UI/ViewModels/SettingsViewModel.cs
index 654eb0c43..b851ae085 100644
--- a/src/Ryujinx/UI/ViewModels/SettingsViewModel.cs
+++ b/src/Ryujinx/UI/ViewModels/SettingsViewModel.cs
@@ -86,7 +86,6 @@ namespace Ryujinx.Ava.UI.ViewModels
public bool IsGameTitleNotNull => !string.IsNullOrEmpty(GameTitle);
public double PanelOpacity => IsGameTitleNotNull ? 0.5 : 1;
-
public int ResolutionScale
{
get => _resolutionScale;
@@ -226,7 +225,6 @@ namespace Ryujinx.Ava.UI.ViewModels
public bool EnablePptc { get; set; }
public bool EnableLowPowerPptc { get; set; }
-
public long TurboMultiplier
{
get => _turboModeMultiplier;
From f5f89609f40971d0c3cd0abe0e687089563287be Mon Sep 17 00:00:00 2001
From: MrKev312 <34964788+MrKev312@users.noreply.github.com>
Date: Fri, 1 Aug 2025 22:21:39 +0200
Subject: [PATCH 02/12] Remove more extra lines
---
src/Ryujinx.Common/ReleaseInformation.cs | 1 -
src/Ryujinx/UI/ViewModels/CompatibilityViewModel.cs | 1 -
src/Ryujinx/UI/Windows/CompatibilityListWindow.axaml.cs | 1 -
3 files changed, 3 deletions(-)
diff --git a/src/Ryujinx.Common/ReleaseInformation.cs b/src/Ryujinx.Common/ReleaseInformation.cs
index c9cc87a21..a0c494c67 100644
--- a/src/Ryujinx.Common/ReleaseInformation.cs
+++ b/src/Ryujinx.Common/ReleaseInformation.cs
@@ -37,5 +37,4 @@ namespace Ryujinx.Common
? $"https://git.ryujinx.app/ryubing/ryujinx/-/compare/Canary-{currentVersion}...Canary-{newVersion}"
: $"https://git.ryujinx.app/ryubing/ryujinx/-/releases/{newVersion}";
}
-
}
diff --git a/src/Ryujinx/UI/ViewModels/CompatibilityViewModel.cs b/src/Ryujinx/UI/ViewModels/CompatibilityViewModel.cs
index 93e6ab5d4..24834ec5c 100644
--- a/src/Ryujinx/UI/ViewModels/CompatibilityViewModel.cs
+++ b/src/Ryujinx/UI/ViewModels/CompatibilityViewModel.cs
@@ -160,6 +160,5 @@ namespace Ryujinx.Ava.UI.ViewModels
};
}
}
-
}
}
diff --git a/src/Ryujinx/UI/Windows/CompatibilityListWindow.axaml.cs b/src/Ryujinx/UI/Windows/CompatibilityListWindow.axaml.cs
index 283efd083..3241b0eec 100644
--- a/src/Ryujinx/UI/Windows/CompatibilityListWindow.axaml.cs
+++ b/src/Ryujinx/UI/Windows/CompatibilityListWindow.axaml.cs
@@ -65,6 +65,5 @@ namespace Ryujinx.Ava.UI.Windows
cvm.StatusSorting(int.Parse(sortStrategy));
}
}
-
}
}
From 17f7ca8bdc7f9321128c56ab24838028c7478e9c Mon Sep 17 00:00:00 2001
From: MrKev312 <34964788+MrKev312@users.noreply.github.com>
Date: Fri, 1 Aug 2025 22:44:44 +0200
Subject: [PATCH 03/12] Refactor syscall method generation for static methods
Introduce `isStaticMethod` dictionary to track static methods. Update `GenerateMethod32` and `GenerateMethod64` to adjust method signatures and invocations based on static status. Modify `GenerateDispatch` to call methods correctly depending on their static nature. Add `Is32BitInteger` helper method for type checking.
---
.../SyscallGenerator.cs | 53 ++++++++++++++-----
1 file changed, 39 insertions(+), 14 deletions(-)
diff --git a/src/Ryujinx.Horizon.Kernel.Generators/SyscallGenerator.cs b/src/Ryujinx.Horizon.Kernel.Generators/SyscallGenerator.cs
index 2a09001db..9673784bd 100644
--- a/src/Ryujinx.Horizon.Kernel.Generators/SyscallGenerator.cs
+++ b/src/Ryujinx.Horizon.Kernel.Generators/SyscallGenerator.cs
@@ -146,11 +146,15 @@ namespace Ryujinx.Horizon.Kernel.Generators
generator.AppendLine();
List syscalls = [];
+ Dictionary isStaticMethod = new();
foreach (MethodDeclarationSyntax method in syntaxReceiver.SvcImplementations)
{
- GenerateMethod32(generator, context.Compilation, method);
- GenerateMethod64(generator, context.Compilation, method);
+ bool isStatic = method.Modifiers.Any(SyntaxKind.StaticKeyword);
+ isStaticMethod[method.Identifier.Text] = isStatic;
+
+ GenerateMethod32(generator, context.Compilation, method, isStatic);
+ GenerateMethod64(generator, context.Compilation, method, isStatic);
foreach (AttributeSyntax attribute in method.AttributeLists.SelectMany(attributeList =>
attributeList.Attributes.Where(attribute =>
@@ -166,9 +170,9 @@ namespace Ryujinx.Horizon.Kernel.Generators
syscalls.Sort();
- GenerateDispatch(generator, syscalls, A32Suffix);
+ GenerateDispatch(generator, syscalls, A32Suffix, isStaticMethod);
generator.AppendLine();
- GenerateDispatch(generator, syscalls, A64Suffix);
+ GenerateDispatch(generator, syscalls, A64Suffix, isStaticMethod);
generator.LeaveScope();
generator.LeaveScope();
@@ -193,9 +197,13 @@ namespace Ryujinx.Horizon.Kernel.Generators
generator.LeaveScope();
}
- private static void GenerateMethod32(CodeGenerator generator, Compilation compilation, MethodDeclarationSyntax method)
+ private static void GenerateMethod32(CodeGenerator generator, Compilation compilation, MethodDeclarationSyntax method, bool isStatic)
{
- generator.EnterScope($"private static void {method.Identifier.Text}{A32Suffix}(Syscall syscall, {TypeExecutionContext} context)");
+ string methodParams = isStatic
+ ? $"{TypeExecutionContext} context"
+ : $"Syscall syscall, {TypeExecutionContext} context";
+
+ generator.EnterScope($"private static void {method.Identifier.Text}{A32Suffix}({methodParams})");
string[] args = new string[method.ParameterList.Parameters.Count];
int index = 0;
@@ -266,9 +274,12 @@ namespace Ryujinx.Horizon.Kernel.Generators
string result = null;
string canonicalReturnTypeName = null;
+ string callPrefix = isStatic
+ ? $"{(method.Parent is ClassDeclarationSyntax cls ? cls.Identifier.Text + "." : "")}{method.Identifier.Text}"
+ : $"syscall.{method.Identifier.Text}";
if (method.ReturnType.ToString() != "void")
{
- generator.AppendLine($"var {ResultVariableName} = syscall.{method.Identifier.Text}({argsList});");
+ generator.AppendLine($"var {ResultVariableName} = {callPrefix}({argsList});");
canonicalReturnTypeName = GetCanonicalTypeName(compilation, method.ReturnType);
if (canonicalReturnTypeName == TypeResult)
@@ -289,7 +300,7 @@ namespace Ryujinx.Horizon.Kernel.Generators
}
else
{
- generator.AppendLine($"syscall.{method.Identifier.Text}({argsList});");
+ generator.AppendLine($"{callPrefix}({argsList});");
}
foreach (OutParameter outParameter in outParameters)
@@ -313,9 +324,12 @@ namespace Ryujinx.Horizon.Kernel.Generators
generator.AppendLine();
}
- private static void GenerateMethod64(CodeGenerator generator, Compilation compilation, MethodDeclarationSyntax method)
+ private static void GenerateMethod64(CodeGenerator generator, Compilation compilation, MethodDeclarationSyntax method, bool isStatic)
{
- generator.EnterScope($"private static void {method.Identifier.Text}{A64Suffix}(Syscall syscall, {TypeExecutionContext} context)");
+ string methodParams = isStatic
+ ? $"{TypeExecutionContext} context"
+ : $"Syscall syscall, {TypeExecutionContext} context";
+ generator.EnterScope($"private static void {method.Identifier.Text}{A64Suffix}({methodParams})");
string[] args = new string[method.ParameterList.Parameters.Count];
int registerIndex = 0;
@@ -356,9 +370,12 @@ namespace Ryujinx.Horizon.Kernel.Generators
string result = null;
string canonicalReturnTypeName = null;
+ string callPrefix = isStatic
+ ? $"{(method.Parent is ClassDeclarationSyntax cls ? cls.Identifier.Text + "." : "")}{method.Identifier.Text}"
+ : $"syscall.{method.Identifier.Text}";
if (method.ReturnType.ToString() != "void")
{
- generator.AppendLine($"var {ResultVariableName} = syscall.{method.Identifier.Text}({argsList});");
+ generator.AppendLine($"var {ResultVariableName} = {callPrefix}({argsList});");
canonicalReturnTypeName = GetCanonicalTypeName(compilation, method.ReturnType);
if (canonicalReturnTypeName == TypeResult)
@@ -374,7 +391,7 @@ namespace Ryujinx.Horizon.Kernel.Generators
}
else
{
- generator.AppendLine($"syscall.{method.Identifier.Text}({argsList});");
+ generator.AppendLine($"{callPrefix}({argsList});");
}
foreach (OutParameter outParameter in outParameters)
@@ -463,7 +480,7 @@ namespace Ryujinx.Horizon.Kernel.Generators
generator.AppendLine($"Logger.{logLevel}?.PrintMsg(LogClass.{logClass}, $\"{log}\");");
}
- private static void GenerateDispatch(CodeGenerator generator, List syscalls, string suffix)
+ private static void GenerateDispatch(CodeGenerator generator, List syscalls, string suffix, Dictionary isStaticMethod)
{
generator.EnterScope($"public static void Dispatch{suffix}(Syscall syscall, {TypeExecutionContext} context, int id)");
generator.EnterScope("switch (id)");
@@ -473,7 +490,14 @@ namespace Ryujinx.Horizon.Kernel.Generators
generator.AppendLine($"case {syscall.Id}:");
generator.IncreaseIndentation();
- generator.AppendLine($"{syscall.Name}{suffix}(syscall, context);");
+ if (isStaticMethod.TryGetValue(syscall.Name, out bool isStatic) && isStatic)
+ {
+ generator.AppendLine($"{syscall.Name}{suffix}(context);");
+ }
+ else
+ {
+ generator.AppendLine($"{syscall.Name}{suffix}(syscall, context);");
+ }
generator.AppendLine("break;");
generator.DecreaseIndentation();
@@ -490,6 +514,7 @@ namespace Ryujinx.Horizon.Kernel.Generators
generator.LeaveScope();
}
+
private static bool Is32BitInteger(string canonicalTypeName)
{
return canonicalTypeName is TypeSystemInt32 or TypeSystemUInt32;
From d081aa8a743fe61690c7c77dda4c6f6268ae47fd Mon Sep 17 00:00:00 2001
From: MrKev312 <34964788+MrKev312@users.noreply.github.com>
Date: Fri, 1 Aug 2025 22:46:36 +0200
Subject: [PATCH 04/12] Fix blank lines
---
src/Ryujinx.Horizon.Kernel.Generators/SyscallGenerator.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Ryujinx.Horizon.Kernel.Generators/SyscallGenerator.cs b/src/Ryujinx.Horizon.Kernel.Generators/SyscallGenerator.cs
index 9673784bd..c2cfec255 100644
--- a/src/Ryujinx.Horizon.Kernel.Generators/SyscallGenerator.cs
+++ b/src/Ryujinx.Horizon.Kernel.Generators/SyscallGenerator.cs
@@ -498,6 +498,7 @@ namespace Ryujinx.Horizon.Kernel.Generators
{
generator.AppendLine($"{syscall.Name}{suffix}(syscall, context);");
}
+
generator.AppendLine("break;");
generator.DecreaseIndentation();
@@ -514,7 +515,6 @@ namespace Ryujinx.Horizon.Kernel.Generators
generator.LeaveScope();
}
-
private static bool Is32BitInteger(string canonicalTypeName)
{
return canonicalTypeName is TypeSystemInt32 or TypeSystemUInt32;
From 416ddba2097a648cc2140526d7ff2b8c9dc62d9a Mon Sep 17 00:00:00 2001
From: MrKev312 <34964788+MrKev312@users.noreply.github.com>
Date: Fri, 1 Aug 2025 22:47:20 +0200
Subject: [PATCH 05/12] Added pragmas to hide wrong suggestions
Ideally this code would be refactored such that this is not needed
---
src/Ryujinx.Graphics.Vulkan/PipelineBase.cs | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs b/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs
index eac47e60e..27ea9451c 100644
--- a/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs
+++ b/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs
@@ -701,7 +701,9 @@ namespace Ryujinx.Graphics.Vulkan
_vertexBufferUpdater.Commit(Cbs);
}
+#pragma warning disable CA1822 // Mark members as static
public void SetAlphaTest(bool enable, float reference, CompareOp op)
+#pragma warning restore CA1822 // Mark members as static
{
// This is currently handled using shader specialization, as Vulkan does not support alpha test.
// In the future, we may want to use this to write the reference value into the support buffer,
@@ -900,12 +902,16 @@ namespace Ryujinx.Graphics.Vulkan
// TODO: Default levels (likely needs emulation on shaders?)
}
+#pragma warning disable CA1822 // Mark members as static
public void SetPointParameters(float size, bool isProgramPointSize, bool enablePointSprite, Origin origin)
+#pragma warning restore CA1822 // Mark members as static
{
// TODO.
}
+#pragma warning disable CA1822 // Mark members as static
public void SetPolygonMode(PolygonMode frontMode, PolygonMode backMode)
+#pragma warning restore CA1822 // Mark members as static
{
// TODO.
}
@@ -1153,7 +1159,9 @@ namespace Ryujinx.Graphics.Vulkan
_descriptorSetUpdater.SetUniformBuffers(CommandBuffer, buffers);
}
+#pragma warning restore CA1822 // Mark members as static
public void SetUserClipDistance(int index, bool enableClip)
+#pragma warning restore CA1822 // Mark members as static
{
// TODO.
}
From e0e66ad231445c09741efc3ba891613ac74f7088 Mon Sep 17 00:00:00 2001
From: MrKev312 <34964788+MrKev312@users.noreply.github.com>
Date: Fri, 1 Aug 2025 22:48:42 +0200
Subject: [PATCH 06/12] Fix broken pragma
---
src/Ryujinx.Graphics.Vulkan/PipelineBase.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs b/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs
index 27ea9451c..b8693de42 100644
--- a/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs
+++ b/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs
@@ -1159,7 +1159,7 @@ namespace Ryujinx.Graphics.Vulkan
_descriptorSetUpdater.SetUniformBuffers(CommandBuffer, buffers);
}
-#pragma warning restore CA1822 // Mark members as static
+#pragma warning disable CA1822 // Mark members as static
public void SetUserClipDistance(int index, bool enableClip)
#pragma warning restore CA1822 // Mark members as static
{
From 056e1566ee6a3618ec0e13d83c313b2e818f6ee5 Mon Sep 17 00:00:00 2001
From: MrKev312 <34964788+MrKev312@users.noreply.github.com>
Date: Fri, 1 Aug 2025 22:49:02 +0200
Subject: [PATCH 07/12] Fix blank line
---
src/Ryujinx/UI/Applet/AvaloniaHostUITheme.cs | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/Ryujinx/UI/Applet/AvaloniaHostUITheme.cs b/src/Ryujinx/UI/Applet/AvaloniaHostUITheme.cs
index 3ab2fdc70..7ef8c0865 100644
--- a/src/Ryujinx/UI/Applet/AvaloniaHostUITheme.cs
+++ b/src/Ryujinx/UI/Applet/AvaloniaHostUITheme.cs
@@ -100,6 +100,7 @@ namespace Ryujinx.Ava.UI.Applet
(float)solidColor.Color.B / 255
);
}
+
return new ThemeColor();
}
}
From f87ae39a8b2a25a3a9453b881b45393db4576d48 Mon Sep 17 00:00:00 2001
From: MrKev312 <34964788+MrKev312@users.noreply.github.com>
Date: Fri, 1 Aug 2025 22:49:19 +0200
Subject: [PATCH 08/12] Make methods that can be static, static
---
.../HOS/Kernel/SupervisorCall/Syscall.cs | 88 +++++++++----------
.../HOS/Services/Fatal/IService.cs | 2 +-
.../Sdk/Audio/Detail/AudioDevice.cs | 12 +--
3 files changed, 51 insertions(+), 51 deletions(-)
diff --git a/src/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall.cs b/src/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall.cs
index c67220617..76a8ed78c 100644
--- a/src/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall.cs
+++ b/src/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall.cs
@@ -184,7 +184,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x5f)]
- public Result FlushProcessDataCache(int processHandle, ulong address, ulong size)
+ public static Result FlushProcessDataCache(int processHandle, ulong address, ulong size)
{
// FIXME: This needs to be implemented as ARMv7 doesn't have any way to do cache maintenance operations on EL0.
// As we don't support (and don't actually need) to flush the cache, this is stubbed.
@@ -263,7 +263,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x22)]
- public Result SendSyncRequestWithUserBuffer(
+ public static Result SendSyncRequestWithUserBuffer(
[PointerSized] ulong messagePtr,
[PointerSized] ulong messageSize,
int handle)
@@ -901,7 +901,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(2)]
- public Result SetMemoryPermission([PointerSized] ulong address, [PointerSized] ulong size, KMemoryPermission permission)
+ public static Result SetMemoryPermission([PointerSized] ulong address, [PointerSized] ulong size, KMemoryPermission permission)
{
if (!PageAligned(address))
{
@@ -934,7 +934,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(3)]
- public Result SetMemoryAttribute(
+ public static Result SetMemoryAttribute(
[PointerSized] ulong address,
[PointerSized] ulong size,
MemoryAttribute attributeMask,
@@ -983,7 +983,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(4)]
- public Result MapMemory([PointerSized] ulong dst, [PointerSized] ulong src, [PointerSized] ulong size)
+ public static Result MapMemory([PointerSized] ulong dst, [PointerSized] ulong src, [PointerSized] ulong size)
{
if (!PageAligned(src | dst))
{
@@ -1020,7 +1020,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(5)]
- public Result UnmapMemory([PointerSized] ulong dst, [PointerSized] ulong src, [PointerSized] ulong size)
+ public static Result UnmapMemory([PointerSized] ulong dst, [PointerSized] ulong src, [PointerSized] ulong size)
{
if (!PageAligned(src | dst))
{
@@ -1057,7 +1057,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(6)]
- public Result QueryMemory([PointerSized] ulong infoPtr, [PointerSized] out ulong pageInfo, [PointerSized] ulong address)
+ public static Result QueryMemory([PointerSized] ulong infoPtr, [PointerSized] out ulong pageInfo, [PointerSized] ulong address)
{
Result result = QueryMemory(out MemoryInfo info, out pageInfo, address);
@@ -1092,7 +1092,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x13)]
- public Result MapSharedMemory(int handle, [PointerSized] ulong address, [PointerSized] ulong size, KMemoryPermission permission)
+ public static Result MapSharedMemory(int handle, [PointerSized] ulong address, [PointerSized] ulong size, KMemoryPermission permission)
{
if (!PageAligned(address))
{
@@ -1139,7 +1139,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x14)]
- public Result UnmapSharedMemory(int handle, [PointerSized] ulong address, [PointerSized] ulong size)
+ public static Result UnmapSharedMemory(int handle, [PointerSized] ulong address, [PointerSized] ulong size)
{
if (!PageAligned(address))
{
@@ -1244,7 +1244,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x51)]
- public Result MapTransferMemory(int handle, [PointerSized] ulong address, [PointerSized] ulong size, KMemoryPermission permission)
+ public static Result MapTransferMemory(int handle, [PointerSized] ulong address, [PointerSized] ulong size, KMemoryPermission permission)
{
if (!PageAligned(address))
{
@@ -1291,7 +1291,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x52)]
- public Result UnmapTransferMemory(int handle, [PointerSized] ulong address, [PointerSized] ulong size)
+ public static Result UnmapTransferMemory(int handle, [PointerSized] ulong address, [PointerSized] ulong size)
{
if (!PageAligned(address))
{
@@ -1332,7 +1332,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x2c)]
- public Result MapPhysicalMemory([PointerSized] ulong address, [PointerSized] ulong size)
+ public static Result MapPhysicalMemory([PointerSized] ulong address, [PointerSized] ulong size)
{
if (!PageAligned(address))
{
@@ -1368,7 +1368,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x2d)]
- public Result UnmapPhysicalMemory([PointerSized] ulong address, [PointerSized] ulong size)
+ public static Result UnmapPhysicalMemory([PointerSized] ulong address, [PointerSized] ulong size)
{
if (!PageAligned(address))
{
@@ -1445,7 +1445,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x4c)]
- public Result ControlCodeMemory(
+ public static Result ControlCodeMemory(
int handle,
CodeMemoryOperation op,
ulong address,
@@ -1524,7 +1524,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x73)]
- public Result SetProcessMemoryPermission(
+ public static Result SetProcessMemoryPermission(
int handle,
ulong src,
ulong size,
@@ -1566,7 +1566,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x74)]
- public Result MapProcessMemory(
+ public static Result MapProcessMemory(
[PointerSized] ulong dst,
int handle,
ulong src,
@@ -1623,7 +1623,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x75)]
- public Result UnmapProcessMemory(
+ public static Result UnmapProcessMemory(
[PointerSized] ulong dst,
int handle,
ulong src,
@@ -1669,7 +1669,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x77)]
- public Result MapProcessCodeMemory(int handle, ulong dst, ulong src, ulong size)
+ public static Result MapProcessCodeMemory(int handle, ulong dst, ulong src, ulong size)
{
if (!PageAligned(dst) || !PageAligned(src))
{
@@ -1707,7 +1707,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x78)]
- public Result UnmapProcessCodeMemory(int handle, ulong dst, ulong src, ulong size)
+ public static Result UnmapProcessCodeMemory(int handle, ulong dst, ulong src, ulong size)
{
if (!PageAligned(dst) || !PageAligned(src))
{
@@ -1752,7 +1752,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
// System
[Svc(0x7b)]
- public Result TerminateProcess(int handle)
+ public static Result TerminateProcess(int handle)
{
KProcess process = KernelStatic.GetCurrentProcess();
@@ -1782,7 +1782,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(7)]
- public void ExitProcess()
+ public static void ExitProcess()
{
KernelStatic.GetCurrentProcess().TerminateCurrentProcess();
}
@@ -1878,7 +1878,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x26)]
- public void Break(ulong reason)
+ public static void Break(ulong reason)
{
KThread currentThread = KernelStatic.GetCurrentThread();
@@ -1905,7 +1905,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x27)]
- public void OutputDebugString([PointerSized] ulong strPtr, [PointerSized] ulong size)
+ public static void OutputDebugString([PointerSized] ulong strPtr, [PointerSized] ulong size)
{
KProcess process = KernelStatic.GetCurrentProcess();
@@ -2371,7 +2371,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x30)]
- public Result GetResourceLimitLimitValue(out long limitValue, int handle, LimitableResource resource)
+ public static Result GetResourceLimitLimitValue(out long limitValue, int handle, LimitableResource resource)
{
limitValue = 0;
@@ -2393,7 +2393,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x31)]
- public Result GetResourceLimitCurrentValue(out long limitValue, int handle, LimitableResource resource)
+ public static Result GetResourceLimitCurrentValue(out long limitValue, int handle, LimitableResource resource)
{
limitValue = 0;
@@ -2415,7 +2415,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x37)]
- public Result GetResourceLimitPeakValue(out long peak, int handle, LimitableResource resource)
+ public static Result GetResourceLimitPeakValue(out long peak, int handle, LimitableResource resource)
{
peak = 0;
@@ -2447,7 +2447,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x7e)]
- public Result SetResourceLimitLimitValue(int handle, LimitableResource resource, long limitValue)
+ public static Result SetResourceLimitLimitValue(int handle, LimitableResource resource, long limitValue)
{
if (resource >= LimitableResource.Count)
{
@@ -2542,7 +2542,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(9)]
- public Result StartThread(int handle)
+ public static Result StartThread(int handle)
{
KProcess process = KernelStatic.GetCurrentProcess();
@@ -2570,7 +2570,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0xa)]
- public void ExitThread()
+ public static void ExitThread()
{
KThread currentThread = KernelStatic.GetCurrentThread();
@@ -2602,7 +2602,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0xc)]
- public Result GetThreadPriority(out int priority, int handle)
+ public static Result GetThreadPriority(out int priority, int handle)
{
KProcess process = KernelStatic.GetCurrentProcess();
@@ -2623,7 +2623,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0xd)]
- public Result SetThreadPriority(int handle, int priority)
+ public static Result SetThreadPriority(int handle, int priority)
{
// TODO: NPDM check.
@@ -2642,7 +2642,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0xe)]
- public Result GetThreadCoreMask(out int preferredCore, out ulong affinityMask, int handle)
+ public static Result GetThreadCoreMask(out int preferredCore, out ulong affinityMask, int handle)
{
KProcess process = KernelStatic.GetCurrentProcess();
@@ -2665,7 +2665,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0xf)]
- public Result SetThreadCoreMask(int handle, int preferredCore, ulong affinityMask)
+ public static Result SetThreadCoreMask(int handle, int preferredCore, ulong affinityMask)
{
KProcess currentProcess = KernelStatic.GetCurrentProcess();
@@ -2714,13 +2714,13 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x10)]
- public int GetCurrentProcessorNumber()
+ public static int GetCurrentProcessorNumber()
{
return KernelStatic.GetCurrentThread().CurrentCore;
}
[Svc(0x25)]
- public Result GetThreadId(out ulong threadUid, int handle)
+ public static Result GetThreadId(out ulong threadUid, int handle)
{
KProcess process = KernelStatic.GetCurrentProcess();
@@ -2741,7 +2741,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x32)]
- public Result SetThreadActivity(int handle, bool pause)
+ public static Result SetThreadActivity(int handle, bool pause)
{
KProcess process = KernelStatic.GetCurrentProcess();
@@ -2766,7 +2766,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x33)]
- public Result GetThreadContext3([PointerSized] ulong address, int handle)
+ public static Result GetThreadContext3([PointerSized] ulong address, int handle)
{
KProcess currentProcess = KernelStatic.GetCurrentProcess();
KThread currentThread = KernelStatic.GetCurrentThread();
@@ -2931,7 +2931,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x1a)]
- public Result ArbitrateLock(int ownerHandle, [PointerSized] ulong mutexAddress, int requesterHandle)
+ public static Result ArbitrateLock(int ownerHandle, [PointerSized] ulong mutexAddress, int requesterHandle)
{
if (IsPointingInsideKernel(mutexAddress))
{
@@ -2949,7 +2949,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x1b)]
- public Result ArbitrateUnlock([PointerSized] ulong mutexAddress)
+ public static Result ArbitrateUnlock([PointerSized] ulong mutexAddress)
{
if (IsPointingInsideKernel(mutexAddress))
{
@@ -2967,7 +2967,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x1c)]
- public Result WaitProcessWideKeyAtomic(
+ public static Result WaitProcessWideKeyAtomic(
[PointerSized] ulong mutexAddress,
[PointerSized] ulong condVarAddress,
int handle,
@@ -2998,7 +2998,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x1d)]
- public Result SignalProcessWideKey([PointerSized] ulong address, int count)
+ public static Result SignalProcessWideKey([PointerSized] ulong address, int count)
{
KProcess currentProcess = KernelStatic.GetCurrentProcess();
@@ -3008,7 +3008,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x34)]
- public Result WaitForAddress([PointerSized] ulong address, ArbitrationType type, int value, long timeout)
+ public static Result WaitForAddress([PointerSized] ulong address, ArbitrationType type, int value, long timeout)
{
if (IsPointingInsideKernel(address))
{
@@ -3040,7 +3040,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x35)]
- public Result SignalToAddress([PointerSized] ulong address, SignalType type, int value, int count)
+ public static Result SignalToAddress([PointerSized] ulong address, SignalType type, int value, int count)
{
if (IsPointingInsideKernel(address))
{
@@ -3067,7 +3067,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x36)]
- public Result SynchronizePreemptionState()
+ public static Result SynchronizePreemptionState()
{
KernelStatic.GetCurrentThread().SynchronizePreemptionState();
diff --git a/src/Ryujinx.HLE/HOS/Services/Fatal/IService.cs b/src/Ryujinx.HLE/HOS/Services/Fatal/IService.cs
index 155077745..4ea7c8294 100644
--- a/src/Ryujinx.HLE/HOS/Services/Fatal/IService.cs
+++ b/src/Ryujinx.HLE/HOS/Services/Fatal/IService.cs
@@ -139,7 +139,7 @@ namespace Ryujinx.HLE.HOS.Services.Fatal
Logger.Info?.Print(LogClass.ServiceFatal, errorReport.ToString());
- context.Device.System.KernelContext.Syscall.Break((ulong)resultCode);
+ Kernel.SupervisorCall.Syscall.Break((ulong)resultCode);
return ResultCode.Success;
}
diff --git a/src/Ryujinx.Horizon/Sdk/Audio/Detail/AudioDevice.cs b/src/Ryujinx.Horizon/Sdk/Audio/Detail/AudioDevice.cs
index 583a04de3..ebe781566 100644
--- a/src/Ryujinx.Horizon/Sdk/Audio/Detail/AudioDevice.cs
+++ b/src/Ryujinx.Horizon/Sdk/Audio/Detail/AudioDevice.cs
@@ -234,7 +234,7 @@ namespace Ryujinx.Horizon.Sdk.Audio.Detail
}
[CmifCommand(15)] // 17.0.0+
- public Result AcquireAudioOutputDeviceNotification([CopyHandle] out int eventHandle, ulong deviceId)
+ public static Result AcquireAudioOutputDeviceNotification([CopyHandle] out int eventHandle, ulong deviceId)
{
eventHandle = 0;
@@ -242,13 +242,13 @@ namespace Ryujinx.Horizon.Sdk.Audio.Detail
}
[CmifCommand(16)] // 17.0.0+
- public Result ReleaseAudioOutputDeviceNotification(ulong deviceId)
+ public static Result ReleaseAudioOutputDeviceNotification(ulong deviceId)
{
return AudioResult.NotImplemented;
}
[CmifCommand(17)] // 17.0.0+
- public Result AcquireAudioInputDeviceNotification([CopyHandle] out int eventHandle, ulong deviceId)
+ public static Result AcquireAudioInputDeviceNotification([CopyHandle] out int eventHandle, ulong deviceId)
{
eventHandle = 0;
@@ -256,19 +256,19 @@ namespace Ryujinx.Horizon.Sdk.Audio.Detail
}
[CmifCommand(18)] // 17.0.0+
- public Result ReleaseAudioInputDeviceNotification(ulong deviceId)
+ public static Result ReleaseAudioInputDeviceNotification(ulong deviceId)
{
return AudioResult.NotImplemented;
}
[CmifCommand(19)] // 18.0.0+
- public Result SetAudioDeviceOutputVolumeAutoTuneEnabled(bool enabled)
+ public static Result SetAudioDeviceOutputVolumeAutoTuneEnabled(bool enabled)
{
return AudioResult.NotImplemented;
}
[CmifCommand(20)] // 18.0.0+
- public Result IsAudioDeviceOutputVolumeAutoTuneEnabled(out bool enabled)
+ public static Result IsAudioDeviceOutputVolumeAutoTuneEnabled(out bool enabled)
{
enabled = false;
From 5c4203a4360dbba6e00e18c7dd909cfc5bd646cf Mon Sep 17 00:00:00 2001
From: MrKev312 <34964788+MrKev312@users.noreply.github.com>
Date: Fri, 1 Aug 2025 22:49:52 +0200
Subject: [PATCH 09/12] Make field readonly
---
src/Ryujinx/UI/ViewModels/CompatibilityViewModel.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Ryujinx/UI/ViewModels/CompatibilityViewModel.cs b/src/Ryujinx/UI/ViewModels/CompatibilityViewModel.cs
index 24834ec5c..c711bd1c6 100644
--- a/src/Ryujinx/UI/ViewModels/CompatibilityViewModel.cs
+++ b/src/Ryujinx/UI/ViewModels/CompatibilityViewModel.cs
@@ -34,7 +34,7 @@ namespace Ryujinx.Ava.UI.ViewModels
private string[] _ownedGameTitleIds = [];
- private Func _sortKeySelector = x => x.GameName; // Default sort by GameName
+ private readonly Func _sortKeySelector = x => x.GameName; // Default sort by GameName
public IEnumerable CurrentEntries => OnlyShowOwnedGames
? _currentEntries.Where(x =>
From 62c4347294c84c28d6a55d75ebf158543e289572 Mon Sep 17 00:00:00 2001
From: MrKev312 <34964788+MrKev312@users.noreply.github.com>
Date: Fri, 1 Aug 2025 22:50:25 +0200
Subject: [PATCH 10/12] Fix code style
---
src/Ryujinx/Program.cs | 5 +----
src/Ryujinx/UI/Applet/AvaloniaHostUITheme.cs | 2 +-
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/src/Ryujinx/Program.cs b/src/Ryujinx/Program.cs
index 47e1d2564..305e4acaa 100644
--- a/src/Ryujinx/Program.cs
+++ b/src/Ryujinx/Program.cs
@@ -219,10 +219,7 @@ namespace Ryujinx.Ava
}
// When you first load the program, copy to remember the path for the global configuration
- if (GlobalConfigurationPath == null)
- {
- GlobalConfigurationPath = ConfigurationPath;
- }
+ GlobalConfigurationPath ??= ConfigurationPath;
UseHardwareAcceleration = ConfigurationState.Instance.EnableHardwareAcceleration;
diff --git a/src/Ryujinx/UI/Applet/AvaloniaHostUITheme.cs b/src/Ryujinx/UI/Applet/AvaloniaHostUITheme.cs
index 7ef8c0865..a926cf72e 100644
--- a/src/Ryujinx/UI/Applet/AvaloniaHostUITheme.cs
+++ b/src/Ryujinx/UI/Applet/AvaloniaHostUITheme.cs
@@ -55,7 +55,7 @@ namespace Ryujinx.Ava.UI.Applet
return culture.TwoLetterISOLanguageName switch
{
- "zh" => langCode == "zh-CN" || langCode == "zh-Hans" || langCode == "zh-SG"
+ "zh" => langCode is "zh-CN" or "zh-Hans" or "zh-SG"
? "Microsoft YaHei UI" // Simplified Chinese
: "Microsoft JhengHei UI", // Traditional Chinese
From 323ef1adba27a78f24b096d785e20fe991790ce3 Mon Sep 17 00:00:00 2001
From: MrKev312 <34964788+MrKev312@users.noreply.github.com>
Date: Fri, 1 Aug 2025 22:50:59 +0200
Subject: [PATCH 11/12] Add pragma to stop SYSLIB1054
---
src/Ryujinx.Audio.Backends.SDL2/SDL2HardwareDeviceDriver.cs | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/Ryujinx.Audio.Backends.SDL2/SDL2HardwareDeviceDriver.cs b/src/Ryujinx.Audio.Backends.SDL2/SDL2HardwareDeviceDriver.cs
index d5381209e..7149dfaa7 100644
--- a/src/Ryujinx.Audio.Backends.SDL2/SDL2HardwareDeviceDriver.cs
+++ b/src/Ryujinx.Audio.Backends.SDL2/SDL2HardwareDeviceDriver.cs
@@ -25,7 +25,9 @@ namespace Ryujinx.Audio.Backends.SDL2
// TODO: Add this to SDL2-CS
// NOTE: We use a DllImport here because of marshaling issue for spec.
[DllImport("SDL2")]
+#pragma warning disable SYSLIB1054 // Use 'LibraryImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time
private static extern int SDL_GetDefaultAudioInfo(nint name, out SDL_AudioSpec spec, int isCapture);
+#pragma warning restore SYSLIB1054 // Use 'LibraryImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time
public SDL2HardwareDeviceDriver()
{
From 9fcc844daeb2fd088634242356aadaf147c4a6ae Mon Sep 17 00:00:00 2001
From: MrKev312 <34964788+MrKev312@users.noreply.github.com>
Date: Fri, 1 Aug 2025 22:53:34 +0200
Subject: [PATCH 12/12] Suppress IDE0079: Remove unnecessary suppression
---
.editorconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/.editorconfig b/.editorconfig
index 1059bcdeb..d07171d67 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -262,6 +262,7 @@ dotnet_diagnostic.IDE0301.severity = none
dotnet_diagnostic.IDE0302.severity = none
dotnet_diagnostic.IDE0305.severity = none
dotnet_diagnostic.CS9113.severity = none # CS9113: Parameter 'value' is unread
+dotnet_diagnostic.IDE0079.severity = none # IDE0079: Remove unnecessary suppression
dotnet_diagnostic.IDE0130.severity = none # IDE0130: Namespace does not match folder structure
[src/Ryujinx/UI/ViewModels/**.cs]