mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-12-12 07:36:59 +00:00
chore: Overall code cleanup
Update NuGet packages, fix version string in plist for macOS
This commit is contained in:
parent
7175da8621
commit
c8959afa3d
55 changed files with 53 additions and 303 deletions
|
|
@ -40,11 +40,11 @@
|
|||
<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.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.UpdateClient" 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="Sep" Version="0.11.1" />
|
||||
<PackageVersion Include="shaderc.net" Version="0.1.0" />
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleLongVersionString</key>
|
||||
<string>%%RYUJINX_BUILD_VERSION%%-%%RYUJINX_BUILD_GIT_HASH%%"</string>
|
||||
<string>%%RYUJINX_BUILD_VERSION%%-%%RYUJINX_BUILD_GIT_HASH%%</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>Ryujinx</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
|
|
@ -44,13 +44,13 @@
|
|||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.2.0</string>
|
||||
<string>%%RYUJINX_BUILD_VERSION%%</string>
|
||||
<key>NSHighResolutionCapable</key>
|
||||
<true/>
|
||||
<key>CSResourcesFileMapped</key>
|
||||
<true/>
|
||||
<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>
|
||||
<string>public.app-category.games</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace ARMeilleure.CodeGen.X86
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ using ARMeilleure.CodeGen.RegisterAllocators;
|
|||
using ARMeilleure.IntermediateRepresentation;
|
||||
using Microsoft.IO;
|
||||
using Ryujinx.Common.Memory;
|
||||
using System.IO;
|
||||
using System.Numerics;
|
||||
|
||||
namespace ARMeilleure.CodeGen.X86
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace ARMeilleure.CodeGen.X86
|
||||
{
|
||||
enum X86Register
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ using ARMeilleure.Decoders;
|
|||
using ARMeilleure.IntermediateRepresentation;
|
||||
using ARMeilleure.Translation;
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using static ARMeilleure.Instructions.InstEmitHelper;
|
||||
|
||||
namespace ARMeilleure.Instructions
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace ARMeilleure.IntermediateRepresentation
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ using Ryujinx.Audio.Renderer.Common;
|
|||
using Ryujinx.Audio.Renderer.Server.Voice;
|
||||
using System;
|
||||
using Ryujinx.Audio.Renderer.Parameter;
|
||||
using Ryujinx.Memory;
|
||||
using WaveBuffer = Ryujinx.Audio.Renderer.Common.WaveBuffer;
|
||||
|
||||
namespace Ryujinx.Audio.Renderer.Dsp.Command
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using Ryujinx.Audio.Renderer.Server.Splitter;
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace Ryujinx.Audio.Renderer.Dsp.Command
|
||||
|
|
|
|||
|
|
@ -1,9 +1,6 @@
|
|||
using Ryujinx.Audio.Common;
|
||||
using Ryujinx.Audio.Renderer.Common;
|
||||
using Ryujinx.Audio.Renderer.Dsp;
|
||||
using Ryujinx.Common.Memory;
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Audio.Renderer.Parameter
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ using Ryujinx.Audio.Renderer.Server.Upsampler;
|
|||
using Ryujinx.Audio.Renderer.Server.Voice;
|
||||
using Ryujinx.Common;
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using CpuAddress = System.UInt64;
|
||||
|
||||
namespace Ryujinx.Audio.Renderer.Server
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
using Ryujinx.Audio.Common;
|
||||
using Ryujinx.Audio.Renderer.Common;
|
||||
using Ryujinx.Audio.Renderer.Dsp;
|
||||
using Ryujinx.Audio.Renderer.Dsp.Command;
|
||||
using Ryujinx.Audio.Renderer.Dsp.State;
|
||||
using Ryujinx.Audio.Renderer.Parameter;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
using Ryujinx.Audio.Renderer.Dsp;
|
||||
using Ryujinx.Audio.Renderer.Parameter;
|
||||
using Ryujinx.Common.Memory;
|
||||
using Ryujinx.Common.Utilities;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ using System.Collections.Generic;
|
|||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
using static Ryujinx.Audio.Renderer.Common.BehaviourParameter;
|
||||
using static Ryujinx.Audio.Renderer.Parameter.VoiceInParameter1;
|
||||
using PlayState = Ryujinx.Audio.Renderer.Server.Types.PlayState;
|
||||
|
||||
namespace Ryujinx.Audio.Renderer.Server.Voice
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Ryujinx.Common.Logging
|
||||
{
|
||||
[JsonSerializable(typeof(LogEventArgsJson))]
|
||||
internal partial class LogEventJsonSerializerContext : JsonSerializerContext
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
@ -230,14 +230,14 @@ namespace Ryujinx.Common.Logging
|
|||
switch (logLevel)
|
||||
{
|
||||
#pragma warning disable IDE0055 // Disable formatting
|
||||
case LogLevel.Debug : Debug = enabled ? new Log(LogLevel.Debug) : new Log?(); break;
|
||||
case LogLevel.Info : Info = enabled ? new Log(LogLevel.Info) : new Log?(); break;
|
||||
case LogLevel.Warning : Warning = enabled ? new Log(LogLevel.Warning) : new Log?(); break;
|
||||
case LogLevel.Error : Error = enabled ? new Log(LogLevel.Error) : new Log?(); break;
|
||||
case LogLevel.Guest : Guest = enabled ? new Log(LogLevel.Guest) : new Log?(); break;
|
||||
case LogLevel.AccessLog : AccessLog = enabled ? new Log(LogLevel.AccessLog) : new Log?(); break;
|
||||
case LogLevel.Stub : Stub = enabled ? new Log(LogLevel.Stub) : new Log?(); break;
|
||||
case LogLevel.Trace : Trace = enabled ? new Log(LogLevel.Trace) : new Log?(); break;
|
||||
case LogLevel.Debug : Debug = enabled ? new Log(LogLevel.Debug) : null; break;
|
||||
case LogLevel.Info : Info = enabled ? new Log(LogLevel.Info) : null; break;
|
||||
case LogLevel.Warning : Warning = enabled ? new Log(LogLevel.Warning) : null; break;
|
||||
case LogLevel.Error : Error = enabled ? new Log(LogLevel.Error) : null; break;
|
||||
case LogLevel.Guest : Guest = enabled ? new Log(LogLevel.Guest) : null; break;
|
||||
case LogLevel.AccessLog : AccessLog = enabled ? new Log(LogLevel.AccessLog) : null; break;
|
||||
case LogLevel.Stub : Stub = enabled ? new Log(LogLevel.Stub) : null; break;
|
||||
case LogLevel.Trace : Trace = enabled ? new Log(LogLevel.Trace) : null; break;
|
||||
case LogLevel.Notice : break;
|
||||
default: throw new ArgumentException("Unknown Log Level", nameof(logLevel));
|
||||
#pragma warning restore IDE0055
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Threading;
|
||||
|
||||
namespace Ryujinx.Common
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,10 +1,5 @@
|
|||
using Ryujinx.Common.Utilities;
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Json;
|
||||
using System.Reflection;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ryujinx.Common
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
using ARMeilleure.State;
|
||||
using System;
|
||||
using System.Threading;
|
||||
|
||||
namespace Ryujinx.Cpu
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
using ARMeilleure;
|
||||
using ARMeilleure.Memory;
|
||||
using ARMeilleure.State;
|
||||
using System;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL
|
||||
{
|
||||
public enum ViewportSwizzle
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
||||
{
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
using Ryujinx.Common.Memory;
|
||||
using Ryujinx.Graphics.GAL;
|
||||
using Ryujinx.Graphics.Gpu.Engine.Types;
|
||||
using Ryujinx.Graphics.Gpu.Shader;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
using Ryujinx.Common.Memory;
|
||||
using Ryujinx.Graphics.Device;
|
||||
using Ryujinx.Graphics.GAL;
|
||||
using Ryujinx.Graphics.Gpu.Engine.GPFifo;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
using Ryujinx.Graphics.GAL;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Ryujinx.Graphics.Gpu.Image
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
using Ryujinx.Graphics.GAL;
|
||||
using Ryujinx.Memory.Range;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Ryujinx.Graphics.Gpu.Memory
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
using Ryujinx.Memory.Range;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Ryujinx.Graphics.Gpu.Memory
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Ryujinx.Graphics.Shader.CodeGen.Glsl.Instructions
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Ryujinx.Graphics.Shader.IntermediateRepresentation
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Ryujinx.Graphics.Shader.Translation
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.Common.Memory;
|
||||
using Ryujinx.Graphics.Texture;
|
||||
using Ryujinx.Graphics.Vic.Types;
|
||||
using System;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ using Ryujinx.Graphics.Shader;
|
|||
using Ryujinx.Graphics.Shader.Translation;
|
||||
using Silk.NET.Vulkan;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using Buffer = Silk.NET.Vulkan.Buffer;
|
||||
using CompareOp = Ryujinx.Graphics.GAL.CompareOp;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
using Ryujinx.Graphics.GAL;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Graphics.Vulkan
|
||||
|
|
|
|||
|
|
@ -1,12 +1,8 @@
|
|||
using Gommon;
|
||||
using JetBrains.Annotations;
|
||||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.HLE.HOS.Kernel.Process;
|
||||
using Ryujinx.HLE.HOS.Kernel.Threading;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Ryujinx.HLE.Debugger
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ using Ryujinx.HLE.HOS.Kernel.Process;
|
|||
using Ryujinx.HLE.HOS.Kernel.Threading;
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Net.Sockets;
|
||||
using System.Threading;
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ namespace Ryujinx.HLE.FileSystem
|
|||
string ncaId = Convert.ToHexStringLower(entry.NcaId).Replace("-", null);
|
||||
Nca nca = _pfs.GetNca(keySet, $"/{ncaId}.nca");
|
||||
|
||||
if (nca.GetProgramIndex() == programIndex)
|
||||
if (nca.ProgramIndex == programIndex)
|
||||
{
|
||||
return nca;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
ulong programId = metaLoader.GetProgramId();
|
||||
ulong programId = metaLoader.ProgramId;
|
||||
|
||||
// Replace the whole ExeFs partition by the modded one.
|
||||
if (device.Configuration.VirtualFileSystem.ModLoader.ReplaceExefsPartition(programId, ref exeFs))
|
||||
|
|
@ -118,13 +118,13 @@ namespace Ryujinx.HLE.Loaders.Processes.Extensions
|
|||
modLoadResult.Hash,
|
||||
true,
|
||||
programName,
|
||||
metaLoader.GetProgramId(),
|
||||
programId,
|
||||
programIndex,
|
||||
null,
|
||||
nsoExecutables);
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ namespace Ryujinx.HLE.Loaders.Processes
|
|||
{
|
||||
MetaLoader metaLoader = exeFs.GetNpdm();
|
||||
BlitStruct<ApplicationControlProperty> nacpData = new(1);
|
||||
ulong programId = metaLoader.GetProgramId();
|
||||
ulong programId = metaLoader.ProgramId;
|
||||
|
||||
device.Configuration.VirtualFileSystem.ModLoader.CollectMods([programId]);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,61 +1,15 @@
|
|||
using LibHac.Common;
|
||||
using LibHac.Fs;
|
||||
using LibHac.Fs.Fsa;
|
||||
using LibHac.Loader;
|
||||
using LibHac.Util;
|
||||
using Ryujinx.Common;
|
||||
using System;
|
||||
|
||||
namespace Ryujinx.HLE.Loaders.Processes.Extensions
|
||||
{
|
||||
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)
|
||||
{
|
||||
byte[] npdmBuffer = EmbeddedResources.Read("Ryujinx.HLE/Homebrew.npdm");
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ namespace Ryujinx.HLE.Loaders.Processes.Extensions
|
|||
|
||||
// Collecting mods related to AocTitleIds and ProgramId.
|
||||
device.Configuration.VirtualFileSystem.ModLoader.CollectMods(
|
||||
device.Configuration.ContentManager.GetAocTitleIds().Prepend(metaLoader.GetProgramId()),
|
||||
device.Configuration.ContentManager.GetAocTitleIds().Prepend(metaLoader.ProgramId),
|
||||
ModLoader.GetModsBasePath(),
|
||||
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.
|
||||
if (romFs == null)
|
||||
|
|
@ -99,38 +99,6 @@ namespace Ryujinx.HLE.Loaders.Processes.Extensions
|
|||
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)
|
||||
{
|
||||
updatePath = null;
|
||||
|
|
@ -140,7 +108,7 @@ namespace Ryujinx.HLE.Loaders.Processes.Extensions
|
|||
Nca updateControlNca = null;
|
||||
|
||||
// Clear the program index part.
|
||||
ulong titleIdBase = mainNca.GetProgramIdBase();
|
||||
ulong titleIdBase = mainNca.ProgramIdBase;
|
||||
|
||||
// Load update information if exists.
|
||||
string titleUpdateMetadataPath = Path.Combine(AppDataManager.GamesDirPath, titleIdBase.ToString("x16"), "updates.json");
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ namespace Ryujinx.HLE.Loaders.Processes.Extensions
|
|||
device.Configuration.ContentManager.ClearAocData();
|
||||
|
||||
// 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))
|
||||
{
|
||||
List<DownloadableContentContainer> dlcContainerList = JsonHelper.DeserializeFromFile(addOnContentMetadataPath, _contentSerializerContext.ListDownloadableContentContainer);
|
||||
|
|
@ -149,14 +149,5 @@ namespace Ryujinx.HLE.Loaders.Processes.Extensions
|
|||
|
||||
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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ using Ryujinx.HLE.HOS.Kernel.Common;
|
|||
using Ryujinx.HLE.HOS.Kernel.Memory;
|
||||
using Ryujinx.HLE.HOS.Kernel.Process;
|
||||
using Ryujinx.HLE.Loaders.Executables;
|
||||
using Ryujinx.HLE.Loaders.Processes.Extensions;
|
||||
using Ryujinx.Horizon.Common;
|
||||
using Ryujinx.Horizon.Sdk.Arp;
|
||||
using System;
|
||||
|
|
@ -44,12 +43,12 @@ namespace Ryujinx.HLE.Loaders.Processes
|
|||
{
|
||||
Nca nca = partitionFileSystem.GetNca(device.FileSystem.KeySet, fileEntry.FullPath);
|
||||
|
||||
if (!nca.IsProgram())
|
||||
if (!nca.IsProgram)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
ulong currentMainProgramId = nca.GetProgramIdBase();
|
||||
ulong currentMainProgramId = nca.ProgramIdBase;
|
||||
|
||||
if (applicationId == 0 && currentMainProgramId != 0)
|
||||
{
|
||||
|
|
@ -66,7 +65,7 @@ namespace Ryujinx.HLE.Loaders.Processes
|
|||
break;
|
||||
}
|
||||
|
||||
hasIndex[nca.GetProgramIndex()] = true;
|
||||
hasIndex[nca.ProgramIndex] = true;
|
||||
}
|
||||
|
||||
if (programCount == 0)
|
||||
|
|
@ -365,7 +364,7 @@ namespace Ryujinx.HLE.Loaders.Processes
|
|||
|
||||
string displayVersion;
|
||||
|
||||
if (metaLoader.GetProgramId() > 0x0100000000007FFF)
|
||||
if (metaLoader.ProgramId > 0x0100000000007FFF)
|
||||
{
|
||||
displayVersion = applicationControlProperties.Value.DisplayVersionString.ToString();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ namespace Ryujinx.HLE.Loaders.Processes
|
|||
|
||||
if (metaLoader is not null)
|
||||
{
|
||||
ulong programId = metaLoader.GetProgramId();
|
||||
ulong programId = metaLoader.ProgramId;
|
||||
|
||||
Name = ApplicationControlProperties.Title[(int)titleLanguage].NameString.ToString();
|
||||
|
||||
|
|
@ -70,7 +70,7 @@ namespace Ryujinx.HLE.Loaders.Processes
|
|||
DisplayVersion = ApplicationControlProperties.DisplayVersionString.ToString();
|
||||
ProgramId = programId;
|
||||
ProgramIdText = $"{programId:x16}";
|
||||
Is64Bit = metaLoader.IsProgram64Bit();
|
||||
Is64Bit = metaLoader.IsProgram64Bit;
|
||||
}
|
||||
|
||||
DiskCacheEnabled = diskCacheEnabled;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
using Ryujinx.Common.Configuration.Hid;
|
||||
using Ryujinx.Common.Configuration.Hid.Controller;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ using Ryujinx.Common;
|
|||
using Ryujinx.Common.Collections;
|
||||
using Ryujinx.Common.Memory.PartialUnmaps;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.Versioning;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ using Ryujinx.Memory;
|
|||
using Ryujinx.Memory.Tracking;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Versioning;
|
||||
|
|
|
|||
|
|
@ -119,7 +119,6 @@ namespace Ryujinx.Ava
|
|||
=> ProcessUnhandledException(sender, e.Exception, false);
|
||||
AppDomain.CurrentDomain.ProcessExit += (_, _) => Exit();
|
||||
|
||||
|
||||
// Setup base data directory.
|
||||
AppDataManager.Initialize(CommandLineState.BaseDirPathArg);
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ using Avalonia.Controls.ApplicationLifetimes;
|
|||
using Avalonia.Input;
|
||||
using Avalonia.Threading;
|
||||
using DiscordRPC;
|
||||
using Gommon;
|
||||
using LibHac.Common;
|
||||
using LibHac.Ns;
|
||||
using Ryujinx.Audio.Backends.Dummy;
|
||||
|
|
@ -479,11 +478,8 @@ namespace Ryujinx.Ava.Systems
|
|||
_viewModel.IsGameRunning = true;
|
||||
|
||||
Dispatcher.UIThread.InvokeAsync(() =>
|
||||
{
|
||||
if (ConfigurationState.Instance.ShowOldUI)
|
||||
{
|
||||
_viewModel.Title = TitleHelper.ActiveApplicationTitle(Device.Processes.ActiveApplication, Program.Version, !ConfigurationState.Instance.ShowOldUI);
|
||||
}
|
||||
});
|
||||
|
||||
_viewModel.SetUiProgressHandlers(Device);
|
||||
|
|
@ -903,10 +899,7 @@ namespace Ryujinx.Ava.Systems
|
|||
|
||||
_viewModel.IsPaused = false;
|
||||
_playTimer.Start();
|
||||
if (ConfigurationState.Instance.ShowOldUI)
|
||||
{
|
||||
_viewModel.Title = TitleHelper.ActiveApplicationTitle(Device?.Processes.ActiveApplication, Program.Version, !ConfigurationState.Instance.ShowOldUI);
|
||||
}
|
||||
Logger.Info?.Print(LogClass.Emulation, "Emulation was resumed");
|
||||
}
|
||||
|
||||
|
|
@ -916,10 +909,7 @@ namespace Ryujinx.Ava.Systems
|
|||
|
||||
_viewModel.IsPaused = true;
|
||||
_playTimer.Stop();
|
||||
if (ConfigurationState.Instance.ShowOldUI)
|
||||
{
|
||||
_viewModel.Title = TitleHelper.ActiveApplicationTitle(Device?.Processes.ActiveApplication, Program.Version, !ConfigurationState.Instance.ShowOldUI, LocaleManager.Instance[LocaleKeys.Paused]);
|
||||
}
|
||||
Logger.Info?.Print(LogClass.Emulation, "Emulation was paused");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
using DynamicData;
|
||||
using DynamicData.Kernel;
|
||||
using Gommon;
|
||||
using LibHac;
|
||||
using LibHac.Common;
|
||||
using LibHac.Fs;
|
||||
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());
|
||||
|
||||
if (!nca.IsProgram() || nca.IsPatch())
|
||||
if (!nca.IsProgram || nca.IsPatch)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1861,14 +1861,14 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||
/// </summary>
|
||||
public static void PreLaunchNotification()
|
||||
{
|
||||
if (ConfigurationState.Instance.Debug.DebuggerSuspendOnStart.Value)
|
||||
if (ConfigurationState.Instance.Debug.DebuggerSuspendOnStart)
|
||||
{
|
||||
NotificationHelper.ShowInformation(
|
||||
LocaleManager.Instance[LocaleKeys.NotificationLaunchCheckSuspendOnStartTitle],
|
||||
LocaleManager.Instance[LocaleKeys.NotificationLaunchCheckSuspendOnStartMessage]);
|
||||
}
|
||||
|
||||
if (ConfigurationState.Instance.Debug.EnableGdbStub.Value)
|
||||
if (ConfigurationState.Instance.Debug.EnableGdbStub)
|
||||
{
|
||||
NotificationHelper.ShowInformation(
|
||||
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)
|
||||
{
|
||||
var MemoryConfigurationLocaleKey = ConfigurationState.Instance.System.DramSize.Value switch
|
||||
var memoryConfigurationLocaleKey = ConfigurationState.Instance.System.DramSize.Value switch
|
||||
{
|
||||
MemoryConfiguration.MemoryConfiguration4GiB or
|
||||
MemoryConfiguration.MemoryConfiguration4GiBAppletDev or
|
||||
|
|
@ -1889,10 +1889,11 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||
_ => LocaleKeys.SettingsTabSystemDramSize4GiB,
|
||||
};
|
||||
|
||||
var MemoryConfigurationLocale = LocaleManager.Instance[MemoryConfigurationLocaleKey];
|
||||
|
||||
NotificationHelper.ShowWarning(
|
||||
LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.NotificationLaunchCheckDramSizeTitle, MemoryConfigurationLocale),
|
||||
LocaleManager.Instance.UpdateAndGetDynamicValue(
|
||||
LocaleKeys.NotificationLaunchCheckDramSizeTitle,
|
||||
LocaleManager.Instance[memoryConfigurationLocaleKey]
|
||||
),
|
||||
LocaleManager.Instance[LocaleKeys.NotificationLaunchCheckDramSizeMessage]);
|
||||
}
|
||||
}
|
||||
|
|
@ -2348,24 +2349,23 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||
Commands.CreateConditional<MainWindowViewModel>(vm => vm?.SelectedApplication != null,
|
||||
async viewModel =>
|
||||
{
|
||||
IReadOnlyList<IStorageFolder> result = await viewModel.StorageProvider.OpenFolderPickerAsync(
|
||||
Optional<IStorageFolder> resOpt = await viewModel.StorageProvider.OpenSingleFolderPickerAsync(
|
||||
new FolderPickerOpenOptions
|
||||
{
|
||||
Title = LocaleManager.Instance[LocaleKeys.FolderDialogExtractTitle],
|
||||
AllowMultiple = false,
|
||||
Title = LocaleManager.Instance[LocaleKeys.FolderDialogExtractTitle]
|
||||
});
|
||||
|
||||
if (result.Count == 0)
|
||||
if (!resOpt.TryGet(out IStorageFolder result))
|
||||
return;
|
||||
|
||||
ApplicationHelper.ExtractSection(
|
||||
result[0].Path.LocalPath,
|
||||
result.Path.LocalPath,
|
||||
NcaSectionType.Logo,
|
||||
viewModel.SelectedApplication.Path,
|
||||
viewModel.SelectedApplication.Name);
|
||||
|
||||
IStorageFile iconFile =
|
||||
await result[0].CreateFileAsync($"{viewModel.SelectedApplication.IdString}.png");
|
||||
await result.CreateFileAsync($"{viewModel.SelectedApplication.IdString}.png");
|
||||
await using Stream fileStream = await iconFile.OpenWriteAsync();
|
||||
|
||||
using SKBitmap bitmap = SKBitmap.Decode(viewModel.SelectedApplication.Icon)
|
||||
|
|
|
|||
|
|
@ -139,15 +139,13 @@ namespace Ryujinx.Ava.UI.Windows
|
|||
Executor.ExecuteBackgroundAsync(async () =>
|
||||
{
|
||||
await ShowIntelMacWarningAsync();
|
||||
FilePath firmwarePath = CommandLineState.FirmwareToInstallPathArg;
|
||||
if (firmwarePath is not null)
|
||||
if (CommandLineState.FirmwareToInstallPathArg.TryGet(out FilePath fwPath))
|
||||
{
|
||||
if ((firmwarePath.ExistsAsFile && firmwarePath.Extension is "xci" or "zip") ||
|
||||
firmwarePath.ExistsAsDirectory)
|
||||
if (fwPath is { ExistsAsFile: true, Extension: "xci" or "zip" } || fwPath.ExistsAsDirectory)
|
||||
{
|
||||
await Dispatcher.UIThread.InvokeAsync(() =>
|
||||
ViewModel.HandleFirmwareInstallation(firmwarePath));
|
||||
CommandLineState.FirmwareToInstallPathArg = null;
|
||||
ViewModel.HandleFirmwareInstallation(fwPath));
|
||||
CommandLineState.FirmwareToInstallPathArg = default;
|
||||
}
|
||||
else
|
||||
Logger.Notice.Print(LogClass.UI, "Invalid firmware type provided. Path must be a directory, or a .zip or .xci file.");
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ namespace Ryujinx.Ava.Utilities
|
|||
public static string OverrideSystemLanguage { get; private set; }
|
||||
public static string OverrideHideCursor { 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 LaunchPathArg { get; private set; }
|
||||
public static string LaunchApplicationId { get; private set; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue