chore: Overall code cleanup

Update NuGet packages, fix version string in plist for macOS
This commit is contained in:
GreemDev 2025-10-26 00:58:47 -05:00
parent 7175da8621
commit c8959afa3d
55 changed files with 53 additions and 303 deletions

View file

@ -14,10 +14,10 @@
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="17.12.6" /> <PackageVersion Include="Microsoft.Build.Utilities.Core" Version="17.12.6" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" /> <PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="Projektanker.Icons.Avalonia" Version="9.6.2" /> <PackageVersion Include="Projektanker.Icons.Avalonia" Version="9.6.2" />
<PackageVersion Include="Projektanker.Icons.Avalonia.FontAwesome" Version="9.6.2"/> <PackageVersion Include="Projektanker.Icons.Avalonia.FontAwesome" Version="9.6.2" />
<PackageVersion Include="Projektanker.Icons.Avalonia.MaterialDesign" Version="9.6.2"/> <PackageVersion Include="Projektanker.Icons.Avalonia.MaterialDesign" Version="9.6.2" />
<PackageVersion Include="CommandLineParser" Version="2.9.1" /> <PackageVersion Include="CommandLineParser" Version="2.9.1" />
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.4.0"/> <PackageVersion Include="CommunityToolkit.Mvvm" Version="8.4.0" />
<PackageVersion Include="Concentus" Version="2.2.2" /> <PackageVersion Include="Concentus" Version="2.2.2" />
<PackageVersion Include="DiscordRichPresence" Version="1.6.1.70" /> <PackageVersion Include="DiscordRichPresence" Version="1.6.1.70" />
<PackageVersion Include="DynamicData" Version="9.4.1" /> <PackageVersion Include="DynamicData" Version="9.4.1" />
@ -40,11 +40,11 @@
<PackageVersion Include="Ryujinx.Audio.OpenAL.Dependencies" Version="1.21.0.1" /> <PackageVersion Include="Ryujinx.Audio.OpenAL.Dependencies" Version="1.21.0.1" />
<PackageVersion Include="Ryujinx.Graphics.Nvdec.Dependencies.AllArch" Version="6.1.2-build3" /> <PackageVersion Include="Ryujinx.Graphics.Nvdec.Dependencies.AllArch" Version="6.1.2-build3" />
<PackageVersion Include="Ryujinx.Graphics.Vulkan.Dependencies.MoltenVK" Version="1.2.0" /> <PackageVersion Include="Ryujinx.Graphics.Vulkan.Dependencies.MoltenVK" Version="1.2.0" />
<PackageVersion Include="Ryujinx.LibHac" Version="0.21.0-alpha.117" /> <PackageVersion Include="Ryujinx.LibHac" Version="0.21.0-alpha.126" />
<PackageVersion Include="Ryujinx.SDL2-CS" Version="2.30.0-build32" /> <PackageVersion Include="Ryujinx.SDL2-CS" Version="2.30.0-build32" />
<PackageVersion Include="Ryujinx.UpdateClient" Version="1.0.44" /> <PackageVersion Include="Ryujinx.UpdateClient" Version="1.0.44" />
<PackageVersion Include="Ryujinx.Systems.Update.Common" Version="1.0.44" /> <PackageVersion Include="Ryujinx.Systems.Update.Common" Version="1.0.44" />
<PackageVersion Include="Gommon" Version="2.7.2.1" /> <PackageVersion Include="Gommon" Version="2.8.0.1" />
<PackageVersion Include="securifybv.ShellLink" Version="0.1.0" /> <PackageVersion Include="securifybv.ShellLink" Version="0.1.0" />
<PackageVersion Include="Sep" Version="0.11.1" /> <PackageVersion Include="Sep" Version="0.11.1" />
<PackageVersion Include="shaderc.net" Version="0.1.0" /> <PackageVersion Include="shaderc.net" Version="0.1.0" />

View file

@ -34,7 +34,7 @@
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string> <string>6.0</string>
<key>CFBundleLongVersionString</key> <key>CFBundleLongVersionString</key>
<string>%%RYUJINX_BUILD_VERSION%%-%%RYUJINX_BUILD_GIT_HASH%%"</string> <string>%%RYUJINX_BUILD_VERSION%%-%%RYUJINX_BUILD_GIT_HASH%%</string>
<key>CFBundleName</key> <key>CFBundleName</key>
<string>Ryujinx</string> <string>Ryujinx</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
@ -44,13 +44,13 @@
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1.2.0</string> <string>%%RYUJINX_BUILD_VERSION%%</string>
<key>NSHighResolutionCapable</key> <key>NSHighResolutionCapable</key>
<true/> <true/>
<key>CSResourcesFileMapped</key> <key>CSResourcesFileMapped</key>
<true/> <true/>
<key>NSHumanReadableCopyright</key> <key>NSHumanReadableCopyright</key>
<string>Copyright © 2018 - 2023 Ryujinx Team and Contributors.</string> <string>Copyright © 2018 - 2024 Ryujinx Team and Contributors. Copyright © 2024 - 2025 Ryubing and Contributors.</string>
<key>LSApplicationCategoryType</key> <key>LSApplicationCategoryType</key>
<string>public.app-category.games</string> <string>public.app-category.games</string>
<key>LSMinimumSystemVersion</key> <key>LSMinimumSystemVersion</key>

View file

