From c406f0708f25704ee041d4b132f08122a9dc83b7 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Wed, 2 Dec 2020 22:50:36 +1000 Subject: [PATCH] Cheats: Implement C0 command (activate codes iff equal) --- src/core/cheats.cpp | 10 ++++++++++ src/core/cheats.h | 1 + 2 files changed, 11 insertions(+) diff --git a/src/core/cheats.cpp b/src/core/cheats.cpp index fe77448ad..628d9b1eb 100644 --- a/src/core/cheats.cpp +++ b/src/core/cheats.cpp @@ -921,6 +921,16 @@ void CheatCode::Apply() const } break; + case InstructionCode::ExitIfNotEqual16: + { + u16 value = DoMemoryRead(inst.address); + if (value == inst.value16) + index++; + else + index = count; + } + break; + case InstructionCode::Slide: { if ((index + 1) >= instructions.size()) diff --git a/src/core/cheats.h b/src/core/cheats.h index de0b0af37..b5a47f7f6 100644 --- a/src/core/cheats.h +++ b/src/core/cheats.h @@ -30,6 +30,7 @@ struct CheatCode Decrement16 = 0x11, Increment8 = 0x20, Decrement8 = 0x21, + ExitIfNotEqual16 = 0xC0, CompareEqual16 = 0xD0, CompareNotEqual16 = 0xD1, CompareLess16 = 0xD2,