all repos — mgba @ 1807b66bd60c4dadd91190833ca0a81e8d4d49bd

mGBA Game Boy Advance Emulator

Revert "GBA: Disable cheat hooks"

This reverts commit 2e55bd098ac97fcb203634f5c65651695de6eb38.
Vicki Pfau vi@endrift.com
Thu, 26 Apr 2018 06:47:09 -0700
commit

1807b66bd60c4dadd91190833ca0a81e8d4d49bd

parent

b89b3b6d138383d235729f728149eaf3f69f01eb

2 files changed, 5 insertions(+), 3 deletions(-)

jump to
M src/gba/cheats.csrc/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.csrc/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); + } } }