From c16cae7ef9b6e7c854fc3a02f344b4f22b6c7d63 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 27 May 2016 19:26:45 +0200 Subject: [PATCH] Create retroarch_set_current_core_type --- retroarch.c | 10 ++++++++++ retroarch.h | 7 +++---- tasks/task_content.c | 1 + 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/retroarch.c b/retroarch.c index 122eec9f8b..ceb6be74e7 100644 --- a/retroarch.c +++ b/retroarch.c @@ -106,6 +106,7 @@ enum RA_OPT_MAX_FRAMES }; +static bool current_core_explicitly_set = false; static enum rarch_core_type current_core_type; static char current_savefile_dir[PATH_MAX_LENGTH]; @@ -1296,6 +1297,9 @@ bool retroarch_main_init(int argc, char *argv[]) runloop_ctl(RUNLOOP_CTL_TASK_INIT, NULL); + if (current_core_explicitly_set) + current_core_explicitly_set = false; + else { settings_t *settings = config_get_ptr(); @@ -1639,6 +1643,12 @@ int retroarch_get_capabilities(enum rarch_capabilities type, return 0; } +void retroarch_set_current_core_type(enum rarch_core_type type) +{ + current_core_explicitly_set = true; + current_core_type = type; +} + /** * retroarch_fail: * @error_code : Error code. diff --git a/retroarch.h b/retroarch.h index 21b951d2dc..6589a5d5b0 100644 --- a/retroarch.h +++ b/retroarch.h @@ -19,6 +19,8 @@ #include +#include "core_type.h" + #ifdef __cplusplus extern "C" { #endif @@ -152,10 +154,7 @@ void retroarch_set_pathnames(const char *path); void retroarch_fill_pathnames(void); -/* Replaces currently loaded configuration file with - * another one. Will load a dummy core to flush state - * properly. */ -bool retroarch_replace_config(char *path); +void retroarch_set_current_core_type(enum rarch_core_type type); /** * retroarch_fail: diff --git a/tasks/task_content.c b/tasks/task_content.c index 2bd7e59617..33a621a497 100644 --- a/tasks/task_content.c +++ b/tasks/task_content.c @@ -1754,6 +1754,7 @@ bool task_push_content_load_default( core_path = settings->path.libretro; /* TODO/FIXME */ runloop_ctl(RUNLOOP_CTL_CLEAR_CONTENT_PATH, NULL); runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, (void*)core_path); + retroarch_set_current_core_type(CORE_TYPE_NET_RETROPAD); #ifdef HAVE_DYNAMIC command_event(CMD_EVENT_LOAD_CORE, NULL); #endif