Cheats: Implement C0 command (activate codes iff equal)

This commit is contained in:
Connor McLaughlin 2020-12-02 22:50:36 +10:00
parent 3eaf28675a
commit c406f0708f
2 changed files with 11 additions and 0 deletions

View file

@ -921,6 +921,16 @@ void CheatCode::Apply() const
}
break;
case InstructionCode::ExitIfNotEqual16:
{
u16 value = DoMemoryRead<u16>(inst.address);
if (value == inst.value16)
index++;
else
index = count;
}
break;
case InstructionCode::Slide:
{
if ((index + 1) >= instructions.size())

View file

@ -30,6 +30,7 @@ struct CheatCode
Decrement16 = 0x11,
Increment8 = 0x20,
Decrement8 = 0x21,
ExitIfNotEqual16 = 0xC0,
CompareEqual16 = 0xD0,
CompareNotEqual16 = 0xD1,
CompareLess16 = 0xD2,