Compare commits

...

17 Commits

Author SHA1 Message Date
MrKev
dafe47860b 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)
2025-08-29 22:54:11 -05:00
GreemDev
462c93e1ff fix key number 5 locale 2025-08-28 20:32:48 -05:00
Babib3l
573a6f32fe nullify + update spanish and french translations (ryubing/ryujinx!125)
See merge request ryubing/ryujinx!125
2025-08-28 13:28:24 -05:00
MrKev
6aab6116a4 Merge branch ryujinx:master into compile-messages-fixes 2025-08-19 05:02:17 -05:00
MrKev
db9a637a4e Merge branch ryujinx:master into compile-messages-fixes 2025-08-02 05:40:19 -05:00
MrKev312
9fcc844dae Suppress IDE0079: Remove unnecessary suppression 2025-08-02 04:24:30 -05:00
MrKev312
323ef1adba Add pragma to stop SYSLIB1054 2025-08-02 04:24:30 -05:00
MrKev312
62c4347294 Fix code style 2025-08-02 04:24:30 -05:00
MrKev312
5c4203a436 Make field readonly 2025-08-02 04:24:30 -05:00
MrKev312
f87ae39a8b Make methods that can be static, static 2025-08-02 04:24:30 -05:00
MrKev312
056e1566ee Fix blank line 2025-08-02 04:24:30 -05:00
MrKev312
e0e66ad231 Fix broken pragma 2025-08-02 04:24:30 -05:00
MrKev312
416ddba209 Added pragmas to hide wrong suggestions
Ideally this code would be refactored such that this is not needed
2025-08-02 04:24:30 -05:00
MrKev312
d081aa8a74 Fix blank lines 2025-08-02 04:24:30 -05:00
MrKev312
17f7ca8bdc Refactor syscall method generation for static methods
Introduce `isStaticMethod` dictionary to track static methods. Update `GenerateMethod32` and `GenerateMethod64` to adjust method signatures and invocations based on static status. Modify `GenerateDispatch` to call methods correctly depending on their static nature. Add `Is32BitInteger` helper method for type checking.
2025-08-02 04:24:30 -05:00
MrKev312
f5f89609f4 Remove more extra lines 2025-08-02 04:24:30 -05:00
MrKev312
16b4a23340 Remove extra blank lines 2025-08-02 04:24:30 -05:00
29 changed files with 302 additions and 297 deletions

View File

