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