Merge branch 'compile-messages-fixes' into 'master'

Cleanup and style improvements

See merge request [ryubing/ryujinx!93](https://git.ryujinx.app/ryubing/ryujinx/-/merge_requests/93)
merge-requests/93/merge
MrKev 2025-08-29 22:54:11 -05:00
commit dafe47860b
28 changed files with 106 additions and 101 deletions

View File

@ -262,6 +262,7 @@ dotnet_diagnostic.IDE0301.severity = none
dotnet_diagnostic.IDE0302.severity = none dotnet_diagnostic.IDE0302.severity = none
dotnet_diagnostic.IDE0305.severity = none dotnet_diagnostic.IDE0305.severity = none
dotnet_diagnostic.CS9113.severity = none # CS9113: Parameter 'value' is unread 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 dotnet_diagnostic.IDE0130.severity = none # IDE0130: Namespace does not match folder structure
[src/Ryujinx/UI/ViewModels/**.cs] [src/Ryujinx/UI/ViewModels/**.cs]

View File

@ -25,7 +25,9 @@ namespace Ryujinx.Audio.Backends.SDL2
// TODO: Add this to SDL2-CS // TODO: Add this to SDL2-CS
// NOTE: We use a DllImport here because of marshaling issue for spec. // NOTE: We use a DllImport here because of marshaling issue for spec.
[DllImport("SDL2")] [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); 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() public SDL2HardwareDeviceDriver()
{ {

View File

@ -36,8 +36,6 @@ namespace Ryujinx.Common.Configuration
}; };
} }
public static float ToFloatY(this AspectRatio aspectRatio) public static float ToFloatY(this AspectRatio aspectRatio)
{ {
return aspectRatio switch return aspectRatio switch

View File

@ -18,8 +18,6 @@ namespace Ryujinx.Common.Configuration
public DirtyHack Hack => hack; public DirtyHack Hack => hack;
public int Value => value; public int Value => value;
public ulong Pack() => Raw.PackBitFields(PackedFormat); public ulong Pack() => Raw.PackBitFields(PackedFormat);
public static EnabledDirtyHack Unpack(ulong packedHack) public static EnabledDirtyHack Unpack(ulong packedHack)

View File

@ -37,6 +37,4 @@ namespace Ryujinx.Common
? $"https://git.ryujinx.app/ryubing/ryujinx/-/compare/Canary-{currentVersion}...Canary-{newVersion}" ? $"https://git.ryujinx.app/ryubing/ryujinx/-/compare/Canary-{currentVersion}...Canary-{newVersion}"
: $"https://git.ryujinx.app/ryubing/ryujinx/-/releases/{newVersion}"; : $"https://git.ryujinx.app/ryubing/ryujinx/-/releases/{newVersion}";
} }
} }

View File

@ -32,7 +32,6 @@ namespace Ryujinx.Common.Utilities
CyclingEnabled = false; CyclingEnabled = false;
} }
public static float Speed { get; set; } = 1; public static float Speed { get; set; } = 1;
private static readonly Lock _lock = new(); private static readonly Lock _lock = new();

View File

@ -15,7 +15,6 @@ namespace Ryujinx.Cpu
/// <inheritdoc/> /// <inheritdoc/>
public ulong Counter => (ulong)(ElapsedSeconds * Frequency); public ulong Counter => (ulong)(ElapsedSeconds * Frequency);
public long TickScalar { get; set; } public long TickScalar { get; set; }
private static long _acumElapsedTicks; private static long _acumElapsedTicks;

View File

@ -98,7 +98,6 @@ namespace Ryujinx.Graphics.Gpu
/// </summary> /// </summary>
internal DirtyHacks DirtyHacks { get; } internal DirtyHacks DirtyHacks { get; }
/// <summary> /// <summary>
/// Host hardware capabilities. /// Host hardware capabilities.
/// </summary> /// </summary>

View File

@ -701,7 +701,9 @@ namespace Ryujinx.Graphics.Vulkan
_vertexBufferUpdater.Commit(Cbs); _vertexBufferUpdater.Commit(Cbs);
} }
#pragma warning disable CA1822 // Mark members as static
public void SetAlphaTest(bool enable, float reference, CompareOp op) 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. // 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, // In the future, we may want to use this to write the reference value into the support buffer,
@ -902,12 +904,16 @@ namespace Ryujinx.Graphics.Vulkan
// TODO: Default levels (likely needs emulation on shaders?) // 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) public void SetPointParameters(float size, bool isProgramPointSize, bool enablePointSprite, Origin origin)
#pragma warning restore CA1822 // Mark members as static
{ {
// TODO. // TODO.
} }
#pragma warning disable CA1822 // Mark members as static
public void SetPolygonMode(PolygonMode frontMode, PolygonMode backMode) public void SetPolygonMode(PolygonMode frontMode, PolygonMode backMode)
#pragma warning restore CA1822 // Mark members as static
{ {
// TODO. // TODO.
} }
@ -1157,7 +1163,9 @@ namespace Ryujinx.Graphics.Vulkan
_descriptorSetUpdater.SetUniformBuffers(CommandBuffer, buffers); _descriptorSetUpdater.SetUniformBuffers(CommandBuffer, buffers);
} }
#pragma warning disable CA1822 // Mark members as static
public void SetUserClipDistance(int index, bool enableClip) public void SetUserClipDistance(int index, bool enableClip)
#pragma warning restore CA1822 // Mark members as static
{ {
// TODO. // TODO.
} }

View File

@ -184,7 +184,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
[Svc(0x5f)] [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. // 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. // 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)] [Svc(0x22)]
public Result SendSyncRequestWithUserBuffer( public static Result SendSyncRequestWithUserBuffer(
[PointerSized] ulong messagePtr, [PointerSized] ulong messagePtr,
[PointerSized] ulong messageSize, [PointerSized] ulong messageSize,
int handle) int handle)
@ -901,7 +901,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
[Svc(2)] [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)) if (!PageAligned(address))
{ {
@ -934,7 +934,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
[Svc(3)] [Svc(3)]
public Result SetMemoryAttribute( public static Result SetMemoryAttribute(
[PointerSized] ulong address, [PointerSized] ulong address,
[PointerSized] ulong size, [PointerSized] ulong size,
MemoryAttribute attributeMask, MemoryAttribute attributeMask,
@ -983,7 +983,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
[Svc(4)] [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)) if (!PageAligned(src | dst))
{ {
@ -1020,7 +1020,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
[Svc(5)] [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)) if (!PageAligned(src | dst))
{ {
@ -1057,7 +1057,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
[Svc(6)] [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); Result result = QueryMemory(out MemoryInfo info, out pageInfo, address);
@ -1092,7 +1092,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
[Svc(0x13)] [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)) if (!PageAligned(address))
{ {
@ -1139,7 +1139,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
[Svc(0x14)] [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)) if (!PageAligned(address))
{ {
@ -1244,7 +1244,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
[Svc(0x51)] [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)) if (!PageAligned(address))
{ {
@ -1291,7 +1291,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
[Svc(0x52)] [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)) if (!PageAligned(address))
{ {
@ -1332,7 +1332,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
[Svc(0x2c)] [Svc(0x2c)]
public Result MapPhysicalMemory([PointerSized] ulong address, [PointerSized] ulong size) public static Result MapPhysicalMemory([PointerSized] ulong address, [PointerSized] ulong size)
{ {
if (!PageAligned(address)) if (!PageAligned(address))
{ {
@ -1368,7 +1368,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
[Svc(0x2d)] [Svc(0x2d)]
public Result UnmapPhysicalMemory([PointerSized] ulong address, [PointerSized] ulong size) public static Result UnmapPhysicalMemory([PointerSized] ulong address, [PointerSized] ulong size)
{ {
if (!PageAligned(address)) if (!PageAligned(address))
{ {
@ -1445,7 +1445,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
[Svc(0x4c)] [Svc(0x4c)]
public Result ControlCodeMemory( public static Result ControlCodeMemory(
int handle, int handle,
CodeMemoryOperation op, CodeMemoryOperation op,
ulong address, ulong address,
@ -1524,7 +1524,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
[Svc(0x73)] [Svc(0x73)]
public Result SetProcessMemoryPermission( public static Result SetProcessMemoryPermission(
int handle, int handle,
ulong src, ulong src,
ulong size, ulong size,
@ -1566,7 +1566,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
[Svc(0x74)] [Svc(0x74)]
public Result MapProcessMemory( public static Result MapProcessMemory(
[PointerSized] ulong dst, [PointerSized] ulong dst,
int handle, int handle,
ulong src, ulong src,
@ -1623,7 +1623,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
[Svc(0x75)] [Svc(0x75)]
public Result UnmapProcessMemory( public static Result UnmapProcessMemory(
[PointerSized] ulong dst, [PointerSized] ulong dst,
int handle, int handle,
ulong src, ulong src,
@ -1669,7 +1669,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
[Svc(0x77)] [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)) if (!PageAligned(dst) || !PageAligned(src))
{ {
@ -1707,7 +1707,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
[Svc(0x78)] [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)) if (!PageAligned(dst) || !PageAligned(src))
{ {
@ -1752,7 +1752,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
// System // System
[Svc(0x7b)] [Svc(0x7b)]
public Result TerminateProcess(int handle) public static Result TerminateProcess(int handle)
{ {
KProcess process = KernelStatic.GetCurrentProcess(); KProcess process = KernelStatic.GetCurrentProcess();
@ -1782,7 +1782,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
[Svc(7)] [Svc(7)]
public void ExitProcess() public static void ExitProcess()
{ {
KernelStatic.GetCurrentProcess().TerminateCurrentProcess(); KernelStatic.GetCurrentProcess().TerminateCurrentProcess();
} }
@ -1878,7 +1878,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
[Svc(0x26)] [Svc(0x26)]
public void Break(ulong reason) public static void Break(ulong reason)
{ {
KThread currentThread = KernelStatic.GetCurrentThread(); KThread currentThread = KernelStatic.GetCurrentThread();
@ -1905,7 +1905,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
[Svc(0x27)] [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(); KProcess process = KernelStatic.GetCurrentProcess();
@ -2371,7 +2371,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
[Svc(0x30)] [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; limitValue = 0;
@ -2393,7 +2393,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
[Svc(0x31)] [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; limitValue = 0;
@ -2415,7 +2415,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
[Svc(0x37)] [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; peak = 0;
@ -2447,7 +2447,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
[Svc(0x7e)] [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) if (resource >= LimitableResource.Count)
{ {
@ -2542,7 +2542,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
[Svc(9)] [Svc(9)]
public Result StartThread(int handle) public static Result StartThread(int handle)
{ {
KProcess process = KernelStatic.GetCurrentProcess(); KProcess process = KernelStatic.GetCurrentProcess();
@ -2570,7 +2570,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
[Svc(0xa)] [Svc(0xa)]
public void ExitThread() public static void ExitThread()
{ {
KThread currentThread = KernelStatic.GetCurrentThread(); KThread currentThread = KernelStatic.GetCurrentThread();
@ -2602,7 +2602,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
[Svc(0xc)] [Svc(0xc)]
public Result GetThreadPriority(out int priority, int handle) public static Result GetThreadPriority(out int priority, int handle)
{ {
KProcess process = KernelStatic.GetCurrentProcess(); KProcess process = KernelStatic.GetCurrentProcess();
@ -2623,7 +2623,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
[Svc(0xd)] [Svc(0xd)]
public Result SetThreadPriority(int handle, int priority) public static Result SetThreadPriority(int handle, int priority)
{ {
// TODO: NPDM check. // TODO: NPDM check.
@ -2642,7 +2642,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
[Svc(0xe)] [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(); KProcess process = KernelStatic.GetCurrentProcess();
@ -2665,7 +2665,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
[Svc(0xf)] [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(); KProcess currentProcess = KernelStatic.GetCurrentProcess();
@ -2714,13 +2714,13 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
[Svc(0x10)] [Svc(0x10)]
public int GetCurrentProcessorNumber() public static int GetCurrentProcessorNumber()
{ {
return KernelStatic.GetCurrentThread().CurrentCore; return KernelStatic.GetCurrentThread().CurrentCore;
} }
[Svc(0x25)] [Svc(0x25)]
public Result GetThreadId(out ulong threadUid, int handle) public static Result GetThreadId(out ulong threadUid, int handle)
{ {
KProcess process = KernelStatic.GetCurrentProcess(); KProcess process = KernelStatic.GetCurrentProcess();
@ -2741,7 +2741,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
[Svc(0x32)] [Svc(0x32)]
public Result SetThreadActivity(int handle, bool pause) public static Result SetThreadActivity(int handle, bool pause)
{ {
KProcess process = KernelStatic.GetCurrentProcess(); KProcess process = KernelStatic.GetCurrentProcess();
@ -2766,7 +2766,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
[Svc(0x33)] [Svc(0x33)]
public Result GetThreadContext3([PointerSized] ulong address, int handle) public static Result GetThreadContext3([PointerSized] ulong address, int handle)
{ {
KProcess currentProcess = KernelStatic.GetCurrentProcess(); KProcess currentProcess = KernelStatic.GetCurrentProcess();
KThread currentThread = KernelStatic.GetCurrentThread(); KThread currentThread = KernelStatic.GetCurrentThread();
@ -2931,7 +2931,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
[Svc(0x1a)] [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)) if (IsPointingInsideKernel(mutexAddress))
{ {
@ -2949,7 +2949,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
[Svc(0x1b)] [Svc(0x1b)]
public Result ArbitrateUnlock([PointerSized] ulong mutexAddress) public static Result ArbitrateUnlock([PointerSized] ulong mutexAddress)
{ {
if (IsPointingInsideKernel(mutexAddress)) if (IsPointingInsideKernel(mutexAddress))
{ {
@ -2967,7 +2967,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
[Svc(0x1c)] [Svc(0x1c)]
public Result WaitProcessWideKeyAtomic( public static Result WaitProcessWideKeyAtomic(
[PointerSized] ulong mutexAddress, [PointerSized] ulong mutexAddress,
[PointerSized] ulong condVarAddress, [PointerSized] ulong condVarAddress,
int handle, int handle,
@ -2998,7 +2998,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
[Svc(0x1d)] [Svc(0x1d)]
public Result SignalProcessWideKey([PointerSized] ulong address, int count) public static Result SignalProcessWideKey([PointerSized] ulong address, int count)
{ {
KProcess currentProcess = KernelStatic.GetCurrentProcess(); KProcess currentProcess = KernelStatic.GetCurrentProcess();
@ -3008,7 +3008,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
[Svc(0x34)] [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)) if (IsPointingInsideKernel(address))
{ {
@ -3040,7 +3040,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
[Svc(0x35)] [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)) if (IsPointingInsideKernel(address))
{ {
@ -3067,7 +3067,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
} }
[Svc(0x36)] [Svc(0x36)]
public Result SynchronizePreemptionState() public static Result SynchronizePreemptionState()
{ {
KernelStatic.GetCurrentThread().SynchronizePreemptionState(); KernelStatic.GetCurrentThread().SynchronizePreemptionState();

View File

@ -147,7 +147,7 @@ namespace Ryujinx.HLE.HOS.Services.Fatal
Logger.Info?.Print(LogClass.ServiceFatal, errorReport.ToString()); Logger.Info?.Print(LogClass.ServiceFatal, errorReport.ToString());
context.Device.System.KernelContext.Syscall.Break((ulong)resultCode); Kernel.SupervisorCall.Syscall.Break((ulong)resultCode);
return ResultCode.Success; return ResultCode.Success;
} }

View File

@ -339,7 +339,6 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption
public static bool HasAmiiboKeyFile => File.Exists(GetKeyRetailBinPath()); public static bool HasAmiiboKeyFile => File.Exists(GetKeyRetailBinPath());
public static DateTime DateTimeFromTag(ushort dateTimeTag) public static DateTime DateTimeFromTag(ushort dateTimeTag)
{ {
try try

View File

@ -17,7 +17,6 @@ namespace Ryujinx.HLE
const int SizeOfApplicationTitle = 0x300; const int SizeOfApplicationTitle = 0x300;
const int OffsetOfApplicationPublisherStrings = 0x200; const int OffsetOfApplicationPublisherStrings = 0x200;
BlitStruct<ApplicationControlProperty> nacpData = new(1); BlitStruct<ApplicationControlProperty> nacpData = new(1);
// name and publisher buffer // name and publisher buffer

View File

@ -63,7 +63,6 @@ namespace Ryujinx.HLE.UI
/// </summary> /// </summary>
IHostUITheme HostUITheme { get; } IHostUITheme HostUITheme { get; }
/// <summary> /// <summary>
/// Displays the player select dialog and returns the selected profile. /// Displays the player select dialog and returns the selected profile.
/// </summary> /// </summary>

View File

@ -146,11 +146,15 @@ namespace Ryujinx.Horizon.Kernel.Generators
generator.AppendLine(); generator.AppendLine();
List<SyscallIdAndName> syscalls = []; List<SyscallIdAndName> syscalls = [];
Dictionary<string, bool> isStaticMethod = new();
foreach (MethodDeclarationSyntax method in syntaxReceiver.SvcImplementations) foreach (MethodDeclarationSyntax method in syntaxReceiver.SvcImplementations)
{ {
GenerateMethod32(generator, context.Compilation, method); bool isStatic = method.Modifiers.Any(SyntaxKind.StaticKeyword);
GenerateMethod64(generator, context.Compilation, method); 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 => foreach (AttributeSyntax attribute in method.AttributeLists.SelectMany(attributeList =>
attributeList.Attributes.Where(attribute => attributeList.Attributes.Where(attribute =>
@ -166,9 +170,9 @@ namespace Ryujinx.Horizon.Kernel.Generators
syscalls.Sort(); syscalls.Sort();
GenerateDispatch(generator, syscalls, A32Suffix); GenerateDispatch(generator, syscalls, A32Suffix, isStaticMethod);
generator.AppendLine(); generator.AppendLine();
GenerateDispatch(generator, syscalls, A64Suffix); GenerateDispatch(generator, syscalls, A64Suffix, isStaticMethod);
generator.LeaveScope(); generator.LeaveScope();
generator.LeaveScope(); generator.LeaveScope();
@ -193,9 +197,13 @@ namespace Ryujinx.Horizon.Kernel.Generators
generator.LeaveScope(); 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]; string[] args = new string[method.ParameterList.Parameters.Count];
int index = 0; int index = 0;
@ -266,9 +274,12 @@ namespace Ryujinx.Horizon.Kernel.Generators
string result = null; string result = null;
string canonicalReturnTypeName = 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") 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); canonicalReturnTypeName = GetCanonicalTypeName(compilation, method.ReturnType);
if (canonicalReturnTypeName == TypeResult) if (canonicalReturnTypeName == TypeResult)
@ -289,7 +300,7 @@ namespace Ryujinx.Horizon.Kernel.Generators
} }
else else
{ {
generator.AppendLine($"syscall.{method.Identifier.Text}({argsList});"); generator.AppendLine($"{callPrefix}({argsList});");
} }
foreach (OutParameter outParameter in outParameters) foreach (OutParameter outParameter in outParameters)
@ -313,9 +324,12 @@ namespace Ryujinx.Horizon.Kernel.Generators
generator.AppendLine(); 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]; string[] args = new string[method.ParameterList.Parameters.Count];
int registerIndex = 0; int registerIndex = 0;
@ -356,9 +370,12 @@ namespace Ryujinx.Horizon.Kernel.Generators
string result = null; string result = null;
string canonicalReturnTypeName = 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") 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); canonicalReturnTypeName = GetCanonicalTypeName(compilation, method.ReturnType);
if (canonicalReturnTypeName == TypeResult) if (canonicalReturnTypeName == TypeResult)
@ -374,7 +391,7 @@ namespace Ryujinx.Horizon.Kernel.Generators
} }
else else
{ {
generator.AppendLine($"syscall.{method.Identifier.Text}({argsList});"); generator.AppendLine($"{callPrefix}({argsList});");
} }
foreach (OutParameter outParameter in outParameters) foreach (OutParameter outParameter in outParameters)
@ -463,7 +480,7 @@ namespace Ryujinx.Horizon.Kernel.Generators
generator.AppendLine($"Logger.{logLevel}?.PrintMsg(LogClass.{logClass}, $\"{log}\");"); generator.AppendLine($"Logger.{logLevel}?.PrintMsg(LogClass.{logClass}, $\"{log}\");");
} }
private static void GenerateDispatch(CodeGenerator generator, List<SyscallIdAndName> syscalls, string suffix) private static void GenerateDispatch(CodeGenerator generator, List<SyscallIdAndName> syscalls, string suffix, Dictionary<string, bool> isStaticMethod)
{ {
generator.EnterScope($"public static void Dispatch{suffix}(Syscall syscall, {TypeExecutionContext} context, int id)"); generator.EnterScope($"public static void Dispatch{suffix}(Syscall syscall, {TypeExecutionContext} context, int id)");
generator.EnterScope("switch (id)"); generator.EnterScope("switch (id)");
@ -473,7 +490,15 @@ namespace Ryujinx.Horizon.Kernel.Generators
generator.AppendLine($"case {syscall.Id}:"); generator.AppendLine($"case {syscall.Id}:");
generator.IncreaseIndentation(); 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.AppendLine("break;");
generator.DecreaseIndentation(); generator.DecreaseIndentation();

View File

@ -234,7 +234,7 @@ namespace Ryujinx.Horizon.Sdk.Audio.Detail
} }
[CmifCommand(15)] // 17.0.0+ [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; eventHandle = 0;
@ -242,13 +242,13 @@ namespace Ryujinx.Horizon.Sdk.Audio.Detail
} }
[CmifCommand(16)] // 17.0.0+ [CmifCommand(16)] // 17.0.0+
public Result ReleaseAudioOutputDeviceNotification(ulong deviceId) public static Result ReleaseAudioOutputDeviceNotification(ulong deviceId)
{ {
return AudioResult.NotImplemented; return AudioResult.NotImplemented;
} }
[CmifCommand(17)] // 17.0.0+ [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; eventHandle = 0;
@ -256,19 +256,19 @@ namespace Ryujinx.Horizon.Sdk.Audio.Detail
} }
[CmifCommand(18)] // 17.0.0+ [CmifCommand(18)] // 17.0.0+
public Result ReleaseAudioInputDeviceNotification(ulong deviceId) public static Result ReleaseAudioInputDeviceNotification(ulong deviceId)
{ {
return AudioResult.NotImplemented; return AudioResult.NotImplemented;
} }
[CmifCommand(19)] // 18.0.0+ [CmifCommand(19)] // 18.0.0+
public Result SetAudioDeviceOutputVolumeAutoTuneEnabled(bool enabled) public static Result SetAudioDeviceOutputVolumeAutoTuneEnabled(bool enabled)
{ {
return AudioResult.NotImplemented; return AudioResult.NotImplemented;
} }
[CmifCommand(20)] // 18.0.0+ [CmifCommand(20)] // 18.0.0+
public Result IsAudioDeviceOutputVolumeAutoTuneEnabled(out bool enabled) public static Result IsAudioDeviceOutputVolumeAutoTuneEnabled(out bool enabled)
{ {
enabled = false; enabled = false;

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);
@ -160,7 +159,6 @@ namespace Ryujinx.Ava
} }
} }
public static string GetDirGameUserConfig(string gameId, bool changeFolderForGame = false) public static string GetDirGameUserConfig(string gameId, bool changeFolderForGame = false)
{ {
if (string.IsNullOrEmpty(gameId)) if (string.IsNullOrEmpty(gameId))
@ -221,10 +219,7 @@ namespace Ryujinx.Ava
} }
// When you first load the program, copy to remember the path for the global configuration // 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; UseHardwareAcceleration = ConfigurationState.Instance.EnableHardwareAcceleration;
@ -349,7 +344,6 @@ namespace Ryujinx.Ava
log.PrintMsg(LogClass.Application, message); log.PrintMsg(LogClass.Application, message);
} }
if (isTerminating) if (isTerminating)
Exit(); Exit();
} }

View File

@ -98,7 +98,6 @@ namespace Ryujinx.Ava.Systems.AppLibrary
}] }]
).OrElse(string.Empty); ).OrElse(string.Empty);
[JsonIgnore] public string IdString => Id.ToString("x16"); [JsonIgnore] public string IdString => Id.ToString("x16");
[JsonIgnore] public ulong IdBase => Id & ~0x1FFFUL; [JsonIgnore] public ulong IdBase => Id & ~0x1FFFUL;

View File

@ -11,7 +11,6 @@ namespace Ryujinx.Ava.Systems.AppLibrary
LdnData = ldnData ?? []; LdnData = ldnData ?? [];
} }
public LdnGameData[] LdnData { get; set; } public LdnGameData[] LdnData { get; set; }
} }
} }

View File

@ -44,7 +44,6 @@ namespace Ryujinx.Ava.Systems.Configuration
configurationFileUpdated = true; configurationFileUpdated = true;
} }
EnableDiscordIntegration.Value = cff.EnableDiscordIntegration; EnableDiscordIntegration.Value = cff.EnableDiscordIntegration;
UpdateCheckerType.Value = shouldLoadFromFile ? cff.UpdateCheckerType : UpdateCheckerType.Value; // Get from global config only UpdateCheckerType.Value = shouldLoadFromFile ? cff.UpdateCheckerType : UpdateCheckerType.Value; // Get from global config only
FocusLostActionType.Value = cff.FocusLostActionType; FocusLostActionType.Value = cff.FocusLostActionType;

View File

@ -326,7 +326,6 @@ namespace Ryujinx.Ava.Systems.Configuration
/// </summary> /// </summary>
public ReactiveObject<bool> MatchSystemTime { get; private set; } public ReactiveObject<bool> MatchSystemTime { get; private set; }
/// <summary> /// <summary>
/// Enable or disable use global input config (Independent from controllers binding) /// Enable or disable use global input config (Independent from controllers binding)
/// </summary> /// </summary>

View File

@ -1,4 +1,4 @@
using Gommon; using Gommon;
using Ryujinx.Ava.Common.Locale; using Ryujinx.Ava.Common.Locale;
using Ryujinx.Ava.UI.Helpers; using Ryujinx.Ava.UI.Helpers;
using Ryujinx.Common; using Ryujinx.Common;
@ -86,7 +86,6 @@ namespace Ryujinx.Ava.Systems
return default; return default;
} }
if (!Version.TryParse(_versionResponse.Version, out Version newVersion)) if (!Version.TryParse(_versionResponse.Version, out Version newVersion))
{ {
Logger.Error?.Print(LogClass.Application, Logger.Error?.Print(LogClass.Application,

View File

@ -55,7 +55,7 @@ namespace Ryujinx.Ava.UI.Applet
return culture.TwoLetterISOLanguageName switch 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 YaHei UI" // Simplified Chinese
: "Microsoft JhengHei UI", // Traditional Chinese : "Microsoft JhengHei UI", // Traditional Chinese
@ -100,6 +100,7 @@ namespace Ryujinx.Ava.UI.Applet
(float)solidColor.Color.B / 255 (float)solidColor.Color.B / 255
); );
} }
return new ThemeColor(); return new ThemeColor();
} }
} }

View File

@ -37,7 +37,6 @@ namespace Ryujinx.Ava.UI.Renderer
_ => throw new NotImplementedException() _ => throw new NotImplementedException()
}; };
private void Initialize() private void Initialize()
{ {
EmbeddedWindow.WindowCreated += CurrentWindow_WindowCreated; EmbeddedWindow.WindowCreated += CurrentWindow_WindowCreated;

View File

@ -30,12 +30,11 @@ namespace Ryujinx.Ava.UI.ViewModels
public string BootsInfoText { get; set; } public string BootsInfoText { get; set; }
public string NothingInfoText { get; set; } public string NothingInfoText { get; set; }
private IEnumerable<CompatibilityEntry> _currentEntries = CompatibilityDatabase.Entries; private IEnumerable<CompatibilityEntry> _currentEntries = CompatibilityDatabase.Entries;
private string[] _ownedGameTitleIds = []; private string[] _ownedGameTitleIds = [];
private Func<CompatibilityEntry, object> _sortKeySelector = x => x.GameName; // Default sort by GameName private readonly Func<CompatibilityEntry, object> _sortKeySelector = x => x.GameName; // Default sort by GameName
public IEnumerable<CompatibilityEntry> CurrentEntries => OnlyShowOwnedGames public IEnumerable<CompatibilityEntry> CurrentEntries => OnlyShowOwnedGames
? _currentEntries.Where(x => ? _currentEntries.Where(x =>
@ -87,7 +86,6 @@ namespace Ryujinx.Ava.UI.ViewModels
} }
} }
public void NameSorting(int nameSort = 0) public void NameSorting(int nameSort = 0)
{ {
_sorting.Name = nameSort; _sorting.Name = nameSort;
@ -162,6 +160,5 @@ namespace Ryujinx.Ava.UI.ViewModels
}; };
} }
} }
} }
} }

View File

@ -327,8 +327,6 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
PlayerIndexes.Add(new(PlayerIndex.Handheld, LocaleManager.Instance[LocaleKeys.ControllerSettingsHandheld])); PlayerIndexes.Add(new(PlayerIndex.Handheld, LocaleManager.Instance[LocaleKeys.ControllerSettingsHandheld]));
} }
private void LoadConfiguration(InputConfig inputConfig = null) private void LoadConfiguration(InputConfig inputConfig = null)
{ {
if (UseGlobalConfig && Program.UseExtraConfig) if (UseGlobalConfig && Program.UseExtraConfig)

View File

@ -90,7 +90,6 @@ namespace Ryujinx.Ava.UI.ViewModels
public bool IsGameTitleNotNull => !string.IsNullOrEmpty(GameTitle); public bool IsGameTitleNotNull => !string.IsNullOrEmpty(GameTitle);
public double PanelOpacity => IsGameTitleNotNull ? 0.5 : 1; public double PanelOpacity => IsGameTitleNotNull ? 0.5 : 1;
public int ResolutionScale public int ResolutionScale
{ {
get => _resolutionScale; get => _resolutionScale;
@ -230,7 +229,6 @@ namespace Ryujinx.Ava.UI.ViewModels
public bool EnablePptc { get; set; } public bool EnablePptc { get; set; }
public bool EnableLowPowerPptc { get; set; } public bool EnableLowPowerPptc { get; set; }
public long TurboMultiplier public long TurboMultiplier
{ {
get => _turboModeMultiplier; get => _turboModeMultiplier;

View File

@ -65,6 +65,5 @@ namespace Ryujinx.Ava.UI.Windows
cvm.StatusSorting(int.Parse(sortStrategy)); cvm.StatusSorting(int.Parse(sortStrategy));
} }
} }
} }
} }