@ -1,5 +1,4 @@
using System; using System;
using System.Diagnostics.CodeAnalysis;
namespace ARMeilleure.CodeGen.X86 namespace ARMeilleure.CodeGen.X86
{ {

View file

@ -2,7 +2,6 @@ using ARMeilleure.CodeGen.RegisterAllocators;
using ARMeilleure.IntermediateRepresentation; using ARMeilleure.IntermediateRepresentation;
using Microsoft.IO; using Microsoft.IO;
using Ryujinx.Common.Memory; using Ryujinx.Common.Memory;
using System.IO;
using System.Numerics; using System.Numerics;
namespace ARMeilleure.CodeGen.X86 namespace ARMeilleure.CodeGen.X86

View file

@ -1,5 +1,3 @@
using System.Diagnostics.CodeAnalysis;
namespace ARMeilleure.CodeGen.X86 namespace ARMeilleure.CodeGen.X86
{ {
enum X86Register enum X86Register

View file

@ -2,7 +2,6 @@ using ARMeilleure.Decoders;
using ARMeilleure.IntermediateRepresentation; using ARMeilleure.IntermediateRepresentation;
using ARMeilleure.Translation; using ARMeilleure.Translation;
using System; using System;
using System.Diagnostics.CodeAnalysis;
using static ARMeilleure.Instructions.InstEmitHelper; using static ARMeilleure.Instructions.InstEmitHelper;
namespace ARMeilleure.Instructions namespace ARMeilleure.Instructions

View file

@ -1,5 +1,4 @@
using System; using System;
using System.Diagnostics.CodeAnalysis;
namespace ARMeilleure.IntermediateRepresentation namespace ARMeilleure.IntermediateRepresentation
{ {

View file

@ -3,7 +3,6 @@ using Ryujinx.Audio.Renderer.Common;
using Ryujinx.Audio.Renderer.Server.Voice; using Ryujinx.Audio.Renderer.Server.Voice;
using System; using System;
using Ryujinx.Audio.Renderer.Parameter; using Ryujinx.Audio.Renderer.Parameter;
using Ryujinx.Memory;
using WaveBuffer = Ryujinx.Audio.Renderer.Common.WaveBuffer; using WaveBuffer = Ryujinx.Audio.Renderer.Common.WaveBuffer;
namespace Ryujinx.Audio.Renderer.Dsp.Command namespace Ryujinx.Audio.Renderer.Dsp.Command

View file

@ -1,5 +1,4 @@
using Ryujinx.Audio.Renderer.Server.Splitter; using Ryujinx.Audio.Renderer.Server.Splitter;
using System;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
namespace Ryujinx.Audio.Renderer.Dsp.Command namespace Ryujinx.Audio.Renderer.Dsp.Command

View file

@ -1,9 +1,6 @@
using Ryujinx.Audio.Common; using Ryujinx.Audio.Common;
using Ryujinx.Audio.Renderer.Common; using Ryujinx.Audio.Renderer.Common;
using Ryujinx.Audio.Renderer.Dsp;
using Ryujinx.Common.Memory; using Ryujinx.Common.Memory;
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Ryujinx.Audio.Renderer.Parameter namespace Ryujinx.Audio.Renderer.Parameter

View file

@ -10,7 +10,6 @@ using Ryujinx.Audio.Renderer.Server.Upsampler;
using Ryujinx.Audio.Renderer.Server.Voice; using Ryujinx.Audio.Renderer.Server.Voice;
using Ryujinx.Common; using Ryujinx.Common;
using System; using System;
using System.Runtime.CompilerServices;
using CpuAddress = System.UInt64; using CpuAddress = System.UInt64;
namespace Ryujinx.Audio.Renderer.Server namespace Ryujinx.Audio.Renderer.Server

View file

@ -1,6 +1,5 @@
using Ryujinx.Audio.Common; using Ryujinx.Audio.Common;
using Ryujinx.Audio.Renderer.Common; using Ryujinx.Audio.Renderer.Common;
using Ryujinx.Audio.Renderer.Dsp;
using Ryujinx.Audio.Renderer.Dsp.Command; using Ryujinx.Audio.Renderer.Dsp.Command;
using Ryujinx.Audio.Renderer.Dsp.State; using Ryujinx.Audio.Renderer.Dsp.State;
using Ryujinx.Audio.Renderer.Parameter; using Ryujinx.Audio.Renderer.Parameter;

View file

@ -1,4 +1,3 @@
using Ryujinx.Audio.Renderer.Dsp;
using Ryujinx.Audio.Renderer.Parameter; using Ryujinx.Audio.Renderer.Parameter;
using Ryujinx.Common.Memory; using Ryujinx.Common.Memory;
using Ryujinx.Common.Utilities; using Ryujinx.Common.Utilities;

View file

@ -12,7 +12,6 @@ using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using static Ryujinx.Audio.Renderer.Common.BehaviourParameter; using static Ryujinx.Audio.Renderer.Common.BehaviourParameter;
using static Ryujinx.Audio.Renderer.Parameter.VoiceInParameter1;
using PlayState = Ryujinx.Audio.Renderer.Server.Types.PlayState; using PlayState = Ryujinx.Audio.Renderer.Server.Types.PlayState;
namespace Ryujinx.Audio.Renderer.Server.Voice namespace Ryujinx.Audio.Renderer.Server.Voice

View file

@ -1,31 +0,0 @@
using Ryujinx.Common.Logging.Formatters;
using System;
using System.Text.Json.Serialization;
namespace Ryujinx.Common.Logging
{
internal class LogEventArgsJson
{
public LogLevel Level { get; }
public TimeSpan Time { get; }
public string ThreadName { get; }
public string Message { get; }
public string Data { get; }
[JsonConstructor]
public LogEventArgsJson(LogLevel level, TimeSpan time, string threadName, string message, string data = null)
{
Level = level;
Time = time;
ThreadName = threadName;
Message = message;
Data = data;
}
public static LogEventArgsJson FromLogEventArgs(LogEventArgs args)
{
return new LogEventArgsJson(args.Level, args.Time, args.ThreadName, args.Message, DynamicObjectFormatter.Format(args.Data));
}
}
}

View file

@ -1,9 +0,0 @@
using System.Text.Json.Serialization;
namespace Ryujinx.Common.Logging
{
[JsonSerializable(typeof(LogEventArgsJson))]
internal partial class LogEventJsonSerializerContext : JsonSerializerContext
{
}
}

View file

@ -230,14 +230,14 @@ namespace Ryujinx.Common.Logging
switch (logLevel) switch (logLevel)
{ {
#pragma warning disable IDE0055 // Disable formatting #pragma warning disable IDE0055 // Disable formatting
case LogLevel.Debug : Debug = enabled ? new Log(LogLevel.Debug) : new Log?(); break; case LogLevel.Debug : Debug = enabled ? new Log(LogLevel.Debug) : null; break;
case LogLevel.Info : Info = enabled ? new Log(LogLevel.Info) : new Log?(); break; case LogLevel.Info : Info = enabled ? new Log(LogLevel.Info) : null; break;
case LogLevel.Warning : Warning = enabled ? new Log(LogLevel.Warning) : new Log?(); break; case LogLevel.Warning : Warning = enabled ? new Log(LogLevel.Warning) : null; break;
case LogLevel.Error : Error = enabled ? new Log(LogLevel.Error) : new Log?(); break; case LogLevel.Error : Error = enabled ? new Log(LogLevel.Error) : null; break;
case LogLevel.Guest : Guest = enabled ? new Log(LogLevel.Guest) : new Log?(); break; case LogLevel.Guest : Guest = enabled ? new Log(LogLevel.Guest) : null; break;
case LogLevel.AccessLog : AccessLog = enabled ? new Log(LogLevel.AccessLog) : new Log?(); break; case LogLevel.AccessLog : AccessLog = enabled ? new Log(LogLevel.AccessLog) : null; break;
case LogLevel.Stub : Stub = enabled ? new Log(LogLevel.Stub) : new Log?(); break; case LogLevel.Stub : Stub = enabled ? new Log(LogLevel.Stub) : null; break;
case LogLevel.Trace : Trace = enabled ? new Log(LogLevel.Trace) : new Log?(); break; case LogLevel.Trace : Trace = enabled ? new Log(LogLevel.Trace) : null; break;
case LogLevel.Notice : break; case LogLevel.Notice : break;
default: throw new ArgumentException("Unknown Log Level", nameof(logLevel)); default: throw new ArgumentException("Unknown Log Level", nameof(logLevel));
#pragma warning restore IDE0055 #pragma warning restore IDE0055

View file

@ -1,42 +0,0 @@
using Ryujinx.Common.Utilities;
using System;
using System.IO;
namespace Ryujinx.Common.Logging.Targets
{
public class JsonLogTarget : ILogTarget
{
private readonly Stream _stream;
private readonly bool _leaveOpen;
private readonly string _name;
string ILogTarget.Name { get => _name; }
public JsonLogTarget(Stream stream, string name)
{
_stream = stream;
_name = name;
}
public JsonLogTarget(Stream stream, bool leaveOpen)
{
_stream = stream;
_leaveOpen = leaveOpen;
}
public void Log(object sender, LogEventArgs e)
{
LogEventArgsJson logEventArgsJson = LogEventArgsJson.FromLogEventArgs(e);
JsonHelper.SerializeToStream(_stream, logEventArgsJson, LogEventJsonSerializerContext.Default.LogEventArgsJson);
}
public void Dispose()
{
GC.SuppressFinalize(this);
if (!_leaveOpen)
{
_stream.Dispose();
}
}
}
}

View file

@ -1,6 +1,5 @@
using System; using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Threading;
namespace Ryujinx.Common namespace Ryujinx.Common
{ {

View file

@ -1,19 +0,0 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
namespace Ryujinx.Common
{
public class ReferenceEqualityComparer<T> : IEqualityComparer<T>
where T : class
{
public bool Equals(T x, T y)
{
return x == y;
}
public int GetHashCode([DisallowNull] T obj)
{
return obj.GetHashCode();
}
}
}

View file

@ -1,10 +1,5 @@
using Ryujinx.Common.Utilities;
using System; using System;
using System.Net.Http;
using System.Net.Http.Json;
using System.Reflection; using System.Reflection;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace Ryujinx.Common namespace Ryujinx.Common
{ {

View file

@ -1,6 +1,5 @@
using ARMeilleure.State; using ARMeilleure.State;
using System; using System;
using System.Threading;
namespace Ryujinx.Cpu namespace Ryujinx.Cpu
{ {

View file

@ -1,4 +1,3 @@
using ARMeilleure;
using ARMeilleure.Memory; using ARMeilleure.Memory;
using ARMeilleure.State; using ARMeilleure.State;
using System; using System;

View file

@ -1,5 +1,3 @@
using System.Diagnostics.CodeAnalysis;
namespace Ryujinx.Graphics.GAL namespace Ryujinx.Graphics.GAL
{ {
public enum ViewportSwizzle public enum ViewportSwizzle

View file

@ -1,5 +1,3 @@
using System.Diagnostics.CodeAnalysis;
namespace Ryujinx.Graphics.Gpu.Engine.Threed namespace Ryujinx.Graphics.Gpu.Engine.Threed
{ {
/// <summary> /// <summary>

View file

@ -1,4 +1,3 @@
using Ryujinx.Common.Memory;
using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.GAL;
using Ryujinx.Graphics.Gpu.Engine.Types; using Ryujinx.Graphics.Gpu.Engine.Types;
using Ryujinx.Graphics.Gpu.Shader; using Ryujinx.Graphics.Gpu.Shader;

View file

@ -1,4 +1,3 @@
using Ryujinx.Common.Memory;
using Ryujinx.Graphics.Device; using Ryujinx.Graphics.Device;
using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.GAL;
using Ryujinx.Graphics.Gpu.Engine.GPFifo; using Ryujinx.Graphics.Gpu.Engine.GPFifo;

View file

@ -1,6 +1,5 @@
using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.GAL;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
namespace Ryujinx.Graphics.Gpu.Image namespace Ryujinx.Graphics.Gpu.Image
{ {

View file

@ -1,7 +1,6 @@
using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.GAL;
using Ryujinx.Memory.Range; using Ryujinx.Memory.Range;
using System; using System;
using System.Collections.Generic;
namespace Ryujinx.Graphics.Gpu.Memory namespace Ryujinx.Graphics.Gpu.Memory
{ {

View file

@ -1,6 +1,5 @@
using Ryujinx.Memory.Range; using Ryujinx.Memory.Range;
using System; using System;
using System.Collections.Generic;
using System.Linq; using System.Linq;
namespace Ryujinx.Graphics.Gpu.Memory namespace Ryujinx.Graphics.Gpu.Memory

View file

@ -1,5 +1,4 @@
using System; using System;
using System.Diagnostics.CodeAnalysis;
namespace Ryujinx.Graphics.Shader.CodeGen.Glsl.Instructions namespace Ryujinx.Graphics.Shader.CodeGen.Glsl.Instructions
{ {

View file

@ -1,5 +1,4 @@
using System; using System;
using System.Diagnostics.CodeAnalysis;
namespace Ryujinx.Graphics.Shader.IntermediateRepresentation namespace Ryujinx.Graphics.Shader.IntermediateRepresentation
{ {

View file

@ -1,5 +1,4 @@
using System; using System;
using System.Diagnostics.CodeAnalysis;
namespace Ryujinx.Graphics.Shader.Translation namespace Ryujinx.Graphics.Shader.Translation
{ {

View file

@ -1,5 +1,4 @@
using Ryujinx.Common.Logging; using Ryujinx.Common.Logging;
using Ryujinx.Common.Memory;
using Ryujinx.Graphics.Texture; using Ryujinx.Graphics.Texture;
using Ryujinx.Graphics.Vic.Types; using Ryujinx.Graphics.Vic.Types;
using System; using System;

View file

@ -4,7 +4,6 @@ using Ryujinx.Graphics.Shader;
using Ryujinx.Graphics.Shader.Translation; using Ryujinx.Graphics.Shader.Translation;
using Silk.NET.Vulkan; using Silk.NET.Vulkan;
using System; using System;
using System.Collections.Generic;
using System.Numerics; using System.Numerics;
using Buffer = Silk.NET.Vulkan.Buffer; using Buffer = Silk.NET.Vulkan.Buffer;
using CompareOp = Ryujinx.Graphics.GAL.CompareOp; using CompareOp = Ryujinx.Graphics.GAL.CompareOp;

View file

@ -1,6 +1,5 @@
using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.GAL;
using System; using System;
using System.Collections.Generic;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Ryujinx.Graphics.Vulkan namespace Ryujinx.Graphics.Vulkan

View file

@ -1,12 +1,8 @@
using Gommon; using Gommon;
using JetBrains.Annotations;
using Ryujinx.Common.Logging; using Ryujinx.Common.Logging;
using Ryujinx.HLE.HOS.Kernel.Process;
using Ryujinx.HLE.HOS.Kernel.Threading;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text;
namespace Ryujinx.HLE.Debugger namespace Ryujinx.HLE.Debugger
{ {

View file

@ -5,7 +5,6 @@ using Ryujinx.HLE.HOS.Kernel.Process;
using Ryujinx.HLE.HOS.Kernel.Threading; using Ryujinx.HLE.HOS.Kernel.Threading;
using System; using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Net.Sockets; using System.Net.Sockets;
using System.Threading; using System.Threading;

View file

@ -49,7 +49,7 @@ namespace Ryujinx.HLE.FileSystem
string ncaId = Convert.ToHexStringLower(entry.NcaId).Replace("-", null); string ncaId = Convert.ToHexStringLower(entry.NcaId).Replace("-", null);
Nca nca = _pfs.GetNca(keySet, $"/{ncaId}.nca"); Nca nca = _pfs.GetNca(keySet, $"/{ncaId}.nca");
if (nca.GetProgramIndex() == programIndex) if (nca.ProgramIndex == programIndex)
{ {
return nca; return nca;
} }

View file

@ -36,7 +36,7 @@ namespace Ryujinx.HLE.Loaders.Processes.Extensions
public static ProcessResult Load(this IFileSystem exeFs, Switch device, BlitStruct<ApplicationControlProperty> nacpData, MetaLoader metaLoader, byte programIndex, bool isHomebrew = false) public static ProcessResult Load(this IFileSystem exeFs, Switch device, BlitStruct<ApplicationControlProperty> nacpData, MetaLoader metaLoader, byte programIndex, bool isHomebrew = false)
{ {
ulong programId = metaLoader.GetProgramId(); ulong programId = metaLoader.ProgramId;
// Replace the whole ExeFs partition by the modded one. // Replace the whole ExeFs partition by the modded one.
if (device.Configuration.VirtualFileSystem.ModLoader.ReplaceExefsPartition(programId, ref exeFs)) if (device.Configuration.VirtualFileSystem.ModLoader.ReplaceExefsPartition(programId, ref exeFs))
@ -118,13 +118,13 @@ namespace Ryujinx.HLE.Loaders.Processes.Extensions
modLoadResult.Hash, modLoadResult.Hash,
true, true,
programName, programName,
metaLoader.GetProgramId(), programId,
programIndex, programIndex,
null, null,
nsoExecutables); nsoExecutables);
// TODO: This should be stored using ProcessId instead. // TODO: This should be stored using ProcessId instead.
device.System.LibHacHorizonManager.ArpIReader.ApplicationId = new LibHac.ApplicationId(metaLoader.GetProgramId()); device.System.LibHacHorizonManager.ArpIReader.ApplicationId = new LibHac.ApplicationId(programId);
return processResult; return processResult;
} }

View file

@ -13,7 +13,7 @@ namespace Ryujinx.HLE.Loaders.Processes
{ {
MetaLoader metaLoader = exeFs.GetNpdm(); MetaLoader metaLoader = exeFs.GetNpdm();
BlitStruct<ApplicationControlProperty> nacpData = new(1); BlitStruct<ApplicationControlProperty> nacpData = new(1);
ulong programId = metaLoader.GetProgramId(); ulong programId = metaLoader.ProgramId;
device.Configuration.VirtualFileSystem.ModLoader.CollectMods([programId]); device.Configuration.VirtualFileSystem.ModLoader.CollectMods([programId]);

View file

@ -1,61 +1,15 @@
using LibHac.Common;
using LibHac.Fs;
using LibHac.Fs.Fsa;
using LibHac.Loader; using LibHac.Loader;
using LibHac.Util;
using Ryujinx.Common; using Ryujinx.Common;
using System;
namespace Ryujinx.HLE.Loaders.Processes.Extensions namespace Ryujinx.HLE.Loaders.Processes.Extensions
{ {
public static class MetaLoaderExtensions public static class MetaLoaderExtensions
{ {
public static ulong GetProgramId(this MetaLoader metaLoader)
{
metaLoader.GetNpdm(out LibHac.Loader.Npdm npdm).ThrowIfFailure();
return npdm.Aci.ProgramId.Value;
}
public static string GetProgramName(this MetaLoader metaLoader)
{
metaLoader.GetNpdm(out LibHac.Loader.Npdm npdm).ThrowIfFailure();
return StringUtils.Utf8ZToString(npdm.Meta.ProgramName);
}
public static bool IsProgram64Bit(this MetaLoader metaLoader)
{
metaLoader.GetNpdm(out LibHac.Loader.Npdm npdm).ThrowIfFailure();
return (npdm.Meta.Flags & 1) != 0;
}
public static void LoadDefault(this MetaLoader metaLoader) public static void LoadDefault(this MetaLoader metaLoader)
{ {
byte[] npdmBuffer = EmbeddedResources.Read("Ryujinx.HLE/Homebrew.npdm"); byte[] npdmBuffer = EmbeddedResources.Read("Ryujinx.HLE/Homebrew.npdm");
metaLoader.Load(npdmBuffer).ThrowIfFailure(); metaLoader.Load(npdmBuffer).ThrowIfFailure();
} }
public static void LoadFromFile(this MetaLoader metaLoader, IFileSystem fileSystem, string path = "")
{
if (string.IsNullOrEmpty(path))
{
path = ProcessConst.MainNpdmPath;
}
using UniqueRef<IFile> npdmFile = new();
fileSystem.OpenFile(ref npdmFile.Ref, path.ToU8Span(), OpenMode.Read).ThrowIfFailure();
npdmFile.Get.GetSize(out long fileSize).ThrowIfFailure();
Span<byte> npdmBuffer = new byte[fileSize];
npdmFile.Get.Read(out _, 0, npdmBuffer).ThrowIfFailure();
metaLoader.Load(npdmBuffer).ThrowIfFailure();
}
} }
} }

View file

@ -44,7 +44,7 @@ namespace Ryujinx.HLE.Loaders.Processes.Extensions
// Collecting mods related to AocTitleIds and ProgramId. // Collecting mods related to AocTitleIds and ProgramId.
device.Configuration.VirtualFileSystem.ModLoader.CollectMods( device.Configuration.VirtualFileSystem.ModLoader.CollectMods(
device.Configuration.ContentManager.GetAocTitleIds().Prepend(metaLoader.GetProgramId()), device.Configuration.ContentManager.GetAocTitleIds().Prepend(metaLoader.ProgramId),
ModLoader.GetModsBasePath(), ModLoader.GetModsBasePath(),
ModLoader.GetSdModsBasePath()); ModLoader.GetSdModsBasePath());
@ -74,7 +74,7 @@ namespace Ryujinx.HLE.Loaders.Processes.Extensions
*/ */
ProcessResult processResult = exeFs.Load(device, nacpData, metaLoader, (byte)nca.GetProgramIndex()); ProcessResult processResult = exeFs.Load(device, nacpData, metaLoader, (byte)nca.ProgramIndex);
// Load RomFS. // Load RomFS.
if (romFs == null) if (romFs == null)
@ -99,38 +99,6 @@ namespace Ryujinx.HLE.Loaders.Processes.Extensions
return processResult; return processResult;
} }
public static ulong GetProgramIdBase(this Nca nca)
{
return nca.Header.TitleId & ~0x1FFFUL;
}
public static int GetProgramIndex(this Nca nca)
{
return (int)(nca.Header.TitleId & 0xF);
}
public static bool IsProgram(this Nca nca)
{
return nca.Header.ContentType == NcaContentType.Program;
}
public static bool IsMain(this Nca nca)
{
return nca.IsProgram() && !nca.IsPatch();
}
public static bool IsPatch(this Nca nca)
{
int dataIndex = Nca.GetSectionIndexFromType(NcaSectionType.Data, NcaContentType.Program);
return nca.IsProgram() && nca.SectionExists(NcaSectionType.Data) && nca.Header.GetFsHeader(dataIndex).IsPatchSection();
}
public static bool IsControl(this Nca nca)
{
return nca.Header.ContentType == NcaContentType.Control;
}
public static (Nca, Nca) GetUpdateData(this Nca mainNca, VirtualFileSystem fileSystem, IntegrityCheckLevel checkLevel, int programIndex, out string updatePath) public static (Nca, Nca) GetUpdateData(this Nca mainNca, VirtualFileSystem fileSystem, IntegrityCheckLevel checkLevel, int programIndex, out string updatePath)
{ {
updatePath = null; updatePath = null;
@ -140,7 +108,7 @@ namespace Ryujinx.HLE.Loaders.Processes.Extensions
Nca updateControlNca = null; Nca updateControlNca = null;
// Clear the program index part. // Clear the program index part.
ulong titleIdBase = mainNca.GetProgramIdBase(); ulong titleIdBase = mainNca.ProgramIdBase;
// Load update information if exists. // Load update information if exists.
string titleUpdateMetadataPath = Path.Combine(AppDataManager.GamesDirPath, titleIdBase.ToString("x16"), "updates.json"); string titleUpdateMetadataPath = Path.Combine(AppDataManager.GamesDirPath, titleIdBase.ToString("x16"), "updates.json");

View file

@ -118,7 +118,7 @@ namespace Ryujinx.HLE.Loaders.Processes.Extensions
device.Configuration.ContentManager.ClearAocData(); device.Configuration.ContentManager.ClearAocData();
// Load DownloadableContents. // Load DownloadableContents.
string addOnContentMetadataPath = System.IO.Path.Combine(AppDataManager.GamesDirPath, mainNca.GetProgramIdBase().ToString("x16"), "dlc.json"); string addOnContentMetadataPath = System.IO.Path.Combine(AppDataManager.GamesDirPath, mainNca.ProgramIdBase.ToString("x16"), "dlc.json");
if (File.Exists(addOnContentMetadataPath)) if (File.Exists(addOnContentMetadataPath))
{ {
List<DownloadableContentContainer> dlcContainerList = JsonHelper.DeserializeFromFile(addOnContentMetadataPath, _contentSerializerContext.ListDownloadableContentContainer); List<DownloadableContentContainer> dlcContainerList = JsonHelper.DeserializeFromFile(addOnContentMetadataPath, _contentSerializerContext.ListDownloadableContentContainer);
@ -149,14 +149,5 @@ namespace Ryujinx.HLE.Loaders.Processes.Extensions
return (false, ProcessResult.Failed); return (false, ProcessResult.Failed);
} }
public static Nca GetNca(this IFileSystem fileSystem, KeySet keySet, string path)
{
using UniqueRef<IFile> ncaFile = new();
fileSystem.OpenFile(ref ncaFile.Ref, path.ToU8Span(), OpenMode.Read).ThrowIfFailure();
return new Nca(keySet, ncaFile.Release().AsStorage());
}
} }
} }

View file

@ -17,7 +17,6 @@ using Ryujinx.HLE.HOS.Kernel.Common;
using Ryujinx.HLE.HOS.Kernel.Memory; using Ryujinx.HLE.HOS.Kernel.Memory;
using Ryujinx.HLE.HOS.Kernel.Process; using Ryujinx.HLE.HOS.Kernel.Process;
using Ryujinx.HLE.Loaders.Executables; using Ryujinx.HLE.Loaders.Executables;
using Ryujinx.HLE.Loaders.Processes.Extensions;
using Ryujinx.Horizon.Common; using Ryujinx.Horizon.Common;
using Ryujinx.Horizon.Sdk.Arp; using Ryujinx.Horizon.Sdk.Arp;
using System; using System;
@ -44,12 +43,12 @@ namespace Ryujinx.HLE.Loaders.Processes
{ {
Nca nca = partitionFileSystem.GetNca(device.FileSystem.KeySet, fileEntry.FullPath); Nca nca = partitionFileSystem.GetNca(device.FileSystem.KeySet, fileEntry.FullPath);
if (!nca.IsProgram()) if (!nca.IsProgram)
{ {
continue; continue;
} }
ulong currentMainProgramId = nca.GetProgramIdBase(); ulong currentMainProgramId = nca.ProgramIdBase;
if (applicationId == 0 && currentMainProgramId != 0) if (applicationId == 0 && currentMainProgramId != 0)
{ {
@ -66,7 +65,7 @@ namespace Ryujinx.HLE.Loaders.Processes
break; break;
} }
hasIndex[nca.GetProgramIndex()] = true; hasIndex[nca.ProgramIndex] = true;
} }
if (programCount == 0) if (programCount == 0)
@ -365,7 +364,7 @@ namespace Ryujinx.HLE.Loaders.Processes
string displayVersion; string displayVersion;
if (metaLoader.GetProgramId() > 0x0100000000007FFF) if (metaLoader.ProgramId > 0x0100000000007FFF)
{ {
displayVersion = applicationControlProperties.Value.DisplayVersionString.ToString(); displayVersion = applicationControlProperties.Value.DisplayVersionString.ToString();
} }

View file

@ -52,7 +52,7 @@ namespace Ryujinx.HLE.Loaders.Processes
if (metaLoader is not null) if (metaLoader is not null)
{ {
ulong programId = metaLoader.GetProgramId(); ulong programId = metaLoader.ProgramId;
Name = ApplicationControlProperties.Title[(int)titleLanguage].NameString.ToString(); Name = ApplicationControlProperties.Title[(int)titleLanguage].NameString.ToString();
@ -70,7 +70,7 @@ namespace Ryujinx.HLE.Loaders.Processes
DisplayVersion = ApplicationControlProperties.DisplayVersionString.ToString(); DisplayVersion = ApplicationControlProperties.DisplayVersionString.ToString();
ProgramId = programId; ProgramId = programId;
ProgramIdText = $"{programId:x16}"; ProgramIdText = $"{programId:x16}";
Is64Bit = metaLoader.IsProgram64Bit(); Is64Bit = metaLoader.IsProgram64Bit;
} }
DiskCacheEnabled = diskCacheEnabled; DiskCacheEnabled = diskCacheEnabled;

View file

@ -1,6 +1,4 @@
using Ryujinx.Common.Configuration.Hid; using Ryujinx.Common.Configuration.Hid;
using Ryujinx.Common.Configuration.Hid.Controller;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Numerics; using System.Numerics;

View file

@ -2,7 +2,6 @@ using Ryujinx.Common;
using Ryujinx.Common.Collections; using Ryujinx.Common.Collections;
using Ryujinx.Common.Memory.PartialUnmaps; using Ryujinx.Common.Memory.PartialUnmaps;
using System; using System;
using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.Versioning; using System.Runtime.Versioning;

View file

@ -11,7 +11,6 @@ using Ryujinx.Memory;
using Ryujinx.Memory.Tracking; using Ryujinx.Memory.Tracking;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Runtime.Versioning; using System.Runtime.Versioning;

View file

@ -119,7 +119,6 @@ namespace Ryujinx.Ava
=> ProcessUnhandledException(sender, e.Exception, false); => ProcessUnhandledException(sender, e.Exception, false);
AppDomain.CurrentDomain.ProcessExit += (_, _) => Exit(); AppDomain.CurrentDomain.ProcessExit += (_, _) => Exit();
// Setup base data directory. // Setup base data directory.
AppDataManager.Initialize(CommandLineState.BaseDirPathArg); AppDataManager.Initialize(CommandLineState.BaseDirPathArg);

View file

@ -4,7 +4,6 @@ using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Input; using Avalonia.Input;
using Avalonia.Threading; using Avalonia.Threading;
using DiscordRPC; using DiscordRPC;
using Gommon;
using LibHac.Common; using LibHac.Common;
using LibHac.Ns; using LibHac.Ns;
using Ryujinx.Audio.Backends.Dummy; using Ryujinx.Audio.Backends.Dummy;
@ -480,10 +479,7 @@ namespace Ryujinx.Ava.Systems
Dispatcher.UIThread.InvokeAsync(() => Dispatcher.UIThread.InvokeAsync(() =>
{ {
if (ConfigurationState.Instance.ShowOldUI) _viewModel.Title = TitleHelper.ActiveApplicationTitle(Device.Processes.ActiveApplication, Program.Version, !ConfigurationState.Instance.ShowOldUI);
{
_viewModel.Title = TitleHelper.ActiveApplicationTitle(Device.Processes.ActiveApplication, Program.Version, !ConfigurationState.Instance.ShowOldUI);
}
}); });
_viewModel.SetUiProgressHandlers(Device); _viewModel.SetUiProgressHandlers(Device);
@ -903,10 +899,7 @@ namespace Ryujinx.Ava.Systems
_viewModel.IsPaused = false; _viewModel.IsPaused = false;
_playTimer.Start(); _playTimer.Start();
if (ConfigurationState.Instance.ShowOldUI) _viewModel.Title = TitleHelper.ActiveApplicationTitle(Device?.Processes.ActiveApplication, Program.Version, !ConfigurationState.Instance.ShowOldUI);
{
_viewModel.Title = TitleHelper.ActiveApplicationTitle(Device?.Processes.ActiveApplication, Program.Version, !ConfigurationState.Instance.ShowOldUI);
}
Logger.Info?.Print(LogClass.Emulation, "Emulation was resumed"); Logger.Info?.Print(LogClass.Emulation, "Emulation was resumed");
} }
@ -916,10 +909,7 @@ namespace Ryujinx.Ava.Systems
_viewModel.IsPaused = true; _viewModel.IsPaused = true;
_playTimer.Stop(); _playTimer.Stop();
if (ConfigurationState.Instance.ShowOldUI) _viewModel.Title = TitleHelper.ActiveApplicationTitle(Device?.Processes.ActiveApplication, Program.Version, !ConfigurationState.Instance.ShowOldUI, LocaleManager.Instance[LocaleKeys.Paused]);
{
_viewModel.Title = TitleHelper.ActiveApplicationTitle(Device?.Processes.ActiveApplication, Program.Version, !ConfigurationState.Instance.ShowOldUI, LocaleManager.Instance[LocaleKeys.Paused]);
}
Logger.Info?.Print(LogClass.Emulation, "Emulation was paused"); Logger.Info?.Print(LogClass.Emulation, "Emulation was paused");
} }

View file

@ -1,7 +1,6 @@
using DynamicData; using DynamicData;
using DynamicData.Kernel; using DynamicData.Kernel;
using Gommon; using Gommon;
using LibHac;
using LibHac.Common; using LibHac.Common;
using LibHac.Fs; using LibHac.Fs;
using LibHac.Fs.Fsa; using LibHac.Fs.Fsa;
@ -469,7 +468,7 @@ namespace Ryujinx.Ava.Systems.AppLibrary
Nca nca = new(_virtualFileSystem.KeySet, new FileStream(applicationPath, FileMode.Open, FileAccess.Read).AsStorage()); Nca nca = new(_virtualFileSystem.KeySet, new FileStream(applicationPath, FileMode.Open, FileAccess.Read).AsStorage());
if (!nca.IsProgram() || nca.IsPatch()) if (!nca.IsProgram || nca.IsPatch)
{ {
return false; return false;
} }

View file

@ -1861,14 +1861,14 @@ namespace Ryujinx.Ava.UI.ViewModels
/// </summary> /// </summary>
public static void PreLaunchNotification() public static void PreLaunchNotification()
{ {
if (ConfigurationState.Instance.Debug.DebuggerSuspendOnStart.Value) if (ConfigurationState.Instance.Debug.DebuggerSuspendOnStart)
{ {
NotificationHelper.ShowInformation( NotificationHelper.ShowInformation(
LocaleManager.Instance[LocaleKeys.NotificationLaunchCheckSuspendOnStartTitle], LocaleManager.Instance[LocaleKeys.NotificationLaunchCheckSuspendOnStartTitle],
LocaleManager.Instance[LocaleKeys.NotificationLaunchCheckSuspendOnStartMessage]); LocaleManager.Instance[LocaleKeys.NotificationLaunchCheckSuspendOnStartMessage]);
} }
if (ConfigurationState.Instance.Debug.EnableGdbStub.Value) if (ConfigurationState.Instance.Debug.EnableGdbStub)
{ {
NotificationHelper.ShowInformation( NotificationHelper.ShowInformation(
LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.NotificationLaunchCheckGdbStubTitle, ConfigurationState.Instance.Debug.GdbStubPort.Value), LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.NotificationLaunchCheckGdbStubTitle, ConfigurationState.Instance.Debug.GdbStubPort.Value),
@ -1877,7 +1877,7 @@ namespace Ryujinx.Ava.UI.ViewModels
if (ConfigurationState.Instance.System.DramSize.Value != MemoryConfiguration.MemoryConfiguration4GiB) if (ConfigurationState.Instance.System.DramSize.Value != MemoryConfiguration.MemoryConfiguration4GiB)
{ {
var MemoryConfigurationLocaleKey = ConfigurationState.Instance.System.DramSize.Value switch var memoryConfigurationLocaleKey = ConfigurationState.Instance.System.DramSize.Value switch
{ {
MemoryConfiguration.MemoryConfiguration4GiB or MemoryConfiguration.MemoryConfiguration4GiB or
MemoryConfiguration.MemoryConfiguration4GiBAppletDev or MemoryConfiguration.MemoryConfiguration4GiBAppletDev or
@ -1889,10 +1889,11 @@ namespace Ryujinx.Ava.UI.ViewModels
_ => LocaleKeys.SettingsTabSystemDramSize4GiB, _ => LocaleKeys.SettingsTabSystemDramSize4GiB,
}; };
var MemoryConfigurationLocale = LocaleManager.Instance[MemoryConfigurationLocaleKey];
NotificationHelper.ShowWarning( NotificationHelper.ShowWarning(
LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.NotificationLaunchCheckDramSizeTitle, MemoryConfigurationLocale), LocaleManager.Instance.UpdateAndGetDynamicValue(
LocaleKeys.NotificationLaunchCheckDramSizeTitle,
LocaleManager.Instance[memoryConfigurationLocaleKey]
),
LocaleManager.Instance[LocaleKeys.NotificationLaunchCheckDramSizeMessage]); LocaleManager.Instance[LocaleKeys.NotificationLaunchCheckDramSizeMessage]);
} }
} }
@ -2348,24 +2349,23 @@ namespace Ryujinx.Ava.UI.ViewModels
Commands.CreateConditional<MainWindowViewModel>(vm => vm?.SelectedApplication != null, Commands.CreateConditional<MainWindowViewModel>(vm => vm?.SelectedApplication != null,
async viewModel => async viewModel =>
{ {
IReadOnlyList<IStorageFolder> result = await viewModel.StorageProvider.OpenFolderPickerAsync( Optional<IStorageFolder> resOpt = await viewModel.StorageProvider.OpenSingleFolderPickerAsync(
new FolderPickerOpenOptions new FolderPickerOpenOptions
{ {
Title = LocaleManager.Instance[LocaleKeys.FolderDialogExtractTitle], Title = LocaleManager.Instance[LocaleKeys.FolderDialogExtractTitle]
AllowMultiple = false,
}); });
if (result.Count == 0) if (!resOpt.TryGet(out IStorageFolder result))
return; return;
ApplicationHelper.ExtractSection( ApplicationHelper.ExtractSection(
result[0].Path.LocalPath, result.Path.LocalPath,
NcaSectionType.Logo, NcaSectionType.Logo,
viewModel.SelectedApplication.Path, viewModel.SelectedApplication.Path,
viewModel.SelectedApplication.Name); viewModel.SelectedApplication.Name);
IStorageFile iconFile = IStorageFile iconFile =
await result[0].CreateFileAsync($"{viewModel.SelectedApplication.IdString}.png"); await result.CreateFileAsync($"{viewModel.SelectedApplication.IdString}.png");
await using Stream fileStream = await iconFile.OpenWriteAsync(); await using Stream fileStream = await iconFile.OpenWriteAsync();
using SKBitmap bitmap = SKBitmap.Decode(viewModel.SelectedApplication.Icon) using SKBitmap bitmap = SKBitmap.Decode(viewModel.SelectedApplication.Icon)

View file

@ -139,15 +139,13 @@ namespace Ryujinx.Ava.UI.Windows
Executor.ExecuteBackgroundAsync(async () => Executor.ExecuteBackgroundAsync(async () =>
{ {
await ShowIntelMacWarningAsync(); await ShowIntelMacWarningAsync();
FilePath firmwarePath = CommandLineState.FirmwareToInstallPathArg; if (CommandLineState.FirmwareToInstallPathArg.TryGet(out FilePath fwPath))
if (firmwarePath is not null)
{ {
if ((firmwarePath.ExistsAsFile && firmwarePath.Extension is "xci" or "zip") || if (fwPath is { ExistsAsFile: true, Extension: "xci" or "zip" } || fwPath.ExistsAsDirectory)
firmwarePath.ExistsAsDirectory)
{ {
await Dispatcher.UIThread.InvokeAsync(() => await Dispatcher.UIThread.InvokeAsync(() =>
ViewModel.HandleFirmwareInstallation(firmwarePath)); ViewModel.HandleFirmwareInstallation(fwPath));
CommandLineState.FirmwareToInstallPathArg = null; CommandLineState.FirmwareToInstallPathArg = default;
} }
else else
Logger.Notice.Print(LogClass.UI, "Invalid firmware type provided. Path must be a directory, or a .zip or .xci file."); Logger.Notice.Print(LogClass.UI, "Invalid firmware type provided. Path must be a directory, or a .zip or .xci file.");

View file

@ -19,7 +19,7 @@ namespace Ryujinx.Ava.Utilities
public static string OverrideSystemLanguage { get; private set; } public static string OverrideSystemLanguage { get; private set; }
public static string OverrideHideCursor { get; private set; } public static string OverrideHideCursor { get; private set; }
public static string BaseDirPathArg { get; private set; } public static string BaseDirPathArg { get; private set; }
public static FilePath FirmwareToInstallPathArg { get; set; } public static Optional<FilePath> FirmwareToInstallPathArg { get; set; }
public static string Profile { get; private set; } public static string Profile { get; private set; }
public static string LaunchPathArg { get; private set; } public static string LaunchPathArg { get; private set; }
public static string LaunchApplicationId { get; private set; } public static string LaunchApplicationId { get; private set; }