From 0eecd0fbf0274169a0c7374c08cc3d3ec053d280 Mon Sep 17 00:00:00 2001 From: tomvita <68505331+tomvita@users.noreply.github.com> Date: Sun, 5 Jan 2025 22:07:14 +0800 Subject: [PATCH] update type 8 extension --- docs/features/cheats.md | 2 +- stratosphere/dmnt/source/cheat/impl/dmnt_cheat_vm.cpp | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/features/cheats.md b/docs/features/cheats.md index d5d23f92a..ce492141b 100644 --- a/docs/features/cheats.md +++ b/docs/features/cheats.md @@ -231,7 +231,7 @@ Note: This is the direct output of `hidKeysDown()`. + 0800000: Right Stick Down + 1000000: SL + 2000000: SR -+ 8000000: when this is set button only activate code once per keydown, need to be release before the code will run again ++ 8000000: No auto-repeat. When this bit is set, the conditional block executes only once when the keypad mask matches. The mask must stop matching to reset for the next trigger. --- diff --git a/stratosphere/dmnt/source/cheat/impl/dmnt_cheat_vm.cpp b/stratosphere/dmnt/source/cheat/impl/dmnt_cheat_vm.cpp index 0131e0034..b3df0c757 100644 --- a/stratosphere/dmnt/source/cheat/impl/dmnt_cheat_vm.cpp +++ b/stratosphere/dmnt/source/cheat/impl/dmnt_cheat_vm.cpp @@ -1000,9 +1000,7 @@ namespace ams::dmnt::cheat::impl { case CheatVmOpcodeType_BeginKeypressConditionalBlock: /* Check for keypress. */ if (cur_opcode.begin_keypress_cond.key_mask > 0x8000000) { - const u64 kDown = ~keyold & kHeld; - - if ((cur_opcode.begin_keypress_cond.key_mask & 0x7FFFFFF & kDown) != (cur_opcode.begin_keypress_cond.key_mask & 0x7FFFFFF)) { + if ((cur_opcode.begin_keypress_cond.key_mask & 0x7FFFFFF & kHeld) != (cur_opcode.begin_keypress_cond.key_mask & 0x7FFFFFF) || (cur_opcode.begin_keypress_cond.key_mask & 0x7FFFFFF & keyold) == (cur_opcode.begin_keypress_cond.key_mask & 0x7FFFFFF)) { /* Keys not pressed. Skip conditional block. */ this->SkipConditionalBlock(true); }