diff --git a/CHANGES b/CHANGES index 6120c5fa2..c6edc5144 100644 --- a/CHANGES +++ b/CHANGES @@ -132,6 +132,7 @@ Bugfixes: - GB Video: Changing LYC while LCDC off doesn't affect STAT (fixes mgba.io/i/1224) - GBA I/O: SOUNDCNT_HI is readable when sound is off - SDL: Fix handling of invalid gamepads (fixes mgba.io/i/1239) + - Libretro: Fix adding codes with hooks Misc: - mGUI: Add SGB border configuration option - mGUI: Add support for different settings types diff --git a/src/gba/cheats.c b/src/gba/cheats.c index 19e80b0b1..8999abc23 100644 --- a/src/gba/cheats.c +++ b/src/gba/cheats.c @@ -276,6 +276,9 @@ static void GBACheatRefresh(struct mCheatSet* cheats, struct mCheatDevice* devic struct GBACheatSet* gbaset = (struct GBACheatSet*) cheats; if (cheats->enabled) { _patchROM(device, gbaset); + if (gbaset->hook && !gbaset->hook->reentries) { + _addBreakpoint(device, gbaset); + } } else { _unpatchROM(device, gbaset); } diff --git a/src/platform/libretro/libretro.c b/src/platform/libretro/libretro.c index 06a9638b1..4258572f5 100644 --- a/src/platform/libretro/libretro.c +++ b/src/platform/libretro/libretro.c @@ -656,6 +656,7 @@ void retro_cheat_set(unsigned index, bool enabled, const char* code) { } } #endif + cheatSet->refresh(cheatSet, device); } unsigned retro_get_region(void) {