From 75734c25c704c4d16391dc789cca2018072c8bbd Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Mon, 28 Sep 2020 21:18:08 +1000 Subject: [PATCH] Cheats: Implement 0x1F/scratchpad write --- src/core/cheats.cpp | 7 +++++++ src/core/cheats.h | 1 + 2 files changed, 8 insertions(+) diff --git a/src/core/cheats.cpp b/src/core/cheats.cpp index f73594aad..eeac73120 100644 --- a/src/core/cheats.cpp +++ b/src/core/cheats.cpp @@ -412,6 +412,13 @@ void CheatCode::Apply() const } break; + case InstructionCode::ScratchpadWrite16: + { + CPU::SafeWriteMemoryHalfWord(CPU::DCACHE_LOCATION | (inst.address & CPU::DCACHE_OFFSET_MASK), inst.value16); + index++; + } + break; + case InstructionCode::Increment16: { u16 value = 0; diff --git a/src/core/cheats.h b/src/core/cheats.h index 6447eb64d..8c2f86d58 100644 --- a/src/core/cheats.h +++ b/src/core/cheats.h @@ -12,6 +12,7 @@ struct CheatCode Nop = 0x00, ConstantWrite8 = 0x30, ConstantWrite16 = 0x80, + ScratchpadWrite16 = 0x1F, Increment16 = 0x10, Decrement16 = 0x11, Increment8 = 0x20,