Merge branch 'libryujinx_bionic_cheats' into 'libryujinx_bionic'

Added Cheat Support

See merge request kenji-nx/ryujinx!8
This commit is contained in:
BeZide 2025-12-08 22:23:58 -06:00
commit 5738728fa3
3 changed files with 37 additions and 8 deletions

View file

@ -24,7 +24,7 @@
<Type Name="Silk.NET.Vulkan.Extensions.KHR.KhrSwapchain"
Dynamic="Required All"/>
</Assembly>
<Assembly Name="Ryujinx.HLE">
<Assembly Name="Ryujinx.HLE" Dynamic="Required All">
<Type Name="Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel.NvHostGpuDeviceFile"
Dynamic="Required All" />
<Type Name="Ryujinx.HLE.HOS.Services.Fs.IFileSystemProxyForLoader"
@ -531,6 +531,27 @@
Dynamic="Required All" />
<Type Name="Ryujinx.HLE.HOS.Services.Pcv.Rgltr.IRegulatorManager"
Dynamic="Required All" />
<!-- Explicitly root the generic tamper operations that are built via MakeGenericType -->
<Type Name="Ryujinx.HLE.HOS.Tamper.Operations.OpMov`1[[System.Byte]]"
Dynamic="Required All" />
<Type Name="Ryujinx.HLE.HOS.Tamper.Operations.OpMov`1[[System.UInt16]]"
Dynamic="Required All" />
<Type Name="Ryujinx.HLE.HOS.Tamper.Operations.OpMov`1[[System.UInt32]]"
Dynamic="Required All" />
<Type Name="Ryujinx.HLE.HOS.Tamper.Operations.OpMov`1[[System.UInt64]]"
Dynamic="Required All" />
<Type Name="Ryujinx.HLE.HOS.Tamper.Operations.OpAdd`1[[System.Byte]]"
Dynamic="Required All" />
<Type Name="Ryujinx.HLE.HOS.Tamper.Operations.OpAdd`1[[System.UInt16]]"
Dynamic="Required All" />
<Type Name="Ryujinx.HLE.HOS.Tamper.Operations.OpAdd`1[[System.UInt32]]"
Dynamic="Required All" />
<Type Name="Ryujinx.HLE.HOS.Tamper.Operations.OpAdd`1[[System.UInt64]]"
Dynamic="Required All" />
</Assembly>
<!-- AOT/Trimming: keep dynamic binder & expression tree runtime -->
<Assembly Name="Microsoft.CSharp" Dynamic="Required All" />
<Assembly Name="System.Linq.Expressions" Dynamic="Required All" />
</Application>
</Directives>
</Directives>

View file

@ -50,6 +50,9 @@ namespace Ryujinx.HLE.HOS
_programs.Enqueue(program);
_programDictionary.TryAdd($"{buildId}-{name}", program);
// NEW: Enable by default (on Android there is currently no UI that calls EnableCheats)
program.IsEnabled = true;
}
Activate();
@ -139,6 +142,12 @@ namespace Ryujinx.HLE.HOS
// Re-enqueue the tampering program because the process is still valid.
_programs.Enqueue(program);
// NEW: If the cheat is (still) disabled — keep rotating, do not execute.
if (!program.IsEnabled)
{
return true;
}
Logger.Debug?.Print(LogClass.TamperMachine, $"Running tampering program {program.Name}");
try
@ -159,10 +168,8 @@ namespace Ryujinx.HLE.HOS
{
Logger.Debug?.Print(LogClass.TamperMachine, $"The tampering program {program.Name} crashed, this can happen while the game is starting");
if (!string.IsNullOrEmpty(ex.Message))
{
Logger.Debug?.Print(LogClass.TamperMachine, ex.Message);
}
// NEW: log full stack trace
Logger.Debug?.Print(LogClass.TamperMachine, ex.ToString());
}
return true;
@ -170,7 +177,7 @@ namespace Ryujinx.HLE.HOS
public void UpdateInput(List<GamepadInput> gamepadInputs)
{
// Look for the input of the player one or the handheld.
// Look for the input of player one or the handheld.
foreach (GamepadInput input in gamepadInputs)
{
if (input.PlayerId is PlayerIndex.Player1 or PlayerIndex.Handheld)
@ -181,7 +188,7 @@ namespace Ryujinx.HLE.HOS
}
}
// Clear the input because player one is not conected.
// Clear the input because player one is not connected.
Volatile.Write(ref _pressedKeys, 0);
}
}

View file

@ -2,6 +2,7 @@
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IsTrimmable>false</IsTrimmable>
</PropertyGroup>
<ItemGroup>