Cheats: Fix 10/11/20/21 commands

This commit is contained in:
Connor McLaughlin 2020-09-28 19:42:42 +10:00
parent 9714a999bb
commit 58e24585c1

View file

@ -410,7 +410,7 @@ void CheatCode::Apply() const
{ {
u16 value = 0; u16 value = 0;
CPU::SafeReadMemoryHalfWord(inst.address, &value); CPU::SafeReadMemoryHalfWord(inst.address, &value);
CPU::SafeWriteMemoryHalfWord(inst.address, value + 1u); CPU::SafeWriteMemoryHalfWord(inst.address, value + inst.value16);
index++; index++;
} }
break; break;
@ -419,7 +419,7 @@ void CheatCode::Apply() const
{ {
u16 value = 0; u16 value = 0;
CPU::SafeReadMemoryHalfWord(inst.address, &value); CPU::SafeReadMemoryHalfWord(inst.address, &value);
CPU::SafeWriteMemoryHalfWord(inst.address, value - 1u); CPU::SafeWriteMemoryHalfWord(inst.address, value - inst.value16);
index++; index++;
} }
break; break;
@ -428,7 +428,7 @@ void CheatCode::Apply() const
{ {
u8 value = 0; u8 value = 0;
CPU::SafeReadMemoryByte(inst.address, &value); CPU::SafeReadMemoryByte(inst.address, &value);
CPU::SafeWriteMemoryByte(inst.address, value + 1u); CPU::SafeWriteMemoryByte(inst.address, value + inst.value8);
index++; index++;
} }
break; break;
@ -437,7 +437,7 @@ void CheatCode::Apply() const
{ {
u8 value = 0; u8 value = 0;
CPU::SafeReadMemoryByte(inst.address, &value); CPU::SafeReadMemoryByte(inst.address, &value);
CPU::SafeWriteMemoryByte(inst.address, value - 1u); CPU::SafeWriteMemoryByte(inst.address, value - inst.value8);
index++; index++;
} }
break; break;