2021-03-27 15:12:05 +01:00
|
|
|
using Ryujinx.HLE.HOS.Services.Hid;
|
|
|
|
using Ryujinx.HLE.HOS.Tamper.Operations;
|
|
|
|
|
|
|
|
namespace Ryujinx.HLE.HOS.Tamper
|
|
|
|
{
|
|
|
|
class AtmosphereProgram : ITamperProgram
|
|
|
|
{
|
|
|
|
private Parameter<long> _pressedKeys;
|
|
|
|
private IOperation _entryPoint;
|
|
|
|
|
2021-08-04 22:05:17 +02:00
|
|
|
public string Name { get; }
|
|
|
|
public bool TampersCodeMemory { get; set; } = false;
|
2021-03-27 15:12:05 +01:00
|
|
|
public ITamperedProcess Process { get; }
|
2022-01-03 09:39:43 +01:00
|
|
|
public bool IsEnabled { get; set; }
|
2021-03-27 15:12:05 +01:00
|
|
|
|
2021-08-04 22:05:17 +02:00
|
|
|
public AtmosphereProgram(string name, ITamperedProcess process, Parameter<long> pressedKeys, IOperation entryPoint)
|
2021-03-27 15:12:05 +01:00
|
|
|
{
|
2021-08-04 22:05:17 +02:00
|
|
|
Name = name;
|
2021-03-27 15:12:05 +01:00
|
|
|
Process = process;
|
|
|
|
_pressedKeys = pressedKeys;
|
|
|
|
_entryPoint = entryPoint;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Execute(ControllerKeys pressedKeys)
|
|
|
|
{
|
2022-01-03 09:39:43 +01:00
|
|
|
if (IsEnabled)
|
|
|
|
{
|
|
|
|
_pressedKeys.Value = (long)pressedKeys;
|
|
|
|
_entryPoint.Execute();
|
|
|
|
}
|
2021-03-27 15:12:05 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|