mirror of
https://github.com/libretro/RetroArch
synced 2025-02-21 09:39:56 +00:00
Create CORE_CTL_{INPUT_DESCRIPTORS}
This commit is contained in:
parent
9a90008543
commit
c7a9182d59
@ -32,6 +32,7 @@
|
|||||||
#include "input/input_remapping.h"
|
#include "input/input_remapping.h"
|
||||||
#include "defaults.h"
|
#include "defaults.h"
|
||||||
#include "general.h"
|
#include "general.h"
|
||||||
|
#include "libretro_version_1.h"
|
||||||
#include "retroarch.h"
|
#include "retroarch.h"
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
#include "verbosity.h"
|
#include "verbosity.h"
|
||||||
@ -2422,7 +2423,7 @@ void config_load(void)
|
|||||||
config_save_file(global->path.core_specific_config);
|
config_save_file(global->path.core_specific_config);
|
||||||
|
|
||||||
/* Flush out some states that could have been set by core environment variables */
|
/* Flush out some states that could have been set by core environment variables */
|
||||||
global->has_set.input_descriptors = false;
|
core_ctl(CORE_CTL_UNSET_INPUT_DESCRIPTORS, NULL);
|
||||||
|
|
||||||
if (!rarch_ctl(RARCH_CTL_IS_BLOCK_CONFIG_READ, NULL))
|
if (!rarch_ctl(RARCH_CTL_IS_BLOCK_CONFIG_READ, NULL))
|
||||||
{
|
{
|
||||||
|
@ -873,7 +873,7 @@ bool rarch_environment_cb(unsigned cmd, void *data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
global->has_set.input_descriptors = true;
|
core_ctl(CORE_CTL_SET_INPUT_DESCRIPTORS, NULL);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -173,6 +173,7 @@ static void retro_set_rewind_callbacks(void)
|
|||||||
|
|
||||||
bool core_ctl(enum core_ctl_state state, void *data)
|
bool core_ctl(enum core_ctl_state state, void *data)
|
||||||
{
|
{
|
||||||
|
static bool has_set_input_descriptors = false;
|
||||||
static struct retro_callbacks retro_ctx;
|
static struct retro_callbacks retro_ctx;
|
||||||
|
|
||||||
switch (state)
|
switch (state)
|
||||||
@ -366,6 +367,14 @@ bool core_ctl(enum core_ctl_state state, void *data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case CORE_CTL_HAS_SET_INPUT_DESCRIPTORS:
|
||||||
|
return has_set_input_descriptors;
|
||||||
|
case CORE_CTL_SET_INPUT_DESCRIPTORS:
|
||||||
|
has_set_input_descriptors = true;
|
||||||
|
break;
|
||||||
|
case CORE_CTL_UNSET_INPUT_DESCRIPTORS:
|
||||||
|
has_set_input_descriptors = false;
|
||||||
|
break;
|
||||||
case CORE_CTL_NONE:
|
case CORE_CTL_NONE:
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -108,7 +108,13 @@ enum core_ctl_state
|
|||||||
|
|
||||||
CORE_CTL_RETRO_LOAD_GAME,
|
CORE_CTL_RETRO_LOAD_GAME,
|
||||||
|
|
||||||
CORE_CTL_RETRO_SET_CONTROLLER_PORT_DEVICE
|
CORE_CTL_RETRO_SET_CONTROLLER_PORT_DEVICE,
|
||||||
|
|
||||||
|
CORE_CTL_HAS_SET_INPUT_DESCRIPTORS,
|
||||||
|
|
||||||
|
CORE_CTL_SET_INPUT_DESCRIPTORS,
|
||||||
|
|
||||||
|
CORE_CTL_UNSET_INPUT_DESCRIPTORS
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct retro_ctx_input_state_info
|
typedef struct retro_ctx_input_state_info
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
#include "../general.h"
|
#include "../general.h"
|
||||||
#include "../retroarch.h"
|
#include "../retroarch.h"
|
||||||
#include "../system.h"
|
#include "../system.h"
|
||||||
|
#include "../libretro_version_1.h"
|
||||||
#include "../frontend/frontend_driver.h"
|
#include "../frontend/frontend_driver.h"
|
||||||
#include "../ui/ui_companion_driver.h"
|
#include "../ui/ui_companion_driver.h"
|
||||||
#include "../gfx/video_shader_driver.h"
|
#include "../gfx/video_shader_driver.h"
|
||||||
@ -2026,7 +2027,6 @@ static int menu_displaylist_parse_load_content_settings(
|
|||||||
menu_displaylist_info_t *info)
|
menu_displaylist_info_t *info)
|
||||||
{
|
{
|
||||||
menu_handle_t *menu = NULL;
|
menu_handle_t *menu = NULL;
|
||||||
global_t *global = global_get_ptr();
|
|
||||||
#ifdef HAVE_CHEEVOS
|
#ifdef HAVE_CHEEVOS
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
#endif
|
#endif
|
||||||
@ -2077,7 +2077,7 @@ static int menu_displaylist_parse_load_content_settings(
|
|||||||
menu_hash_to_str(MENU_LABEL_CORE_OPTIONS),
|
menu_hash_to_str(MENU_LABEL_CORE_OPTIONS),
|
||||||
MENU_SETTING_ACTION, 0, 0);
|
MENU_SETTING_ACTION, 0, 0);
|
||||||
|
|
||||||
if (global->has_set.input_descriptors)
|
if (core_ctl(CORE_CTL_HAS_SET_INPUT_DESCRIPTORS, NULL))
|
||||||
menu_entries_push(info->list,
|
menu_entries_push(info->list,
|
||||||
menu_hash_to_str(MENU_LABEL_VALUE_CORE_INPUT_REMAPPING_OPTIONS),
|
menu_hash_to_str(MENU_LABEL_VALUE_CORE_INPUT_REMAPPING_OPTIONS),
|
||||||
menu_hash_to_str(MENU_LABEL_CORE_INPUT_REMAPPING_OPTIONS),
|
menu_hash_to_str(MENU_LABEL_CORE_INPUT_REMAPPING_OPTIONS),
|
||||||
|
@ -3327,7 +3327,7 @@ static bool setting_append_list_input_player_options(
|
|||||||
if (
|
if (
|
||||||
settings->input.input_descriptor_label_show
|
settings->input.input_descriptor_label_show
|
||||||
&& (i < RARCH_FIRST_META_KEY)
|
&& (i < RARCH_FIRST_META_KEY)
|
||||||
&& (global->has_set.input_descriptors)
|
&& (core_ctl(CORE_CTL_HAS_SET_INPUT_DESCRIPTORS, NULL))
|
||||||
&& (i != RARCH_TURBO_ENABLE)
|
&& (i != RARCH_TURBO_ENABLE)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
@ -901,6 +901,8 @@ bool runloop_ctl(enum runloop_ctl_state state, void *data)
|
|||||||
runloop_ctl(RUNLOOP_CTL_CLEAR_CONTENT_PATH, NULL);
|
runloop_ctl(RUNLOOP_CTL_CLEAR_CONTENT_PATH, NULL);
|
||||||
runloop_overrides_active = false;
|
runloop_overrides_active = false;
|
||||||
|
|
||||||
|
core_ctl(CORE_CTL_UNSET_INPUT_DESCRIPTORS, NULL);
|
||||||
|
|
||||||
global = global_get_ptr();
|
global = global_get_ptr();
|
||||||
memset(global, 0, sizeof(struct global));
|
memset(global, 0, sizeof(struct global));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user