Revert "GBA: Disable cheat hooks" This reverts commit 2e55bd098ac97fcb203634f5c65651695de6eb38.
Vicki Pfau vi@endrift.com
Thu, 26 Apr 2018 06:47:09 -0700
2 files changed,
5 insertions(+),
3 deletions(-)
M
src/gba/cheats.c
→
src/gba/cheats.c
@@ -21,7 +21,7 @@ ++cheats->hook->reentries;
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 @@ --cheats->hook->reentries;
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) {
M
src/gba/gba.c
→
src/gba/gba.c
@@ -805,7 +805,9 @@ struct mCheatDevice* device = (struct mCheatDevice*) gba->cpu->components[CPU_COMPONENT_CHEAT_DEVICE];
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); + } } }