From 4a545a00c6765ac3b0c4de23627372e9ced67d2c Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Sun, 8 Dec 2024 19:01:53 -0600 Subject: [PATCH] Headless in Avalonia, v1 It will get more advanced than this, this is for proof of concept. --- src/Ryujinx.Headless.SDL2/Program.cs | 4 ++-- src/Ryujinx.UI.Common/Helper/FileAssociationHelper.cs | 2 +- src/Ryujinx/Program.cs | 6 ++++++ src/Ryujinx/Ryujinx.csproj | 1 + 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Ryujinx.Headless.SDL2/Program.cs b/src/Ryujinx.Headless.SDL2/Program.cs index 12158176a..46743b4eb 100644 --- a/src/Ryujinx.Headless.SDL2/Program.cs +++ b/src/Ryujinx.Headless.SDL2/Program.cs @@ -43,7 +43,7 @@ using Key = Ryujinx.Common.Configuration.Hid.Key; namespace Ryujinx.Headless.SDL2 { - class Program + public class Program { public static string Version { get; private set; } @@ -62,7 +62,7 @@ namespace Ryujinx.Headless.SDL2 private static readonly InputConfigJsonSerializerContext _serializerContext = new(JsonHelper.GetDefaultSerializerOptions()); - static void Main(string[] args) + public static void Main(string[] args) { Version = ReleaseInformation.Version; diff --git a/src/Ryujinx.UI.Common/Helper/FileAssociationHelper.cs b/src/Ryujinx.UI.Common/Helper/FileAssociationHelper.cs index 9333a1b76..5dc871063 100644 --- a/src/Ryujinx.UI.Common/Helper/FileAssociationHelper.cs +++ b/src/Ryujinx.UI.Common/Helper/FileAssociationHelper.cs @@ -132,7 +132,7 @@ namespace Ryujinx.UI.Common.Helper if (uninstall) { - // If the types don't already exist, there's nothing to do and we can call this operation successful. + // If the types don't already exist, there's nothing to do, and we can call this operation successful. if (!AreMimeTypesRegisteredWindows()) { return true; diff --git a/src/Ryujinx/Program.cs b/src/Ryujinx/Program.cs index 05fd66b90..0f6d1bfae 100644 --- a/src/Ryujinx/Program.cs +++ b/src/Ryujinx/Program.cs @@ -55,6 +55,12 @@ namespace Ryujinx.Ava Initialize(args); + if (args[0] is "--no-gui" or "nogui") + { + Headless.SDL2.Program.Main(args.Skip(1).ToArray()); + return 0; + } + LoggerAdapter.Register(); IconProvider.Current diff --git a/src/Ryujinx/Ryujinx.csproj b/src/Ryujinx/Ryujinx.csproj index 989a3a5bd..74f4e479a 100644 --- a/src/Ryujinx/Ryujinx.csproj +++ b/src/Ryujinx/Ryujinx.csproj @@ -67,6 +67,7 @@ +