From 504abbd6e0ca8073e6a3e60776b2278bd0ffcaed Mon Sep 17 00:00:00 2001 From: german77 Date: Sun, 4 Feb 2024 15:19:54 -0600 Subject: dmnt: cheats: Update cheat vm to latest version --- src/core/memory/dmnt_cheat_vm.h | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/core/memory/dmnt_cheat_vm.h') diff --git a/src/core/memory/dmnt_cheat_vm.h b/src/core/memory/dmnt_cheat_vm.h index 641cb09c4..32797dcd7 100644 --- a/src/core/memory/dmnt_cheat_vm.h +++ b/src/core/memory/dmnt_cheat_vm.h @@ -42,12 +42,16 @@ enum class CheatVmOpcodeType : u32 { DoubleExtendedWidth = 0xF0, // Double-extended width opcodes. + PauseProcess = 0xFF0, + ResumeProcess = 0xFF1, DebugLog = 0xFFF, }; enum class MemoryAccessType : u32 { MainNso = 0, Heap = 1, + Alias = 2, + Aslr = 3, }; enum class ConditionalComparisonType : u32 { @@ -131,7 +135,9 @@ struct BeginConditionalOpcode { VmInt value{}; }; -struct EndConditionalOpcode {}; +struct EndConditionalOpcode { + bool is_else; +}; struct ControlLoopOpcode { bool start_loop{}; @@ -222,6 +228,10 @@ struct ReadWriteStaticRegisterOpcode { u32 idx{}; }; +struct PauseProcessOpcode {}; + +struct ResumeProcessOpcode {}; + struct DebugLogOpcode { u32 bit_width{}; u32 log_id{}; @@ -244,8 +254,8 @@ struct CheatVmOpcode { PerformArithmeticStaticOpcode, BeginKeypressConditionalOpcode, PerformArithmeticRegisterOpcode, StoreRegisterToAddressOpcode, BeginRegisterConditionalOpcode, SaveRestoreRegisterOpcode, - SaveRestoreRegisterMaskOpcode, ReadWriteStaticRegisterOpcode, DebugLogOpcode, - UnrecognizedInstruction> + SaveRestoreRegisterMaskOpcode, ReadWriteStaticRegisterOpcode, PauseProcessOpcode, + ResumeProcessOpcode, DebugLogOpcode, UnrecognizedInstruction> opcode{}; }; @@ -296,7 +306,7 @@ private: std::array loop_tops{}; bool DecodeNextOpcode(CheatVmOpcode& out); - void SkipConditionalBlock(); + void SkipConditionalBlock(bool is_if); void ResetState(); // For implementing the DebugLog opcode. -- cgit v1.2.3