diff --git a/audio/audio_driver.c b/audio/audio_driver.c index eda77dfb43..3a6fc74246 100644 --- a/audio/audio_driver.c +++ b/audio/audio_driver.c @@ -495,7 +495,7 @@ static bool audio_driver_flush(const int16_t *data, size_t samples) recording_push_audio(data, samples); - rarch_main_ctl(RUNLOOP_CTL_IS_PAUSED, &is_paused); + runloop_ctl(RUNLOOP_CTL_IS_PAUSED, &is_paused); if (is_paused || settings->audio.mute_enable) return true; @@ -535,7 +535,7 @@ static bool audio_driver_flush(const int16_t *data, size_t samples) src_data.ratio = audio_driver_data.src_ratio; - rarch_main_ctl(RUNLOOP_CTL_IS_SLOWMOTION, &is_slowmotion); + runloop_ctl(RUNLOOP_CTL_IS_SLOWMOTION, &is_slowmotion); if (is_slowmotion) src_data.ratio *= settings->slowmotion_ratio; diff --git a/command_event.c b/command_event.c index 1d4961b07b..ee62dccf13 100644 --- a/command_event.c +++ b/command_event.c @@ -1042,7 +1042,7 @@ bool event_command(enum event_command cmd) event_command(EVENT_CMD_LOAD_CONTENT_PERSIST); #else char *fullpath = NULL; - rarch_main_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath); + runloop_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath); rarch_environment_cb(RETRO_ENVIRONMENT_SET_LIBRETRO_PATH, (void*)settings->libretro); rarch_environment_cb(RETRO_ENVIRONMENT_EXEC, (void*)fullpath); @@ -1097,7 +1097,7 @@ bool event_command(enum event_command cmd) if (!settings->video.fullscreen) event_command(EVENT_CMD_REINIT); - rarch_main_ctl(RUNLOOP_CTL_SET_WINDOWED_SCALE, &idx); + runloop_ctl(RUNLOOP_CTL_SET_WINDOWED_SCALE, &idx); } break; case EVENT_CMD_MENU_TOGGLE: @@ -1143,7 +1143,7 @@ bool event_command(enum event_command cmd) return false; break; case EVENT_CMD_UNLOAD_CORE: - rarch_main_ctl(RUNLOOP_CTL_PREPARE_DUMMY, NULL); + runloop_ctl(RUNLOOP_CTL_PREPARE_DUMMY, NULL); event_command(EVENT_CMD_LOAD_CORE_DEINIT); break; case EVENT_CMD_QUIT: @@ -1417,7 +1417,7 @@ bool event_command(enum event_command cmd) #if defined(GEKKO) && defined(HW_RVL) char new_path[PATH_MAX_LENGTH]; fill_pathname_join(new_path, g_defaults.dir.core, SALAMANDER_FILE, sizeof(new_path)); - rarch_main_ctl(RUNLOOP_CTL_SET_CONTENT_PATH, new_path); + runloop_ctl(RUNLOOP_CTL_SET_CONTENT_PATH, new_path); #endif if (driver->frontend_ctx && driver->frontend_ctx->set_fork) driver->frontend_ctx->set_fork(true, false); @@ -1436,7 +1436,7 @@ bool event_command(enum event_command cmd) #endif break; case EVENT_CMD_PAUSE_CHECKS: - rarch_main_ctl(RUNLOOP_CTL_IS_PAUSED, &boolean); + runloop_ctl(RUNLOOP_CTL_IS_PAUSED, &boolean); if (boolean) { @@ -1453,21 +1453,21 @@ bool event_command(enum event_command cmd) } break; case EVENT_CMD_PAUSE_TOGGLE: - rarch_main_ctl(RUNLOOP_CTL_IS_PAUSED, &boolean); + runloop_ctl(RUNLOOP_CTL_IS_PAUSED, &boolean); boolean = !boolean; - rarch_main_ctl(RUNLOOP_CTL_SET_PAUSED, &boolean); + runloop_ctl(RUNLOOP_CTL_SET_PAUSED, &boolean); event_command(EVENT_CMD_PAUSE_CHECKS); break; case EVENT_CMD_UNPAUSE: boolean = false; - rarch_main_ctl(RUNLOOP_CTL_SET_PAUSED, &boolean); + runloop_ctl(RUNLOOP_CTL_SET_PAUSED, &boolean); event_command(EVENT_CMD_PAUSE_CHECKS); break; case EVENT_CMD_PAUSE: boolean = true; - rarch_main_ctl(RUNLOOP_CTL_SET_PAUSED, &boolean); + runloop_ctl(RUNLOOP_CTL_SET_PAUSED, &boolean); event_command(EVENT_CMD_PAUSE_CHECKS); break; case EVENT_CMD_MENU_PAUSE_LIBRETRO: @@ -1726,7 +1726,7 @@ case EVENT_CMD_REMOTE_INIT: event_set_volume(-0.5f); break; case EVENT_CMD_SET_FRAME_LIMIT: - rarch_main_ctl(RUNLOOP_CTL_SET_FRAME_LIMIT_LAST_TIME, NULL); + runloop_ctl(RUNLOOP_CTL_SET_FRAME_LIMIT_LAST_TIME, NULL); break; case EVENT_CMD_NONE: default: diff --git a/configuration.c b/configuration.c index 67db4575d3..ec8e62a4bf 100644 --- a/configuration.c +++ b/configuration.c @@ -754,7 +754,7 @@ static void config_set_defaults(void) fill_pathname_expand_special(settings->libretro_directory, g_defaults.dir.core, sizeof(settings->libretro_directory)); if (*g_defaults.path.core) - rarch_main_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, g_defaults.path.core); + runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, g_defaults.path.core); if (*g_defaults.dir.database) strlcpy(settings->content_database, g_defaults.dir.database, sizeof(settings->content_database)); diff --git a/content.c b/content.c index be53201f7c..24a23a8b5f 100644 --- a/content.c +++ b/content.c @@ -619,7 +619,8 @@ bool init_content_file(void) else { char *fullpath = NULL; - rarch_main_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath); + + runloop_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath); attr.i = system->info.block_extract; attr.i |= system->info.need_fullpath << 1; diff --git a/dynamic.c b/dynamic.c index ec764f232e..41d1d8039f 100644 --- a/dynamic.c +++ b/dynamic.c @@ -768,7 +768,7 @@ bool rarch_environment_cb(unsigned cmd, void *data) case RETRO_ENVIRONMENT_SHUTDOWN: RARCH_LOG("Environ SHUTDOWN.\n"); system->shutdown = true; - rarch_main_ctl(RUNLOOP_CTL_SET_CORE_SHUTDOWN, NULL); + runloop_ctl(RUNLOOP_CTL_SET_CORE_SHUTDOWN, NULL); break; case RETRO_ENVIRONMENT_SET_PERFORMANCE_LEVEL: @@ -781,7 +781,7 @@ bool rarch_environment_cb(unsigned cmd, void *data) if (settings->system_directory[0] == '\0') { char *fullpath = NULL; - rarch_main_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath); + runloop_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath); RARCH_WARN("SYSTEM DIR is empty, assume CONTENT DIR %s\n", fullpath); fill_pathname_basedir(global->dir.systemdir, fullpath, @@ -1286,20 +1286,20 @@ bool rarch_environment_cb(unsigned cmd, void *data) if (!path_file_exists((const char*)data)) return false; - rarch_main_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, data); + runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, data); break; case RETRO_ENVIRONMENT_EXEC: case RETRO_ENVIRONMENT_EXEC_ESCAPE: { char *fullpath = NULL; - rarch_main_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath); + runloop_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath); if (fullpath != data) { - rarch_main_ctl(RUNLOOP_CTL_CLEAR_CONTENT_PATH, NULL); + runloop_ctl(RUNLOOP_CTL_CLEAR_CONTENT_PATH, NULL); if (data) - rarch_main_ctl(RUNLOOP_CTL_SET_CONTENT_PATH, data); + runloop_ctl(RUNLOOP_CTL_SET_CONTENT_PATH, data); } #if defined(RARCH_CONSOLE) @@ -1312,7 +1312,7 @@ bool rarch_environment_cb(unsigned cmd, void *data) if (cmd == RETRO_ENVIRONMENT_EXEC_ESCAPE) { RARCH_LOG("Environ (Private) EXEC_ESCAPE.\n"); - rarch_main_ctl(RUNLOOP_CTL_SET_EXEC, NULL); + runloop_ctl(RUNLOOP_CTL_SET_EXEC, NULL); } else RARCH_LOG("Environ (Private) EXEC.\n"); diff --git a/frontend/drivers/platform_ps3.c b/frontend/drivers/platform_ps3.c index 8e2516b6b4..9279885e44 100644 --- a/frontend/drivers/platform_ps3.c +++ b/frontend/drivers/platform_ps3.c @@ -372,7 +372,7 @@ static void frontend_ps3_exec(const char *path, bool should_load_game) RARCH_LOG("Attempt to load executable: [%s].\n", path); #ifndef IS_SALAMANDER - rarch_main_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath); + runloop_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath); if (should_load_game && fullpath[0] != '\0') { diff --git a/frontend/drivers/platform_psp.c b/frontend/drivers/platform_psp.c index 58bbef4bb3..fe628b1aaf 100644 --- a/frontend/drivers/platform_psp.c +++ b/frontend/drivers/platform_psp.c @@ -255,7 +255,8 @@ static void frontend_psp_exec(const char *path, bool should_load_game) #ifndef IS_SALAMANDER char *fullpath = NULL; - rarch_main_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath); + + runloop_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath); if (should_load_game && fullpath[0] != '\0') { diff --git a/frontend/drivers/platform_wii.c b/frontend/drivers/platform_wii.c index f0e94ce67d..0481cb0d59 100644 --- a/frontend/drivers/platform_wii.c +++ b/frontend/drivers/platform_wii.c @@ -135,7 +135,8 @@ void system_exec_wii(const char *_path, bool should_load_game) strlcpy(game_path, gx_rom_path, sizeof(game_path)); #else char *fullpath = NULL; - rarch_main_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath); + + runloop_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath); strlcpy(game_path, fullpath, sizeof(game_path)); #endif } diff --git a/frontend/drivers/platform_xdk.cpp b/frontend/drivers/platform_xdk.cpp index 3346d0dc7e..e74dabaca0 100644 --- a/frontend/drivers/platform_xdk.cpp +++ b/frontend/drivers/platform_xdk.cpp @@ -323,7 +323,8 @@ static void frontend_xdk_exec(const char *path, bool should_load_game) #else #ifdef _XBOX char *fullpath = NULL; - rarch_main_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath); + + runloop_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath); #if defined(_XBOX1) LAUNCH_DATA ptr; diff --git a/frontend/frontend.c b/frontend/frontend.c index 181d023905..4b0bd25b01 100644 --- a/frontend/frontend.c +++ b/frontend/frontend.c @@ -304,7 +304,7 @@ int rarch_main(int argc, char *argv[], void *data) global_t *global = global_get_ptr(); rarch_system_info_t *system = rarch_system_info_get_ptr(); - rarch_main_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath); + runloop_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath); if (global->inited.content || system->no_content) history_playlist_push( diff --git a/gfx/drivers/gl.c b/gfx/drivers/gl.c index ca2614a49a..8f84ea7951 100644 --- a/gfx/drivers/gl.c +++ b/gfx/drivers/gl.c @@ -1839,8 +1839,8 @@ static bool gl_frame(void *data, const void *frame, #endif #endif #endif - rarch_main_ctl(RUNLOOP_CTL_IS_SLOWMOTION, &is_slowmotion); - rarch_main_ctl(RUNLOOP_CTL_IS_PAUSED, &is_paused); + runloop_ctl(RUNLOOP_CTL_IS_SLOWMOTION, &is_slowmotion); + runloop_ctl(RUNLOOP_CTL_IS_PAUSED, &is_paused); /* Disable BFI during fast forward, slow-motion, * and pause to prevent flicker. */ diff --git a/gfx/video_driver.c b/gfx/video_driver.c index ce7af05de4..92f7eb6f12 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -1173,7 +1173,7 @@ static bool video_driver_cached_frame(void) driver_t *driver = driver_get_ptr(); void *recording = driver ? driver->recording_data : NULL; - if (rarch_main_ctl(RUNLOOP_CTL_IS_IDLE, NULL)) + if (runloop_ctl(RUNLOOP_CTL_IS_IDLE, NULL)) return true; /* Maybe return false here for indication of idleness? */ /* Cannot allow recording when pushing duped frames. */ diff --git a/gfx/video_thread_wrapper.c b/gfx/video_thread_wrapper.c index d783f8e8f1..b58ba6e827 100644 --- a/gfx/video_thread_wrapper.c +++ b/gfx/video_thread_wrapper.c @@ -435,7 +435,7 @@ static bool thread_alive(void *data) bool ret, is_paused; thread_video_t *thr = (thread_video_t*)data; - rarch_main_ctl(RUNLOOP_CTL_IS_PAUSED, &is_paused); + runloop_ctl(RUNLOOP_CTL_IS_PAUSED, &is_paused); if (is_paused) { diff --git a/input/drivers/android_input.c b/input/drivers/android_input.c index 0de373ae29..a0fdafde86 100644 --- a/input/drivers/android_input.c +++ b/input/drivers/android_input.c @@ -273,7 +273,7 @@ static void android_input_poll_main_cmd(void) scond_broadcast(android_app->cond); slock_unlock(android_app->mutex); - rarch_main_ctl(RUNLOOP_CTL_IS_PAUSED, &is_paused); + runloop_ctl(RUNLOOP_CTL_IS_PAUSED, &is_paused); if (is_paused) event_command(EVENT_CMD_REINIT); @@ -324,8 +324,8 @@ static void android_input_poll_main_cmd(void) { bool boolean = false; - rarch_main_ctl(RUNLOOP_CTL_SET_PAUSED, &boolean); - rarch_main_ctl(RUNLOOP_CTL_SET_IDLE, &boolean); + runloop_ctl(RUNLOOP_CTL_SET_PAUSED, &boolean); + runloop_ctl(RUNLOOP_CTL_SET_IDLE, &boolean); if ((android_app->sensor_state_mask & (UINT64_C(1) << RETRO_SENSOR_ACCELEROMETER_ENABLE)) @@ -343,8 +343,8 @@ static void android_input_poll_main_cmd(void) { bool boolean = true; - rarch_main_ctl(RUNLOOP_CTL_SET_PAUSED, &boolean); - rarch_main_ctl(RUNLOOP_CTL_SET_IDLE, &boolean); + runloop_ctl(RUNLOOP_CTL_SET_PAUSED, &boolean); + runloop_ctl(RUNLOOP_CTL_SET_IDLE, &boolean); /* Avoid draining battery while app is not being used. */ if ((android_app->sensor_state_mask diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index f39a81773e..b0e09ce4a1 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -650,14 +650,14 @@ static int generic_action_ok(const char *path, case ACTION_OK_LOAD_CORE: flush_char = NULL; flush_type = MENU_SETTINGS; - rarch_main_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, action_path); + runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, action_path); event_command(EVENT_CMD_LOAD_CORE); #if defined(HAVE_DYNAMIC) /* No content needed for this core, load core immediately. */ if (menu->load_no_content && settings->core.set_supports_no_game_enable) { - rarch_main_ctl(RUNLOOP_CTL_CLEAR_CONTENT_PATH, NULL); + runloop_ctl(RUNLOOP_CTL_CLEAR_CONTENT_PATH, NULL); ret = menu_common_load_content(NULL, NULL, false, CORE_TYPE_PLAIN); if (ret == -1) action_ok_push_quick_menu(); @@ -1355,12 +1355,12 @@ static int action_ok_file_load_or_resume(const char *path, if (!menu) return -1; - rarch_main_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath); + runloop_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath); if (!strcmp(menu->deferred_path, fullpath)) return generic_action_ok_command(EVENT_CMD_RESUME); - rarch_main_ctl(RUNLOOP_CTL_SET_CONTENT_PATH, menu->deferred_path); + runloop_ctl(RUNLOOP_CTL_SET_CONTENT_PATH, menu->deferred_path); event_command(EVENT_CMD_LOAD_CORE); rarch_ctl(RARCH_CTL_LOAD_CONTENT, NULL); diff --git a/menu/drivers/menu_generic.c b/menu/drivers/menu_generic.c index 2cc41c1f1d..00aa37ada5 100644 --- a/menu/drivers/menu_generic.c +++ b/menu/drivers/menu_generic.c @@ -361,7 +361,7 @@ int menu_iterate_render(void) driver->render(); } - if (menu_driver_alive() && !rarch_main_ctl(RUNLOOP_CTL_IS_IDLE, NULL)) + if (menu_driver_alive() && !runloop_ctl(RUNLOOP_CTL_IS_IDLE, NULL)) menu_display_ctl(MENU_DISPLAY_CTL_LIBRETRO, NULL); menu_driver_set_texture(); diff --git a/menu/drivers/rgui.c b/menu/drivers/rgui.c index 8225253d8f..c414b15a59 100644 --- a/menu/drivers/rgui.c +++ b/menu/drivers/rgui.c @@ -449,7 +449,7 @@ static void rgui_render(void) if (menu_entries_needs_refresh() && menu_driver_alive() && !msg_force) return; - if (rarch_main_ctl(RUNLOOP_CTL_IS_IDLE, NULL)) + if (runloop_ctl(RUNLOOP_CTL_IS_IDLE, NULL)) return; if (!menu_display_ctl(MENU_DISPLAY_CTL_UPDATE_PENDING, NULL)) diff --git a/menu/menu.c b/menu/menu.c index 5381fef4fa..64c7b99536 100644 --- a/menu/menu.c +++ b/menu/menu.c @@ -37,7 +37,7 @@ static void menu_environment_get(int *argc, char *argv[], if (!wrap_args) return; - rarch_main_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath); + runloop_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath); wrap_args->no_content = menu->load_no_content; if (!global->has_set.verbosity) @@ -62,7 +62,7 @@ static void menu_push_to_history_playlist(void) if (!settings->history_list_enable) return; - rarch_main_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath); + runloop_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath); if (*fullpath) { @@ -98,7 +98,7 @@ bool menu_load_content(enum rarch_core_type type) driver_t *driver = driver_get_ptr(); char *fullpath = NULL; - rarch_main_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath); + runloop_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath); /* redraw menu frame */ menu_display_ctl(MENU_DISPLAY_CTL_SET_MSG_FORCE, &msg_force); menu_iterate_render(); @@ -137,12 +137,12 @@ int menu_common_load_content( if (core_path) { - rarch_main_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, (void*)core_path); + runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, (void*)core_path); event_command(EVENT_CMD_LOAD_CORE); } if (fullpath) - rarch_main_ctl(RUNLOOP_CTL_SET_CONTENT_PATH, (void*)fullpath); + runloop_ctl(RUNLOOP_CTL_SET_CONTENT_PATH, (void*)fullpath); switch (type) { diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 4d99a5e92d..68dc815fba 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -1797,7 +1797,7 @@ static int menu_displaylist_parse_horizontal_content_actions(menu_displaylist_in if (!menu) return -1; - rarch_main_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath); + runloop_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath); if (global->inited.main && (global->inited.core.type != CORE_TYPE_DUMMY) && !strcmp(menu->deferred_path, fullpath)) diff --git a/retroarch.c b/retroarch.c index 6681aa6f82..f12c33d80a 100644 --- a/retroarch.c +++ b/retroarch.c @@ -254,7 +254,7 @@ static void set_basename(const char *path) char *dst = NULL; global_t *global = global_get_ptr(); - rarch_main_ctl(RUNLOOP_CTL_SET_CONTENT_PATH, (void*)path); + runloop_ctl(RUNLOOP_CTL_SET_CONTENT_PATH, (void*)path); strlcpy(global->name.base, path, sizeof(global->name.base)); #ifdef HAVE_COMPRESSION @@ -745,7 +745,7 @@ static void parse_input(int argc, char *argv[]) } else { - rarch_main_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, optarg); + runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, optarg); global->has_set.libretro = true; } break; @@ -883,7 +883,7 @@ static void parse_input(int argc, char *argv[]) case RA_OPT_MAX_FRAMES: { unsigned max_frames = strtoul(optarg, NULL, 10); - rarch_main_ctl(RUNLOOP_CTL_SET_MAX_FRAMES, &max_frames); + runloop_ctl(RUNLOOP_CTL_SET_MAX_FRAMES, &max_frames); } break; @@ -1083,7 +1083,7 @@ void rarch_main_alloc(void) event_command(EVENT_CMD_HISTORY_DEINIT); - rarch_main_ctl(RUNLOOP_CTL_CLEAR_STATE, NULL); + runloop_ctl(RUNLOOP_CTL_CLEAR_STATE, NULL); } /** @@ -1100,17 +1100,17 @@ void rarch_main_new(void) init_state(); main_init_state_config(); - rarch_main_ctl(RUNLOOP_CTL_MSG_QUEUE_INIT, NULL); + runloop_ctl(RUNLOOP_CTL_MSG_QUEUE_INIT, NULL); } void rarch_main_free(void) { - rarch_main_ctl(RUNLOOP_CTL_MSG_QUEUE_DEINIT, NULL); + runloop_ctl(RUNLOOP_CTL_MSG_QUEUE_DEINIT, NULL); event_command(EVENT_CMD_DRIVERS_DEINIT); event_command(EVENT_CMD_LOG_FILE_DEINIT); - rarch_main_ctl(RUNLOOP_CTL_STATE_FREE, NULL); - rarch_main_ctl(RUNLOOP_CTL_GLOBAL_FREE, NULL); + runloop_ctl(RUNLOOP_CTL_STATE_FREE, NULL); + runloop_ctl(RUNLOOP_CTL_GLOBAL_FREE, NULL); rarch_main_data_deinit(); config_free(); @@ -1185,7 +1185,7 @@ int rarch_main_init(int argc, char *argv[]) settings->multimedia.builtin_imageviewer_enable)) { char *fullpath = NULL; - rarch_main_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath); + runloop_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath); switch (rarch_path_is_media_type(fullpath)) { @@ -1348,7 +1348,7 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data) global->block_config_read = false; *settings->libretro = '\0'; /* Load core in new config. */ } - rarch_main_ctl(RUNLOOP_CTL_PREPARE_DUMMY, NULL); + runloop_ctl(RUNLOOP_CTL_PREPARE_DUMMY, NULL); return true; case RARCH_CTL_MENU_RUNNING: #ifdef HAVE_MENU @@ -1547,7 +1547,7 @@ void rarch_playlist_load_content(void *data, unsigned idx) free(path_check); } - rarch_main_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, (void*)core_path); + runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, (void*)core_path); #ifdef HAVE_MENU if (menu) @@ -1623,10 +1623,10 @@ int rarch_defer_core(core_info_list_t *core_info, const char *dir, if (supported != 1) return 0; - rarch_main_ctl(RUNLOOP_CTL_SET_CONTENT_PATH, s); + runloop_ctl(RUNLOOP_CTL_SET_CONTENT_PATH, s); if (path_file_exists(new_core_path)) - rarch_main_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, new_core_path); + runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, new_core_path); return -1; } diff --git a/runloop.c b/runloop.c index d2b0912336..174f223b6d 100644 --- a/runloop.c +++ b/runloop.c @@ -440,7 +440,7 @@ global_t *global_get_ptr(void) return &g_extern; } -bool rarch_main_ctl(enum rarch_main_ctl_state state, void *data) +bool runloop_ctl(enum runloop_ctl_state state, void *data) { settings_t *settings = config_get_ptr(); global_t *global = global_get_ptr(); @@ -493,7 +493,7 @@ bool rarch_main_ctl(enum rarch_main_ctl_state state, void *data) check_pause(settings, focused, cmd->pause_pressed, cmd->frameadvance_pressed); - if (!rarch_main_ctl(RUNLOOP_CTL_CHECK_PAUSE_STATE, cmd)) + if (!runloop_ctl(RUNLOOP_CTL_CHECK_PAUSE_STATE, cmd)) return false; if (!focused) return false; @@ -536,7 +536,7 @@ bool rarch_main_ctl(enum rarch_main_ctl_state state, void *data) break; } #endif - if (!rarch_main_ctl(RUNLOOP_CTL_CHECK_IDLE_STATE, data)) + if (!runloop_ctl(RUNLOOP_CTL_CHECK_IDLE_STATE, data)) return false; check_fast_forward_button( @@ -552,10 +552,10 @@ bool rarch_main_ctl(enum rarch_main_ctl_state state, void *data) check_rewind(settings, global, cmd->rewind_pressed); - rarch_main_ctl(RUNLOOP_CTL_CHECK_SLOWMOTION, &cmd->slowmotion_pressed); + runloop_ctl(RUNLOOP_CTL_CHECK_SLOWMOTION, &cmd->slowmotion_pressed); if (cmd->movie_record) - rarch_main_ctl(RUNLOOP_CTL_CHECK_MOVIE, NULL); + runloop_ctl(RUNLOOP_CTL_CHECK_MOVIE, NULL); check_shader_dir(global, cmd->shader_next_pressed, cmd->shader_prev_pressed); @@ -627,10 +627,10 @@ bool rarch_main_ctl(enum rarch_main_ctl_state state, void *data) break; case RUNLOOP_CTL_CHECK_MOVIE: if (global->bsv.movie_playback) - return rarch_main_ctl(RUNLOOP_CTL_CHECK_MOVIE_PLAYBACK, NULL); + return runloop_ctl(RUNLOOP_CTL_CHECK_MOVIE_PLAYBACK, NULL); if (!global->bsv.movie) - return rarch_main_ctl(RUNLOOP_CTL_CHECK_MOVIE_INIT, NULL); - return rarch_main_ctl(RUNLOOP_CTL_CHECK_MOVIE_RECORD, NULL); + return runloop_ctl(RUNLOOP_CTL_CHECK_MOVIE_INIT, NULL); + return runloop_ctl(RUNLOOP_CTL_CHECK_MOVIE_RECORD, NULL); case RUNLOOP_CTL_CHECK_MOVIE_RECORD: if (!global->bsv.movie) return false; @@ -711,8 +711,8 @@ bool rarch_main_ctl(enum rarch_main_ctl_state state, void *data) break; case RUNLOOP_CTL_CLEAR_STATE: driver_clear_state(); - rarch_main_ctl(RUNLOOP_CTL_STATE_FREE, NULL); - rarch_main_ctl(RUNLOOP_CTL_GLOBAL_FREE, NULL); + runloop_ctl(RUNLOOP_CTL_STATE_FREE, NULL); + runloop_ctl(RUNLOOP_CTL_GLOBAL_FREE, NULL); break; case RUNLOOP_CTL_SET_MAX_FRAMES: { @@ -780,7 +780,7 @@ bool rarch_main_ctl(enum rarch_main_ctl_state state, void *data) rarch_main_msg_queue_free(); break; case RUNLOOP_CTL_MSG_QUEUE_INIT: - rarch_main_ctl(RUNLOOP_CTL_MSG_QUEUE_DEINIT, NULL); + runloop_ctl(RUNLOOP_CTL_MSG_QUEUE_DEINIT, NULL); rarch_main_msg_queue_init(); break; case RUNLOOP_CTL_PREPARE_DUMMY: @@ -792,7 +792,7 @@ bool rarch_main_ctl(enum rarch_main_ctl_state state, void *data) #endif rarch_main_data_clear_state(); - rarch_main_ctl(RUNLOOP_CTL_CLEAR_CONTENT_PATH, NULL); + runloop_ctl(RUNLOOP_CTL_CLEAR_CONTENT_PATH, NULL); rarch_ctl(RARCH_CTL_LOAD_CONTENT, NULL); } @@ -957,7 +957,7 @@ static INLINE int rarch_main_iterate_time_to_exit(event_cmd_state_t *cmd) if (main_core_shutdown_initiated && settings->load_dummy_on_core_shutdown) { - if (!rarch_main_ctl(RUNLOOP_CTL_PREPARE_DUMMY, NULL)) + if (!runloop_ctl(RUNLOOP_CTL_PREPARE_DUMMY, NULL)) return -1; system->shutdown = false; @@ -1083,7 +1083,7 @@ int rarch_main_iterate(unsigned *sleep_ms) if (menu_driver_alive()) { bool focused = check_focus(settings) && !ui_companion_is_on_foreground(); - bool is_idle = rarch_main_ctl(RUNLOOP_CTL_IS_IDLE, NULL); + bool is_idle = runloop_ctl(RUNLOOP_CTL_IS_IDLE, NULL); if (menu_driver_iterate((enum menu_action)menu_input_frame_retropad(input, trigger_input)) == -1) rarch_ctl(RARCH_CTL_MENU_RUNNING_FINISHED, NULL); @@ -1103,7 +1103,7 @@ int rarch_main_iterate(unsigned *sleep_ms) } #endif - if (!rarch_main_ctl(RUNLOOP_CTL_CHECK_STATE, &cmd)) + if (!runloop_ctl(RUNLOOP_CTL_CHECK_STATE, &cmd)) { /* RetroArch has been paused. */ driver->retro_ctx.poll_cb(); diff --git a/runloop.h b/runloop.h index 950bcedff0..ec1aac78de 100644 --- a/runloop.h +++ b/runloop.h @@ -35,7 +35,7 @@ extern "C" { #endif -enum rarch_main_ctl_state +enum runloop_ctl_state { RUNLOOP_CTL_IS_IDLE = 0, RUNLOOP_CTL_SET_WINDOWED_SCALE, @@ -336,7 +336,7 @@ void rarch_main_msg_queue_push_new(uint32_t hash, unsigned prio, const char *rarch_main_msg_queue_pull(void); -bool rarch_main_ctl(enum rarch_main_ctl_state state, void *data); +bool runloop_ctl(enum runloop_ctl_state state, void *data); typedef int (*transfer_cb_t)(void *data, size_t len); diff --git a/screenshot.c b/screenshot.c index d0c42d09c7..21762d4a00 100644 --- a/screenshot.c +++ b/screenshot.c @@ -268,7 +268,7 @@ bool take_screenshot(void) msg = msg_hash_to_str(MSG_FAILED_TO_TAKE_SCREENSHOT); } - rarch_main_ctl(RUNLOOP_CTL_IS_PAUSED, &is_paused); + runloop_ctl(RUNLOOP_CTL_IS_PAUSED, &is_paused); rarch_main_msg_queue_push(msg, 1, is_paused ? 1 : 180, true); diff --git a/tests/test_reentrancy.c b/tests/test_reentrancy.c index 3d4bb6d819..6b7f7b015e 100644 --- a/tests/test_reentrancy.c +++ b/tests/test_reentrancy.c @@ -36,7 +36,7 @@ int main(int argc, char *argv[]) (argc - optind - 1) * sizeof(char*)); argc--; - rarch_main_ctl(RUNLOOP_CTL_CLEAR_STATE); + runloop_ctl(RUNLOOP_CTL_CLEAR_STATE); } } diff --git a/ui/drivers/ui_cocoa.m b/ui/drivers/ui_cocoa.m index 60a98d1115..4cfb13fcc0 100644 --- a/ui/drivers/ui_cocoa.m +++ b/ui/drivers/ui_cocoa.m @@ -276,7 +276,7 @@ extern void action_ok_push_quick_menu(void); NSString *__core = [filenames objectAtIndex:0]; const char *core_name = global ? global->menu.info.library_name : NULL; - rarch_main_ctl(RUNLOOP_CTL_SET_CONTENT_PATH, (void*)__core.UTF8String); + runloop_ctl(RUNLOOP_CTL_SET_CONTENT_PATH, (void*)__core.UTF8String); if (core_name) ui_companion_event_command(EVENT_CMD_LOAD_CONTENT); @@ -306,13 +306,13 @@ extern void action_ok_push_quick_menu(void); if (__core) { - rarch_main_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, (void*)__core.UTF8String); + runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, (void*)__core.UTF8String); ui_companion_event_command(EVENT_CMD_LOAD_CORE); if (menu->load_no_content && settings->core.set_supports_no_game_enable) { int ret = 0; - rarch_main_ctl(RUNLOOP_CTL_CLEAR_CONTENT_PATH, NULL); + runloop_ctl(RUNLOOP_CTL_CLEAR_CONTENT_PATH, NULL); ret = menu_common_load_content(NULL, NULL, false, CORE_TYPE_PLAIN); if (ret == -1) action_ok_push_quick_menu(); @@ -341,7 +341,7 @@ extern void action_ok_push_quick_menu(void); NSString *__core = url.path; const char *core_name = global ? global->menu.info.library_name : NULL; - rarch_main_ctl(RUNLOOP_CTL_SET_CONTENT_PATH, (void*)__core.UTF8String); + runloop_ctl(RUNLOOP_CTL_SET_CONTENT_PATH, (void*)__core.UTF8String); if (core_name) ui_companion_event_command(EVENT_CMD_LOAD_CONTENT); @@ -412,7 +412,7 @@ extern void action_ok_push_quick_menu(void); if (sender_tag >= 10 && sender_tag <= 19) { unsigned idx = (sender_tag - (10-1)); - rarch_main_ctl(RUNLOOP_CTL_SET_WINDOWED_SCALE, &idx); + runloop_ctl(RUNLOOP_CTL_SET_WINDOWED_SCALE, &idx); cmd = EVENT_CMD_RESIZE_WINDOWED_SCALE; } diff --git a/ui/drivers/ui_cocoatouch.m b/ui/drivers/ui_cocoatouch.m index be4bb1952e..2bdfb9d33f 100644 --- a/ui/drivers/ui_cocoatouch.m +++ b/ui/drivers/ui_cocoatouch.m @@ -45,8 +45,8 @@ static void rarch_enable_ui(void) ui_companion_set_foreground(true); - rarch_main_ctl(RUNLOOP_CTL_SET_PAUSED, &boolean); - rarch_main_ctl(RUNLOOP_CTL_SET_IDLE, &boolean); + runloop_ctl(RUNLOOP_CTL_SET_PAUSED, &boolean); + runloop_ctl(RUNLOOP_CTL_SET_IDLE, &boolean); rarch_ctl(RARCH_CTL_MENU_RUNNING, NULL); } @@ -56,8 +56,8 @@ static void rarch_disable_ui(void) ui_companion_set_foreground(false); - rarch_main_ctl(RUNLOOP_CTL_SET_PAUSED, &boolean); - rarch_main_ctl(RUNLOOP_CTL_SET_IDLE, &boolean); + runloop_ctl(RUNLOOP_CTL_SET_PAUSED, &boolean); + runloop_ctl(RUNLOOP_CTL_SET_IDLE, &boolean); rarch_ctl(RARCH_CTL_MENU_RUNNING_FINISHED, NULL); } @@ -85,7 +85,7 @@ static void rarch_draw_observer(CFRunLoopObserverRef observer, return; } - if (rarch_main_ctl(RUNLOOP_CTL_IS_IDLE, NULL)) + if (runloop_ctl(RUNLOOP_CTL_IS_IDLE, NULL)) return; CFRunLoopWakeUp(CFRunLoopGetMain()); } diff --git a/ui/drivers/ui_win32.c b/ui/drivers/ui_win32.c index b2425610d6..fa85d91ee7 100644 --- a/ui/drivers/ui_win32.c +++ b/ui/drivers/ui_win32.c @@ -524,10 +524,10 @@ LRESULT win32_menu_loop(HWND owner, WPARAM wparam) switch (mode) { case ID_M_LOAD_CORE: - rarch_main_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, win32_file); + runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, win32_file); break; case ID_M_LOAD_CONTENT: - rarch_main_ctl(RUNLOOP_CTL_SET_CONTENT_PATH, win32_file); + runloop_ctl(RUNLOOP_CTL_SET_CONTENT_PATH, win32_file); do_wm_close = true; break; } @@ -582,7 +582,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)); - rarch_main_ctl(RUNLOOP_CTL_SET_WINDOWED_SCALE, &idx); + runloop_ctl(RUNLOOP_CTL_SET_WINDOWED_SCALE, &idx); cmd = EVENT_CMD_RESIZE_WINDOWED_SCALE; } else if (mode == ID_M_STATE_INDEX_AUTO)