diff --git a/stratosphere/dmnt/source/dmnt_cheat_vm.cpp b/stratosphere/dmnt/source/dmnt_cheat_vm.cpp index 9afc9edc3..3a7b95625 100644 --- a/stratosphere/dmnt/source/dmnt_cheat_vm.cpp +++ b/stratosphere/dmnt/source/dmnt_cheat_vm.cpp @@ -183,6 +183,9 @@ bool DmntCheatVm::DecodeNextOpcode(CheatVmOpcode *out) { } opcode.opcode = (CheatVmOpcodeType)(((first_dword >> 28) & 0xF)); + if (opcode.opcode >= CheatVmOpcodeType_ExtendedWidth) { + opcode.opcode = (CheatVmOpcodeType)((((u32)opcode.opcode) << 4) | ((first_dword >> 24) & 0xF)); + } switch (opcode.opcode) { case CheatVmOpcodeType_StoreStatic: @@ -294,6 +297,7 @@ bool DmntCheatVm::DecodeNextOpcode(CheatVmOpcode *out) { } } break; + case CheatVmOpcodeType_ExtendedWidth: default: /* Unrecognized instruction cannot be decoded. */ valid = false; @@ -631,6 +635,9 @@ void DmntCheatVm::Execute(const CheatProcessMetadata *metadata) { this->registers[cur_opcode.perform_math_reg.dst_reg_index] = res_val; } break; + default: + /* By default, we do a no-op. */ + break; } } } \ No newline at end of file diff --git a/stratosphere/dmnt/source/dmnt_cheat_vm.hpp b/stratosphere/dmnt/source/dmnt_cheat_vm.hpp index 2236dd9a4..d892479bc 100644 --- a/stratosphere/dmnt/source/dmnt_cheat_vm.hpp +++ b/stratosphere/dmnt/source/dmnt_cheat_vm.hpp @@ -34,6 +34,10 @@ enum CheatVmOpcodeType : u32 { /* These are not implemented by Gateway's VM. */ CheatVmOpcodeType_PerformArithmeticRegister = 9, + + /* This is a meta entry, and not a real opcode. */ + /* This is to facilitate multi-nybble instruction decoding in the future. */ + CheatVmOpcodeType_ExtendedWidth = 12, }; enum MemoryAccessType : u32 { diff --git a/stratosphere/libstratosphere b/stratosphere/libstratosphere index 9ce1dce44..82c67a62d 160000 --- a/stratosphere/libstratosphere +++ b/stratosphere/libstratosphere @@ -1 +1 @@ -Subproject commit 9ce1dce4400461311a17712628febd99b25ff335 +Subproject commit 82c67a62d69f04f656da495c696f264eea6fa63a