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