Permalink
Browse files

Revert "GBA: Disable cheat hooks"

This reverts commit 2e55bd0.
  • Loading branch information...
endrift committed Apr 26, 2018
1 parent b89b3b6 commit 1807b66bd60c4dadd91190833ca0a81e8d4d49bd
Showing with 5 additions and 3 deletions.
  1. +2 −2 src/gba/cheats.c
  2. +3 −1 src/gba/gba.c
View
@@ -21,7 +21,7 @@ static void _addBreakpoint(struct mCheatDevice* device, struct GBACheatSet* chea
if (cheats->hook->reentries > 1) {
return;
}
- // TODO: Put back hooks
+ GBASetBreakpoint(device->p->board, &device->d, cheats->hook->address, cheats->hook->mode, &cheats->hook->patchedOpcode);
}
static void _removeBreakpoint(struct mCheatDevice* device, struct GBACheatSet* cheats) {
@@ -32,7 +32,7 @@ static void _removeBreakpoint(struct mCheatDevice* device, struct GBACheatSet* c
if (cheats->hook->reentries > 0) {
return;
}
- // TODO: Put back hooks
+ GBAClearBreakpoint(device->p->board, cheats->hook->address, cheats->hook->mode, cheats->hook->patchedOpcode);
}
static void _patchROM(struct mCheatDevice* device, struct GBACheatSet* cheats) {
View
@@ -805,7 +805,9 @@ void GBAFrameEnded(struct GBA* gba) {
size_t i;
for (i = 0; i < mCheatSetsSize(&device->cheats); ++i) {
struct GBACheatSet* cheats = (struct GBACheatSet*) *mCheatSetsGetPointer(&device->cheats, i);
- mCheatRefresh(device, &cheats->d);
+ if (!cheats->hook) {
+ mCheatRefresh(device, &cheats->d);
+ }
}
}

0 comments on commit 1807b66

Please sign in to comment.