mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-29 22:15:17 -04:00
dmnt-cheat: Add Save/Restore register opcode
This commit is contained in:
parent
a0f3183c79
commit
477bee2e4c
2 changed files with 40 additions and 0 deletions
|
@ -43,6 +43,7 @@ enum CheatVmOpcodeType : u32 {
|
|||
|
||||
/* Extended width opcodes. */
|
||||
CheatVmOpcodeType_BeginRegisterConditionalBlock = 0xC0,
|
||||
CheatVmOpcodeType_SaveRestoreRegister = 0xC1,
|
||||
};
|
||||
|
||||
enum MemoryAccessType : u32 {
|
||||
|
@ -191,6 +192,11 @@ struct BeginRegisterConditionalOpcode {
|
|||
VmInt value;
|
||||
};
|
||||
|
||||
struct SaveRestoreRegisterOpcode {
|
||||
u32 dst_index;
|
||||
u32 src_index;
|
||||
bool is_save;
|
||||
};
|
||||
|
||||
struct CheatVmOpcode {
|
||||
CheatVmOpcodeType opcode;
|
||||
|
@ -208,6 +214,7 @@ struct CheatVmOpcode {
|
|||
PerformArithmeticRegisterOpcode perform_math_reg;
|
||||
StoreRegisterToAddressOpcode str_register;
|
||||
BeginRegisterConditionalOpcode begin_reg_cond;
|
||||
SaveRestoreRegisterOpcode save_restore_reg;
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -222,6 +229,7 @@ class DmntCheatVm {
|
|||
bool decode_success = false;
|
||||
u32 program[MaximumProgramOpcodeCount] = {0};
|
||||
u64 registers[NumRegisters] = {0};
|
||||
u64 saved_values[NumRegisters] = {0};
|
||||
size_t loop_tops[NumRegisters] = {0};
|
||||
private:
|
||||
bool DecodeNextOpcode(CheatVmOpcode *out);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue