2021-03-27 08:12:05 -06: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 14:05:17 -06:00
|
|
|
public string Name { get; }
|
|
|
|
public bool TampersCodeMemory { get; set; } = false;
|
2021-03-27 08:12:05 -06:00
|
|
|
public ITamperedProcess Process { get; }
|
2022-01-03 01:39:43 -07:00
|
|
|
public bool IsEnabled { get; set; }
|
2021-03-27 08:12:05 -06:00
|
|
|
|
2021-08-04 14:05:17 -06:00
|
|
|
public AtmosphereProgram(string name, ITamperedProcess process, Parameter<long> pressedKeys, IOperation entryPoint)
|
2021-03-27 08:12:05 -06:00
|
|
|
{
|
2021-08-04 14:05:17 -06:00
|
|
|
Name = name;
|
2021-03-27 08:12:05 -06:00
|
|
|
Process = process;
|
|
|
|
_pressedKeys = pressedKeys;
|
|
|
|
_entryPoint = entryPoint;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Execute(ControllerKeys pressedKeys)
|
|
|
|
{
|
2022-01-03 01:39:43 -07:00
|
|
|
if (IsEnabled)
|
|
|
|
{
|
|
|
|
_pressedKeys.Value = (long)pressedKeys;
|
|
|
|
_entryPoint.Execute();
|
|
|
|
}
|
2021-03-27 08:12:05 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|