all repos — mgba @ 78af66c9d5847a6281947143016b931c18b1a075

mGBA Game Boy Advance Emulator

GBA Cheats: Fix key-activated CodeBreaker cheats
Jeffrey Pfau jeffrey@endrift.com
Wed, 21 Sep 2016 23:30:12 -0700
commit

78af66c9d5847a6281947143016b931c18b1a075

parent

1f0f943526b06790aaf9dfaffa9538f21988af19

4 files changed, 10 insertions(+), 3 deletions(-)

jump to
M CHANGESCHANGES

@@ -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.csrc/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.hsrc/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.csrc/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;