namespace Ryujinx.HLE.HOS.Tamper
{
///
/// The opcodes specified for the Atmosphere Cheat VM.
///
enum CodeType
{
///
/// Code type 0 allows writing a static value to a memory address.
///
StoreConstantToAddress = 0x0,
///
/// Code type 1 performs a comparison of the contents of memory to a static value.
/// If the condition is not met, all instructions until the appropriate conditional block terminator
/// are skipped.
///
BeginMemoryConditionalBlock = 0x1,
///
/// Code type 2 marks the end of a conditional block (started by Code Type 1 or Code Type 8).
///
EndConditionalBlock = 0x2,
///
/// Code type 3 allows for iterating in a loop a fixed number of times.
///
StartEndLoop = 0x3,
///
/// Code type 4 allows setting a register to a constant value.
///
LoadRegisterWithContant = 0x4,
///
/// Code type 5 allows loading a value from memory into a register, either using a fixed address or by
/// dereferencing the destination register.
///
LoadRegisterWithMemory = 0x5,
///
/// Code type 6 allows writing a fixed value to a memory address specified by a register.
///
StoreConstantToMemory = 0x6,
///
/// Code type 7 allows performing arithmetic on registers. However, it has been deprecated by Code
/// type 9, and is only kept for backwards compatibility.
///
LegacyArithmetic = 0x7,
///
/// Code type 8 enters or skips a conditional block based on whether a key combination is pressed.
///
BeginKeypressConditionalBlock = 0x8,
///
/// Code type 9 allows performing arithmetic on registers.
///
Arithmetic = 0x9,
///
/// Code type 10 allows writing a register to memory.
///
StoreRegisterToMemory = 0xA,
///
/// Code type 0xC0 performs a comparison of the contents of a register and another value.
/// This code support multiple operand types, see below. If the condition is not met,
/// all instructions until the appropriate conditional block terminator are skipped.
///
BeginRegisterConditionalBlock = 0xC0,
///
/// Code type 0xC1 performs saving or restoring of registers.
/// NOTE: Registers are saved and restored to a different set of registers than the ones used
/// for the other opcodes (Save Registers).
///
SaveOrRestoreRegister = 0xC1,
///
/// Code type 0xC2 performs saving or restoring of multiple registers using a bitmask.
/// NOTE: Registers are saved and restored to a different set of registers than the ones used
/// for the other opcodes (Save Registers).
///
SaveOrRestoreRegisterWithMask = 0xC2,
///
/// Code type 0xC3 reads or writes a static register with a given register.
/// NOTE: Registers are saved and restored to a different set of registers than the ones used
/// for the other opcodes (Static Registers).
///
ReadOrWriteStaticRegister = 0xC3,
///
/// Code type 0xFF0 pauses the current process.
///
PauseProcess = 0xFF0,
///
/// Code type 0xFF1 resumes the current process.
///
ResumeProcess = 0xFF1,
///
/// Code type 0xFFF writes a debug log.
///
DebugLog = 0xFFF
}
}