diff --git a/cheevos.c b/cheevos.c index a391d032fd..9410968bf9 100644 --- a/cheevos.c +++ b/cheevos.c @@ -2499,6 +2499,25 @@ found: return false; } +void cheevos_reset_game(void) +{ + cheevo_t *cheevo = cheevos_locals.core.cheevos; + const cheevo_t *end = cheevo + cheevos_locals.core.count; + + for (; cheevo < end; cheevo++) + { + cheevo->last = 1; + } + + cheevo = cheevos_locals.unofficial.cheevos; + end = cheevo + cheevos_locals.unofficial.count; + + for (; cheevo < end; cheevo++) + { + cheevo->last = 1; + } +} + void cheevos_populate_menu(void *data) { #ifdef HAVE_MENU diff --git a/cheevos.h b/cheevos.h index 71ae2ac961..9b8985a6d2 100644 --- a/cheevos.h +++ b/cheevos.h @@ -41,6 +41,8 @@ typedef struct bool cheevos_load(const void *data); +void cheevos_reset_game(void); + void cheevos_populate_menu(void *data); bool cheevos_get_description(cheevos_ctx_desc_t *desc); diff --git a/core_impl.c b/core_impl.c index 5d669d6f01..3fe06e0e66 100644 --- a/core_impl.c +++ b/core_impl.c @@ -44,6 +44,7 @@ #include "verbosity.h" #include "gfx/video_driver.h" #include "audio/audio_driver.h" +#include "cheevos.h" static struct retro_core_t core; static unsigned core_poll_type; @@ -83,7 +84,7 @@ void core_set_input_state(retro_ctx_input_state_info_t *info) * core_init_libretro_cbs: * @data : pointer to retro_callbacks object * - * Initializes libretro callbacks, and binds the libretro callbacks + * Initializes libretro callbacks, and binds the libretro callbacks * to default callback functions. **/ static bool core_init_libretro_cbs(void *data) @@ -355,6 +356,7 @@ bool core_get_system_av_info(struct retro_system_av_info *av_info) bool core_reset(void) { core.retro_reset(); + cheevos_reset_game(); return true; } @@ -435,10 +437,10 @@ bool core_load(void) bool core_verify_api_version(void) { unsigned api_version = core.retro_api_version(); - RARCH_LOG("%s: %u\n", + RARCH_LOG("%s: %u\n", msg_hash_to_str(MSG_VERSION_OF_LIBRETRO_API), api_version); - RARCH_LOG("%s: %u\n", + RARCH_LOG("%s: %u\n", msg_hash_to_str(MSG_COMPILED_AGAINST_API), RETRO_API_VERSION);