From 73afa042f11ae6331e47c7ad9d08044ea06aa8b1 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Thu, 22 Jul 2021 06:06:48 -0700 Subject: [PATCH] dmnt: fix opcode decoding (closes #1575) --- stratosphere/dmnt/source/cheat/impl/dmnt_cheat_vm.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stratosphere/dmnt/source/cheat/impl/dmnt_cheat_vm.cpp b/stratosphere/dmnt/source/cheat/impl/dmnt_cheat_vm.cpp index 47933b2bf..8f9fa4f90 100644 --- a/stratosphere/dmnt/source/cheat/impl/dmnt_cheat_vm.cpp +++ b/stratosphere/dmnt/source/cheat/impl/dmnt_cheat_vm.cpp @@ -388,7 +388,7 @@ namespace ams::dmnt::cheat::impl { case CheatVmOpcodeType_EndConditionalBlock: { /* 2X000000 */ - opcode.end_cond.is_else = ((first_dword >> 28) & 0xF) == 1; + opcode.end_cond.is_else = ((first_dword >> 24) & 0xF) == 1; } break; case CheatVmOpcodeType_ControlLoop: @@ -397,7 +397,7 @@ namespace ams::dmnt::cheat::impl { /* 310R0000 */ /* Parse register, whether loop start or loop end. */ opcode.ctrl_loop.start_loop = ((first_dword >> 24) & 0xF) == 0; - opcode.ctrl_loop.reg_index = ((first_dword >> 20) & 0xF); + opcode.ctrl_loop.reg_index = ((first_dword >> 16) & 0xF); /* Read number of iters if loop start. */ if (opcode.ctrl_loop.start_loop) {