From 4fd456e1583a4c8686c8de87c2aeb1eb78125be1 Mon Sep 17 00:00:00 2001 From: David Guillen Fandos Date: Wed, 5 May 2021 02:20:00 +0200 Subject: Adding Code Breaker cheat support This works on both interpreter and dynarec. Tested in MIPS, ARM and x86, still needs some more testing, some edge cases can be buggy. --- libretro.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'libretro.c') diff --git a/libretro.c b/libretro.c index 21ca04f..40aec37 100644 --- a/libretro.c +++ b/libretro.c @@ -639,8 +639,16 @@ bool retro_unserialize(const void* data, size_t size) void retro_cheat_reset(void) { + cheat_clear(); +} + +void retro_cheat_set(unsigned index, bool enabled, const char* code) +{ + if (!enabled) + return; + + cheat_parse(index, code); } -void retro_cheat_set(unsigned index, bool enabled, const char* code) {} static void extract_directory(char* buf, const char* path, size_t size) { -- cgit v1.2.3