From 064f23b354e12c46950e0fb2cd12e4d62a0144b9 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 24 Nov 2014 06:21:52 +0100 Subject: [PATCH] Add content_is_init - set to true if content file has been loaded into memory, set to false when it has failed in doing so --- content.c | 5 ++++- frontend/frontend.c | 5 ++--- general.h | 1 + 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/content.c b/content.c index 7d84358b12..ea26174ae0 100644 --- a/content.c +++ b/content.c @@ -134,8 +134,12 @@ static ssize_t read_content_file(const char *path, void **buf) { uint8_t *ret_buf = NULL; ssize_t ret = -1; + + RARCH_LOG("Loading content file: %s.\n", path); ret = read_file(path, (void**) &ret_buf); + g_extern.content_is_init = (ret <= 0) ? false : true; + if (ret <= 0) return ret; @@ -371,7 +375,6 @@ static bool load_content(const struct retro_subsystem_info *special, if (!need_fullpath && *path) { /* Load the content into memory. */ - RARCH_LOG("Loading content file: %s.\n", path); /* First content file is significant, attempt to do patching, * CRC checking, etc. */ diff --git a/frontend/frontend.c b/frontend/frontend.c index c84f61fec8..b651f65ce1 100644 --- a/frontend/frontend.c +++ b/frontend/frontend.c @@ -254,9 +254,8 @@ returntype main_entry(signature()) if (g_settings.history_list_enable) { -#if defined(RARCH_CONSOLE) || defined(RARCH_MOBILE) - if (ret) -#endif + /* TODO - need to also check for SET_SUPPORT_NO_GAME here. */ + if (g_extern.content_is_init) history_playlist_push(g_defaults.history, g_extern.fullpath, g_settings.libretro, diff --git a/general.h b/general.h index c587737d83..f85caefa33 100644 --- a/general.h +++ b/general.h @@ -785,6 +785,7 @@ struct global FILE *log_file; bool main_is_init; + bool content_is_init; bool error_in_init; char error_string[PATH_MAX]; jmp_buf error_sjlj_context;