From 883f07f487ecd2e803cf2f924ab1e9a51e5f4fa9 Mon Sep 17 00:00:00 2001 From: David Guillen Fandos Date: Wed, 5 May 2021 18:07:55 +0200 Subject: Fix small buf and add cheat error messages Some minor formating too --- libretro.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'libretro.c') diff --git a/libretro.c b/libretro.c index 40aec37..d8e9efc 100644 --- a/libretro.c +++ b/libretro.c @@ -647,7 +647,23 @@ void retro_cheat_set(unsigned index, bool enabled, const char* code) if (!enabled) return; - cheat_parse(index, code); + switch (cheat_parse(index, code)) + { + case CheatErrorTooMany: + show_warning_message("Too many active cheats!", 2500); + break; + case CheatErrorTooBig: + show_warning_message("Cheats are too big!", 2500); + break; + case CheatErrorEncrypted: + show_warning_message("Encrypted cheats are not supported!", 2500); + break; + case CheatErrorNotSupported: + show_warning_message("Cheat type is not supported!", 2500); + break; + case CheatNoError: + break; + }; } static void extract_directory(char* buf, const char* path, size_t size) -- cgit v1.2.3