Create retroarch_set_current_core_type

This commit is contained in:
twinaphex 2016-05-27 19:26:45 +02:00
parent ccd5b2f73d
commit c16cae7ef9
3 changed files with 14 additions and 4 deletions

View File

@ -106,6 +106,7 @@ enum
RA_OPT_MAX_FRAMES RA_OPT_MAX_FRAMES
}; };
static bool current_core_explicitly_set = false;
static enum rarch_core_type current_core_type; static enum rarch_core_type current_core_type;
static char current_savefile_dir[PATH_MAX_LENGTH]; 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); runloop_ctl(RUNLOOP_CTL_TASK_INIT, NULL);
if (current_core_explicitly_set)
current_core_explicitly_set = false;
else
{ {
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
@ -1639,6 +1643,12 @@ int retroarch_get_capabilities(enum rarch_capabilities type,
return 0; return 0;
} }
void retroarch_set_current_core_type(enum rarch_core_type type)
{
current_core_explicitly_set = true;
current_core_type = type;
}
/** /**
* retroarch_fail: * retroarch_fail:
* @error_code : Error code. * @error_code : Error code.

View File

@ -19,6 +19,8 @@
#include <boolean.h> #include <boolean.h>
#include "core_type.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@ -152,10 +154,7 @@ void retroarch_set_pathnames(const char *path);
void retroarch_fill_pathnames(void); void retroarch_fill_pathnames(void);
/* Replaces currently loaded configuration file with void retroarch_set_current_core_type(enum rarch_core_type type);
* another one. Will load a dummy core to flush state
* properly. */
bool retroarch_replace_config(char *path);
/** /**
* retroarch_fail: * retroarch_fail:

View File

@ -1754,6 +1754,7 @@ bool task_push_content_load_default(
core_path = settings->path.libretro; /* TODO/FIXME */ core_path = settings->path.libretro; /* TODO/FIXME */
runloop_ctl(RUNLOOP_CTL_CLEAR_CONTENT_PATH, NULL); runloop_ctl(RUNLOOP_CTL_CLEAR_CONTENT_PATH, NULL);
runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, (void*)core_path); runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, (void*)core_path);
retroarch_set_current_core_type(CORE_TYPE_NET_RETROPAD);
#ifdef HAVE_DYNAMIC #ifdef HAVE_DYNAMIC
command_event(CMD_EVENT_LOAD_CORE, NULL); command_event(CMD_EVENT_LOAD_CORE, NULL);
#endif #endif