diff --git a/audio/drivers/ctr_audio.c b/audio/drivers/ctr_audio.c index b171664432..8b4240462d 100644 --- a/audio/drivers/ctr_audio.c +++ b/audio/drivers/ctr_audio.c @@ -185,14 +185,12 @@ static bool ctr_audio_alive(void *data) static bool ctr_audio_start(void *data) { ctr_audio_t* ctr = (ctr_audio_t*)data; - /* TODO/FIXME - we should not depend upon global state - * in audio/video/input drivers. */ - global_t *global = global_get_ptr(); + rarch_system_info_t *system = rarch_system_info_get_ptr(); /* prevents restarting audio when the menu * is toggled off on shutdown */ - if (global->system.shutdown) + if (system->shutdown) return true; // CSND_SetPlayState(0x8, 1); diff --git a/frontend/drivers/platform_ps3.c b/frontend/drivers/platform_ps3.c index 3275097311..120e7db10c 100644 --- a/frontend/drivers/platform_ps3.c +++ b/frontend/drivers/platform_ps3.c @@ -68,8 +68,10 @@ static void callback_sysutil_exit(uint64_t status, { case CELL_SYSUTIL_REQUEST_EXITGAME: { - global_t *global = global_get_ptr(); - global->system.shutdown = true; + rarch_system_info_t *system = rarch_system_info_get_ptr(); + + if (system) + system->shutdown = true; } break; } diff --git a/gfx/drivers_context/androidegl_ctx.c b/gfx/drivers_context/androidegl_ctx.c index 430127d459..a313fc5b91 100644 --- a/gfx/drivers_context/androidegl_ctx.c +++ b/gfx/drivers_context/androidegl_ctx.c @@ -251,7 +251,7 @@ static void android_gfx_ctx_check_window(void *data, bool *quit, bool *resize, unsigned *width, unsigned *height, unsigned frame_count) { unsigned new_width, new_height; - global_t *global = global_get_ptr(); + rarch_system_info_t *system = rarch_system_info_get_ptr(); (void)frame_count; @@ -267,7 +267,7 @@ static void android_gfx_ctx_check_window(void *data, bool *quit, } /* Check if we are exiting. */ - if (global->system.shutdown) + if (system->shutdown) *quit = true; } diff --git a/gfx/drivers_context/bbqnx_ctx.c b/gfx/drivers_context/bbqnx_ctx.c index 573b502b08..715e4cfe79 100644 --- a/gfx/drivers_context/bbqnx_ctx.c +++ b/gfx/drivers_context/bbqnx_ctx.c @@ -324,7 +324,7 @@ static void gfx_ctx_qnx_check_window(void *data, bool *quit, bool *resize, unsigned *width, unsigned *height, unsigned frame_count) { unsigned new_width, new_height; - global_t *global = global_get_ptr(); + rarch_system_info_t *system = rarch_system_info_get_ptr(); (void)data; (void)frame_count; @@ -340,7 +340,7 @@ static void gfx_ctx_qnx_check_window(void *data, bool *quit, } /* Check if we are exiting. */ - if (global->system.shutdown) + if (system->shutdown) *quit = true; } diff --git a/gfx/video_viewport.c b/gfx/video_viewport.c index f6fcb38eb9..1573239e15 100644 --- a/gfx/video_viewport.c +++ b/gfx/video_viewport.c @@ -193,7 +193,7 @@ void video_viewport_get_scaled_integer(struct video_viewport *vp, * but it is desirable in some cases. * * If square pixels are used, base_height will be equal to - * global->system.av_info.base_height. */ + * system->av_info.base_height. */ base_width = (unsigned)roundf(base_height * aspect_ratio); /* Make sure that we don't get 0x scale ... */ diff --git a/input/drivers/qnx_input.c b/input/drivers/qnx_input.c index 978a96acd0..0ddb380759 100644 --- a/input/drivers/qnx_input.c +++ b/input/drivers/qnx_input.c @@ -588,6 +588,7 @@ static void qnx_handle_navigator_event( navigator_window_state_t state; bps_event_t *event_pause = NULL; global_t *global = global_get_ptr(); + rarch_system_info_t *system = rarch_system_info_get_ptr(); (void)rc; @@ -618,7 +619,7 @@ static void qnx_handle_navigator_event( } else if (bps_event_get_code(event_pause) == NAVIGATOR_EXIT) { - global->system.shutdown = true; + system->shutdown = true; break; } } diff --git a/menu/cbs/menu_cbs_deferred_push.c b/menu/cbs/menu_cbs_deferred_push.c index dde7c306d7..92ce116fd1 100644 --- a/menu/cbs/menu_cbs_deferred_push.c +++ b/menu/cbs/menu_cbs_deferred_push.c @@ -458,8 +458,9 @@ static int deferred_push_detect_core_list(menu_displaylist_info_t *info) static int deferred_push_default(menu_displaylist_info_t *info) { - settings_t *settings = config_get_ptr(); - global_t *global = global_get_ptr(); + settings_t *settings = config_get_ptr(); + global_t *global = global_get_ptr(); + rarch_system_info_t *system = rarch_system_info_get_ptr(); info->type_default = MENU_FILE_PLAIN; info->setting = menu_setting_find(info->label); @@ -472,7 +473,7 @@ static int deferred_push_default(menu_displaylist_info_t *info) sizeof(info->exts)); } else - strlcpy(info->exts, global->system.valid_extensions, sizeof(info->exts)); + strlcpy(info->exts, system->valid_extensions, sizeof(info->exts)); (void)settings; diff --git a/menu/cbs/menu_cbs_left.c b/menu/cbs/menu_cbs_left.c index 90a5983a08..658d242b15 100644 --- a/menu/cbs/menu_cbs_left.c +++ b/menu/cbs/menu_cbs_left.c @@ -315,11 +315,11 @@ static int core_setting_left(unsigned type, const char *label, bool wraparound) { unsigned idx = type - MENU_SETTINGS_CORE_OPTION_START; - global_t *global = global_get_ptr(); + rarch_system_info_t *system = rarch_system_info_get_ptr(); (void)label; - core_option_prev(global->system.core_options, idx); + core_option_prev(system->core_options, idx); return 0; } diff --git a/menu/cbs/menu_cbs_right.c b/menu/cbs/menu_cbs_right.c index 3473df5a69..312133e0b7 100644 --- a/menu/cbs/menu_cbs_right.c +++ b/menu/cbs/menu_cbs_right.c @@ -317,11 +317,11 @@ int core_setting_right(unsigned type, const char *label, bool wraparound) { unsigned idx = type - MENU_SETTINGS_CORE_OPTION_START; - global_t *global = global_get_ptr(); + rarch_system_info_t *system = rarch_system_info_get_ptr(); (void)label; - core_option_next(global->system.core_options, idx); + core_option_next(system->core_options, idx); return 0; } diff --git a/menu/cbs/menu_cbs_start.c b/menu/cbs/menu_cbs_start.c index 8627f62ba6..7a1e5d9d61 100644 --- a/menu/cbs/menu_cbs_start.c +++ b/menu/cbs/menu_cbs_start.c @@ -253,12 +253,12 @@ static int action_start_performance_counters_frontend(unsigned type, static int action_start_core_setting(unsigned type, const char *label) { - global_t *global = global_get_ptr(); unsigned idx = type - MENU_SETTINGS_CORE_OPTION_START; + rarch_system_info_t *system = rarch_system_info_get_ptr(); (void)label; - core_option_set_default(global->system.core_options, idx); + core_option_set_default(system->core_options, idx); return 0; }