mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-27 10:10:57 +00:00
Create CORE_INFO_CTL commands
This commit is contained in:
parent
e1bd5ca335
commit
7a01fb1616
19
core_info.c
19
core_info.c
@ -662,8 +662,27 @@ void core_info_list_get_missing_firmware(
|
||||
|
||||
bool core_info_ctl(enum core_info_state state, void *data)
|
||||
{
|
||||
static core_info_list_t *core_info_curr_list = NULL;
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case CORE_INFO_CTL_LIST_DEINIT:
|
||||
if (core_info_curr_list)
|
||||
core_info_list_free(core_info_curr_list);
|
||||
core_info_curr_list = NULL;
|
||||
return true;
|
||||
case CORE_INFO_CTL_LIST_INIT:
|
||||
core_info_curr_list = core_info_list_new();
|
||||
return true;
|
||||
case CORE_INFO_CTL_LIST_GET:
|
||||
{
|
||||
core_info_list_t **core = (core_info_list_t**)data;
|
||||
if (!core)
|
||||
return false;
|
||||
*core = core_info_curr_list;
|
||||
}
|
||||
return true;
|
||||
|
||||
case CORE_INFO_CTL_NONE:
|
||||
default:
|
||||
break;
|
||||
|
@ -26,7 +26,10 @@ extern "C" {
|
||||
|
||||
enum core_info_state
|
||||
{
|
||||
CORE_INFO_CTL_NONE = 0
|
||||
CORE_INFO_CTL_NONE = 0,
|
||||
CORE_INFO_CTL_LIST_DEINIT,
|
||||
CORE_INFO_CTL_LIST_INIT,
|
||||
CORE_INFO_CTL_LIST_GET
|
||||
};
|
||||
|
||||
typedef struct
|
||||
|
17
runloop.c
17
runloop.c
@ -436,7 +436,6 @@ bool runloop_ctl(enum runloop_ctl_state state, void *data)
|
||||
static slock_t *runloop_msg_queue_lock = NULL;
|
||||
#endif
|
||||
static core_info_t *core_info_current = NULL;
|
||||
static core_info_list_t *core_info_curr_list = NULL;
|
||||
static msg_queue_t *runloop_msg_queue = NULL;
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
@ -489,21 +488,11 @@ bool runloop_ctl(enum runloop_ctl_state state, void *data)
|
||||
case RUNLOOP_CTL_HAS_CORE_OPTIONS:
|
||||
return runloop_system.core_options;
|
||||
case RUNLOOP_CTL_CURRENT_CORE_LIST_FREE:
|
||||
if (core_info_curr_list)
|
||||
core_info_list_free(core_info_curr_list);
|
||||
core_info_curr_list = NULL;
|
||||
return true;
|
||||
return core_info_ctl(CORE_INFO_CTL_LIST_DEINIT, NULL);
|
||||
case RUNLOOP_CTL_CURRENT_CORE_LIST_INIT:
|
||||
core_info_curr_list = core_info_list_new();
|
||||
return true;
|
||||
return core_info_ctl(CORE_INFO_CTL_LIST_INIT, NULL);
|
||||
case RUNLOOP_CTL_CURRENT_CORE_LIST_GET:
|
||||
{
|
||||
core_info_list_t **core = (core_info_list_t**)data;
|
||||
if (!core)
|
||||
return false;
|
||||
*core = core_info_curr_list;
|
||||
}
|
||||
return true;
|
||||
return core_info_ctl(CORE_INFO_CTL_LIST_GET, data);
|
||||
case RUNLOOP_CTL_CURRENT_CORE_FREE:
|
||||
if (core_info_current)
|
||||
free(core_info_current);
|
||||
|
Loading…
Reference in New Issue
Block a user