From 8e45b8c324a31f7129b39b7d686ca35cf1e20f29 Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Thu, 20 Jul 2023 14:01:47 +0300 Subject: [PATCH] [ActionReplay] Add 16-bit writes --- src/core/action_replay.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/core/action_replay.cpp b/src/core/action_replay.cpp index 2153bd1a..65cc1e96 100644 --- a/src/core/action_replay.cpp +++ b/src/core/action_replay.cpp @@ -42,7 +42,16 @@ void ActionReplay::runInstruction(const Cheat& cheat, u32 instruction) { const u32 type = instruction >> 28; switch (type) { - // 8 bit write to [XXXXXXX + offset] + // 16-bit write to [XXXXXXX + offset] + case 0x1: { + const u32 baseAddr = Helpers::getBits<0, 28>(instruction); + const u16 value = u16(cheat[pc++]); + write16(baseAddr + *activeOffset, value); + break; + } + + + // 8-bit write to [XXXXXXX + offset] case 0x2: { const u32 baseAddr = Helpers::getBits<0, 28>(instruction); const u8 value = u8(cheat[pc++]);