From b58ee6c29def7de51b5d92c2d36dcc7d0ecb8581 Mon Sep 17 00:00:00 2001 From: Andre Leiradella Date: Fri, 6 Nov 2015 17:32:40 -0200 Subject: [PATCH 1/3] correct formatting --- content.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/content.c b/content.c index a37f873960..9eebff5e0e 100644 --- a/content.c +++ b/content.c @@ -517,12 +517,12 @@ static bool load_content(const struct retro_subsystem_info *special, { ret = core.retro_load_game(*content->elems[0].data ? info : NULL); - #ifdef HAVE_CHEEVOS - /* Load the achievements into memory if the game has content. */ +#ifdef HAVE_CHEEVOS + /* Load the achievements into memory if the game has content. */ - cheevos_globals.cheats_were_enabled = cheevos_globals.cheats_are_enabled; - cheevos_load(*content->elems[0].data ? info : NULL); - #endif + cheevos_globals.cheats_were_enabled = cheevos_globals.cheats_are_enabled; + cheevos_load(*content->elems[0].data ? info : NULL); +#endif } if (!ret) From d61d703d33d8bcd55c46c15ec3d1583f19a3df0b Mon Sep 17 00:00:00 2001 From: Andre Leiradella Date: Fri, 6 Nov 2015 17:37:06 -0200 Subject: [PATCH 2/3] added log message when the core doesn't support cheevos --- cheevos.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cheevos.c b/cheevos.c index b269ba19a1..dee4293171 100644 --- a/cheevos.c +++ b/cheevos.c @@ -1792,7 +1792,8 @@ int cheevos_load(const struct retro_game_info *info) if (!memory) { rarch_main_msg_queue_push("This core doesn't support achievements", 0, 5 * 60, false); - //return -1; + RARCH_LOG("This core doesn't support achievements\n"); + return -1; } /* The the supported extensions as a hint to what method we should use. */ From 17ef8fba27ac0515a4b61643616101562cfe1c04 Mon Sep 17 00:00:00 2001 From: Andre Leiradella Date: Fri, 6 Nov 2015 19:14:18 -0200 Subject: [PATCH 3/3] fix crashes for cores that don't require content to run --- cheevos.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cheevos.c b/cheevos.c index dee4293171..d1e2a7578a 100644 --- a/cheevos.c +++ b/cheevos.c @@ -1784,6 +1784,10 @@ int cheevos_load(const struct retro_game_info *info) if (!config_get_ptr()->cheevos.enable) return 0; + /* Also return OK if there's no content. */ + if (!info) + return 0; + memory = core.retro_get_memory_size(RETRO_MEMORY_SYSTEM_RAM); memory += core.retro_get_memory_size(RETRO_MEMORY_VIDEO_RAM); memory += core.retro_get_memory_size(RETRO_MEMORY_RTC);