Move code to proper locations

This commit is contained in:
twinaphex 2021-11-23 16:58:36 +01:00
parent 0a40e1f771
commit b4137915e8
4 changed files with 82 additions and 91 deletions

View File

@ -177,6 +177,18 @@ audio_driver_state_t *audio_state_get_ptr(void)
return &audio_driver_st;
}
/**
* config_get_audio_driver_options:
*
* Get an enumerated list of all audio driver names, separated by '|'.
*
* Returns: string listing of all audio driver names, separated by '|'.
**/
const char *config_get_audio_driver_options(void)
{
return char_list_new_special(STRING_LIST_AUDIO_DRIVERS, NULL);
}
#ifdef HAVE_TRANSLATE
/* TODO/FIXME - Doesn't currently work. Fix this. */
bool audio_driver_is_ai_service_speech_running(void)

View File

@ -402,6 +402,12 @@ video_driver_state_t *video_state_get_ptr(void)
{
return &video_driver_st;
}
void crt_switch_driver_refresh(void)
{
video_driver_reinit(DRIVERS_CMD_ALL);
}
#ifdef HAVE_THREADS
void *video_thread_get_ptr(video_driver_state_t *video_st)

View File

@ -358,6 +358,30 @@ input_driver_state_t *input_state_get_ptr(void)
return &input_driver_st;
}
/**
* config_get_input_driver_options:
*
* Get an enumerated list of all input driver names, separated by '|'.
*
* Returns: string listing of all input driver names, separated by '|'.
**/
const char* config_get_input_driver_options(void)
{
return char_list_new_special(STRING_LIST_INPUT_DRIVERS, NULL);
}
/**
* config_get_joypad_driver_options:
*
* Get an enumerated list of all joypad driver names, separated by '|'.
*
* Returns: string listing of all joypad driver names, separated by '|'.
**/
const char* config_get_joypad_driver_options(void)
{
return char_list_new_special(STRING_LIST_INPUT_JOYPAD_DRIVERS, NULL);
}
/**
* Finds first suitable joypad driver and initializes. Used as a fallback by
* input_joypad_init_driver when no matching driver is found.

View File

@ -233,6 +233,14 @@
#define BSV_MOVIE_ARG
#endif
#define _PSUPP_BUF(buf, var, name, desc) \
strlcat(buf, " ", sizeof(buf)); \
strlcat(buf, name, sizeof(buf)); \
strlcat(buf, ":\n\t\t", sizeof(buf)); \
strlcat(buf, desc, sizeof(buf)); \
strlcat(buf, ": ", sizeof(buf)); \
strlcat(buf, var ? "yes\n" : "no\n", sizeof(buf))
/* Griffin hack */
#ifdef HAVE_QT
#ifndef HAVE_MAIN
@ -240,6 +248,38 @@
#endif
#endif
/* Descriptive names for options without short variant.
*
* Please keep the name in sync with the option name.
* Order does not matter. */
enum
{
RA_OPT_MENU = 256, /* must be outside the range of a char */
RA_OPT_STATELESS,
RA_OPT_CHECK_FRAMES,
RA_OPT_PORT,
RA_OPT_SPECTATE,
RA_OPT_NICK,
RA_OPT_COMMAND,
RA_OPT_APPENDCONFIG,
RA_OPT_BPS,
RA_OPT_IPS,
RA_OPT_NO_PATCH,
RA_OPT_RECORDCONFIG,
RA_OPT_SUBSYSTEM,
RA_OPT_SIZE,
RA_OPT_FEATURES,
RA_OPT_VERSION,
RA_OPT_EOF_EXIT,
RA_OPT_LOG_FILE,
RA_OPT_MAX_FRAMES,
RA_OPT_MAX_FRAMES_SCREENSHOT,
RA_OPT_MAX_FRAMES_SCREENSHOT_PATH,
RA_OPT_SET_SHADER,
RA_OPT_ACCESSIBILITY,
RA_OPT_LOAD_MENU_ON_ERROR
};
/* DRIVERS */
#ifdef HAVE_BLUETOOTH
extern const bluetooth_driver_t *bluetooth_drivers[];
@ -3970,64 +4010,6 @@ void libretro_free_system_info(struct retro_system_info *info)
memset(info, 0, sizeof(*info));
}
/* INPUT */
/**
* config_get_input_driver_options:
*
* Get an enumerated list of all input driver names, separated by '|'.
*
* Returns: string listing of all input driver names, separated by '|'.
**/
const char* config_get_input_driver_options(void)
{
return char_list_new_special(STRING_LIST_INPUT_DRIVERS, NULL);
}
/* MENU INPUT */
/**
* config_get_joypad_driver_options:
*
* Get an enumerated list of all joypad driver names, separated by '|'.
*
* Returns: string listing of all joypad driver names, separated by '|'.
**/
const char* config_get_joypad_driver_options(void)
{
return char_list_new_special(STRING_LIST_INPUT_JOYPAD_DRIVERS, NULL);
}
/* AUDIO */
/**
* config_get_audio_driver_options:
*
* Get an enumerated list of all audio driver names, separated by '|'.
*
* Returns: string listing of all audio driver names, separated by '|'.
**/
const char *config_get_audio_driver_options(void)
{
return char_list_new_special(STRING_LIST_AUDIO_DRIVERS, NULL);
}
/* VIDEO */
void crt_switch_driver_refresh(void)
{
/*video_context_driver_reset();*/
video_driver_reinit(DRIVERS_CMD_ALL);
}
#define _PSUPP_BUF(buf, var, name, desc) \
strlcat(buf, " ", sizeof(buf)); \
strlcat(buf, name, sizeof(buf)); \
strlcat(buf, ":\n\t\t", sizeof(buf)); \
strlcat(buf, desc, sizeof(buf)); \
strlcat(buf, ": ", sizeof(buf)); \
strlcat(buf, var ? "yes\n" : "no\n", sizeof(buf))
static void retroarch_print_features(void)
{
char buf[2048];
@ -4277,39 +4259,6 @@ static void retroarch_print_help(const char *arg0)
}
}
/* Descriptive names for options without short variant.
*
* Please keep the name in sync with the option name.
* Order does not matter. */
enum
{
RA_OPT_MENU = 256, /* must be outside the range of a char */
RA_OPT_STATELESS,
RA_OPT_CHECK_FRAMES,
RA_OPT_PORT,
RA_OPT_SPECTATE,
RA_OPT_NICK,
RA_OPT_COMMAND,
RA_OPT_APPENDCONFIG,
RA_OPT_BPS,
RA_OPT_IPS,
RA_OPT_NO_PATCH,
RA_OPT_RECORDCONFIG,
RA_OPT_SUBSYSTEM,
RA_OPT_SIZE,
RA_OPT_FEATURES,
RA_OPT_VERSION,
RA_OPT_EOF_EXIT,
RA_OPT_LOG_FILE,
RA_OPT_MAX_FRAMES,
RA_OPT_MAX_FRAMES_SCREENSHOT,
RA_OPT_MAX_FRAMES_SCREENSHOT_PATH,
RA_OPT_SET_SHADER,
RA_OPT_ACCESSIBILITY,
RA_OPT_LOAD_MENU_ON_ERROR
};
/**
* retroarch_parse_input_and_config:
* @argc : Count of (commandline) arguments.