GBA Cheats: Fix key-activated CodeBreaker cheats

This commit is contained in:
Jeffrey Pfau 2016-09-21 23:30:12 -07:00
parent 1f0f943526
commit 78af66c9d5
4 changed files with 10 additions and 3 deletions

View File

@ -9,6 +9,7 @@ Bugfixes:
- 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

View File

@ -349,6 +349,11 @@ void mCheatRefresh(struct mCheatDevice* device, struct mCheatSet* cheats) {
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) {

View File

@ -27,7 +27,8 @@ enum mCheatType {
CHEAT_IF_ULT,
CHEAT_IF_UGT,
CHEAT_IF_AND,
CHEAT_IF_LAND
CHEAT_IF_LAND,
CHEAT_IF_NAND
};
struct mCheat {

View File

@ -276,9 +276,9 @@ bool GBACheatAddCodeBreaker(struct GBACheatSet* cheats, uint32_t op1, uint16_t o
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;