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; }
|
|
|
|
|
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)
|
|
|
|
{
|
|
|
|
_pressedKeys.Value = (long)pressedKeys;
|
|
|
|
_entryPoint.Execute();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|