@ -262,6 +262,7 @@ dotnet_diagnostic.IDE0301.severity = none
dotnet_diagnostic.IDE0302.severity = none
dotnet_diagnostic.IDE0305.severity = none
dotnet_diagnostic.CS9113.severity = none # CS9113: Parameter 'value' is unread
dotnet_diagnostic.IDE0079.severity = none # IDE0079: Remove unnecessary suppression
dotnet_diagnostic.IDE0130.severity = none # IDE0130: Namespace does not match folder structure
[src/Ryujinx/UI/ViewModels/**.cs]

File diff suppressed because it is too large Load Diff

View File

@ -25,7 +25,9 @@ namespace Ryujinx.Audio.Backends.SDL2
// TODO: Add this to SDL2-CS
// NOTE: We use a DllImport here because of marshaling issue for spec.
[DllImport("SDL2")]
#pragma warning disable SYSLIB1054 // Use 'LibraryImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time
private static extern int SDL_GetDefaultAudioInfo(nint name, out SDL_AudioSpec spec, int isCapture);
#pragma warning restore SYSLIB1054 // Use 'LibraryImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time
public SDL2HardwareDeviceDriver()
{

View File

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

View File

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

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/-/releases/{newVersion}";
}
}

View File

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

View File

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

View File

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

View File

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

View File

@ -184,7 +184,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x5f)]
public Result FlushProcessDataCache(int processHandle, ulong address, ulong size)
public static Result FlushProcessDataCache(int processHandle, ulong address, ulong size)
{
// FIXME: This needs to be implemented as ARMv7 doesn't have any way to do cache maintenance operations on EL0.
// As we don't support (and don't actually need) to flush the cache, this is stubbed.
@ -263,7 +263,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x22)]
public Result SendSyncRequestWithUserBuffer(
public static Result SendSyncRequestWithUserBuffer(
[PointerSized] ulong messagePtr,
[PointerSized] ulong messageSize,
int handle)
@ -901,7 +901,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(2)]
public Result SetMemoryPermission([PointerSized] ulong address, [PointerSized] ulong size, KMemoryPermission permission)
public static Result SetMemoryPermission([PointerSized] ulong address, [PointerSized] ulong size, KMemoryPermission permission)
{
if (!PageAligned(address))
{
@ -934,7 +934,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(3)]
public Result SetMemoryAttribute(
public static Result SetMemoryAttribute(
[PointerSized] ulong address,
[PointerSized] ulong size,
MemoryAttribute attributeMask,
@ -983,7 +983,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(4)]
public Result MapMemory([PointerSized] ulong dst, [PointerSized] ulong src, [PointerSized] ulong size)
public static Result MapMemory([PointerSized] ulong dst, [PointerSized] ulong src, [PointerSized] ulong size)
{
if (!PageAligned(src | dst))
{
@ -1020,7 +1020,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(5)]
public Result UnmapMemory([PointerSized] ulong dst, [PointerSized] ulong src, [PointerSized] ulong size)
public static Result UnmapMemory([PointerSized] ulong dst, [PointerSized] ulong src, [PointerSized] ulong size)
{
if (!PageAligned(src | dst))
{
@ -1057,7 +1057,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(6)]
public Result QueryMemory([PointerSized] ulong infoPtr, [PointerSized] out ulong pageInfo, [PointerSized] ulong address)
public static Result QueryMemory([PointerSized] ulong infoPtr, [PointerSized] out ulong pageInfo, [PointerSized] ulong address)
{
Result result = QueryMemory(out MemoryInfo info, out pageInfo, address);
@ -1092,7 +1092,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x13)]
public Result MapSharedMemory(int handle, [PointerSized] ulong address, [PointerSized] ulong size, KMemoryPermission permission)
public static Result MapSharedMemory(int handle, [PointerSized] ulong address, [PointerSized] ulong size, KMemoryPermission permission)
{
if (!PageAligned(address))
{
@ -1139,7 +1139,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x14)]
public Result UnmapSharedMemory(int handle, [PointerSized] ulong address, [PointerSized] ulong size)
public static Result UnmapSharedMemory(int handle, [PointerSized] ulong address, [PointerSized] ulong size)
{
if (!PageAligned(address))
{
@ -1244,7 +1244,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x51)]
public Result MapTransferMemory(int handle, [PointerSized] ulong address, [PointerSized] ulong size, KMemoryPermission permission)
public static Result MapTransferMemory(int handle, [PointerSized] ulong address, [PointerSized] ulong size, KMemoryPermission permission)
{
if (!PageAligned(address))
{
@ -1291,7 +1291,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x52)]
public Result UnmapTransferMemory(int handle, [PointerSized] ulong address, [PointerSized] ulong size)
public static Result UnmapTransferMemory(int handle, [PointerSized] ulong address, [PointerSized] ulong size)
{
if (!PageAligned(address))
{
@ -1332,7 +1332,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x2c)]
public Result MapPhysicalMemory([PointerSized] ulong address, [PointerSized] ulong size)
public static Result MapPhysicalMemory([PointerSized] ulong address, [PointerSized] ulong size)
{
if (!PageAligned(address))
{
@ -1368,7 +1368,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x2d)]
public Result UnmapPhysicalMemory([PointerSized] ulong address, [PointerSized] ulong size)
public static Result UnmapPhysicalMemory([PointerSized] ulong address, [PointerSized] ulong size)
{
if (!PageAligned(address))
{
@ -1445,7 +1445,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x4c)]
public Result ControlCodeMemory(
public static Result ControlCodeMemory(
int handle,
CodeMemoryOperation op,
ulong address,
@ -1524,7 +1524,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x73)]
public Result SetProcessMemoryPermission(
public static Result SetProcessMemoryPermission(
int handle,
ulong src,
ulong size,
@ -1566,7 +1566,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x74)]
public Result MapProcessMemory(
public static Result MapProcessMemory(
[PointerSized] ulong dst,
int handle,
ulong src,
@ -1623,7 +1623,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x75)]
public Result UnmapProcessMemory(
public static Result UnmapProcessMemory(
[PointerSized] ulong dst,
int handle,
ulong src,
@ -1669,7 +1669,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x77)]
public Result MapProcessCodeMemory(int handle, ulong dst, ulong src, ulong size)
public static Result MapProcessCodeMemory(int handle, ulong dst, ulong src, ulong size)
{
if (!PageAligned(dst) || !PageAligned(src))
{
@ -1707,7 +1707,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x78)]
public Result UnmapProcessCodeMemory(int handle, ulong dst, ulong src, ulong size)
public static Result UnmapProcessCodeMemory(int handle, ulong dst, ulong src, ulong size)
{
if (!PageAligned(dst) || !PageAligned(src))
{
@ -1752,7 +1752,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
// System
[Svc(0x7b)]
public Result TerminateProcess(int handle)
public static Result TerminateProcess(int handle)
{
KProcess process = KernelStatic.GetCurrentProcess();
@ -1782,7 +1782,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(7)]
public void ExitProcess()
public static void ExitProcess()
{
KernelStatic.GetCurrentProcess().TerminateCurrentProcess();
}
@ -1878,7 +1878,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x26)]
public void Break(ulong reason)
public static void Break(ulong reason)
{
KThread currentThread = KernelStatic.GetCurrentThread();
@ -1905,7 +1905,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x27)]
public void OutputDebugString([PointerSized] ulong strPtr, [PointerSized] ulong size)
public static void OutputDebugString([PointerSized] ulong strPtr, [PointerSized] ulong size)
{
KProcess process = KernelStatic.GetCurrentProcess();
@ -2371,7 +2371,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x30)]
public Result GetResourceLimitLimitValue(out long limitValue, int handle, LimitableResource resource)
public static Result GetResourceLimitLimitValue(out long limitValue, int handle, LimitableResource resource)
{
limitValue = 0;
@ -2393,7 +2393,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x31)]
public Result GetResourceLimitCurrentValue(out long limitValue, int handle, LimitableResource resource)
public static Result GetResourceLimitCurrentValue(out long limitValue, int handle, LimitableResource resource)
{
limitValue = 0;
@ -2415,7 +2415,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x37)]
public Result GetResourceLimitPeakValue(out long peak, int handle, LimitableResource resource)
public static Result GetResourceLimitPeakValue(out long peak, int handle, LimitableResource resource)
{
peak = 0;
@ -2447,7 +2447,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x7e)]
public Result SetResourceLimitLimitValue(int handle, LimitableResource resource, long limitValue)
public static Result SetResourceLimitLimitValue(int handle, LimitableResource resource, long limitValue)
{
if (resource >= LimitableResource.Count)
{
@ -2542,7 +2542,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(9)]
public Result StartThread(int handle)
public static Result StartThread(int handle)
{
KProcess process = KernelStatic.GetCurrentProcess();
@ -2570,7 +2570,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0xa)]
public void ExitThread()
public static void ExitThread()
{
KThread currentThread = KernelStatic.GetCurrentThread();
@ -2602,7 +2602,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0xc)]
public Result GetThreadPriority(out int priority, int handle)
public static Result GetThreadPriority(out int priority, int handle)
{
KProcess process = KernelStatic.GetCurrentProcess();
@ -2623,7 +2623,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0xd)]
public Result SetThreadPriority(int handle, int priority)
public static Result SetThreadPriority(int handle, int priority)
{
// TODO: NPDM check.
@ -2642,7 +2642,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0xe)]
public Result GetThreadCoreMask(out int preferredCore, out ulong affinityMask, int handle)
public static Result GetThreadCoreMask(out int preferredCore, out ulong affinityMask, int handle)
{
KProcess process = KernelStatic.GetCurrentProcess();
@ -2665,7 +2665,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0xf)]
public Result SetThreadCoreMask(int handle, int preferredCore, ulong affinityMask)
public static Result SetThreadCoreMask(int handle, int preferredCore, ulong affinityMask)
{
KProcess currentProcess = KernelStatic.GetCurrentProcess();
@ -2714,13 +2714,13 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x10)]
public int GetCurrentProcessorNumber()
public static int GetCurrentProcessorNumber()
{
return KernelStatic.GetCurrentThread().CurrentCore;
}
[Svc(0x25)]
public Result GetThreadId(out ulong threadUid, int handle)
public static Result GetThreadId(out ulong threadUid, int handle)
{
KProcess process = KernelStatic.GetCurrentProcess();
@ -2741,7 +2741,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x32)]
public Result SetThreadActivity(int handle, bool pause)
public static Result SetThreadActivity(int handle, bool pause)
{
KProcess process = KernelStatic.GetCurrentProcess();
@ -2766,7 +2766,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x33)]
public Result GetThreadContext3([PointerSized] ulong address, int handle)
public static Result GetThreadContext3([PointerSized] ulong address, int handle)
{
KProcess currentProcess = KernelStatic.GetCurrentProcess();
KThread currentThread = KernelStatic.GetCurrentThread();
@ -2931,7 +2931,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x1a)]
public Result ArbitrateLock(int ownerHandle, [PointerSized] ulong mutexAddress, int requesterHandle)
public static Result ArbitrateLock(int ownerHandle, [PointerSized] ulong mutexAddress, int requesterHandle)
{
if (IsPointingInsideKernel(mutexAddress))
{
@ -2949,7 +2949,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x1b)]
public Result ArbitrateUnlock([PointerSized] ulong mutexAddress)
public static Result ArbitrateUnlock([PointerSized] ulong mutexAddress)
{
if (IsPointingInsideKernel(mutexAddress))
{
@ -2967,7 +2967,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x1c)]
public Result WaitProcessWideKeyAtomic(
public static Result WaitProcessWideKeyAtomic(
[PointerSized] ulong mutexAddress,
[PointerSized] ulong condVarAddress,
int handle,
@ -2998,7 +2998,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x1d)]
public Result SignalProcessWideKey([PointerSized] ulong address, int count)
public static Result SignalProcessWideKey([PointerSized] ulong address, int count)
{
KProcess currentProcess = KernelStatic.GetCurrentProcess();
@ -3008,7 +3008,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x34)]
public Result WaitForAddress([PointerSized] ulong address, ArbitrationType type, int value, long timeout)
public static Result WaitForAddress([PointerSized] ulong address, ArbitrationType type, int value, long timeout)
{
if (IsPointingInsideKernel(address))
{
@ -3040,7 +3040,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x35)]
public Result SignalToAddress([PointerSized] ulong address, SignalType type, int value, int count)
public static Result SignalToAddress([PointerSized] ulong address, SignalType type, int value, int count)
{
if (IsPointingInsideKernel(address))
{
@ -3067,7 +3067,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
[Svc(0x36)]
public Result SynchronizePreemptionState()
public static Result SynchronizePreemptionState()
{
KernelStatic.GetCurrentThread().SynchronizePreemptionState();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -119,7 +119,6 @@ namespace Ryujinx.Ava
=> ProcessUnhandledException(sender, e.Exception, false);
AppDomain.CurrentDomain.ProcessExit += (_, _) => Exit();
// Setup base data directory.
AppDataManager.Initialize(CommandLineState.BaseDirPathArg);
@ -160,7 +159,6 @@ namespace Ryujinx.Ava
}
}
public static string GetDirGameUserConfig(string gameId, bool changeFolderForGame = false)
{
if (string.IsNullOrEmpty(gameId))
@ -221,10 +219,7 @@ namespace Ryujinx.Ava
}
// When you first load the program, copy to remember the path for the global configuration
if (GlobalConfigurationPath == null)
{
GlobalConfigurationPath = ConfigurationPath;
}
GlobalConfigurationPath ??= ConfigurationPath;
UseHardwareAcceleration = ConfigurationState.Instance.EnableHardwareAcceleration;
@ -349,7 +344,6 @@ namespace Ryujinx.Ava
log.PrintMsg(LogClass.Application, message);
}
if (isTerminating)
Exit();
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -55,7 +55,7 @@ namespace Ryujinx.Ava.UI.Applet
return culture.TwoLetterISOLanguageName switch
{
"zh" => langCode == "zh-CN" || langCode == "zh-Hans" || langCode == "zh-SG"
"zh" => langCode is "zh-CN" or "zh-Hans" or "zh-SG"
? "Microsoft YaHei UI" // Simplified Chinese
: "Microsoft JhengHei UI", // Traditional Chinese
@ -100,6 +100,7 @@ namespace Ryujinx.Ava.UI.Applet
(float)solidColor.Color.B / 255
);
}
return new ThemeColor();
}
}

View File

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

View File

@ -30,12 +30,11 @@ namespace Ryujinx.Ava.UI.ViewModels
public string BootsInfoText { get; set; }
public string NothingInfoText { get; set; }
private IEnumerable<CompatibilityEntry> _currentEntries = CompatibilityDatabase.Entries;
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
? _currentEntries.Where(x =>
@ -87,7 +86,6 @@ namespace Ryujinx.Ava.UI.ViewModels
}
}
public void NameSorting(int nameSort = 0)
{
_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]));
}
private void LoadConfiguration(InputConfig inputConfig = null)
{
if (UseGlobalConfig && Program.UseExtraConfig)

View File

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

View File

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