diff --git a/command.c b/command.c index ff92fcc46c..db03549c6e 100644 --- a/command.c +++ b/command.c @@ -1368,15 +1368,15 @@ static bool command_event_init_core(enum rarch_core_type *data) if (!core_init_symbols(data)) return false; - runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_INIT, NULL); + rarch_ctl(RARCH_CTL_SYSTEM_INFO_INIT, NULL); /* auto overrides: apply overrides */ if(settings->bools.auto_overrides_enable) { if (config_load_override()) - runloop_ctl(RUNLOOP_CTL_SET_OVERRIDES_ACTIVE, NULL); + rarch_ctl(RARCH_CTL_SET_OVERRIDES_ACTIVE, NULL); else - runloop_ctl(RUNLOOP_CTL_UNSET_OVERRIDES_ACTIVE, NULL); + rarch_ctl(RARCH_CTL_UNSET_OVERRIDES_ACTIVE, NULL); } /* Auto-remap: apply shader preset files */ @@ -1406,20 +1406,20 @@ static bool command_event_init_core(enum rarch_core_type *data) if (!core_load(settings->uints.input_poll_type_behavior)) return false; - runloop_ctl(RUNLOOP_CTL_SET_FRAME_LIMIT, NULL); + rarch_ctl(RARCH_CTL_SET_FRAME_LIMIT, NULL); return true; } static void command_event_disable_overrides(void) { - if (!runloop_ctl(RUNLOOP_CTL_IS_OVERRIDES_ACTIVE, NULL)) + if (!rarch_ctl(RARCH_CTL_IS_OVERRIDES_ACTIVE, NULL)) return; /* reload the original config */ config_unload_override(); - runloop_ctl(RUNLOOP_CTL_UNSET_OVERRIDES_ACTIVE, NULL); + rarch_ctl(RARCH_CTL_UNSET_OVERRIDES_ACTIVE, NULL); } static void command_event_restore_default_shader_preset(void) @@ -1583,12 +1583,12 @@ static bool command_event_save_core_config(void) sizeof(config_path)); } - if (runloop_ctl(RUNLOOP_CTL_IS_OVERRIDES_ACTIVE, NULL)) + if (rarch_ctl(RARCH_CTL_IS_OVERRIDES_ACTIVE, NULL)) { /* Overrides block config file saving, * make it appear as overrides weren't enabled * for a manual save. */ - runloop_ctl(RUNLOOP_CTL_UNSET_OVERRIDES_ACTIVE, NULL); + rarch_ctl(RARCH_CTL_UNSET_OVERRIDES_ACTIVE, NULL); overrides_active = true; } @@ -1597,9 +1597,9 @@ static bool command_event_save_core_config(void) runloop_msg_queue_push(msg, 1, 180, true); if (overrides_active) - runloop_ctl(RUNLOOP_CTL_SET_OVERRIDES_ACTIVE, NULL); + rarch_ctl(RARCH_CTL_SET_OVERRIDES_ACTIVE, NULL); else - runloop_ctl(RUNLOOP_CTL_UNSET_OVERRIDES_ACTIVE, NULL); + rarch_ctl(RARCH_CTL_UNSET_OVERRIDES_ACTIVE, NULL); return ret; } @@ -1633,7 +1633,7 @@ static void command_event_save_current_config(enum override_type type) /* set overrides to active so the original config can be restored after closing content */ - runloop_ctl(RUNLOOP_CTL_SET_OVERRIDES_ACTIVE, NULL); + rarch_ctl(RARCH_CTL_SET_OVERRIDES_ACTIVE, NULL); } else { @@ -1762,7 +1762,7 @@ static bool command_event_resize_windowed_scale(void) unsigned *window_scale = NULL; settings_t *settings = config_get_ptr(); - if (runloop_ctl(RUNLOOP_CTL_GET_WINDOWED_SCALE, &window_scale)) + if (rarch_ctl(RARCH_CTL_GET_WINDOWED_SCALE, &window_scale)) { if (!window_scale || *window_scale == 0) return false; @@ -1773,7 +1773,7 @@ static bool command_event_resize_windowed_scale(void) if (!settings->bools.video_fullscreen) command_event(CMD_EVENT_REINIT, NULL); - runloop_ctl(RUNLOOP_CTL_SET_WINDOWED_SCALE, &idx); + rarch_ctl(RARCH_CTL_SET_WINDOWED_SCALE, &idx); return true; } @@ -2057,7 +2057,7 @@ bool command_event(enum event_command cmd, void *data) case CMD_EVENT_AUDIO_STOP: return audio_driver_stop(); case CMD_EVENT_AUDIO_START: - return audio_driver_start(runloop_ctl(RUNLOOP_CTL_IS_SHUTDOWN, NULL)); + return audio_driver_start(rarch_ctl(RARCH_CTL_IS_SHUTDOWN, NULL)); case CMD_EVENT_AUDIO_MUTE_TOGGLE: { bool audio_mute_enable = *(audio_get_bool_ptr(AUDIO_ACTION_MUTE_ENABLE)); @@ -2362,21 +2362,21 @@ bool command_event(enum event_command cmd, void *data) } break; case CMD_EVENT_PAUSE_TOGGLE: - boolean = runloop_ctl(RUNLOOP_CTL_IS_PAUSED, NULL); + boolean = rarch_ctl(RARCH_CTL_IS_PAUSED, NULL); boolean = !boolean; - runloop_ctl(RUNLOOP_CTL_SET_PAUSED, &boolean); + rarch_ctl(RARCH_CTL_SET_PAUSED, &boolean); command_event(CMD_EVENT_PAUSE_CHECKS, NULL); break; case CMD_EVENT_UNPAUSE: boolean = false; - runloop_ctl(RUNLOOP_CTL_SET_PAUSED, &boolean); + rarch_ctl(RARCH_CTL_SET_PAUSED, &boolean); command_event(CMD_EVENT_PAUSE_CHECKS, NULL); break; case CMD_EVENT_PAUSE: boolean = true; - runloop_ctl(RUNLOOP_CTL_SET_PAUSED, &boolean); + rarch_ctl(RARCH_CTL_SET_PAUSED, &boolean); command_event(CMD_EVENT_PAUSE_CHECKS, NULL); break; case CMD_EVENT_MENU_PAUSE_LIBRETRO: @@ -2694,7 +2694,7 @@ bool command_event(enum event_command cmd, void *data) command_event_set_volume(-0.5f); break; case CMD_EVENT_SET_FRAME_LIMIT: - runloop_ctl(RUNLOOP_CTL_SET_FRAME_LIMIT, NULL); + rarch_ctl(RARCH_CTL_SET_FRAME_LIMIT, NULL); break; case CMD_EVENT_DISABLE_OVERRIDES: command_event_disable_overrides(); diff --git a/configuration.c b/configuration.c index 41155502c1..eb0262f066 100644 --- a/configuration.c +++ b/configuration.c @@ -1697,7 +1697,7 @@ static void config_set_defaults(void) strlcpy(settings->paths.network_buildbot_url, g_defaults.path.buildbot_server_url, sizeof(settings->paths.network_buildbot_url)); if (!string_is_empty(g_defaults.path.core)) - runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, g_defaults.path.core); + rarch_ctl(RARCH_CTL_SET_LIBRETRO_PATH, g_defaults.path.core); if (!string_is_empty(g_defaults.dir.database)) strlcpy(settings->paths.path_content_database, g_defaults.dir.database, sizeof(settings->paths.path_content_database)); @@ -2280,9 +2280,9 @@ static bool config_load_file(const char *path, bool set_defaults, if (config_get_bool(conf, tmp, &tmp_bool)) { if (tmp_bool) - runloop_ctl(RUNLOOP_CTL_SET_PERFCNT_ENABLE, NULL); + rarch_ctl(RARCH_CTL_SET_PERFCNT_ENABLE, NULL); else - runloop_ctl(RUNLOOP_CTL_UNSET_PERFCNT_ENABLE, NULL); + rarch_ctl(RARCH_CTL_UNSET_PERFCNT_ENABLE, NULL); } } @@ -3385,7 +3385,7 @@ bool config_save_file(const char *path) if (!conf) conf = config_file_new(NULL); - if (!conf || runloop_ctl(RUNLOOP_CTL_IS_OVERRIDES_ACTIVE, NULL)) + if (!conf || rarch_ctl(RARCH_CTL_IS_OVERRIDES_ACTIVE, NULL)) { if (conf) config_file_free(conf); @@ -3505,7 +3505,7 @@ bool config_save_file(const char *path) config_set_bool(conf, "log_verbosity", verbosity_is_enabled()); config_set_bool(conf, "perfcnt_enable", - runloop_ctl(RUNLOOP_CTL_IS_PERFCNT_ENABLE, NULL)); + rarch_ctl(RARCH_CTL_IS_PERFCNT_ENABLE, NULL)); msg_color = (((int)(settings->floats.video_msg_color_r * 255.0f) & 0xff) << 16) + (((int)(settings->floats.video_msg_color_g * 255.0f) & 0xff) << 8) + diff --git a/core_info.c b/core_info.c index 9376b797d5..7ab95ba2c1 100644 --- a/core_info.c +++ b/core_info.c @@ -507,7 +507,7 @@ static bool core_info_list_update_missing_firmware_internal( if (!info) return false; - runloop_ctl(RUNLOOP_CTL_UNSET_MISSING_BIOS, NULL); + rarch_ctl(RARCH_CTL_UNSET_MISSING_BIOS, NULL); for (i = 0; i < info->firmware_count; i++) { if (string_is_empty(info->firmware[i].path)) @@ -518,7 +518,7 @@ static bool core_info_list_update_missing_firmware_internal( info->firmware[i].missing = !path_file_exists(path); if (info->firmware[i].missing && !info->firmware[i].optional) { - runloop_ctl(RUNLOOP_CTL_SET_MISSING_BIOS, NULL); + rarch_ctl(RARCH_CTL_SET_MISSING_BIOS, NULL); RARCH_WARN("Firmware missing: %s\n", info->firmware[i].path); } } diff --git a/driver.c b/driver.c index 494d18302f..4fd383c952 100644 --- a/driver.c +++ b/driver.c @@ -222,7 +222,7 @@ static void driver_adjust_system_rates(void) if (!video_driver_get_ptr(false)) return; - if (runloop_ctl(RUNLOOP_CTL_IS_NONBLOCK_FORCED, NULL)) + if (rarch_ctl(RARCH_CTL_IS_NONBLOCK_FORCED, NULL)) command_event(CMD_EVENT_VIDEO_SET_NONBLOCKING_STATE, NULL); else driver_set_nonblock_state(); @@ -247,7 +247,7 @@ void driver_set_nonblock_state(void) bool video_nonblock = enable; if ( !settings->bools.video_vsync - || runloop_ctl(RUNLOOP_CTL_IS_NONBLOCK_FORCED, NULL)) + || rarch_ctl(RARCH_CTL_IS_NONBLOCK_FORCED, NULL)) video_nonblock = true; video_driver_set_nonblock_state(video_nonblock); } @@ -330,7 +330,7 @@ void drivers_init(int flags) hwr->context_reset(); video_driver_unset_video_cache_context_ack(); - runloop_ctl(RUNLOOP_CTL_SET_FRAME_TIME_LAST, NULL); + rarch_ctl(RARCH_CTL_SET_FRAME_TIME_LAST, NULL); } if (flags & DRIVER_AUDIO_MASK) diff --git a/dynamic.c b/dynamic.c index c0be244829..044a2c8fe0 100644 --- a/dynamic.c +++ b/dynamic.c @@ -671,9 +671,9 @@ void uninit_libretro_sym(struct retro_core_t *current_core) memset(current_core, 0, sizeof(struct retro_core_t)); - runloop_ctl(RUNLOOP_CTL_CORE_OPTIONS_DEINIT, NULL); - runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_FREE, NULL); - runloop_ctl(RUNLOOP_CTL_FRAME_TIME_FREE, NULL); + rarch_ctl(RARCH_CTL_CORE_OPTIONS_DEINIT, NULL); + rarch_ctl(RARCH_CTL_SYSTEM_INFO_FREE, NULL); + rarch_ctl(RARCH_CTL_FRAME_TIME_FREE, NULL); camera_driver_ctl(RARCH_CAMERA_CTL_UNSET_ACTIVE, NULL); location_driver_ctl(RARCH_LOCATION_CTL_UNSET_ACTIVE, NULL); @@ -926,7 +926,7 @@ static bool dynamic_verify_hw_context(enum retro_hw_context_type type, static void core_performance_counter_start(struct retro_perf_counter *perf) { - if (runloop_ctl(RUNLOOP_CTL_IS_PERFCNT_ENABLE, NULL)) + if (rarch_ctl(RARCH_CTL_IS_PERFCNT_ENABLE, NULL)) { perf->call_cnt++; perf->start = cpu_features_get_perf_counter(); @@ -935,7 +935,7 @@ static void core_performance_counter_start(struct retro_perf_counter *perf) static void core_performance_counter_stop(struct retro_perf_counter *perf) { - if (runloop_ctl(RUNLOOP_CTL_IS_PERFCNT_ENABLE, NULL)) + if (rarch_ctl(RARCH_CTL_IS_PERFCNT_ENABLE, NULL)) perf->total += cpu_features_get_perf_counter() - perf->start; } @@ -972,7 +972,7 @@ bool rarch_environment_cb(unsigned cmd, void *data) break; case RETRO_ENVIRONMENT_GET_VARIABLE: - if (!runloop_ctl(RUNLOOP_CTL_CORE_OPTIONS_GET, data)) + if (!rarch_ctl(RARCH_CTL_CORE_OPTIONS_GET, data)) { struct retro_variable *var = (struct retro_variable*)data; @@ -986,14 +986,14 @@ bool rarch_environment_cb(unsigned cmd, void *data) break; case RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE: - *(bool*)data = runloop_ctl(RUNLOOP_CTL_IS_CORE_OPTION_UPDATED, NULL); + *(bool*)data = rarch_ctl(RARCH_CTL_IS_CORE_OPTION_UPDATED, NULL); break; case RETRO_ENVIRONMENT_SET_VARIABLES: RARCH_LOG("Environ SET_VARIABLES.\n"); - runloop_ctl(RUNLOOP_CTL_CORE_OPTIONS_DEINIT, NULL); - runloop_ctl(RUNLOOP_CTL_CORE_OPTIONS_INIT, data); + rarch_ctl(RARCH_CTL_CORE_OPTIONS_DEINIT, NULL); + rarch_ctl(RARCH_CTL_CORE_OPTIONS_INIT, data); break; @@ -1022,8 +1022,8 @@ bool rarch_environment_cb(unsigned cmd, void *data) case RETRO_ENVIRONMENT_SHUTDOWN: RARCH_LOG("Environ SHUTDOWN.\n"); - runloop_ctl(RUNLOOP_CTL_SET_SHUTDOWN, NULL); - runloop_ctl(RUNLOOP_CTL_SET_CORE_SHUTDOWN, NULL); + rarch_ctl(RARCH_CTL_SET_SHUTDOWN, NULL); + rarch_ctl(RARCH_CTL_SET_CORE_SHUTDOWN, NULL); break; case RETRO_ENVIRONMENT_SET_PERFORMANCE_LEVEL: @@ -1221,8 +1221,8 @@ bool rarch_environment_cb(unsigned cmd, void *data) const struct retro_keyboard_callback *info = (const struct retro_keyboard_callback*)data; - runloop_ctl(RUNLOOP_CTL_FRONTEND_KEY_EVENT_GET, &frontend_key_event); - runloop_ctl(RUNLOOP_CTL_KEY_EVENT_GET, &key_event); + rarch_ctl(RARCH_CTL_FRONTEND_KEY_EVENT_GET, &frontend_key_event); + rarch_ctl(RARCH_CTL_KEY_EVENT_GET, &key_event); RARCH_LOG("Environ SET_KEYBOARD_CALLBACK.\n"); if (key_event) @@ -1309,7 +1309,7 @@ bool rarch_environment_cb(unsigned cmd, void *data) case RETRO_ENVIRONMENT_SET_FRAME_TIME_CALLBACK: { RARCH_LOG("Environ SET_FRAME_TIME_CALLBACK.\n"); - runloop_ctl(RUNLOOP_CTL_SET_FRAME_TIME, data); + rarch_ctl(RARCH_CTL_SET_FRAME_TIME, data); break; } diff --git a/frontend/drivers/platform_gx.c b/frontend/drivers/platform_gx.c index 57916af632..c2002bb338 100644 --- a/frontend/drivers/platform_gx.c +++ b/frontend/drivers/platform_gx.c @@ -423,7 +423,7 @@ static void frontend_gx_process_args(int *argc, char *argv[]) char path[PATH_MAX_LENGTH] = {0}; strlcpy(path, strrchr(argv[0], '/') + 1, sizeof(path)); if (path_file_exists(path)) - runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, path); + rarch_ctl(RARCH_CTL_SET_LIBRETRO_PATH, path); } #endif } diff --git a/frontend/drivers/platform_ps3.c b/frontend/drivers/platform_ps3.c index b246b9286b..98584b86e8 100644 --- a/frontend/drivers/platform_ps3.c +++ b/frontend/drivers/platform_ps3.c @@ -91,7 +91,7 @@ static void callback_sysutil_exit(uint64_t status, if (frontend) frontend->shutdown = frontend_ps3_shutdown; - runloop_ctl(RUNLOOP_CTL_SET_SHUTDOWN, NULL); + rarch_ctl(RARCH_CTL_SET_SHUTDOWN, NULL); } break; } @@ -573,7 +573,7 @@ static void frontend_ps3_process_args(int *argc, char *argv[]) char path[PATH_MAX_LENGTH] = {0}; strlcpy(path, argv[0], sizeof(path)); if (path_file_exists(path)) - runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, path); + rarch_ctl(RARCH_CTL_SET_LIBRETRO_PATH, path); } #endif } diff --git a/gfx/common/win32_common.cpp b/gfx/common/win32_common.cpp index d900882a53..a5a15d3fa9 100644 --- a/gfx/common/win32_common.cpp +++ b/gfx/common/win32_common.cpp @@ -190,7 +190,7 @@ INT_PTR CALLBACK PickCoreProc(HWND hDlg, UINT message, core_info_list_get_supported_cores(core_info_list, path_get(RARCH_PATH_CONTENT), &core_info, &list_size); info = (const core_info_t*)&core_info[lbItem]; - runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH,info->path); + rarch_ctl(RARCH_CTL_SET_LIBRETRO_PATH,info->path); } break; } diff --git a/gfx/video_driver.c b/gfx/video_driver.c index ea1c68d9ba..c36b3df9a4 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -857,7 +857,7 @@ static bool video_driver_init_internal(bool *video_is_threaded) video.width = width; video.height = height; video.fullscreen = settings->bools.video_fullscreen; - video.vsync = settings->bools.video_vsync && !runloop_ctl(RUNLOOP_CTL_IS_NONBLOCK_FORCED, NULL); + video.vsync = settings->bools.video_vsync && !rarch_ctl(RARCH_CTL_IS_NONBLOCK_FORCED, NULL); video.force_aspect = settings->bools.video_force_aspect; video.font_enable = settings->bools.video_font_enable; video.swap_interval = settings->uints.video_swap_interval; @@ -1265,7 +1265,7 @@ void video_driver_monitor_adjust_system_rates(void) settings_t *settings = config_get_ptr(); float video_refresh_rate = settings->floats.video_refresh_rate; - runloop_ctl(RUNLOOP_CTL_UNSET_NONBLOCK_FORCED, NULL); + rarch_ctl(RARCH_CTL_UNSET_NONBLOCK_FORCED, NULL); if (av_info) info = (const struct retro_system_timing*)&av_info->timing; @@ -1288,7 +1288,7 @@ void video_driver_monitor_adjust_system_rates(void) return; /* We won't be able to do VSync reliably when game FPS > monitor FPS. */ - runloop_ctl(RUNLOOP_CTL_SET_NONBLOCK_FORCED, NULL); + rarch_ctl(RARCH_CTL_SET_NONBLOCK_FORCED, NULL); RARCH_LOG("[Video]: Game FPS > Monitor FPS. Cannot rely on VSync.\n"); } @@ -2670,7 +2670,7 @@ bool video_context_driver_check_window(gfx_ctx_size_t *size_data) && current_video_context && current_video_context->check_window) { - bool is_shutdown = runloop_ctl(RUNLOOP_CTL_IS_SHUTDOWN, NULL); + bool is_shutdown = rarch_ctl(RARCH_CTL_IS_SHUTDOWN, NULL); current_video_context->check_window(video_context_data, size_data->quit, size_data->resize, diff --git a/gfx/video_thread_wrapper.c b/gfx/video_thread_wrapper.c index c3995aaed4..c01a250b88 100644 --- a/gfx/video_thread_wrapper.c +++ b/gfx/video_thread_wrapper.c @@ -661,7 +661,7 @@ static bool video_thread_alive(void *data) bool ret; thread_video_t *thr = (thread_video_t*)data; - if (runloop_ctl(RUNLOOP_CTL_IS_PAUSED, NULL)) + if (rarch_ctl(RARCH_CTL_IS_PAUSED, NULL)) { thread_packet_t pkt = { CMD_ALIVE }; diff --git a/input/drivers/android_input.c b/input/drivers/android_input.c index 60000de61a..7b8983d4c0 100644 --- a/input/drivers/android_input.c +++ b/input/drivers/android_input.c @@ -368,8 +368,8 @@ static void android_input_poll_main_cmd(void) { bool boolean = false; - runloop_ctl(RUNLOOP_CTL_SET_PAUSED, &boolean); - runloop_ctl(RUNLOOP_CTL_SET_IDLE, &boolean); + rarch_ctl(RARCH_CTL_SET_PAUSED, &boolean); + rarch_ctl(RARCH_CTL_SET_IDLE, &boolean); video_driver_unset_stub_frame(); if ((android_app->sensor_state_mask @@ -388,8 +388,8 @@ static void android_input_poll_main_cmd(void) { bool boolean = true; - runloop_ctl(RUNLOOP_CTL_SET_PAUSED, &boolean); - runloop_ctl(RUNLOOP_CTL_SET_IDLE, &boolean); + rarch_ctl(RARCH_CTL_SET_PAUSED, &boolean); + rarch_ctl(RARCH_CTL_SET_IDLE, &boolean); video_driver_set_stub_frame(); /* Avoid draining battery while app is not being used. */ @@ -1291,13 +1291,13 @@ static void android_input_poll(void *data) if (android_app->destroyRequested != 0) { - runloop_ctl(RUNLOOP_CTL_SET_SHUTDOWN, NULL); + rarch_ctl(RARCH_CTL_SET_SHUTDOWN, NULL); return; } if (android_app->reinitRequested != 0) { - if (runloop_ctl(RUNLOOP_CTL_IS_PAUSED, NULL)) + if (rarch_ctl(RARCH_CTL_IS_PAUSED, NULL)) command_event(CMD_EVENT_REINIT, NULL); android_app_write_cmd(android_app, APP_CMD_REINIT_DONE); return; @@ -1318,13 +1318,13 @@ bool android_run_events(void *data) /* Check if we are exiting. */ if (android_app->destroyRequested != 0) { - runloop_ctl(RUNLOOP_CTL_SET_SHUTDOWN, NULL); + rarch_ctl(RARCH_CTL_SET_SHUTDOWN, NULL); return false; } if (android_app->reinitRequested != 0) { - if (runloop_ctl(RUNLOOP_CTL_IS_PAUSED, NULL)) + if (rarch_ctl(RARCH_CTL_IS_PAUSED, NULL)) command_event(CMD_EVENT_REINIT, NULL); android_app_write_cmd(android_app, APP_CMD_REINIT_DONE); } diff --git a/input/drivers/qnx_input.c b/input/drivers/qnx_input.c index a729dfa1b1..6e15030001 100644 --- a/input/drivers/qnx_input.c +++ b/input/drivers/qnx_input.c @@ -659,7 +659,7 @@ static void qnx_handle_navigator_event( command_event(CMD_EVENT_MENU_TOGGLE, NULL); return; shutdown: - runloop_ctl(RUNLOOP_CTL_SET_SHUTDOWN, NULL); + rarch_ctl(RARCH_CTL_SET_SHUTDOWN, NULL); return; } diff --git a/input/drivers_joypad/gx_joypad.c b/input/drivers_joypad/gx_joypad.c index b67ccf32ba..46347e6f54 100644 --- a/input/drivers_joypad/gx_joypad.c +++ b/input/drivers_joypad/gx_joypad.c @@ -323,7 +323,7 @@ static void gx_joypad_poll(void) #ifdef HW_RVL if (g_quit) { - runloop_ctl(RUNLOOP_CTL_SET_SHUTDOWN, NULL); + rarch_ctl(RARCH_CTL_SET_SHUTDOWN, NULL); return; } diff --git a/input/input_keyboard.c b/input/input_keyboard.c index 1a85e21f3f..5a9e813594 100644 --- a/input/input_keyboard.c +++ b/input/input_keyboard.c @@ -324,7 +324,7 @@ void input_keyboard_event(bool down, unsigned code, else { retro_keyboard_event_t *key_event = NULL; - runloop_ctl(RUNLOOP_CTL_KEY_EVENT_GET, &key_event); + rarch_ctl(RARCH_CTL_KEY_EVENT_GET, &key_event); if (key_event && *key_event) (*key_event)(down, code, character, mod); diff --git a/menu/cbs/menu_cbs_get_value.c b/menu/cbs/menu_cbs_get_value.c index 778339bdf9..93ea93bc67 100644 --- a/menu/cbs/menu_cbs_get_value.c +++ b/menu/cbs/menu_cbs_get_value.c @@ -1456,7 +1456,7 @@ static void menu_action_setting_disp_set_label_core_options(file_list_t* list, *s = '\0'; *w = 19; - if (runloop_ctl(RUNLOOP_CTL_CORE_OPTIONS_LIST_GET, &coreopts)) + if (rarch_ctl(RARCH_CTL_CORE_OPTIONS_LIST_GET, &coreopts)) { core_opt = core_option_manager_get_val(coreopts, type - MENU_SETTINGS_CORE_OPTION_START); diff --git a/menu/cbs/menu_cbs_left.c b/menu/cbs/menu_cbs_left.c index 5524eb35a1..cd43a502a3 100644 --- a/menu/cbs/menu_cbs_left.c +++ b/menu/cbs/menu_cbs_left.c @@ -369,7 +369,7 @@ static int core_setting_left(unsigned type, const char *label, { unsigned idx = type - MENU_SETTINGS_CORE_OPTION_START; - runloop_ctl(RUNLOOP_CTL_CORE_OPTION_PREV, &idx); + rarch_ctl(RARCH_CTL_CORE_OPTION_PREV, &idx); return 0; } diff --git a/menu/cbs/menu_cbs_right.c b/menu/cbs/menu_cbs_right.c index 116d6118b4..49d8663fb4 100644 --- a/menu/cbs/menu_cbs_right.c +++ b/menu/cbs/menu_cbs_right.c @@ -366,7 +366,7 @@ int core_setting_right(unsigned type, const char *label, { unsigned idx = type - MENU_SETTINGS_CORE_OPTION_START; - runloop_ctl(RUNLOOP_CTL_CORE_OPTION_NEXT, &idx); + rarch_ctl(RARCH_CTL_CORE_OPTION_NEXT, &idx); return 0; } diff --git a/menu/cbs/menu_cbs_start.c b/menu/cbs/menu_cbs_start.c index 6deacaa7fa..1cddd253a0 100644 --- a/menu/cbs/menu_cbs_start.c +++ b/menu/cbs/menu_cbs_start.c @@ -196,7 +196,7 @@ static int action_start_core_setting(unsigned type, unsigned idx = type - MENU_SETTINGS_CORE_OPTION_START; core_option_manager_t *coreopts = NULL; - if (runloop_ctl(RUNLOOP_CTL_CORE_OPTIONS_LIST_GET, &coreopts)) + if (rarch_ctl(RARCH_CTL_CORE_OPTIONS_LIST_GET, &coreopts)) core_option_manager_set_default(coreopts, idx); return 0; diff --git a/menu/drivers/xui.cpp b/menu/drivers/xui.cpp index c8ba3d4249..7733012e0b 100644 --- a/menu/drivers/xui.cpp +++ b/menu/drivers/xui.cpp @@ -440,13 +440,13 @@ static void xui_frame(void *data, video_frame_info_t *video_info) XuiRenderSetViewTransform( app.GetDC(), &matOrigView ); - runloop_ctl(RUNLOOP_CTL_MSG_QUEUE_PULL, &message); + rarch_ctl(RARCH_CTL_MSG_QUEUE_PULL, &message); if (message) xui_render_message(message); else { - runloop_ctl(RUNLOOP_CTL_MSG_QUEUE_PULL, &message); + rarch_ctl(RARCH_CTL_MSG_QUEUE_PULL, &message); if (message) xui_render_message(message); diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index f4c6e28e70..32f441f896 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -2918,7 +2918,7 @@ static int menu_displaylist_parse_information_list( MENU_SETTING_ACTION, 0, 0); #endif - if (runloop_ctl(RUNLOOP_CTL_IS_PERFCNT_ENABLE, NULL)) + if (rarch_ctl(RARCH_CTL_IS_PERFCNT_ENABLE, NULL)) { menu_entries_append_enum(info->list, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_FRONTEND_COUNTERS), @@ -6275,15 +6275,15 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) info->need_push = true; break; case DISPLAYLIST_CORE_OPTIONS: - if (runloop_ctl(RUNLOOP_CTL_HAS_CORE_OPTIONS, NULL)) + if (rarch_ctl(RARCH_CTL_HAS_CORE_OPTIONS, NULL)) { size_t opts = 0; - runloop_ctl(RUNLOOP_CTL_GET_CORE_OPTION_SIZE, &opts); + rarch_ctl(RARCH_CTL_GET_CORE_OPTION_SIZE, &opts); if (settings->bools.game_specific_options) { - if (!runloop_ctl(RUNLOOP_CTL_IS_GAME_OPTIONS_ACTIVE, NULL)) + if (!rarch_ctl(RARCH_CTL_IS_GAME_OPTIONS_ACTIVE, NULL)) menu_entries_append_enum(info->list, msg_hash_to_str( MENU_ENUM_LABEL_VALUE_GAME_SPECIFIC_OPTIONS_CREATE), @@ -6312,7 +6312,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) { core_option_manager_t *coreopts = NULL; - runloop_ctl(RUNLOOP_CTL_CORE_OPTIONS_LIST_GET, &coreopts); + rarch_ctl(RARCH_CTL_CORE_OPTIONS_LIST_GET, &coreopts); for (i = 0; i < opts; i++) menu_entries_append_enum(info->list, diff --git a/menu/menu_driver.c b/menu/menu_driver.c index fa1a746689..8d7d72b802 100644 --- a/menu/menu_driver.c +++ b/menu/menu_driver.c @@ -254,8 +254,8 @@ static void menu_driver_toggle(bool on) else menu_driver_alive = false; - runloop_ctl(RUNLOOP_CTL_FRONTEND_KEY_EVENT_GET, &frontend_key_event); - runloop_ctl(RUNLOOP_CTL_KEY_EVENT_GET, &key_event); + rarch_ctl(RARCH_CTL_FRONTEND_KEY_EVENT_GET, &frontend_key_event); + rarch_ctl(RARCH_CTL_KEY_EVENT_GET, &key_event); if (menu_driver_alive) { @@ -278,12 +278,12 @@ static void menu_driver_toggle(bool on) *frontend_key_event = *key_event; *key_event = menu_input_key_event; - runloop_ctl(RUNLOOP_CTL_SET_FRAME_TIME_LAST, NULL); + rarch_ctl(RARCH_CTL_SET_FRAME_TIME_LAST, NULL); } } else { - if (!runloop_ctl(RUNLOOP_CTL_IS_SHUTDOWN, NULL)) + if (!rarch_ctl(RARCH_CTL_IS_SHUTDOWN, NULL)) driver_set_nonblock_state(); if (settings && settings->bools.menu_pause_libretro) diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 6cf3807e96..6937e9b963 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -2916,7 +2916,7 @@ static bool setting_append_list( START_SUB_GROUP(list, list_info, "Performance Counters", &group_info, &subgroup_info, parent_group); - runloop_ctl(RUNLOOP_CTL_GET_PERFCNT, &tmp_b); + rarch_ctl(RARCH_CTL_GET_PERFCNT, &tmp_b); CONFIG_BOOL( list, list_info, diff --git a/network/httpserver/httpserver.c b/network/httpserver/httpserver.c index 7844230b99..b996aed4aa 100644 --- a/network/httpserver/httpserver.c +++ b/network/httpserver/httpserver.c @@ -380,7 +380,7 @@ static int httpserver_handle_basic_info(struct mg_connection* conn, void* cbdata } mg_printf(conn, "],\"coreOptions\":["); - runloop_ctl(RUNLOOP_CTL_CORE_OPTIONS_LIST_GET, (void*)&core_opts); + rarch_ctl(RARCH_CTL_CORE_OPTIONS_LIST_GET, (void*)&core_opts); opts = core_opts->opts; for (p = 0; p < core_opts->size; p++, opts++) diff --git a/performance_counters.c b/performance_counters.c index 0b275fc2e7..95437300d5 100644 --- a/performance_counters.c +++ b/performance_counters.c @@ -64,7 +64,7 @@ unsigned retro_get_perf_count_libretro(void) void rarch_perf_register(struct retro_perf_counter *perf) { if ( - !runloop_ctl(RUNLOOP_CTL_IS_PERFCNT_ENABLE, NULL) + !rarch_ctl(RARCH_CTL_IS_PERFCNT_ENABLE, NULL) || perf->registered || perf_ptr_rarch >= MAX_COUNTERS ) @@ -107,7 +107,7 @@ static void log_counters(struct retro_perf_counter **counters, unsigned num) void rarch_perf_log(void) { - if (!runloop_ctl(RUNLOOP_CTL_IS_PERFCNT_ENABLE, NULL)) + if (!rarch_ctl(RARCH_CTL_IS_PERFCNT_ENABLE, NULL)) return; RARCH_LOG("[PERF]: Performance counters (RetroArch):\n"); diff --git a/retroarch.c b/retroarch.c index 345ba9a9d0..8e96706c72 100644 --- a/retroarch.c +++ b/retroarch.c @@ -649,7 +649,7 @@ static void retroarch_parse_input(int argc, char *argv[]) *global->name.bps = '\0'; *global->name.ips = '\0'; - runloop_ctl(RUNLOOP_CTL_UNSET_OVERRIDES_ACTIVE, NULL); + rarch_ctl(RARCH_CTL_UNSET_OVERRIDES_ACTIVE, NULL); /* Make sure we can call retroarch_parse_input several times ... */ optind = 0; @@ -807,7 +807,7 @@ static void retroarch_parse_input(int argc, char *argv[]) } else if (path_file_exists(optarg)) { - runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, optarg); + rarch_ctl(RARCH_CTL_SET_LIBRETRO_PATH, optarg); retroarch_override_setting_set(RARCH_OVERRIDE_SETTING_LIBRETRO, NULL); /* We requested explicit core, so use PLAIN core type. */ @@ -1227,7 +1227,7 @@ bool retroarch_main_init(int argc, char *argv[]) retroarch_validate_cpu_features(); config_load(); - runloop_ctl(RUNLOOP_CTL_TASK_INIT, NULL); + rarch_ctl(RARCH_CTL_TASK_INIT, NULL); retroarch_main_init_media(); @@ -1324,6 +1324,33 @@ void rarch_menu_running_finished(void) #endif } +/** + * rarch_game_specific_options: + * + * Returns: true (1) if a game specific core + * options path has been found, + * otherwise false (0). + **/ +static bool rarch_game_specific_options(char **output) +{ + char game_path[8192]; + + game_path[0] ='\0'; + + if (!retroarch_validate_game_options(game_path, + sizeof(game_path), false)) + return false; + + if (!config_file_exists(game_path)) + return false; + + RARCH_LOG("%s %s\n", + msg_hash_to_str(MSG_GAME_SPECIFIC_CORE_OPTIONS_FOUND_AT), + game_path); + *output = strdup(game_path); + return true; +} + bool rarch_ctl(enum rarch_ctl_state state, void *data) { switch(state) @@ -1374,9 +1401,9 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data) driver_ctl(RARCH_DRIVER_CTL_UNINIT_ALL, NULL); command_event(CMD_EVENT_LOG_FILE_DEINIT, NULL); - runloop_ctl(RUNLOOP_CTL_STATE_FREE, NULL); + rarch_ctl(RARCH_CTL_STATE_FREE, NULL); global_free(); - runloop_ctl(RUNLOOP_CTL_DATA_DEINIT, NULL); + rarch_ctl(RARCH_CTL_DATA_DEINIT, NULL); config_free(); break; case RARCH_CTL_PREINIT: @@ -1386,7 +1413,7 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data) config_init(); driver_ctl(RARCH_DRIVER_CTL_DEINIT, NULL); - runloop_ctl(RUNLOOP_CTL_STATE_FREE, NULL); + rarch_ctl(RARCH_CTL_STATE_FREE, NULL); global_free(); break; case RARCH_CTL_MAIN_DEINIT: @@ -1433,7 +1460,7 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data) for (i = 0; i < MAX_USERS; i++) input_config_set_device(i, RETRO_DEVICE_JOYPAD); } - runloop_ctl(RUNLOOP_CTL_HTTPSERVER_INIT, NULL); + rarch_ctl(RARCH_CTL_HTTPSERVER_INIT, NULL); retroarch_msg_queue_init(); break; case RARCH_CTL_IS_SRAM_LOAD_DISABLED: @@ -1465,6 +1492,344 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data) break; case RARCH_CTL_IS_BLOCK_CONFIG_READ: return rarch_block_config_read; + case RARCH_CTL_SYSTEM_INFO_INIT: + core_get_system_info(&runloop_system.info); + + if (!runloop_system.info.library_name) + runloop_system.info.library_name = msg_hash_to_str(MSG_UNKNOWN); + if (!runloop_system.info.library_version) + runloop_system.info.library_version = "v0"; + + video_driver_set_title_buf(); + + strlcpy(runloop_system.valid_extensions, + runloop_system.info.valid_extensions ? + runloop_system.info.valid_extensions : DEFAULT_EXT, + sizeof(runloop_system.valid_extensions)); + break; + case RARCH_CTL_GET_CORE_OPTION_SIZE: + { + unsigned *idx = (unsigned*)data; + if (!idx) + return false; + *idx = (unsigned)core_option_manager_size(runloop_core_options); + } + break; + case RARCH_CTL_HAS_CORE_OPTIONS: + return runloop_core_options; + case RARCH_CTL_CORE_OPTIONS_LIST_GET: + { + core_option_manager_t **coreopts = (core_option_manager_t**)data; + if (!coreopts) + return false; + *coreopts = runloop_core_options; + } + break; + case RARCH_CTL_SYSTEM_INFO_FREE: + + /* No longer valid. */ + if (runloop_system.subsystem.data) + free(runloop_system.subsystem.data); + runloop_system.subsystem.data = NULL; + runloop_system.subsystem.size = 0; + + if (runloop_system.ports.data) + free(runloop_system.ports.data); + runloop_system.ports.data = NULL; + runloop_system.ports.size = 0; + + if (runloop_system.mmaps.descriptors) + free((void *)runloop_system.mmaps.descriptors); + runloop_system.mmaps.descriptors = NULL; + runloop_system.mmaps.num_descriptors = 0; + + runloop_key_event = NULL; + runloop_frontend_key_event = NULL; + + audio_driver_unset_callback(); + memset(&runloop_system, 0, sizeof(rarch_system_info_t)); + break; + case RARCH_CTL_SET_FRAME_TIME_LAST: + runloop_frame_time_last = 0; + break; + case RARCH_CTL_SET_OVERRIDES_ACTIVE: + runloop_overrides_active = true; + break; + case RARCH_CTL_UNSET_OVERRIDES_ACTIVE: + runloop_overrides_active = false; + break; + case RARCH_CTL_IS_OVERRIDES_ACTIVE: + return runloop_overrides_active; + case RARCH_CTL_SET_MISSING_BIOS: + runloop_missing_bios = true; + break; + case RARCH_CTL_UNSET_MISSING_BIOS: + runloop_missing_bios = false; + break; + case RARCH_CTL_IS_MISSING_BIOS: + return runloop_missing_bios; + case RARCH_CTL_IS_GAME_OPTIONS_ACTIVE: + return runloop_game_options_active; + case RARCH_CTL_SET_FRAME_LIMIT: + { + settings_t *settings = config_get_ptr(); + struct retro_system_av_info *av_info = + video_viewport_get_system_av_info(); + float fastforward_ratio = + (settings->floats.fastforward_ratio == 0.0f) + ? 1.0f : settings->floats.fastforward_ratio; + + frame_limit_last_time = cpu_features_get_time_usec(); + frame_limit_minimum_time = (retro_time_t)roundf(1000000.0f + / (av_info->timing.fps * fastforward_ratio)); + } + break; + case RARCH_CTL_GET_PERFCNT: + { + bool **perfcnt = (bool**)data; + if (!perfcnt) + return false; + *perfcnt = &runloop_perfcnt_enable; + } + break; + case RARCH_CTL_SET_PERFCNT_ENABLE: + runloop_perfcnt_enable = true; + break; + case RARCH_CTL_UNSET_PERFCNT_ENABLE: + runloop_perfcnt_enable = false; + break; + case RARCH_CTL_IS_PERFCNT_ENABLE: + return runloop_perfcnt_enable; + case RARCH_CTL_SET_NONBLOCK_FORCED: + runloop_force_nonblock = true; + break; + case RARCH_CTL_UNSET_NONBLOCK_FORCED: + runloop_force_nonblock = false; + break; + case RARCH_CTL_IS_NONBLOCK_FORCED: + return runloop_force_nonblock; + case RARCH_CTL_SET_FRAME_TIME: + { + const struct retro_frame_time_callback *info = + (const struct retro_frame_time_callback*)data; +#ifdef HAVE_NETWORKING + /* retro_run() will be called in very strange and + * mysterious ways, have to disable it. */ + if (netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_ENABLED, NULL)) + return false; +#endif + runloop_frame_time = *info; + } + break; + case RARCH_CTL_GET_WINDOWED_SCALE: + { + unsigned **scale = (unsigned**)data; + if (!scale) + return false; + *scale = (unsigned*)&runloop_pending_windowed_scale; + } + break; + case RARCH_CTL_SET_WINDOWED_SCALE: + { + unsigned *idx = (unsigned*)data; + if (!idx) + return false; + runloop_pending_windowed_scale = *idx; + } + break; + case RARCH_CTL_SET_LIBRETRO_PATH: + return path_set(RARCH_PATH_CORE, (const char*)data); + case RARCH_CTL_FRAME_TIME_FREE: + memset(&runloop_frame_time, 0, + sizeof(struct retro_frame_time_callback)); + runloop_frame_time_last = 0; + runloop_max_frames = 0; + break; + case RARCH_CTL_STATE_FREE: + runloop_perfcnt_enable = false; + runloop_idle = false; + runloop_paused = false; + runloop_slowmotion = false; + runloop_overrides_active = false; + runloop_autosave = false; + rarch_ctl(RARCH_CTL_FRAME_TIME_FREE, NULL); + break; + case RARCH_CTL_IS_IDLE: + return runloop_idle; + case RARCH_CTL_SET_IDLE: + { + bool *ptr = (bool*)data; + if (!ptr) + return false; + runloop_idle = *ptr; + } + break; + case RARCH_CTL_SET_PAUSED: + { + bool *ptr = (bool*)data; + if (!ptr) + return false; + runloop_paused = *ptr; + } + break; + case RARCH_CTL_IS_PAUSED: + return runloop_paused; + case RARCH_CTL_TASK_INIT: + { +#ifdef HAVE_THREADS + settings_t *settings = config_get_ptr(); + bool threaded_enable = settings->bools.threaded_data_runloop_enable; +#else + bool threaded_enable = false; +#endif + task_queue_deinit(); + task_queue_init(threaded_enable, runloop_msg_queue_push); + } + break; + case RARCH_CTL_SET_CORE_SHUTDOWN: + runloop_core_shutdown_initiated = true; + break; + case RARCH_CTL_SET_SHUTDOWN: + runloop_shutdown_initiated = true; + break; + case RARCH_CTL_IS_SHUTDOWN: + return runloop_shutdown_initiated; + case RARCH_CTL_DATA_DEINIT: + task_queue_deinit(); + break; + case RARCH_CTL_IS_CORE_OPTION_UPDATED: + if (!runloop_core_options) + return false; + return core_option_manager_updated(runloop_core_options); + case RARCH_CTL_CORE_OPTION_PREV: + { + unsigned *idx = (unsigned*)data; + if (!idx) + return false; + core_option_manager_prev(runloop_core_options, *idx); + if (ui_companion_is_on_foreground()) + ui_companion_driver_notify_refresh(); + } + break; + case RARCH_CTL_CORE_OPTION_NEXT: + { + unsigned *idx = (unsigned*)data; + if (!idx) + return false; + core_option_manager_next(runloop_core_options, *idx); + if (ui_companion_is_on_foreground()) + ui_companion_driver_notify_refresh(); + } + break; + case RARCH_CTL_CORE_OPTIONS_GET: + { + struct retro_variable *var = (struct retro_variable*)data; + + if (!runloop_core_options || !var) + return false; + + RARCH_LOG("Environ GET_VARIABLE %s:\n", var->key); + core_option_manager_get(runloop_core_options, var); + RARCH_LOG("\t%s\n", var->value ? var->value : + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NOT_AVAILABLE)); + } + break; + case RARCH_CTL_CORE_OPTIONS_INIT: + { + settings_t *settings = config_get_ptr(); + char *game_options_path = NULL; + bool ret = false; + const struct retro_variable *vars = + (const struct retro_variable*)data; + + if (settings && settings->bools.game_specific_options) + ret = rarch_game_specific_options(&game_options_path); + + if(ret) + { + runloop_game_options_active = true; + runloop_core_options = + core_option_manager_new(game_options_path, vars); + free(game_options_path); + } + else + { + char buf[PATH_MAX_LENGTH]; + const char *options_path = NULL; + + buf[0] = '\0'; + + if (settings) + options_path = settings->paths.path_core_options; + + if (string_is_empty(options_path) && !path_is_empty(RARCH_PATH_CONFIG)) + { + fill_pathname_resolve_relative(buf, path_get(RARCH_PATH_CONFIG), + file_path_str(FILE_PATH_CORE_OPTIONS_CONFIG), sizeof(buf)); + options_path = buf; + } + + runloop_game_options_active = false; + + if (!string_is_empty(options_path)) + runloop_core_options = + core_option_manager_new(options_path, vars); + } + + } + break; + case RARCH_CTL_CORE_OPTIONS_DEINIT: + { + if (!runloop_core_options) + return false; + + /* check if game options file was just created and flush + to that file instead */ + if(!path_is_empty(RARCH_PATH_CORE_OPTIONS)) + { + core_option_manager_flush_game_specific(runloop_core_options, + path_get(RARCH_PATH_CORE_OPTIONS)); + path_clear(RARCH_PATH_CORE_OPTIONS); + } + else + core_option_manager_flush(runloop_core_options); + + if (runloop_game_options_active) + runloop_game_options_active = false; + + if (runloop_core_options) + core_option_manager_free(runloop_core_options); + runloop_core_options = NULL; + } + break; + case RARCH_CTL_KEY_EVENT_GET: + { + retro_keyboard_event_t **key_event = + (retro_keyboard_event_t**)data; + if (!key_event) + return false; + *key_event = &runloop_key_event; + } + break; + case RARCH_CTL_FRONTEND_KEY_EVENT_GET: + { + retro_keyboard_event_t **key_event = + (retro_keyboard_event_t**)data; + if (!key_event) + return false; + *key_event = &runloop_frontend_key_event; + } + break; + case RARCH_CTL_HTTPSERVER_INIT: +#if defined(HAVE_HTTPSERVER) && defined(HAVE_ZLIB) + httpserver_init(8888); +#endif + break; + case RARCH_CTL_HTTPSERVER_DESTROY: +#if defined(HAVE_HTTPSERVER) && defined(HAVE_ZLIB) + httpserver_destroy(); +#endif + break; case RARCH_CTL_NONE: default: return false; @@ -1840,32 +2205,6 @@ void runloop_msg_queue_push(const char *msg, #endif } -/** - * rarch_game_specific_options: - * - * Returns: true (1) if a game specific core - * options path has been found, - * otherwise false (0). - **/ -static bool rarch_game_specific_options(char **output) -{ - char game_path[8192]; - - game_path[0] ='\0'; - - if (!retroarch_validate_game_options(game_path, - sizeof(game_path), false)) - return false; - - if (!config_file_exists(game_path)) - return false; - - RARCH_LOG("%s %s\n", - msg_hash_to_str(MSG_GAME_SPECIFIC_CORE_OPTIONS_FOUND_AT), - game_path); - *output = strdup(game_path); - return true; -} void runloop_get_status(bool *is_paused, bool *is_idle, bool *is_slowmotion, bool *is_perfcnt_enable) @@ -1890,357 +2229,6 @@ bool runloop_msg_queue_pull(const char **ret) return true; } -bool runloop_ctl(enum runloop_ctl_state state, void *data) -{ - - switch (state) - { - case RUNLOOP_CTL_SYSTEM_INFO_INIT: - core_get_system_info(&runloop_system.info); - - if (!runloop_system.info.library_name) - runloop_system.info.library_name = msg_hash_to_str(MSG_UNKNOWN); - if (!runloop_system.info.library_version) - runloop_system.info.library_version = "v0"; - - video_driver_set_title_buf(); - - strlcpy(runloop_system.valid_extensions, - runloop_system.info.valid_extensions ? - runloop_system.info.valid_extensions : DEFAULT_EXT, - sizeof(runloop_system.valid_extensions)); - break; - case RUNLOOP_CTL_GET_CORE_OPTION_SIZE: - { - unsigned *idx = (unsigned*)data; - if (!idx) - return false; - *idx = (unsigned)core_option_manager_size(runloop_core_options); - } - break; - case RUNLOOP_CTL_HAS_CORE_OPTIONS: - return runloop_core_options; - case RUNLOOP_CTL_CORE_OPTIONS_LIST_GET: - { - core_option_manager_t **coreopts = (core_option_manager_t**)data; - if (!coreopts) - return false; - *coreopts = runloop_core_options; - } - break; - case RUNLOOP_CTL_SYSTEM_INFO_FREE: - - /* No longer valid. */ - if (runloop_system.subsystem.data) - free(runloop_system.subsystem.data); - runloop_system.subsystem.data = NULL; - runloop_system.subsystem.size = 0; - - if (runloop_system.ports.data) - free(runloop_system.ports.data); - runloop_system.ports.data = NULL; - runloop_system.ports.size = 0; - - if (runloop_system.mmaps.descriptors) - free((void *)runloop_system.mmaps.descriptors); - runloop_system.mmaps.descriptors = NULL; - runloop_system.mmaps.num_descriptors = 0; - - runloop_key_event = NULL; - runloop_frontend_key_event = NULL; - - audio_driver_unset_callback(); - memset(&runloop_system, 0, sizeof(rarch_system_info_t)); - break; - case RUNLOOP_CTL_SET_FRAME_TIME_LAST: - runloop_frame_time_last = 0; - break; - case RUNLOOP_CTL_SET_OVERRIDES_ACTIVE: - runloop_overrides_active = true; - break; - case RUNLOOP_CTL_UNSET_OVERRIDES_ACTIVE: - runloop_overrides_active = false; - break; - case RUNLOOP_CTL_IS_OVERRIDES_ACTIVE: - return runloop_overrides_active; - case RUNLOOP_CTL_SET_MISSING_BIOS: - runloop_missing_bios = true; - break; - case RUNLOOP_CTL_UNSET_MISSING_BIOS: - runloop_missing_bios = false; - break; - case RUNLOOP_CTL_IS_MISSING_BIOS: - return runloop_missing_bios; - case RUNLOOP_CTL_IS_GAME_OPTIONS_ACTIVE: - return runloop_game_options_active; - case RUNLOOP_CTL_SET_FRAME_LIMIT: - { - settings_t *settings = config_get_ptr(); - struct retro_system_av_info *av_info = - video_viewport_get_system_av_info(); - float fastforward_ratio = - (settings->floats.fastforward_ratio == 0.0f) - ? 1.0f : settings->floats.fastforward_ratio; - - frame_limit_last_time = cpu_features_get_time_usec(); - frame_limit_minimum_time = (retro_time_t)roundf(1000000.0f - / (av_info->timing.fps * fastforward_ratio)); - } - break; - case RUNLOOP_CTL_GET_PERFCNT: - { - bool **perfcnt = (bool**)data; - if (!perfcnt) - return false; - *perfcnt = &runloop_perfcnt_enable; - } - break; - case RUNLOOP_CTL_SET_PERFCNT_ENABLE: - runloop_perfcnt_enable = true; - break; - case RUNLOOP_CTL_UNSET_PERFCNT_ENABLE: - runloop_perfcnt_enable = false; - break; - case RUNLOOP_CTL_IS_PERFCNT_ENABLE: - return runloop_perfcnt_enable; - case RUNLOOP_CTL_SET_NONBLOCK_FORCED: - runloop_force_nonblock = true; - break; - case RUNLOOP_CTL_UNSET_NONBLOCK_FORCED: - runloop_force_nonblock = false; - break; - case RUNLOOP_CTL_IS_NONBLOCK_FORCED: - return runloop_force_nonblock; - case RUNLOOP_CTL_SET_FRAME_TIME: - { - const struct retro_frame_time_callback *info = - (const struct retro_frame_time_callback*)data; -#ifdef HAVE_NETWORKING - /* retro_run() will be called in very strange and - * mysterious ways, have to disable it. */ - if (netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_ENABLED, NULL)) - return false; -#endif - runloop_frame_time = *info; - } - break; - case RUNLOOP_CTL_GET_WINDOWED_SCALE: - { - unsigned **scale = (unsigned**)data; - if (!scale) - return false; - *scale = (unsigned*)&runloop_pending_windowed_scale; - } - break; - case RUNLOOP_CTL_SET_WINDOWED_SCALE: - { - unsigned *idx = (unsigned*)data; - if (!idx) - return false; - runloop_pending_windowed_scale = *idx; - } - break; - case RUNLOOP_CTL_SET_LIBRETRO_PATH: - return path_set(RARCH_PATH_CORE, (const char*)data); - case RUNLOOP_CTL_FRAME_TIME_FREE: - memset(&runloop_frame_time, 0, - sizeof(struct retro_frame_time_callback)); - runloop_frame_time_last = 0; - runloop_max_frames = 0; - break; - case RUNLOOP_CTL_STATE_FREE: - runloop_perfcnt_enable = false; - runloop_idle = false; - runloop_paused = false; - runloop_slowmotion = false; - runloop_overrides_active = false; - runloop_autosave = false; - runloop_ctl(RUNLOOP_CTL_FRAME_TIME_FREE, NULL); - break; - case RUNLOOP_CTL_IS_IDLE: - return runloop_idle; - case RUNLOOP_CTL_SET_IDLE: - { - bool *ptr = (bool*)data; - if (!ptr) - return false; - runloop_idle = *ptr; - } - break; - case RUNLOOP_CTL_SET_PAUSED: - { - bool *ptr = (bool*)data; - if (!ptr) - return false; - runloop_paused = *ptr; - } - break; - case RUNLOOP_CTL_IS_PAUSED: - return runloop_paused; - case RUNLOOP_CTL_TASK_INIT: - { -#ifdef HAVE_THREADS - settings_t *settings = config_get_ptr(); - bool threaded_enable = settings->bools.threaded_data_runloop_enable; -#else - bool threaded_enable = false; -#endif - task_queue_deinit(); - task_queue_init(threaded_enable, runloop_msg_queue_push); - } - break; - case RUNLOOP_CTL_SET_CORE_SHUTDOWN: - runloop_core_shutdown_initiated = true; - break; - case RUNLOOP_CTL_SET_SHUTDOWN: - runloop_shutdown_initiated = true; - break; - case RUNLOOP_CTL_IS_SHUTDOWN: - return runloop_shutdown_initiated; - case RUNLOOP_CTL_DATA_DEINIT: - task_queue_deinit(); - break; - case RUNLOOP_CTL_IS_CORE_OPTION_UPDATED: - if (!runloop_core_options) - return false; - return core_option_manager_updated(runloop_core_options); - case RUNLOOP_CTL_CORE_OPTION_PREV: - { - unsigned *idx = (unsigned*)data; - if (!idx) - return false; - core_option_manager_prev(runloop_core_options, *idx); - if (ui_companion_is_on_foreground()) - ui_companion_driver_notify_refresh(); - } - break; - case RUNLOOP_CTL_CORE_OPTION_NEXT: - { - unsigned *idx = (unsigned*)data; - if (!idx) - return false; - core_option_manager_next(runloop_core_options, *idx); - if (ui_companion_is_on_foreground()) - ui_companion_driver_notify_refresh(); - } - break; - case RUNLOOP_CTL_CORE_OPTIONS_GET: - { - struct retro_variable *var = (struct retro_variable*)data; - - if (!runloop_core_options || !var) - return false; - - RARCH_LOG("Environ GET_VARIABLE %s:\n", var->key); - core_option_manager_get(runloop_core_options, var); - RARCH_LOG("\t%s\n", var->value ? var->value : - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NOT_AVAILABLE)); - } - break; - case RUNLOOP_CTL_CORE_OPTIONS_INIT: - { - settings_t *settings = config_get_ptr(); - char *game_options_path = NULL; - bool ret = false; - const struct retro_variable *vars = - (const struct retro_variable*)data; - - if (settings && settings->bools.game_specific_options) - ret = rarch_game_specific_options(&game_options_path); - - if(ret) - { - runloop_game_options_active = true; - runloop_core_options = - core_option_manager_new(game_options_path, vars); - free(game_options_path); - } - else - { - char buf[PATH_MAX_LENGTH]; - const char *options_path = NULL; - - buf[0] = '\0'; - - if (settings) - options_path = settings->paths.path_core_options; - - if (string_is_empty(options_path) && !path_is_empty(RARCH_PATH_CONFIG)) - { - fill_pathname_resolve_relative(buf, path_get(RARCH_PATH_CONFIG), - file_path_str(FILE_PATH_CORE_OPTIONS_CONFIG), sizeof(buf)); - options_path = buf; - } - - runloop_game_options_active = false; - - if (!string_is_empty(options_path)) - runloop_core_options = - core_option_manager_new(options_path, vars); - } - - } - break; - case RUNLOOP_CTL_CORE_OPTIONS_DEINIT: - { - if (!runloop_core_options) - return false; - - /* check if game options file was just created and flush - to that file instead */ - if(!path_is_empty(RARCH_PATH_CORE_OPTIONS)) - { - core_option_manager_flush_game_specific(runloop_core_options, - path_get(RARCH_PATH_CORE_OPTIONS)); - path_clear(RARCH_PATH_CORE_OPTIONS); - } - else - core_option_manager_flush(runloop_core_options); - - if (runloop_game_options_active) - runloop_game_options_active = false; - - if (runloop_core_options) - core_option_manager_free(runloop_core_options); - runloop_core_options = NULL; - } - break; - case RUNLOOP_CTL_KEY_EVENT_GET: - { - retro_keyboard_event_t **key_event = - (retro_keyboard_event_t**)data; - if (!key_event) - return false; - *key_event = &runloop_key_event; - } - break; - case RUNLOOP_CTL_FRONTEND_KEY_EVENT_GET: - { - retro_keyboard_event_t **key_event = - (retro_keyboard_event_t**)data; - if (!key_event) - return false; - *key_event = &runloop_frontend_key_event; - } - break; - case RUNLOOP_CTL_HTTPSERVER_INIT: -#if defined(HAVE_HTTPSERVER) && defined(HAVE_ZLIB) - httpserver_init(8888); -#endif - break; - case RUNLOOP_CTL_HTTPSERVER_DESTROY: -#if defined(HAVE_HTTPSERVER) && defined(HAVE_ZLIB) - httpserver_destroy(); -#endif - break; - case RUNLOOP_CTL_NONE: - default: - break; - } - - return true; -} - #if 0 static void runloop_upload_audio(void *task_data, void *user_data, const char *err) diff --git a/retroarch.h b/retroarch.h index 5b62cf601c..5f9024350b 100644 --- a/retroarch.h +++ b/retroarch.h @@ -78,7 +78,78 @@ enum rarch_ctl_state /* Username */ RARCH_CTL_HAS_SET_USERNAME, RARCH_CTL_USERNAME_SET, - RARCH_CTL_USERNAME_UNSET + RARCH_CTL_USERNAME_UNSET, + + RARCH_CTL_SET_FRAME_LIMIT, + + RARCH_CTL_TASK_INIT, + + RARCH_CTL_FRAME_TIME_FREE, + RARCH_CTL_SET_FRAME_TIME_LAST, + RARCH_CTL_SET_FRAME_TIME, + + RARCH_CTL_IS_IDLE, + RARCH_CTL_SET_IDLE, + + RARCH_CTL_GET_WINDOWED_SCALE, + RARCH_CTL_SET_WINDOWED_SCALE, + + RARCH_CTL_IS_OVERRIDES_ACTIVE, + RARCH_CTL_SET_OVERRIDES_ACTIVE, + RARCH_CTL_UNSET_OVERRIDES_ACTIVE, + + RARCH_CTL_IS_MISSING_BIOS, + RARCH_CTL_SET_MISSING_BIOS, + RARCH_CTL_UNSET_MISSING_BIOS, + + RARCH_CTL_IS_GAME_OPTIONS_ACTIVE, + + RARCH_CTL_IS_NONBLOCK_FORCED, + RARCH_CTL_SET_NONBLOCK_FORCED, + RARCH_CTL_UNSET_NONBLOCK_FORCED, + + RARCH_CTL_SET_LIBRETRO_PATH, + + RARCH_CTL_IS_PAUSED, + RARCH_CTL_SET_PAUSED, + + RARCH_CTL_SET_CORE_SHUTDOWN, + + RARCH_CTL_SET_SHUTDOWN, + RARCH_CTL_IS_SHUTDOWN, + + /* Runloop state */ + RARCH_CTL_STATE_FREE, + + /* Performance counters */ + RARCH_CTL_GET_PERFCNT, + RARCH_CTL_SET_PERFCNT_ENABLE, + RARCH_CTL_UNSET_PERFCNT_ENABLE, + RARCH_CTL_IS_PERFCNT_ENABLE, + + /* Key event */ + RARCH_CTL_FRONTEND_KEY_EVENT_GET, + RARCH_CTL_KEY_EVENT_GET, + RARCH_CTL_DATA_DEINIT, + + /* Core options */ + RARCH_CTL_HAS_CORE_OPTIONS, + RARCH_CTL_GET_CORE_OPTION_SIZE, + RARCH_CTL_IS_CORE_OPTION_UPDATED, + RARCH_CTL_CORE_OPTIONS_LIST_GET, + RARCH_CTL_CORE_OPTION_PREV, + RARCH_CTL_CORE_OPTION_NEXT, + RARCH_CTL_CORE_OPTIONS_GET, + RARCH_CTL_CORE_OPTIONS_INIT, + RARCH_CTL_CORE_OPTIONS_DEINIT, + + /* System info */ + RARCH_CTL_SYSTEM_INFO_INIT, + RARCH_CTL_SYSTEM_INFO_FREE, + + /* HTTP server */ + RARCH_CTL_HTTPSERVER_INIT, + RARCH_CTL_HTTPSERVER_DESTROY }; enum rarch_capabilities @@ -114,82 +185,6 @@ enum runloop_action RUNLOOP_ACTION_AUTOSAVE }; -enum runloop_ctl_state -{ - RUNLOOP_CTL_NONE = 0, - - RUNLOOP_CTL_SET_FRAME_LIMIT, - - RUNLOOP_CTL_TASK_INIT, - - RUNLOOP_CTL_FRAME_TIME_FREE, - RUNLOOP_CTL_SET_FRAME_TIME_LAST, - RUNLOOP_CTL_SET_FRAME_TIME, - - RUNLOOP_CTL_IS_IDLE, - RUNLOOP_CTL_SET_IDLE, - - RUNLOOP_CTL_GET_WINDOWED_SCALE, - RUNLOOP_CTL_SET_WINDOWED_SCALE, - - RUNLOOP_CTL_IS_OVERRIDES_ACTIVE, - RUNLOOP_CTL_SET_OVERRIDES_ACTIVE, - RUNLOOP_CTL_UNSET_OVERRIDES_ACTIVE, - - RUNLOOP_CTL_IS_MISSING_BIOS, - RUNLOOP_CTL_SET_MISSING_BIOS, - RUNLOOP_CTL_UNSET_MISSING_BIOS, - - RUNLOOP_CTL_IS_GAME_OPTIONS_ACTIVE, - - RUNLOOP_CTL_IS_NONBLOCK_FORCED, - RUNLOOP_CTL_SET_NONBLOCK_FORCED, - RUNLOOP_CTL_UNSET_NONBLOCK_FORCED, - - RUNLOOP_CTL_SET_LIBRETRO_PATH, - - RUNLOOP_CTL_IS_PAUSED, - RUNLOOP_CTL_SET_PAUSED, - - RUNLOOP_CTL_SET_CORE_SHUTDOWN, - - RUNLOOP_CTL_SET_SHUTDOWN, - RUNLOOP_CTL_IS_SHUTDOWN, - - /* Runloop state */ - RUNLOOP_CTL_STATE_FREE, - - /* Performance counters */ - RUNLOOP_CTL_GET_PERFCNT, - RUNLOOP_CTL_SET_PERFCNT_ENABLE, - RUNLOOP_CTL_UNSET_PERFCNT_ENABLE, - RUNLOOP_CTL_IS_PERFCNT_ENABLE, - - /* Key event */ - RUNLOOP_CTL_FRONTEND_KEY_EVENT_GET, - RUNLOOP_CTL_KEY_EVENT_GET, - RUNLOOP_CTL_DATA_DEINIT, - - /* Core options */ - RUNLOOP_CTL_HAS_CORE_OPTIONS, - RUNLOOP_CTL_GET_CORE_OPTION_SIZE, - RUNLOOP_CTL_IS_CORE_OPTION_UPDATED, - RUNLOOP_CTL_CORE_OPTIONS_LIST_GET, - RUNLOOP_CTL_CORE_OPTION_PREV, - RUNLOOP_CTL_CORE_OPTION_NEXT, - RUNLOOP_CTL_CORE_OPTIONS_GET, - RUNLOOP_CTL_CORE_OPTIONS_INIT, - RUNLOOP_CTL_CORE_OPTIONS_DEINIT, - - /* System info */ - RUNLOOP_CTL_SYSTEM_INFO_INIT, - RUNLOOP_CTL_SYSTEM_INFO_FREE, - - /* HTTP server */ - RUNLOOP_CTL_HTTPSERVER_INIT, - RUNLOOP_CTL_HTTPSERVER_DESTROY -}; - struct rarch_main_wrap { int argc; @@ -337,8 +332,6 @@ bool runloop_msg_queue_pull(const char **ret); void runloop_get_status(bool *is_paused, bool *is_idle, bool *is_slowmotion, bool *is_perfcnt_enable); -bool runloop_ctl(enum runloop_ctl_state state, void *data); - void runloop_set(enum runloop_action action); void runloop_unset(enum runloop_action action); diff --git a/tasks/task_content.c b/tasks/task_content.c index a9738db88b..8762bc9e05 100644 --- a/tasks/task_content.c +++ b/tasks/task_content.c @@ -1006,7 +1006,7 @@ bool task_push_start_dummy_core(content_ctx_info_t *content_info) content_ctx.is_bps_pref = rarch_ctl(RARCH_CTL_IS_BPS_PREF, NULL); content_ctx.is_ups_pref = rarch_ctl(RARCH_CTL_IS_UPS_PREF, NULL); content_ctx.patch_is_blocked = rarch_ctl(RARCH_CTL_IS_PATCH_BLOCKED, NULL); - content_ctx.bios_is_missing = runloop_ctl(RUNLOOP_CTL_IS_MISSING_BIOS, NULL); + content_ctx.bios_is_missing = rarch_ctl(RARCH_CTL_IS_MISSING_BIOS, NULL); content_ctx.history_list_enable = false; content_ctx.directory_system = NULL; content_ctx.directory_cache = NULL; @@ -1049,9 +1049,9 @@ bool task_push_start_dummy_core(content_ctx_info_t *content_info) #ifdef HAVE_MENU menu_driver_ctl(RARCH_MENU_CTL_UNSET_LOAD_NO_CONTENT, NULL); #endif - runloop_ctl(RUNLOOP_CTL_STATE_FREE, NULL); - runloop_ctl(RUNLOOP_CTL_DATA_DEINIT, NULL); - runloop_ctl(RUNLOOP_CTL_TASK_INIT, NULL); + rarch_ctl(RARCH_CTL_STATE_FREE, NULL); + rarch_ctl(RARCH_CTL_DATA_DEINIT, NULL); + rarch_ctl(RARCH_CTL_TASK_INIT, NULL); /* Load content */ if (!task_load_content(content_info, &content_ctx, @@ -1099,7 +1099,7 @@ bool task_push_load_content_from_playlist_from_menu( content_ctx.is_bps_pref = rarch_ctl(RARCH_CTL_IS_BPS_PREF, NULL); content_ctx.is_ups_pref = rarch_ctl(RARCH_CTL_IS_UPS_PREF, NULL); content_ctx.patch_is_blocked = rarch_ctl(RARCH_CTL_IS_PATCH_BLOCKED, NULL); - content_ctx.bios_is_missing = runloop_ctl(RUNLOOP_CTL_IS_MISSING_BIOS, NULL); + content_ctx.bios_is_missing = rarch_ctl(RARCH_CTL_IS_MISSING_BIOS, NULL); content_ctx.history_list_enable = false; content_ctx.directory_system = NULL; content_ctx.directory_cache = NULL; @@ -1130,7 +1130,7 @@ bool task_push_load_content_from_playlist_from_menu( content_ctx.directory_system = strdup(settings->paths.directory_system); /* Set libretro core path */ - runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, (void*)core_path); + rarch_ctl(RARCH_CTL_SET_LIBRETRO_PATH, (void*)core_path); /* Is content required by this core? */ if (fullpath) @@ -1157,7 +1157,7 @@ bool task_push_load_content_from_playlist_from_menu( } #ifndef HAVE_DYNAMIC - runloop_ctl(RUNLOOP_CTL_SET_SHUTDOWN, NULL); + rarch_ctl(RARCH_CTL_SET_SHUTDOWN, NULL); rarch_menu_running_finished(); #endif @@ -1197,7 +1197,7 @@ bool task_push_start_current_core(content_ctx_info_t *content_info) content_ctx.is_bps_pref = rarch_ctl(RARCH_CTL_IS_BPS_PREF, NULL); content_ctx.is_ups_pref = rarch_ctl(RARCH_CTL_IS_UPS_PREF, NULL); content_ctx.patch_is_blocked = rarch_ctl(RARCH_CTL_IS_PATCH_BLOCKED, NULL); - content_ctx.bios_is_missing = runloop_ctl(RUNLOOP_CTL_IS_MISSING_BIOS, NULL); + content_ctx.bios_is_missing = rarch_ctl(RARCH_CTL_IS_MISSING_BIOS, NULL); content_ctx.history_list_enable = false; content_ctx.directory_system = NULL; content_ctx.directory_cache = NULL; @@ -1286,7 +1286,7 @@ bool task_push_load_new_core( void *user_data) { /* Set libretro core path */ - runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, (void*)core_path); + rarch_ctl(RARCH_CTL_SET_LIBRETRO_PATH, (void*)core_path); /* Load core */ command_event(CMD_EVENT_LOAD_CORE, NULL); @@ -1325,7 +1325,7 @@ bool task_push_load_content_with_new_core_from_menu( content_ctx.is_bps_pref = rarch_ctl(RARCH_CTL_IS_BPS_PREF, NULL); content_ctx.is_ups_pref = rarch_ctl(RARCH_CTL_IS_UPS_PREF, NULL); content_ctx.patch_is_blocked = rarch_ctl(RARCH_CTL_IS_PATCH_BLOCKED, NULL); - content_ctx.bios_is_missing = runloop_ctl(RUNLOOP_CTL_IS_MISSING_BIOS, NULL); + content_ctx.bios_is_missing = rarch_ctl(RARCH_CTL_IS_MISSING_BIOS, NULL); content_ctx.history_list_enable = false; content_ctx.directory_system = NULL; content_ctx.directory_cache = NULL; @@ -1359,7 +1359,7 @@ bool task_push_load_content_with_new_core_from_menu( path_set(RARCH_PATH_CONTENT, fullpath); /* Set libretro core path */ - runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, (void*)core_path); + rarch_ctl(RARCH_CTL_SET_LIBRETRO_PATH, (void*)core_path); #ifdef HAVE_DYNAMIC /* Load core */ @@ -1427,7 +1427,7 @@ static bool task_load_content_callback(content_ctx_info_t *content_info, content_ctx.is_bps_pref = rarch_ctl(RARCH_CTL_IS_BPS_PREF, NULL); content_ctx.is_ups_pref = rarch_ctl(RARCH_CTL_IS_UPS_PREF, NULL); content_ctx.patch_is_blocked = rarch_ctl(RARCH_CTL_IS_PATCH_BLOCKED, NULL); - content_ctx.bios_is_missing = runloop_ctl(RUNLOOP_CTL_IS_MISSING_BIOS, NULL); + content_ctx.bios_is_missing = rarch_ctl(RARCH_CTL_IS_MISSING_BIOS, NULL); content_ctx.history_list_enable = false; content_ctx.directory_system = NULL; content_ctx.directory_cache = NULL; @@ -1502,7 +1502,7 @@ bool task_push_load_content_with_new_core_from_companion_ui( path_set(RARCH_PATH_CONTENT, fullpath); /* Set libretro core path */ - runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, (void*)core_path); + rarch_ctl(RARCH_CTL_SET_LIBRETRO_PATH, (void*)core_path); #ifdef HAVE_DYNAMIC command_event(CMD_EVENT_LOAD_CORE, NULL); #endif diff --git a/ui/drivers/ui_cocoa.m b/ui/drivers/ui_cocoa.m index 81f3baed60..84a8215af3 100644 --- a/ui/drivers/ui_cocoa.m +++ b/ui/drivers/ui_cocoa.m @@ -329,7 +329,7 @@ static void open_core_handler(ui_browser_window_state_t *state, bool result) settings_t *settings = config_get_ptr(); - runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, (void*)state->result); + rarch_ctl(RARCH_CTL_SET_LIBRETRO_PATH, (void*)state->result); ui_companion_event_command(CMD_EVENT_LOAD_CORE); if (menu_driver_ctl(RARCH_MENU_CTL_HAS_LOAD_NO_CONTENT, NULL) @@ -481,7 +481,7 @@ static void open_document_handler(ui_browser_window_state_t *state, bool result) if (sender_tag >= 10 && sender_tag <= 19) { unsigned idx = (sender_tag - (10-1)); - runloop_ctl(RUNLOOP_CTL_SET_WINDOWED_SCALE, &idx); + rarch_ctl(RARCH_CTL_SET_WINDOWED_SCALE, &idx); cmd = CMD_EVENT_RESIZE_WINDOWED_SCALE; } diff --git a/ui/drivers/ui_cocoatouch.m b/ui/drivers/ui_cocoatouch.m index 9b5f93d2fb..41cbadaef1 100644 --- a/ui/drivers/ui_cocoatouch.m +++ b/ui/drivers/ui_cocoatouch.m @@ -54,8 +54,8 @@ static void rarch_enable_ui(void) ui_companion_set_foreground(true); - runloop_ctl(RUNLOOP_CTL_SET_PAUSED, &boolean); - runloop_ctl(RUNLOOP_CTL_SET_IDLE, &boolean); + rarch_ctl(RARCH_CTL_SET_PAUSED, &boolean); + rarch_ctl(RARCH_CTL_SET_IDLE, &boolean); rarch_menu_running(); } @@ -65,8 +65,8 @@ static void rarch_disable_ui(void) ui_companion_set_foreground(false); - runloop_ctl(RUNLOOP_CTL_SET_PAUSED, &boolean); - runloop_ctl(RUNLOOP_CTL_SET_IDLE, &boolean); + rarch_ctl(RARCH_CTL_SET_PAUSED, &boolean); + rarch_ctl(RARCH_CTL_SET_IDLE, &boolean); rarch_menu_running_finished(); #ifdef HAVE_AVFOUNDATION [[RetroArch_iOS get] supportOtherAudioSessions]; @@ -97,7 +97,7 @@ static void rarch_draw_observer(CFRunLoopObserverRef observer, return; } - if (runloop_ctl(RUNLOOP_CTL_IS_IDLE, NULL)) + if (rarch_ctl(RARCH_CTL_IS_IDLE, NULL)) return; CFRunLoopWakeUp(CFRunLoopGetMain()); } diff --git a/ui/drivers/ui_win32.c b/ui/drivers/ui_win32.c index dca9767f99..4fc3ac32fe 100644 --- a/ui/drivers/ui_win32.c +++ b/ui/drivers/ui_win32.c @@ -627,7 +627,7 @@ LRESULT win32_menu_loop(HWND owner, WPARAM wparam) switch (mode) { case ID_M_LOAD_CORE: - runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, win32_file); + rarch_ctl(RARCH_CTL_SET_LIBRETRO_PATH, win32_file); cmd = CMD_EVENT_LOAD_CORE; break; case ID_M_LOAD_CONTENT: @@ -695,7 +695,7 @@ LRESULT win32_menu_loop(HWND owner, WPARAM wparam) if (mode >= ID_M_WINDOW_SCALE_1X && mode <= ID_M_WINDOW_SCALE_10X) { unsigned idx = (mode - (ID_M_WINDOW_SCALE_1X-1)); - runloop_ctl(RUNLOOP_CTL_SET_WINDOWED_SCALE, &idx); + rarch_ctl(RARCH_CTL_SET_WINDOWED_SCALE, &idx); cmd = CMD_EVENT_RESIZE_WINDOWED_SCALE; } else if (mode == ID_M_STATE_INDEX_AUTO)