mirror of
https://github.com/ryujinx-mirror/ryujinx.git
synced 2024-11-29 13:33:01 +00:00
Fix Tamper Machine crash and timings (#2159)
* Add missing return * Change TamperMachine sleep to 83ms * Change constant name to PascalCase
This commit is contained in:
parent
524fe3bea4
commit
9ae60207c4
2 changed files with 7 additions and 1 deletions
|
@ -630,6 +630,8 @@ namespace Ryujinx.HLE.HOS
|
|||
if (tamperInfo == null || tamperInfo.BuildIds == null || tamperInfo.CodeAddresses == null)
|
||||
{
|
||||
Logger.Error?.Print(LogClass.ModLoader, "Unable to install cheat because the associated process is invalid");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Logger.Info?.Print(LogClass.ModLoader, $"Build ids found for title {titleId:X16}:\n {String.Join("\n ", tamperInfo.BuildIds)}");
|
||||
|
|
|
@ -13,6 +13,10 @@ namespace Ryujinx.HLE.HOS
|
|||
{
|
||||
public class TamperMachine
|
||||
{
|
||||
// Atmosphere specifies a delay of 83 milliseconds between the execution of the last
|
||||
// cheat and the re-execution of the first one.
|
||||
private const int TamperMachineSleepMs = 1000 / 12;
|
||||
|
||||
private Thread _tamperThread = null;
|
||||
private ConcurrentQueue<ITamperProgram> _programs = new ConcurrentQueue<ITamperProgram>();
|
||||
private long _pressedKeys = 0;
|
||||
|
@ -76,7 +80,7 @@ namespace Ryujinx.HLE.HOS
|
|||
if (sleepCounter == 0)
|
||||
{
|
||||
sleepCounter = _programs.Count;
|
||||
Thread.Sleep(1);
|
||||
Thread.Sleep(TamperMachineSleepMs);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue