GBA Cheats: Fix key-activated CodeBreaker cheats
Jeffrey Pfau jeffrey@endrift.com
Wed, 21 Sep 2016 23:30:12 -0700
4 files changed,
10 insertions(+),
3 deletions(-)
M
CHANGES
→
CHANGES
@@ -9,6 +9,7 @@ - FFmpeg: Fix encoding AAC
- GB Video: Fix video frames getting missed when LCDC is off - LR35902: Fix events running with the wrong cycle active - GB Video: Clear screen when LCDC is off + - GBA Cheats: Fix key-activated CodeBreaker cheats Misc: - All: Only update version info if needed - FFmpeg: Encoding cleanup
M
src/core/cheats.c
→
src/core/cheats.c
@@ -349,6 +349,11 @@ condition = _readMem(device->p, address, cheat->width) && operand;
conditionRemaining = cheat->repeat; negativeConditionRemaining = cheat->negativeRepeat; break; + case CHEAT_IF_NAND: + condition = !(_readMem(device->p, address, cheat->width) & operand); + conditionRemaining = cheat->repeat; + negativeConditionRemaining = cheat->negativeRepeat; + break; } if (performAssignment) {
M
src/core/cheats.h
→
src/core/cheats.h
@@ -27,7 +27,8 @@ CHEAT_IF_GT,
CHEAT_IF_ULT, CHEAT_IF_UGT, CHEAT_IF_AND, - CHEAT_IF_LAND + CHEAT_IF_LAND, + CHEAT_IF_NAND }; struct mCheat {
M
src/gba/cheats/codebreaker.c
→
src/gba/cheats/codebreaker.c
@@ -276,9 +276,9 @@ case CB_IF_SPECIAL:
switch (op1 & 0x0FFFFFFF) { case 0x20: cheat = mCheatListAppend(&cheats->d.list); - cheat->type = CHEAT_IF_AND; + cheat->type = CHEAT_IF_NAND; cheat->width = 2; - cheat->address = BASE_IO | REG_JOYSTAT; + cheat->address = BASE_IO | REG_KEYINPUT; cheat->operand = op2; cheat->repeat = 1; return true;