[ActionReplay] Add 16-bit writes

This commit is contained in:
wheremyfoodat 2023-07-20 14:01:47 +03:00
parent 97f8ea6cfd
commit 8e45b8c324

View file

@ -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++]);