mirror of
https://github.com/libretro/RetroArch
synced 2025-04-02 07:20:34 +00:00
rename a bunch of functions to runloop_ prefix instead of retroarch_ -
we need to make a better distinction between runloop and the 'retroarch state'
This commit is contained in:
parent
0b66c81197
commit
68f0e50a2f
113
retroarch.c
113
retroarch.c
@ -4409,7 +4409,7 @@ bool menu_input_dialog_start(menu_input_ctx_line_t *line)
|
|||||||
|
|
||||||
/* MESSAGE QUEUE */
|
/* MESSAGE QUEUE */
|
||||||
|
|
||||||
static void retroarch_msg_queue_deinit(void)
|
static void runloop_msg_queue_deinit(void)
|
||||||
{
|
{
|
||||||
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
||||||
RUNLOOP_MSG_QUEUE_LOCK(runloop_st);
|
RUNLOOP_MSG_QUEUE_LOCK(runloop_st);
|
||||||
@ -4425,13 +4425,15 @@ static void retroarch_msg_queue_deinit(void)
|
|||||||
runloop_st->msg_queue_size = 0;
|
runloop_st->msg_queue_size = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void retroarch_msg_queue_init(void)
|
static void runloop_msg_queue_init(void)
|
||||||
{
|
{
|
||||||
retroarch_msg_queue_deinit();
|
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
||||||
msg_queue_initialize(&runloop_state.msg_queue, 8);
|
|
||||||
|
runloop_msg_queue_deinit();
|
||||||
|
msg_queue_initialize(&runloop_st->msg_queue, 8);
|
||||||
|
|
||||||
#ifdef HAVE_THREADS
|
#ifdef HAVE_THREADS
|
||||||
runloop_state.msg_queue_lock = slock_new();
|
runloop_st->msg_queue_lock = slock_new();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4693,7 +4695,7 @@ bool command_set_shader(command_t *cmd, const char *arg)
|
|||||||
{
|
{
|
||||||
enum rarch_shader_type type = video_shader_parse_type(arg);
|
enum rarch_shader_type type = video_shader_parse_type(arg);
|
||||||
struct rarch_state *p_rarch = &rarch_st;
|
struct rarch_state *p_rarch = &rarch_st;
|
||||||
settings_t *settings = p_rarch->configuration_settings;
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
if (!string_is_empty(arg))
|
if (!string_is_empty(arg))
|
||||||
{
|
{
|
||||||
@ -4725,7 +4727,7 @@ static void task_auto_translate_handler(retro_task_t *task)
|
|||||||
int *mode_ptr = (int*)task->user_data;
|
int *mode_ptr = (int*)task->user_data;
|
||||||
struct rarch_state *p_rarch = &rarch_st;
|
struct rarch_state *p_rarch = &rarch_st;
|
||||||
#ifdef HAVE_ACCESSIBILITY
|
#ifdef HAVE_ACCESSIBILITY
|
||||||
settings_t *settings = p_rarch->configuration_settings;
|
settings_t *settings = config_get_ptr();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (task_get_cancelled(task))
|
if (task_get_cancelled(task))
|
||||||
@ -4741,7 +4743,8 @@ static void task_auto_translate_handler(retro_task_t *task)
|
|||||||
break;
|
break;
|
||||||
case 2: /* Narrator Mode */
|
case 2: /* Narrator Mode */
|
||||||
#ifdef HAVE_ACCESSIBILITY
|
#ifdef HAVE_ACCESSIBILITY
|
||||||
if (!is_narrator_running(p_rarch, settings->bools.accessibility_enable))
|
if (!is_narrator_running(p_rarch,
|
||||||
|
settings->bools.accessibility_enable))
|
||||||
goto task_finished;
|
goto task_finished;
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
@ -4825,7 +4828,7 @@ static void handle_translation_cb(
|
|||||||
char* auto_string = NULL;
|
char* auto_string = NULL;
|
||||||
char* key_string = NULL;
|
char* key_string = NULL;
|
||||||
struct rarch_state *p_rarch = &rarch_st;
|
struct rarch_state *p_rarch = &rarch_st;
|
||||||
settings_t* settings = p_rarch->configuration_settings;
|
settings_t* settings = config_get_ptr();
|
||||||
bool was_paused = runloop_state.paused;
|
bool was_paused = runloop_state.paused;
|
||||||
video_driver_state_t
|
video_driver_state_t
|
||||||
*video_st = video_state_get_ptr();
|
*video_st = video_state_get_ptr();
|
||||||
@ -6163,7 +6166,7 @@ static void command_event_runtime_log_init(struct rarch_state *p_rarch)
|
|||||||
sizeof(p_rarch->runtime_core_path));
|
sizeof(p_rarch->runtime_core_path));
|
||||||
}
|
}
|
||||||
|
|
||||||
static INLINE float retroarch_set_frame_limit(
|
static INLINE float runloop_set_frame_limit(
|
||||||
const struct retro_system_av_info *av_info,
|
const struct retro_system_av_info *av_info,
|
||||||
float fastforward_ratio)
|
float fastforward_ratio)
|
||||||
{
|
{
|
||||||
@ -6173,7 +6176,7 @@ static INLINE float retroarch_set_frame_limit(
|
|||||||
(av_info->timing.fps * fastforward_ratio));
|
(av_info->timing.fps * fastforward_ratio));
|
||||||
}
|
}
|
||||||
|
|
||||||
static INLINE float retroarch_get_runloop_fastforward_ratio(
|
static INLINE float runloop_get_fastforward_ratio(
|
||||||
settings_t *settings,
|
settings_t *settings,
|
||||||
struct retro_fastforwarding_override *fastmotion_override)
|
struct retro_fastforwarding_override *fastmotion_override)
|
||||||
{
|
{
|
||||||
@ -6246,7 +6249,7 @@ static bool command_event_init_core(
|
|||||||
#endif
|
#endif
|
||||||
show_set_initial_disk_msg = settings->bools.notification_show_set_initial_disk;
|
show_set_initial_disk_msg = settings->bools.notification_show_set_initial_disk;
|
||||||
poll_type_behavior = settings->uints.input_poll_type_behavior;
|
poll_type_behavior = settings->uints.input_poll_type_behavior;
|
||||||
fastforward_ratio = retroarch_get_runloop_fastforward_ratio(
|
fastforward_ratio = runloop_get_fastforward_ratio(
|
||||||
settings, &runloop_state.fastmotion_override.current);
|
settings, &runloop_state.fastmotion_override.current);
|
||||||
|
|
||||||
#ifdef HAVE_CHEEVOS
|
#ifdef HAVE_CHEEVOS
|
||||||
@ -6308,7 +6311,7 @@ static bool command_event_init_core(
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
runloop_st->frame_limit_minimum_time =
|
runloop_st->frame_limit_minimum_time =
|
||||||
retroarch_set_frame_limit(&video_st->av_info,
|
runloop_set_frame_limit(&video_st->av_info,
|
||||||
fastforward_ratio);
|
fastforward_ratio);
|
||||||
runloop_st->frame_limit_last_time = cpu_features_get_time_usec();
|
runloop_st->frame_limit_last_time = cpu_features_get_time_usec();
|
||||||
|
|
||||||
@ -6871,9 +6874,7 @@ static void runloop_audio_buffer_status_free(void)
|
|||||||
runloop_st->audio_latency = 0;
|
runloop_st->audio_latency = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void retroarch_fastmotion_override_free(
|
static void runloop_fastmotion_override_free(runloop_state_t *runloop_st)
|
||||||
struct rarch_state *p_rarch,
|
|
||||||
runloop_state_t *runloop_st)
|
|
||||||
{
|
{
|
||||||
video_driver_state_t
|
video_driver_state_t
|
||||||
*video_st = video_state_get_ptr();
|
*video_st = video_state_get_ptr();
|
||||||
@ -6897,8 +6898,7 @@ static void retroarch_fastmotion_override_free(
|
|||||||
|
|
||||||
if (reset_frame_limit)
|
if (reset_frame_limit)
|
||||||
runloop_st->frame_limit_minimum_time =
|
runloop_st->frame_limit_minimum_time =
|
||||||
retroarch_set_frame_limit(
|
runloop_set_frame_limit(&video_st->av_info, fastforward_ratio);
|
||||||
&video_st->av_info, fastforward_ratio);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void runloop_core_options_cb_free(runloop_state_t *runloop_st)
|
static void runloop_core_options_cb_free(runloop_state_t *runloop_st)
|
||||||
@ -6907,7 +6907,7 @@ static void runloop_core_options_cb_free(runloop_state_t *runloop_st)
|
|||||||
runloop_st->core_options_callback.update_display = NULL;
|
runloop_st->core_options_callback.update_display = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void retroarch_system_info_free(runloop_state_t *runloop_st)
|
static void runloop_system_info_free(runloop_state_t *runloop_st)
|
||||||
{
|
{
|
||||||
rarch_system_info_t *sys_info = &runloop_st->system;
|
rarch_system_info_t *sys_info = &runloop_st->system;
|
||||||
|
|
||||||
@ -7431,7 +7431,7 @@ bool command_event(enum event_command cmd, void *data)
|
|||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_DYNAMIC
|
#ifdef HAVE_DYNAMIC
|
||||||
path_clear(RARCH_PATH_CORE);
|
path_clear(RARCH_PATH_CORE);
|
||||||
retroarch_system_info_free(&runloop_state);
|
runloop_system_info_free(&runloop_state);
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
audio_driver_state_t
|
audio_driver_state_t
|
||||||
@ -8710,8 +8710,8 @@ bool command_event(enum event_command cmd, void *data)
|
|||||||
*video_st = video_state_get_ptr();
|
*video_st = video_state_get_ptr();
|
||||||
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
||||||
runloop_st->frame_limit_minimum_time=
|
runloop_st->frame_limit_minimum_time=
|
||||||
retroarch_set_frame_limit(&video_st->av_info,
|
runloop_set_frame_limit(&video_st->av_info,
|
||||||
retroarch_get_runloop_fastforward_ratio(
|
runloop_get_fastforward_ratio(
|
||||||
settings,
|
settings,
|
||||||
&runloop_state.fastmotion_override.current));
|
&runloop_state.fastmotion_override.current));
|
||||||
}
|
}
|
||||||
@ -9099,7 +9099,7 @@ void main_exit(void *args)
|
|||||||
p_rarch->rarch_block_config_read = false;
|
p_rarch->rarch_block_config_read = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
retroarch_msg_queue_deinit();
|
runloop_msg_queue_deinit();
|
||||||
driver_uninit(p_rarch, DRIVERS_CMD_ALL);
|
driver_uninit(p_rarch, DRIVERS_CMD_ALL);
|
||||||
|
|
||||||
retro_main_log_file_deinit();
|
retro_main_log_file_deinit();
|
||||||
@ -9201,7 +9201,7 @@ int rarch_main(int argc, char *argv[], void *data)
|
|||||||
input_config_set_device(i, RETRO_DEVICE_JOYPAD);
|
input_config_set_device(i, RETRO_DEVICE_JOYPAD);
|
||||||
}
|
}
|
||||||
|
|
||||||
retroarch_msg_queue_init();
|
runloop_msg_queue_init();
|
||||||
|
|
||||||
if (p_rarch->current_frontend_ctx)
|
if (p_rarch->current_frontend_ctx)
|
||||||
{
|
{
|
||||||
@ -10151,6 +10151,27 @@ static core_option_manager_t *runloop_init_core_options(
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static core_option_manager_t *runloop_init_core_variables(
|
||||||
|
settings_t *settings, const struct retro_variable *vars)
|
||||||
|
{
|
||||||
|
char options_path[PATH_MAX_LENGTH];
|
||||||
|
char src_options_path[PATH_MAX_LENGTH];
|
||||||
|
|
||||||
|
/* Ensure these are NULL-terminated */
|
||||||
|
options_path[0] = '\0';
|
||||||
|
src_options_path[0] = '\0';
|
||||||
|
|
||||||
|
/* Get core options file path */
|
||||||
|
runloop_init_core_options_path(
|
||||||
|
settings,
|
||||||
|
options_path, sizeof(options_path),
|
||||||
|
src_options_path, sizeof(src_options_path));
|
||||||
|
|
||||||
|
if (!string_is_empty(options_path))
|
||||||
|
return core_option_manager_new_vars(options_path, src_options_path, vars);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* retroarch_environment_cb:
|
* retroarch_environment_cb:
|
||||||
@ -10316,7 +10337,7 @@ static bool retroarch_environment_cb(unsigned cmd, void *data)
|
|||||||
runloop_state.folder_options_active = false;
|
runloop_state.folder_options_active = false;
|
||||||
runloop_state.core_options = NULL;
|
runloop_state.core_options = NULL;
|
||||||
}
|
}
|
||||||
if ((new_vars = retroarch_init_core_variables(
|
if ((new_vars = runloop_init_core_variables(
|
||||||
settings,
|
settings,
|
||||||
(const struct retro_variable *)data)))
|
(const struct retro_variable *)data)))
|
||||||
runloop_state.core_options = new_vars;
|
runloop_state.core_options = new_vars;
|
||||||
@ -11898,7 +11919,7 @@ static bool retroarch_environment_cb(unsigned cmd, void *data)
|
|||||||
if (runloop_state.fastmotion)
|
if (runloop_state.fastmotion)
|
||||||
{
|
{
|
||||||
throttle_state->mode = RETRO_THROTTLE_FAST_FORWARD;
|
throttle_state->mode = RETRO_THROTTLE_FAST_FORWARD;
|
||||||
throttle_state->rate *= retroarch_get_runloop_fastforward_ratio(
|
throttle_state->rate *= runloop_get_fastforward_ratio(
|
||||||
settings, &runloop_state.fastmotion_override.current);
|
settings, &runloop_state.fastmotion_override.current);
|
||||||
}
|
}
|
||||||
else if (runloop_state.slowmotion && !no_audio)
|
else if (runloop_state.slowmotion && !no_audio)
|
||||||
@ -12445,13 +12466,13 @@ static void uninit_libretro_symbols(
|
|||||||
runloop_state.folder_options_active = false;
|
runloop_state.folder_options_active = false;
|
||||||
runloop_state.core_options = NULL;
|
runloop_state.core_options = NULL;
|
||||||
}
|
}
|
||||||
retroarch_system_info_free(&runloop_state);
|
runloop_system_info_free(&runloop_state);
|
||||||
audio_st->callback.callback = NULL;
|
audio_st->callback.callback = NULL;
|
||||||
audio_st->callback.set_state = NULL;
|
audio_st->callback.set_state = NULL;
|
||||||
runloop_frame_time_free();
|
runloop_frame_time_free();
|
||||||
runloop_audio_buffer_status_free();
|
runloop_audio_buffer_status_free();
|
||||||
input_game_focus_free();
|
input_game_focus_free();
|
||||||
retroarch_fastmotion_override_free(p_rarch, &runloop_state);
|
runloop_fastmotion_override_free(&runloop_state);
|
||||||
runloop_core_options_cb_free(&runloop_state);
|
runloop_core_options_cb_free(&runloop_state);
|
||||||
p_rarch->camera_driver_active = false;
|
p_rarch->camera_driver_active = false;
|
||||||
p_rarch->location_driver_active = false;
|
p_rarch->location_driver_active = false;
|
||||||
@ -19151,7 +19172,7 @@ bool retroarch_ctl(enum rarch_ctl_state state, void *data)
|
|||||||
runloop_frame_time_free();
|
runloop_frame_time_free();
|
||||||
runloop_audio_buffer_status_free();
|
runloop_audio_buffer_status_free();
|
||||||
input_game_focus_free();
|
input_game_focus_free();
|
||||||
retroarch_fastmotion_override_free(p_rarch, &runloop_state);
|
runloop_fastmotion_override_free(&runloop_state);
|
||||||
runloop_core_options_cb_free(&runloop_state);
|
runloop_core_options_cb_free(&runloop_state);
|
||||||
memset(&input_st->analog_requested, 0,
|
memset(&input_st->analog_requested, 0,
|
||||||
sizeof(input_st->analog_requested));
|
sizeof(input_st->analog_requested));
|
||||||
@ -19216,28 +19237,6 @@ bool retroarch_ctl(enum rarch_ctl_state state, void *data)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static core_option_manager_t *retroarch_init_core_variables(
|
|
||||||
settings_t *settings,
|
|
||||||
const struct retro_variable *vars)
|
|
||||||
{
|
|
||||||
char options_path[PATH_MAX_LENGTH];
|
|
||||||
char src_options_path[PATH_MAX_LENGTH];
|
|
||||||
|
|
||||||
/* Ensure these are NULL-terminated */
|
|
||||||
options_path[0] = '\0';
|
|
||||||
src_options_path[0] = '\0';
|
|
||||||
|
|
||||||
/* Get core options file path */
|
|
||||||
runloop_init_core_options_path(
|
|
||||||
settings,
|
|
||||||
options_path, sizeof(options_path),
|
|
||||||
src_options_path, sizeof(src_options_path));
|
|
||||||
|
|
||||||
if (!string_is_empty(options_path))
|
|
||||||
return core_option_manager_new_vars(options_path, src_options_path, vars);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* get the name of the current shader preset */
|
/* get the name of the current shader preset */
|
||||||
const char *retroarch_get_shader_preset(void)
|
const char *retroarch_get_shader_preset(void)
|
||||||
{
|
{
|
||||||
@ -19724,7 +19723,7 @@ static void runloop_apply_fastmotion_override(
|
|||||||
|
|
||||||
if (fastforward_ratio_current != fastforward_ratio_last)
|
if (fastforward_ratio_current != fastforward_ratio_last)
|
||||||
runloop_st->frame_limit_minimum_time =
|
runloop_st->frame_limit_minimum_time =
|
||||||
retroarch_set_frame_limit(&video_st->av_info,
|
runloop_set_frame_limit(&video_st->av_info,
|
||||||
fastforward_ratio_current);
|
fastforward_ratio_current);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -20513,8 +20512,7 @@ static enum runloop_state_enum runloop_check_state(
|
|||||||
|
|
||||||
if (menu_st->alive)
|
if (menu_st->alive)
|
||||||
{
|
{
|
||||||
float fastforward_ratio = retroarch_get_runloop_fastforward_ratio(
|
float fastforward_ratio = runloop_get_fastforward_ratio(settings,
|
||||||
settings,
|
|
||||||
&runloop_st->fastmotion_override.current);
|
&runloop_st->fastmotion_override.current);
|
||||||
|
|
||||||
if (!settings->bools.menu_throttle_framerate && !fastforward_ratio)
|
if (!settings->bools.menu_throttle_framerate && !fastforward_ratio)
|
||||||
@ -21328,13 +21326,12 @@ end:
|
|||||||
|
|
||||||
if (runloop_st->fastmotion)
|
if (runloop_st->fastmotion)
|
||||||
runloop_st->frame_limit_minimum_time =
|
runloop_st->frame_limit_minimum_time =
|
||||||
retroarch_set_frame_limit(&video_st->av_info,
|
runloop_set_frame_limit(&video_st->av_info,
|
||||||
retroarch_get_runloop_fastforward_ratio(
|
runloop_get_fastforward_ratio(settings,
|
||||||
settings,
|
|
||||||
&runloop_st->fastmotion_override.current));
|
&runloop_st->fastmotion_override.current));
|
||||||
else
|
else
|
||||||
runloop_st->frame_limit_minimum_time =
|
runloop_st->frame_limit_minimum_time =
|
||||||
retroarch_set_frame_limit(&video_st->av_info,
|
runloop_set_frame_limit(&video_st->av_info,
|
||||||
1.0f);
|
1.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,9 +36,6 @@ static void deinit_netplay(struct rarch_state *p_rarch);
|
|||||||
static void retroarch_deinit_drivers(struct rarch_state *p_rarch,
|
static void retroarch_deinit_drivers(struct rarch_state *p_rarch,
|
||||||
struct retro_callbacks *cbs);
|
struct retro_callbacks *cbs);
|
||||||
|
|
||||||
static core_option_manager_t *retroarch_init_core_variables(
|
|
||||||
settings_t *settings,
|
|
||||||
const struct retro_variable *vars);
|
|
||||||
#ifdef HAVE_RUNAHEAD
|
#ifdef HAVE_RUNAHEAD
|
||||||
#if defined(HAVE_DYNAMIC) || defined(HAVE_DYLIB)
|
#if defined(HAVE_DYNAMIC) || defined(HAVE_DYLIB)
|
||||||
static bool secondary_core_create(struct rarch_state *p_rarch,
|
static bool secondary_core_create(struct rarch_state *p_rarch,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user