From 11f7735965b891d6ec70b3f81728d5e893c77698 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 22 Jan 2016 15:43:40 +0100 Subject: [PATCH] Create RARCH_CTL_INIT_SYSTEM_AV_INFO --- command_event.c | 2 +- retroarch.c | 19 +++++++------------ retroarch.h | 23 ++++++++++------------- 3 files changed, 18 insertions(+), 26 deletions(-) diff --git a/command_event.c b/command_event.c index d07d26f8e8..931949394a 100644 --- a/command_event.c +++ b/command_event.c @@ -591,7 +591,7 @@ static bool event_init_core(void) return false; retro_init_libretro_cbs(&retro_ctx); - rarch_init_system_av_info(); + rarch_ctl(RARCH_CTL_INIT_SYSTEM_AV_INFO, NULL); return true; } diff --git a/retroarch.c b/retroarch.c index f725e0e4ab..6deb6bc9c4 100644 --- a/retroarch.c +++ b/retroarch.c @@ -1082,18 +1082,6 @@ static bool init_state(void) return true; } -/** - * rarch_init_system_av_info: - * - * Initialize system A/V information by calling the libretro core's - * get_system_av_info function. - **/ -void rarch_init_system_av_info(void) -{ - struct retro_system_av_info *av_info = video_viewport_get_system_av_info(); - core.retro_get_system_av_info(av_info); - runloop_ctl(RUNLOOP_CTL_SET_FRAME_LIMIT, NULL); -} /** * rarch_main_init: @@ -1296,6 +1284,13 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data) switch(state) { + case RARCH_CTL_INIT_SYSTEM_AV_INFO: + { + struct retro_system_av_info *av_info = video_viewport_get_system_av_info(); + core.retro_get_system_av_info(av_info); + runloop_ctl(RUNLOOP_CTL_SET_FRAME_LIMIT, NULL); + } + break; case RARCH_CTL_IS_PLAIN_CORE: return (current_core_type == CORE_TYPE_PLAIN); case RARCH_CTL_IS_DUMMY_CORE: diff --git a/retroarch.h b/retroarch.h index 15750b11d5..cc0a27a5c8 100644 --- a/retroarch.h +++ b/retroarch.h @@ -104,13 +104,18 @@ enum rarch_ctl_state */ RARCH_CTL_VERIFY_API_VERSION, - /* Validates CPU features for given processor architecture. - * - * Make sure we haven't compiled for something we cannot run. - * Ideally, code would get swapped out depending on CPU support, - * but this will do for now. */ + /* Validates CPU features for given processor architecture. + * Make sure we haven't compiled for something we cannot run. + * Ideally, code would get swapped out depending on CPU support, + * but this will do for now. */ RARCH_CTL_VALIDATE_CPU_FEATURES, + /** + * Initialize system A/V information by calling the libretro core's + * get_system_av_info function. + **/ + RARCH_CTL_INIT_SYSTEM_AV_INFO, + RARCH_CTL_FILL_PATHNAMES, RARCH_CTL_SET_PATHS_REDIRECT, @@ -224,14 +229,6 @@ int rarch_defer_core(void *data, const char *menu_label, char *s, size_t len); -/** - * rarch_init_system_av_info: - * - * Initialize system A/V information by calling the libretro core's - * get_system_av_info function. - **/ -void rarch_init_system_av_info(void); - void rarch_set_paths(const char *path); int rarch_info_get_capabilities(enum rarch_capabilities type, char *s, size_t len);