diff --git a/apple/common/apple_gfx_context.c.inl b/apple/common/apple_gfx_context.c.inl index 3c03b62588..1b5f1644d1 100644 --- a/apple/common/apple_gfx_context.c.inl +++ b/apple/common/apple_gfx_context.c.inl @@ -283,7 +283,7 @@ static void apple_gfx_ctx_update_window_title(void *data) if (got_text) [[g_view window] setTitle:[NSString stringWithCString:text encoding:NSUTF8StringEncoding]]; if (g_settings.fps_show) - msg_queue_push(g_extern.msg_queue, buf_fps, 1, 1); + msg_queue_push(g_runloop.msg_queue, buf_fps, 1, 1); #endif } diff --git a/camera/camera_driver.c b/camera/camera_driver.c index 76cc1d996b..0efe084743 100644 --- a/camera/camera_driver.c +++ b/camera/camera_driver.c @@ -151,7 +151,7 @@ bool driver_camera_start(void) if (g_settings.camera.allow) return driver.camera->start(driver.camera_data); - msg_queue_push(g_extern.msg_queue, + msg_queue_push(g_runloop.msg_queue, "Camera is explicitly disabled.\n", 1, 180); } return false; diff --git a/cheats.c b/cheats.c index 4abbc54521..2a7935f4c5 100644 --- a/cheats.c +++ b/cheats.c @@ -232,7 +232,7 @@ void cheat_manager_free(cheat_manager_t *handle) void cheat_manager_update(cheat_manager_t *handle, unsigned handle_idx) { - msg_queue_clear(g_extern.msg_queue); + msg_queue_clear(g_runloop.msg_queue); char msg[256]; snprintf(msg, sizeof(msg), "Cheat: #%u [%s]: %s", @@ -240,7 +240,7 @@ void cheat_manager_update(cheat_manager_t *handle, unsigned handle_idx) (handle->cheats[handle_idx].desc) ? (handle->cheats[handle_idx].desc) : (handle->cheats[handle_idx].code) ); - msg_queue_push(g_extern.msg_queue, msg, 1, 180); + msg_queue_push(g_runloop.msg_queue, msg, 1, 180); RARCH_LOG("%s\n", msg); } diff --git a/command.c b/command.c index 749920fc74..6662470d12 100644 --- a/command.c +++ b/command.c @@ -230,10 +230,10 @@ static bool cmd_set_shader(const char *arg) if (type == RARCH_SHADER_NONE) return false; - msg_queue_clear(g_extern.msg_queue); + msg_queue_clear(g_runloop.msg_queue); snprintf(msg, sizeof(msg), "Shader: \"%s\"", arg); - msg_queue_push(g_extern.msg_queue, msg, 1, 120); + msg_queue_push(g_runloop.msg_queue, msg, 1, 120); RARCH_LOG("Applying shader \"%s\".\n", arg); return driver.video->set_shader(driver.video_data, type, arg); diff --git a/database_info.c b/database_info.c index 22d2ab5be2..b332d586f5 100644 --- a/database_info.c +++ b/database_info.c @@ -137,8 +137,8 @@ int database_info_write_rdl_iterate(database_info_rdl_handle_t *dbl) snprintf(msg, sizeof(msg), "%zu/%zu: Scanning %s...\n", dbl->list_ptr, dbl->list->size, name); - msg_queue_clear(g_extern.msg_queue); - msg_queue_push(g_extern.msg_queue, msg, 1, 180); + msg_queue_clear(g_runloop.msg_queue); + msg_queue_push(g_runloop.msg_queue, msg, 1, 180); crc = crc32_calculate(ret_buf, ret); diff --git a/driver.c b/driver.c index 6e978c4a9f..c93cfd6c0b 100644 --- a/driver.c +++ b/driver.c @@ -268,7 +268,7 @@ bool driver_update_system_av_info(const struct retro_system_av_info *info) if (driver.recording_data) { static const char *msg = "Restarting recording due to driver reinit."; - msg_queue_push(g_extern.msg_queue, msg, 2, 180); + msg_queue_push(g_runloop.msg_queue, msg, 2, 180); RARCH_WARN("%s\n", msg); rarch_main_command(RARCH_CMD_RECORD_DEINIT); rarch_main_command(RARCH_CMD_RECORD_INIT); diff --git a/dynamic.c b/dynamic.c index 2cf6167609..e2cc0068f9 100644 --- a/dynamic.c +++ b/dynamic.c @@ -674,10 +674,10 @@ bool rarch_environment_cb(unsigned cmd, void *data) { const struct retro_message *msg = (const struct retro_message*)data; RARCH_LOG("Environ SET_MESSAGE: %s\n", msg->msg); - if (g_extern.msg_queue) + if (g_runloop.msg_queue) { - msg_queue_clear(g_extern.msg_queue); - msg_queue_push(g_extern.msg_queue, msg->msg, 1, msg->frames); + msg_queue_clear(g_runloop.msg_queue); + msg_queue_push(g_runloop.msg_queue, msg->msg, 1, msg->frames); } break; } diff --git a/general.h b/general.h index de2b5e4546..b9b79f3d9f 100644 --- a/general.h +++ b/general.h @@ -432,6 +432,30 @@ struct runloop bool is_paused; bool is_menu; bool is_slowmotion; + +#ifdef HAVE_NETWORKING + struct + { + struct + { + struct http_connection_t *handle; + transfer_cb_t cb; + char elem1[PATH_MAX_LENGTH]; + } connection; + msg_queue_t *msg_queue; + struct http_t *handle; + transfer_cb_t cb; + } http; +#endif + +#ifdef HAVE_LIBRETRODB + struct + { + } db; +#endif + + nbio_handle_t nbio; + msg_queue_t *msg_queue; }; /* All run-time- / command line flag-related globals go here. */ @@ -618,23 +642,6 @@ struct global } menu; #endif - msg_queue_t *msg_queue; -#ifdef HAVE_NETWORKING - struct - { - struct - { - struct http_connection_t *handle; - transfer_cb_t cb; - char elem1[PATH_MAX_LENGTH]; - } connection; - msg_queue_t *msg_queue; - struct http_t *handle; - transfer_cb_t cb; - } http; -#endif - - nbio_handle_t nbio; bool exec; diff --git a/gfx/drivers/exynos_gfx.c b/gfx/drivers/exynos_gfx.c index 3882aab5d6..4e52230d6a 100644 --- a/gfx/drivers/exynos_gfx.c +++ b/gfx/drivers/exynos_gfx.c @@ -1432,7 +1432,7 @@ static bool exynos_gfx_frame(void *data, const void *frame, unsigned width, char buffer[128], buffer_fps[128]; video_monitor_get_fps(buffer, sizeof(buffer), g_settings.fps_show ? buffer_fps : NULL, sizeof(buffer_fps)); - msg_queue_push(g_extern.msg_queue, buffer_fps, 1, 1); + msg_queue_push(g_runloop.msg_queue, buffer_fps, 1, 1); } /* If at this point the dimension parameters are still zero, setup some * diff --git a/gfx/drivers_context/androidegl_ctx.c b/gfx/drivers_context/androidegl_ctx.c index 42af581bb6..076e772910 100644 --- a/gfx/drivers_context/androidegl_ctx.c +++ b/gfx/drivers_context/androidegl_ctx.c @@ -277,7 +277,7 @@ static void android_gfx_ctx_update_window_title(void *data) video_monitor_get_fps(buf, sizeof(buf), g_settings.fps_show ? buf_fps : NULL, sizeof(buf_fps)); if (g_settings.fps_show) - msg_queue_push(g_extern.msg_queue, buf_fps, 1, 1); + msg_queue_push(g_runloop.msg_queue, buf_fps, 1, 1); } static bool android_gfx_ctx_set_video_mode(void *data, diff --git a/gfx/drivers_context/bbqnx_ctx.c b/gfx/drivers_context/bbqnx_ctx.c index 9046f18b03..41dd557100 100644 --- a/gfx/drivers_context/bbqnx_ctx.c +++ b/gfx/drivers_context/bbqnx_ctx.c @@ -362,7 +362,7 @@ static void gfx_ctx_qnx_update_window_title(void *data) video_monitor_get_fps(buf, sizeof(buf), g_settings.fps_show ? buf_fps : NULL, sizeof(buf_fps)); if (g_settings.fps_show) - msg_queue_push(g_extern.msg_queue, buf_fps, 1, 1); + msg_queue_push(g_runloop.msg_queue, buf_fps, 1, 1); } static bool gfx_ctx_qnx_set_video_mode(void *data, diff --git a/gfx/drivers_context/d3d_ctx.cpp b/gfx/drivers_context/d3d_ctx.cpp index 899da8cb05..3937e975c9 100644 --- a/gfx/drivers_context/d3d_ctx.cpp +++ b/gfx/drivers_context/d3d_ctx.cpp @@ -145,7 +145,7 @@ static void gfx_ctx_d3d_update_title(void *data) stat.dwAvailPhys/(1024.0f*1024.0f), stat.dwTotalPhys/(1024.0f*1024.0f)); strlcat(buffer_fps, mem, sizeof(buffer_fps)); #endif - msg_queue_push(g_extern.msg_queue, buffer_fps, 1, 1); + msg_queue_push(g_runloop.msg_queue, buffer_fps, 1, 1); } #ifndef _XBOX diff --git a/gfx/drivers_context/drm_egl_ctx.c b/gfx/drivers_context/drm_egl_ctx.c index a059e72e85..0d3ae42b9e 100644 --- a/gfx/drivers_context/drm_egl_ctx.c +++ b/gfx/drivers_context/drm_egl_ctx.c @@ -274,7 +274,7 @@ static void gfx_ctx_drm_egl_update_window_title(void *data) video_monitor_get_fps(buf, sizeof(buf), g_settings.fps_show ? buf_fps : NULL, sizeof(buf_fps)); if (g_settings.fps_show) - msg_queue_push(g_extern.msg_queue, buf_fps, 1, 1); + msg_queue_push(g_runloop.msg_queue, buf_fps, 1, 1); } static void gfx_ctx_drm_egl_get_video_size(void *data, unsigned *width, unsigned *height) diff --git a/gfx/drivers_context/emscriptenegl_ctx.c b/gfx/drivers_context/emscriptenegl_ctx.c index 058027e3f7..f98931fbf4 100644 --- a/gfx/drivers_context/emscriptenegl_ctx.c +++ b/gfx/drivers_context/emscriptenegl_ctx.c @@ -96,7 +96,7 @@ static void gfx_ctx_emscripten_update_window_title(void *data) video_monitor_get_fps(buf, sizeof(buf), g_settings.fps_show ? buf_fps : NULL, sizeof(buf_fps)); if (g_settings.fps_show) - msg_queue_push(g_extern.msg_queue, buf_fps, 1, 1); + msg_queue_push(g_runloop.msg_queue, buf_fps, 1, 1); } static void gfx_ctx_emscripten_get_video_size(void *data, diff --git a/gfx/drivers_context/glx_ctx.c b/gfx/drivers_context/glx_ctx.c index 0fda1f014c..2e4ee3bd19 100644 --- a/gfx/drivers_context/glx_ctx.c +++ b/gfx/drivers_context/glx_ctx.c @@ -201,7 +201,7 @@ static void gfx_ctx_glx_update_window_title(void *data) g_settings.fps_show ? buf_fps : NULL, sizeof(buf_fps))) XStoreName(glx->g_dpy, glx->g_win, buf); if (g_settings.fps_show) - msg_queue_push(g_extern.msg_queue, buf_fps, 1, 1); + msg_queue_push(g_runloop.msg_queue, buf_fps, 1, 1); } static void gfx_ctx_glx_get_video_size(void *data, diff --git a/gfx/drivers_context/mali_fbdev_ctx.c b/gfx/drivers_context/mali_fbdev_ctx.c index 2b219f5f37..ff63e8accc 100644 --- a/gfx/drivers_context/mali_fbdev_ctx.c +++ b/gfx/drivers_context/mali_fbdev_ctx.c @@ -208,7 +208,7 @@ static void gfx_ctx_mali_fbdev_update_window_title(void *data) video_monitor_get_fps(buf, sizeof(buf), g_settings.fps_show ? buf_fps : NULL, sizeof(buf_fps)); if (g_settings.fps_show) - msg_queue_push(g_extern.msg_queue, buf_fps, 1, 1); + msg_queue_push(g_runloop.msg_queue, buf_fps, 1, 1); } static bool gfx_ctx_mali_fbdev_set_video_mode(void *data, diff --git a/gfx/drivers_context/ps3_ctx.c b/gfx/drivers_context/ps3_ctx.c index 97b78a1437..bd6cdcc934 100644 --- a/gfx/drivers_context/ps3_ctx.c +++ b/gfx/drivers_context/ps3_ctx.c @@ -224,7 +224,7 @@ static void gfx_ctx_ps3_update_window_title(void *data) video_monitor_get_fps(buf, sizeof(buf), g_settings.fps_show ? buf_fps : NULL, sizeof(buf_fps)); if (g_settings.fps_show) - msg_queue_push(g_extern.msg_queue, buf_fps, 1, 1); + msg_queue_push(g_runloop.msg_queue, buf_fps, 1, 1); } static void gfx_ctx_ps3_get_video_size(void *data, diff --git a/gfx/drivers_context/sdl_gl_ctx.c b/gfx/drivers_context/sdl_gl_ctx.c index 3e04ee984a..5551ee4541 100644 --- a/gfx/drivers_context/sdl_gl_ctx.c +++ b/gfx/drivers_context/sdl_gl_ctx.c @@ -291,7 +291,7 @@ static void sdl_ctx_update_window_title(void *data) #endif } if (g_settings.fps_show) - msg_queue_push(g_extern.msg_queue, buf_fps, 1, 1); + msg_queue_push(g_runloop.msg_queue, buf_fps, 1, 1); } static void sdl_ctx_check_window(void *data, bool *quit, bool *resize,unsigned *width, diff --git a/gfx/drivers_context/vc_egl_ctx.c b/gfx/drivers_context/vc_egl_ctx.c index a9abc61389..3f5be7c2c7 100644 --- a/gfx/drivers_context/vc_egl_ctx.c +++ b/gfx/drivers_context/vc_egl_ctx.c @@ -128,7 +128,7 @@ static void gfx_ctx_vc_update_window_title(void *data) video_monitor_get_fps(buf, sizeof(buf), g_settings.fps_show ? buf_fps : NULL, sizeof(buf_fps)); if (g_settings.fps_show) - msg_queue_push(g_extern.msg_queue, buf_fps, 1, 1); + msg_queue_push(g_runloop.msg_queue, buf_fps, 1, 1); } static void gfx_ctx_vc_get_video_size(void *data, diff --git a/gfx/drivers_context/vivante_fbdev_ctx.c b/gfx/drivers_context/vivante_fbdev_ctx.c index 00971ada62..567224486f 100644 --- a/gfx/drivers_context/vivante_fbdev_ctx.c +++ b/gfx/drivers_context/vivante_fbdev_ctx.c @@ -197,7 +197,7 @@ static void gfx_ctx_vivante_update_window_title(void *data) video_monitor_get_fps(buf, sizeof(buf), g_settings.fps_show ? buf_fps : NULL, sizeof(buf_fps)); if (g_settings.fps_show) - msg_queue_push(g_extern.msg_queue, buf_fps, 1, 1); + msg_queue_push(g_runloop.msg_queue, buf_fps, 1, 1); } static bool gfx_ctx_vivante_set_video_mode(void *data, diff --git a/gfx/drivers_context/wayland_ctx.c b/gfx/drivers_context/wayland_ctx.c index bc240068e7..842f643b82 100644 --- a/gfx/drivers_context/wayland_ctx.c +++ b/gfx/drivers_context/wayland_ctx.c @@ -342,7 +342,7 @@ static void gfx_ctx_wl_update_window_title(void *data) wl_shell_surface_set_title(wl->g_shell_surf, buf); if (g_settings.fps_show) - msg_queue_push(g_extern.msg_queue, buf_fps, 1, 1); + msg_queue_push(g_runloop.msg_queue, buf_fps, 1, 1); } static void gfx_ctx_wl_get_video_size(void *data, diff --git a/gfx/drivers_context/wgl_ctx.c b/gfx/drivers_context/wgl_ctx.c index 6ae82d29bc..f437556ad7 100644 --- a/gfx/drivers_context/wgl_ctx.c +++ b/gfx/drivers_context/wgl_ctx.c @@ -354,7 +354,7 @@ static void gfx_ctx_wgl_update_window_title(void *data) g_settings.fps_show ? buf_fps : NULL, sizeof(buf_fps))) SetWindowText(g_hwnd, buf); if (g_settings.fps_show) - msg_queue_push(g_extern.msg_queue, buf_fps, 1, 1); + msg_queue_push(g_runloop.msg_queue, buf_fps, 1, 1); } static void gfx_ctx_wgl_get_video_size(void *data, unsigned *width, unsigned *height) diff --git a/gfx/drivers_context/xegl_ctx.c b/gfx/drivers_context/xegl_ctx.c index 6c0a44a59b..e840f9bc8d 100644 --- a/gfx/drivers_context/xegl_ctx.c +++ b/gfx/drivers_context/xegl_ctx.c @@ -219,7 +219,7 @@ static void gfx_ctx_xegl_update_window_title(void *data) g_settings.fps_show ? buf_fps : NULL, sizeof(buf_fps))) XStoreName(g_dpy, g_win, buf); if (g_settings.fps_show) - msg_queue_push(g_extern.msg_queue, buf_fps, 1, 1); + msg_queue_push(g_runloop.msg_queue, buf_fps, 1, 1); } static void gfx_ctx_xegl_get_video_size(void *data, diff --git a/gfx/video_monitor.c b/gfx/video_monitor.c index 3b8ce0af33..211e3d9a24 100644 --- a/gfx/video_monitor.c +++ b/gfx/video_monitor.c @@ -59,7 +59,7 @@ void video_monitor_set_refresh_rate(float hz) { char msg[PATH_MAX_LENGTH]; snprintf(msg, sizeof(msg), "Setting refresh rate to: %.3f Hz.", hz); - msg_queue_push(g_extern.msg_queue, msg, 1, 180); + msg_queue_push(g_runloop.msg_queue, msg, 1, 180); RARCH_LOG("%s\n", msg); g_settings.video.refresh_rate = hz; diff --git a/input/drivers_joypad/apple_joypad_hid.c b/input/drivers_joypad/apple_joypad_hid.c index b0c965e2b6..3ea1ab3fc0 100644 --- a/input/drivers_joypad/apple_joypad_hid.c +++ b/input/drivers_joypad/apple_joypad_hid.c @@ -127,7 +127,7 @@ static void remove_device(void* context, IOReturn result, void* sender) snprintf(msg, sizeof(msg), "Joypad #%u (%s) disconnected.", connection->slot, "N/A"); - msg_queue_push(g_extern.msg_queue, msg, 0, 60); + msg_queue_push(g_runloop.msg_queue, msg, 0, 60); RARCH_LOG("[apple_input]: %s\n", msg); apple->buttons[connection->slot] = 0; diff --git a/input/drivers_joypad/linuxraw_joypad.c b/input/drivers_joypad/linuxraw_joypad.c index 359c28e534..9282c1ba42 100644 --- a/input/drivers_joypad/linuxraw_joypad.c +++ b/input/drivers_joypad/linuxraw_joypad.c @@ -97,7 +97,7 @@ static bool linuxraw_joypad_init_pad(const char *path, struct linuxraw_joypad *p { char msg[512]; snprintf(msg, sizeof(msg), "Joypad #%u (%s) connected.", (unsigned)(pad - linuxraw_pads), pad->ident); - msg_queue_push(g_extern.msg_queue, msg, 0, 60); + msg_queue_push(g_runloop.msg_queue, msg, 0, 60); } #endif } @@ -153,7 +153,7 @@ static void handle_plugged_pad(void) { char msg[512]; snprintf(msg, sizeof(msg), "Joypad #%u (%s) disconnected.", idx, linuxraw_pads[idx].ident); - msg_queue_push(g_extern.msg_queue, msg, 0, 60); + msg_queue_push(g_runloop.msg_queue, msg, 0, 60); } #endif diff --git a/input/drivers_joypad/udev_joypad.c b/input/drivers_joypad/udev_joypad.c index 0eed07ca11..061c05e8c6 100644 --- a/input/drivers_joypad/udev_joypad.c +++ b/input/drivers_joypad/udev_joypad.c @@ -457,7 +457,7 @@ static void check_device(struct udev_device *dev, const char *path, bool hotplug { char msg[512]; snprintf(msg, sizeof(msg), "Joypad #%u (%s) connected.", pad, path); - msg_queue_push(g_extern.msg_queue, msg, 0, 60); + msg_queue_push(g_runloop.msg_queue, msg, 0, 60); RARCH_LOG("[udev]: %s\n", msg); } #else @@ -482,7 +482,7 @@ static void udev_joypad_remove_device(const char *path) #ifndef IS_JOYCONFIG char msg[512]; snprintf(msg, sizeof(msg), "Joypad #%u (%s) disconnected.", i, udev_pads[i].ident); - msg_queue_push(g_extern.msg_queue, msg, 0, 60); + msg_queue_push(g_runloop.msg_queue, msg, 0, 60); RARCH_LOG("[udev]: %s\n", msg); #endif free_pad(i, true); diff --git a/input/input_autodetect.c b/input/input_autodetect.c index 5712d6d68b..92a519a91b 100644 --- a/input/input_autodetect.c +++ b/input/input_autodetect.c @@ -91,7 +91,7 @@ found: idx, name); if (!block_osd_spam) - msg_queue_push(g_extern.msg_queue, msg, 0, 60); + msg_queue_push(g_runloop.msg_queue, msg, 0, 60); RARCH_LOG("%s\n", msg); return true; diff --git a/libretro_version_1.c b/libretro_version_1.c index 3f155d51b5..6180a83cd5 100644 --- a/libretro_version_1.c +++ b/libretro_version_1.c @@ -136,7 +136,7 @@ static void video_frame(const void *data, unsigned width, ) recording_dump_frame(data, width, height, pitch); - msg = msg_queue_pull(g_extern.msg_queue); + msg = msg_queue_pull(g_runloop.msg_queue); driver.current_msg = msg; if (video_frame_filter(data, width, height, pitch, diff --git a/location/location_driver.c b/location/location_driver.c index c2606e7b63..6d02a944cf 100644 --- a/location/location_driver.c +++ b/location/location_driver.c @@ -147,7 +147,8 @@ bool driver_location_start(void) if (g_settings.location.allow) return driver.location->start(driver.location_data); - msg_queue_push(g_extern.msg_queue, "Location is explicitly disabled.\n", 1, 180); + msg_queue_clear(g_runloop.msg_queue); + msg_queue_push(g_runloop.msg_queue, "Location is explicitly disabled.\n", 1, 180); } return false; } diff --git a/menu/drivers/rgui.c b/menu/drivers/rgui.c index 80938ac6d8..a0c16a83b1 100644 --- a/menu/drivers/rgui.c +++ b/menu/drivers/rgui.c @@ -444,7 +444,7 @@ static void rgui_render(void) if (menu->msg_force) { - message_queue = msg_queue_pull(g_extern.msg_queue); + message_queue = msg_queue_pull(g_runloop.msg_queue); menu->msg_force = false; } else diff --git a/menu/drivers/rmenu_xui.cpp b/menu/drivers/rmenu_xui.cpp index aa8fe58964..9792755094 100644 --- a/menu/drivers/rmenu_xui.cpp +++ b/menu/drivers/rmenu_xui.cpp @@ -461,7 +461,7 @@ static void rmenu_xui_frame(void) xui_render_message(message); else { - const char *message = msg_queue_pull(g_extern.msg_queue); + const char *message = msg_queue_pull(g_runloop.msg_queue); if (message) xui_render_message(message); } diff --git a/menu/menu.c b/menu/menu.c index 6020f5c129..2e68e3d323 100644 --- a/menu/menu.c +++ b/menu/menu.c @@ -105,7 +105,7 @@ static void push_to_history_playlist(void) fill_pathname_base(tmp, g_extern.fullpath, sizeof(tmp)); snprintf(str, sizeof(str), "INFO - Loading %s ...", tmp); - msg_queue_push(g_extern.msg_queue, str, 1, 1); + msg_queue_push(g_runloop.msg_queue, str, 1, 1); } content_playlist_push(g_defaults.history, @@ -143,7 +143,7 @@ bool menu_load_content(void) fill_pathname_base(name, g_extern.fullpath, sizeof(name)); snprintf(msg, sizeof(msg), "Failed to load %s.\n", name); - msg_queue_push(g_extern.msg_queue, msg, 1, 90); + msg_queue_push(g_runloop.msg_queue, msg, 1, 90); if (driver.menu) driver.menu->msg_force = true; diff --git a/menu/menu_entries_cbs.c b/menu/menu_entries_cbs.c index 27e9a635f0..3c0bc03e8b 100644 --- a/menu/menu_entries_cbs.c +++ b/menu/menu_entries_cbs.c @@ -115,8 +115,8 @@ int cb_core_updater_download(void *data_, size_t len) snprintf(msg, sizeof(msg), "Download complete: %s.", core_updater_path); - msg_queue_clear(g_extern.msg_queue); - msg_queue_push(g_extern.msg_queue, msg, 1, 90); + msg_queue_clear(g_runloop.msg_queue); + msg_queue_push(g_runloop.msg_queue, msg, 1, 90); #ifdef HAVE_ZLIB file_ext = path_get_extension(output_path); diff --git a/menu/menu_entries_cbs_ok.c b/menu/menu_entries_cbs_ok.c index 7f0bd7a81f..61b9c79964 100644 --- a/menu/menu_entries_cbs_ok.c +++ b/menu/menu_entries_cbs_ok.c @@ -286,8 +286,8 @@ static int action_ok_core_updater_list(const char *path, strlcat(url_path, "|cb_core_updater_list", sizeof(url_path)); - msg_queue_clear(g_extern.http.msg_queue); - msg_queue_push(g_extern.http.msg_queue, url_path, 0, 1); + msg_queue_clear(g_runloop.http.msg_queue); + msg_queue_push(g_runloop.http.msg_queue, url_path, 0, 1); #endif return menu_list_push_stack_refresh( @@ -426,8 +426,8 @@ static int action_ok_menu_wallpaper_load(const char *path, strlcpy(g_settings.menu.wallpaper, wallpaper_path, sizeof(g_settings.menu.wallpaper)); strlcat(wallpaper_path, "|cb_menu_wallpaper", sizeof(wallpaper_path)); - msg_queue_clear(g_extern.nbio.image.msg_queue); - msg_queue_push(g_extern.nbio.image.msg_queue, wallpaper_path, 0, 1); + msg_queue_clear(g_runloop.nbio.image.msg_queue); + msg_queue_push(g_runloop.nbio.image.msg_queue, wallpaper_path, 0, 1); } menu_list_pop_stack_by_needle(menu->menu_list, setting->name); @@ -899,13 +899,13 @@ static int action_ok_core_updater_download(const char *path, strlcpy(core_updater_path, path, sizeof(core_updater_path)); snprintf(msg, sizeof(msg), "Starting download: %s.", path); - msg_queue_clear(g_extern.msg_queue); - msg_queue_push(g_extern.msg_queue, msg, 1, 90); + msg_queue_clear(g_runloop.msg_queue); + msg_queue_push(g_runloop.msg_queue, msg, 1, 90); strlcat(core_path, "|cb_core_updater_download", sizeof(core_path)); - msg_queue_clear(g_extern.http.msg_queue); - msg_queue_push(g_extern.http.msg_queue, core_path, 0, 1); + msg_queue_clear(g_runloop.http.msg_queue); + msg_queue_push(g_runloop.http.msg_queue, core_path, 0, 1); #endif return 0; } diff --git a/netplay.c b/netplay.c index 9c99ba6432..067a19bc7d 100644 --- a/netplay.c +++ b/netplay.c @@ -122,8 +122,8 @@ struct netplay static void warn_hangup(void) { RARCH_WARN("Netplay has disconnected. Will continue without connection ...\n"); - if (g_extern.msg_queue) - msg_queue_push(g_extern.msg_queue, "Netplay has disconnected. Will continue without connection.", 0, 480); + if (g_runloop.msg_queue) + msg_queue_push(g_runloop.msg_queue, "Netplay has disconnected. Will continue without connection.", 0, 480); } /** @@ -279,7 +279,7 @@ static bool netplay_get_cmd(netplay_t *netplay) netplay->flip_frame = flip_frame; RARCH_LOG("Netplay users are flipped.\n"); - msg_queue_push(g_extern.msg_queue, "Netplay users are flipped.", 1, 180); + msg_queue_push(g_runloop.msg_queue, "Netplay users are flipped.", 1, 180); return netplay_cmd_ack(netplay); @@ -606,7 +606,7 @@ static void log_connection(const struct sockaddr_storage *their_addr, char msg[512]; snprintf(msg, sizeof(msg), "Got connection from: \"%s (%s)\" (#%u)", nick, str, slot); - msg_queue_push(g_extern.msg_queue, msg, 1, 180); + msg_queue_push(g_runloop.msg_queue, msg, 1, 180); RARCH_LOG("%s\n", msg); } } @@ -912,7 +912,7 @@ static bool send_info(netplay_t *netplay) snprintf(msg, sizeof(msg), "Connected to: \"%s\"", netplay->other_nick); RARCH_LOG("%s\n", msg); - msg_queue_push(g_extern.msg_queue, msg, 1, 180); + msg_queue_push(g_runloop.msg_queue, msg, 1, 180); return true; } @@ -1062,7 +1062,7 @@ static bool get_info_spectate(netplay_t *netplay) } snprintf(msg, sizeof(msg), "Connected to \"%s\"", netplay->other_nick); - msg_queue_push(g_extern.msg_queue, msg, 1, 180); + msg_queue_push(g_runloop.msg_queue, msg, 1, 180); RARCH_LOG("%s\n", msg); @@ -1265,7 +1265,7 @@ void netplay_flip_users(netplay_t *netplay) && netplay_get_response(netplay)) { RARCH_LOG("Netplay users are flipped.\n"); - msg_queue_push(g_extern.msg_queue, "Netplay users are flipped.", 1, 180); + msg_queue_push(g_runloop.msg_queue, "Netplay users are flipped.", 1, 180); /* Queue up a flip well enough in the future. */ netplay->flip ^= true; @@ -1281,7 +1281,7 @@ void netplay_flip_users(netplay_t *netplay) error: RARCH_WARN("%s\n", msg); - msg_queue_push(g_extern.msg_queue, msg, 1, 180); + msg_queue_push(g_runloop.msg_queue, msg, 1, 180); } /** @@ -1367,8 +1367,8 @@ static int16_t netplay_get_spectate_input(netplay_t *netplay, bool port, return swap_if_big16(inp); RARCH_ERR("Connection with host was cut.\n"); - msg_queue_clear(g_extern.msg_queue); - msg_queue_push(g_extern.msg_queue, + msg_queue_clear(g_runloop.msg_queue); + msg_queue_push(g_runloop.msg_queue, "Connection with host was cut.", 1, 180); pretro_set_input_state(netplay->cbs.state_cb); @@ -1586,7 +1586,7 @@ static void netplay_post_frame_spectate(netplay_t *netplay) RARCH_LOG("Client (#%u) disconnected ...\n", i); snprintf(msg, sizeof(msg), "Client (#%u) disconnected.", i); - msg_queue_push(g_extern.msg_queue, msg, 1, 180); + msg_queue_push(g_runloop.msg_queue, msg, 1, 180); socket_close(netplay->spectate_fds[i]); netplay->spectate_fds[i] = -1; diff --git a/record/record_driver.c b/record/record_driver.c index 52b285e142..29bd9cf692 100644 --- a/record/record_driver.c +++ b/record/record_driver.c @@ -122,8 +122,8 @@ void recording_dump_frame(const void *data, unsigned width, { static const char msg[] = "Recording terminated due to resize."; RARCH_WARN("%s\n", msg); - msg_queue_clear(g_extern.msg_queue); - msg_queue_push(g_extern.msg_queue, msg, 1, 180); + msg_queue_clear(g_runloop.msg_queue); + msg_queue_push(g_runloop.msg_queue, msg, 1, 180); rarch_main_command(RARCH_CMD_RECORD_DEINIT); return; diff --git a/retroarch.c b/retroarch.c index 10812602f4..5de04fc0b9 100644 --- a/retroarch.c +++ b/retroarch.c @@ -939,7 +939,7 @@ static void init_movie(void) } g_extern.bsv.movie_playback = true; - msg_queue_push(g_extern.msg_queue, "Starting movie playback.", 2, 180); + msg_queue_push(g_runloop.msg_queue, "Starting movie playback.", 2, 180); RARCH_LOG("Starting movie playback.\n"); g_settings.rewind_granularity = 1; } @@ -949,17 +949,17 @@ static void init_movie(void) snprintf(msg, sizeof(msg), "Starting movie record to \"%s\".", g_extern.bsv.movie_start_path); - msg_queue_clear(g_extern.msg_queue); + msg_queue_clear(g_runloop.msg_queue); if (!(g_extern.bsv.movie = bsv_movie_init(g_extern.bsv.movie_start_path, RARCH_MOVIE_RECORD))) { - msg_queue_push(g_extern.msg_queue, "Failed to start movie record.", 1, 180); + msg_queue_push(g_runloop.msg_queue, "Failed to start movie record.", 1, 180); RARCH_ERR("Failed to start movie record.\n"); return; } - msg_queue_push(g_extern.msg_queue, msg, 1, 180); + msg_queue_push(g_runloop.msg_queue, msg, 1, 180); RARCH_LOG("Starting movie record to \"%s\".\n", g_extern.bsv.movie_start_path); g_settings.rewind_granularity = 1; @@ -1014,8 +1014,8 @@ static bool init_netplay(void) g_extern.netplay_is_client = false; RARCH_WARN(RETRO_LOG_INIT_NETPLAY_FAILED); - if (g_extern.msg_queue) - msg_queue_push(g_extern.msg_queue, + if (g_runloop.msg_queue) + msg_queue_push(g_runloop.msg_queue, RETRO_MSG_INIT_NETPLAY_FAILED, 0, 180); return false; @@ -1268,7 +1268,7 @@ static void load_auto_state(void) snprintf(msg, sizeof(msg), "Auto-loading savestate from \"%s\" %s.", savestate_name_auto, ret ? "succeeded" : "failed"); - msg_queue_push(g_extern.msg_queue, msg, 1, 180); + msg_queue_push(g_runloop.msg_queue, msg, 1, 180); RARCH_LOG("%s\n", msg); } @@ -1367,8 +1367,8 @@ static void main_state(unsigned cmd) else strlcpy(msg, "Core does not support save states.", sizeof(msg)); - msg_queue_clear(g_extern.msg_queue); - msg_queue_push(g_extern.msg_queue, msg, 2, 180); + msg_queue_clear(g_runloop.msg_queue); + msg_queue_push(g_runloop.msg_queue, msg, 2, 180); RARCH_LOG("%s\n", msg); } @@ -1398,8 +1398,8 @@ void rarch_disk_control_append_image(const char *path) snprintf(msg, sizeof(msg), "Appended disk: %s", path); RARCH_LOG("%s\n", msg); - msg_queue_clear(g_extern.msg_queue); - msg_queue_push(g_extern.msg_queue, msg, 0, 180); + msg_queue_clear(g_runloop.msg_queue); + msg_queue_push(g_runloop.msg_queue, msg, 0, 180); rarch_main_command(RARCH_CMD_AUTOSAVE_DEINIT); @@ -1460,8 +1460,8 @@ void rarch_disk_control_set_eject(bool new_state, bool print_log) /* Only noise in menu. */ if (print_log) { - msg_queue_clear(g_extern.msg_queue); - msg_queue_push(g_extern.msg_queue, msg, 1, 180); + msg_queue_clear(g_runloop.msg_queue); + msg_queue_push(g_runloop.msg_queue, msg, 1, 180); } } } @@ -1511,8 +1511,8 @@ void rarch_disk_control_set_index(unsigned idx) RARCH_ERR("%s\n", msg); else RARCH_LOG("%s\n", msg); - msg_queue_clear(g_extern.msg_queue); - msg_queue_push(g_extern.msg_queue, msg, 1, 180); + msg_queue_clear(g_runloop.msg_queue); + msg_queue_push(g_runloop.msg_queue, msg, 1, 180); } } @@ -2058,8 +2058,8 @@ static bool save_core_config(void) else { const char *message = "Config directory not set. Cannot save new config."; - msg_queue_clear(g_extern.msg_queue); - msg_queue_push(g_extern.msg_queue, message, 1, 180); + msg_queue_clear(g_runloop.msg_queue); + msg_queue_push(g_runloop.msg_queue, message, 1, 180); RARCH_ERR("%s\n", message); return false; } @@ -2121,8 +2121,8 @@ static bool save_core_config(void) RARCH_ERR("%s\n", msg); } - msg_queue_clear(g_extern.msg_queue); - msg_queue_push(g_extern.msg_queue, msg, 1, 180); + msg_queue_clear(g_runloop.msg_queue); + msg_queue_push(g_runloop.msg_queue, msg, 1, 180); return ret; } @@ -2208,8 +2208,8 @@ bool rarch_main_command(unsigned cmd) break; case RARCH_CMD_RESET: RARCH_LOG(RETRO_LOG_RESETTING_CONTENT); - msg_queue_clear(g_extern.msg_queue); - msg_queue_push(g_extern.msg_queue, "Reset.", 1, 120); + msg_queue_clear(g_runloop.msg_queue); + msg_queue_push(g_runloop.msg_queue, "Reset.", 1, 120); pretro_reset(); /* bSNES since v073r01 resets controllers to JOYPAD @@ -2337,8 +2337,8 @@ bool rarch_main_command(unsigned cmd) return false; } - msg_queue_clear(g_extern.msg_queue); - msg_queue_push(g_extern.msg_queue, msg, 1, 180); + msg_queue_clear(g_runloop.msg_queue); + msg_queue_push(g_runloop.msg_queue, msg, 1, 180); RARCH_LOG("%s\n", msg); } break; @@ -2602,22 +2602,22 @@ bool rarch_main_command(unsigned cmd) rarch_main_command(RARCH_CMD_AUTOSAVE_INIT); break; case RARCH_CMD_MSG_QUEUE_DEINIT: - if (g_extern.msg_queue) - msg_queue_free(g_extern.msg_queue); - g_extern.msg_queue = NULL; + if (g_runloop.msg_queue) + msg_queue_free(g_runloop.msg_queue); + g_runloop.msg_queue = NULL; break; case RARCH_CMD_MSG_QUEUE_INIT: rarch_main_command(RARCH_CMD_MSG_QUEUE_DEINIT); - if (!g_extern.msg_queue) - rarch_assert(g_extern.msg_queue = msg_queue_new(8)); + if (!g_runloop.msg_queue) + rarch_assert(g_runloop.msg_queue = msg_queue_new(8)); #ifdef HAVE_NETWORKING - if (!g_extern.http.msg_queue) - rarch_assert(g_extern.http.msg_queue = msg_queue_new(8)); + if (!g_runloop.http.msg_queue) + rarch_assert(g_runloop.http.msg_queue = msg_queue_new(8)); #endif - if (!g_extern.nbio.msg_queue) - rarch_assert(g_extern.nbio.msg_queue = msg_queue_new(8)); - if (!g_extern.nbio.image.msg_queue) - rarch_assert(g_extern.nbio.image.msg_queue = msg_queue_new(8)); + if (!g_runloop.nbio.msg_queue) + rarch_assert(g_runloop.nbio.msg_queue = msg_queue_new(8)); + if (!g_runloop.nbio.image.msg_queue) + rarch_assert(g_runloop.nbio.image.msg_queue = msg_queue_new(8)); break; case RARCH_CMD_BSV_MOVIE_DEINIT: if (g_extern.bsv.movie) @@ -2719,8 +2719,8 @@ bool rarch_main_command(unsigned cmd) } else { - msg_queue_clear(g_extern.msg_queue); - msg_queue_push(g_extern.msg_queue, "Core does not support Disk Options.", 1, 120); + msg_queue_clear(g_runloop.msg_queue); + msg_queue_push(g_runloop.msg_queue, "Core does not support Disk Options.", 1, 120); } break; case RARCH_CMD_DISK_NEXT: @@ -2740,8 +2740,8 @@ bool rarch_main_command(unsigned cmd) } else { - msg_queue_clear(g_extern.msg_queue); - msg_queue_push(g_extern.msg_queue, "Core does not support Disk Options.", 1, 120); + msg_queue_clear(g_runloop.msg_queue); + msg_queue_push(g_runloop.msg_queue, "Core does not support Disk Options.", 1, 120); } break; case RARCH_CMD_DISK_PREV: @@ -2761,8 +2761,8 @@ bool rarch_main_command(unsigned cmd) } else { - msg_queue_clear(g_extern.msg_queue); - msg_queue_push(g_extern.msg_queue, "Core does not support Disk Options.", 1, 120); + msg_queue_clear(g_runloop.msg_queue); + msg_queue_push(g_runloop.msg_queue, "Core does not support Disk Options.", 1, 120); } break; case RARCH_CMD_RUMBLE_STOP: diff --git a/runloop.c b/runloop.c index bbcb30a147..e34a8f25e1 100644 --- a/runloop.c +++ b/runloop.c @@ -59,8 +59,8 @@ static void set_volume(float gain) g_settings.audio.volume = min(g_settings.audio.volume, 12.0f); snprintf(msg, sizeof(msg), "Volume: %.1f dB", g_settings.audio.volume); - msg_queue_clear(g_extern.msg_queue); - msg_queue_push(g_extern.msg_queue, msg, 1, 180); + msg_queue_clear(g_runloop.msg_queue); + msg_queue_push(g_runloop.msg_queue, msg, 1, 180); RARCH_LOG("%s\n", msg); g_extern.audio_data.volume_gain = db_to_gain(g_settings.audio.volume); @@ -174,15 +174,13 @@ static void check_stateslots(bool pressed_increase, bool pressed_decrease) else return; - - if (g_extern.msg_queue) - msg_queue_clear(g_extern.msg_queue); + msg_queue_clear(g_runloop.msg_queue); snprintf(msg, sizeof(msg), "State slot: %d", g_settings.state_slot); - if (g_extern.msg_queue) - msg_queue_push(g_extern.msg_queue, msg, 1, 180); + if (g_runloop.msg_queue) + msg_queue_push(g_runloop.msg_queue, msg, 1, 180); RARCH_LOG("%s\n", msg); } @@ -239,13 +237,13 @@ static void check_rewind(bool pressed) { const void *buf = NULL; - msg_queue_clear(g_extern.msg_queue); + msg_queue_clear(g_runloop.msg_queue); if (state_manager_pop(g_extern.rewind.state, &buf)) { g_extern.rewind.frame_is_reverse = true; setup_rewind_audio(); - msg_queue_push(g_extern.msg_queue, RETRO_MSG_REWINDING, 0, + msg_queue_push(g_runloop.msg_queue, RETRO_MSG_REWINDING, 0, g_runloop.is_paused ? 1 : 30); pretro_unserialize(buf, g_extern.rewind.size); @@ -253,7 +251,7 @@ static void check_rewind(bool pressed) bsv_movie_frame_rewind(g_extern.bsv.movie); } else - msg_queue_push(g_extern.msg_queue, + msg_queue_push(g_runloop.msg_queue, RETRO_MSG_REWIND_REACHED_END, 0, 30); } else @@ -296,8 +294,8 @@ static void check_slowmotion(bool pressed) if (g_settings.video.black_frame_insertion) rarch_render_cached_frame(); - msg_queue_clear(g_extern.msg_queue); - msg_queue_push(g_extern.msg_queue, g_extern.rewind.frame_is_reverse ? + msg_queue_clear(g_runloop.msg_queue); + msg_queue_push(g_runloop.msg_queue, g_extern.rewind.frame_is_reverse ? "Slow motion rewind." : "Slow motion.", 0, 30); } @@ -329,8 +327,8 @@ static bool check_movie_init(void) if (!g_extern.bsv.movie) ret = false; - msg_queue_clear(g_extern.msg_queue); - msg_queue_push(g_extern.msg_queue, g_extern.bsv.movie ? + msg_queue_clear(g_runloop.msg_queue); + msg_queue_push(g_runloop.msg_queue, g_extern.bsv.movie ? msg : "Failed to start movie record.", 1, 180); if (g_extern.bsv.movie) @@ -353,8 +351,8 @@ static bool check_movie_record(void) if (!g_extern.bsv.movie) return false; - msg_queue_clear(g_extern.msg_queue); - msg_queue_push(g_extern.msg_queue, + msg_queue_clear(g_runloop.msg_queue); + msg_queue_push(g_runloop.msg_queue, RETRO_MSG_MOVIE_RECORD_STOPPING, 2, 180); RARCH_LOG(RETRO_LOG_MOVIE_RECORD_STOPPING); @@ -375,7 +373,7 @@ static bool check_movie_playback(void) if (!g_extern.bsv.movie_end) return false; - msg_queue_push(g_extern.msg_queue, + msg_queue_push(g_runloop.msg_queue, RETRO_MSG_MOVIE_PLAYBACK_ENDED, 1, 180); RARCH_LOG(RETRO_LOG_MOVIE_PLAYBACK_ENDED); @@ -441,11 +439,11 @@ static void check_shader_dir(bool pressed_next, bool pressed_prev) else return; - msg_queue_clear(g_extern.msg_queue); + msg_queue_clear(g_runloop.msg_queue); snprintf(msg, sizeof(msg), "Shader #%u: \"%s\".", (unsigned)g_extern.shader_dir.ptr, shader); - msg_queue_push(g_extern.msg_queue, msg, 1, 120); + msg_queue_push(g_runloop.msg_queue, msg, 1, 120); RARCH_LOG("Applying shader \"%s\".\n", shader); if (!video_driver_set_shader(type, shader)) diff --git a/runloop_data.c b/runloop_data.c index ce4d4011ab..9ec358c50e 100644 --- a/runloop_data.c +++ b/runloop_data.c @@ -37,7 +37,7 @@ static int rarch_main_iterate_http_transfer(void) { size_t pos = 0, tot = 0; - if (!net_http_update(g_extern.http.handle, &pos, &tot)) + if (!net_http_update(g_runloop.http.handle, &pos, &tot)) { #ifdef _WIN32 RARCH_LOG("%.9I64u / %.9I64u \r", (unsigned long long)pos, (unsigned long long)tot); @@ -52,22 +52,22 @@ static int rarch_main_iterate_http_transfer(void) static int rarch_main_iterate_http_conn_transfer(void) { - if (!net_http_connection_iterate(g_extern.http.connection.handle)) + if (!net_http_connection_iterate(g_runloop.http.connection.handle)) return -1; return 0; } static int rarch_main_iterate_http_conn_parse(void) { - if (net_http_connection_done(g_extern.http.connection.handle)) + if (net_http_connection_done(g_runloop.http.connection.handle)) { - if (g_extern.http.connection.handle && g_extern.http.connection.cb) - g_extern.http.connection.cb(g_extern.http.connection.handle, 0); + if (g_runloop.http.connection.handle && g_runloop.http.connection.cb) + g_runloop.http.connection.cb(g_runloop.http.connection.handle, 0); } - net_http_connection_free(g_extern.http.connection.handle); + net_http_connection_free(g_runloop.http.connection.handle); - g_extern.http.connection.handle = NULL; + g_runloop.http.connection.handle = NULL; return 0; } @@ -75,37 +75,37 @@ static int rarch_main_iterate_http_conn_parse(void) static int rarch_main_iterate_http_parse(void) { size_t len; - char *data = (char*)net_http_data(g_extern.http.handle, &len, false); + char *data = (char*)net_http_data(g_runloop.http.handle, &len, false); - if (data && g_extern.http.cb) - g_extern.http.cb(data, len); + if (data && g_runloop.http.cb) + g_runloop.http.cb(data, len); - net_http_delete(g_extern.http.handle); + net_http_delete(g_runloop.http.handle); - g_extern.http.handle = NULL; - msg_queue_clear(g_extern.http.msg_queue); + g_runloop.http.handle = NULL; + msg_queue_clear(g_runloop.http.msg_queue); return 0; } static int cb_http_conn_default(void *data_, size_t len) { - g_extern.http.handle = net_http_new(g_extern.http.connection.handle); + g_runloop.http.handle = net_http_new(g_runloop.http.connection.handle); - if (!g_extern.http.handle) + if (!g_runloop.http.handle) { RARCH_ERR("Could not create new HTTP session handle.\n"); return -1; } - g_extern.http.cb = NULL; + g_runloop.http.cb = NULL; - if (g_extern.http.connection.elem1[0] != '\0') + if (g_runloop.http.connection.elem1[0] != '\0') { - if (!strcmp(g_extern.http.connection.elem1, "cb_core_updater_download")) - g_extern.http.cb = &cb_core_updater_download; - if (!strcmp(g_extern.http.connection.elem1, "cb_core_updater_list")) - g_extern.http.cb = &cb_core_updater_list; + if (!strcmp(g_runloop.http.connection.elem1, "cb_core_updater_download")) + g_runloop.http.cb = &cb_core_updater_download; + if (!strcmp(g_runloop.http.connection.elem1, "cb_core_updater_list")) + g_runloop.http.cb = &cb_core_updater_list; } return 0; @@ -128,13 +128,13 @@ static int rarch_main_iterate_http_poll(void) { char elem0[PATH_MAX_LENGTH]; struct string_list *str_list = NULL; - const char *url = msg_queue_pull(g_extern.http.msg_queue); + const char *url = msg_queue_pull(g_runloop.http.msg_queue); if (!url) return -1; /* Can only deal with one HTTP transfer at a time for now */ - if (g_extern.http.handle) + if (g_runloop.http.handle) return -1; str_list = string_split(url, "|"); @@ -145,17 +145,17 @@ static int rarch_main_iterate_http_poll(void) if (str_list->size > 0) strlcpy(elem0, str_list->elems[0].data, sizeof(elem0)); - g_extern.http.connection.handle = net_http_connection_new(elem0); + g_runloop.http.connection.handle = net_http_connection_new(elem0); - if (!g_extern.http.connection.handle) + if (!g_runloop.http.connection.handle) return -1; - g_extern.http.connection.cb = &cb_http_conn_default; + g_runloop.http.connection.cb = &cb_http_conn_default; if (str_list->size > 1) - strlcpy(g_extern.http.connection.elem1, + strlcpy(g_runloop.http.connection.elem1, str_list->elems[1].data, - sizeof(g_extern.http.connection.elem1)); + sizeof(g_runloop.http.connection.elem1)); string_list_free(str_list); @@ -485,8 +485,8 @@ static void rarch_main_iterate_rdl(void) #ifdef HAVE_LIBRETRODB if (!driver.menu->rdl->iterating) { - msg_queue_clear(g_extern.msg_queue); - msg_queue_push(g_extern.msg_queue, "Scanning of directory finished.\n", 1, 180); + msg_queue_clear(g_runloop.msg_queue); + msg_queue_push(g_runloop.msg_queue, "Scanning of directory finished.\n", 1, 180); database_info_write_rdl_free(driver.menu->rdl); driver.menu->rdl = NULL; @@ -533,16 +533,16 @@ void do_data_nbio_state_checks(nbio_handle_t *nbio) void do_data_state_checks(void) { - do_data_nbio_state_checks(&g_extern.nbio); + do_data_nbio_state_checks(&g_runloop.nbio); #ifdef HAVE_NETWORKING - if (g_extern.http.connection.handle) + if (g_runloop.http.connection.handle) { if (!rarch_main_iterate_http_conn_transfer()) rarch_main_iterate_http_conn_parse(); } - if (g_extern.http.handle) + if (g_runloop.http.handle) { if (!rarch_main_iterate_http_transfer()) rarch_main_iterate_http_parse(); diff --git a/screenshot.c b/screenshot.c index 0dc8345500..b8e9c68840 100644 --- a/screenshot.c +++ b/screenshot.c @@ -258,7 +258,7 @@ bool take_screenshot(void) driver.video->viewport_info; /* Clear out message queue to avoid OSD fonts to appear on screenshot. */ - msg_queue_clear(g_extern.msg_queue); + msg_queue_clear(g_runloop.msg_queue); if (viewport_read) { @@ -292,7 +292,7 @@ bool take_screenshot(void) msg = RETRO_MSG_TAKE_SCREENSHOT_FAILED; } - msg_queue_push(g_extern.msg_queue, msg, 1, g_runloop.is_paused ? 1 : 180); + msg_queue_push(g_runloop.msg_queue, msg, 1, g_runloop.is_paused ? 1 : 180); if (g_runloop.is_paused) rarch_render_cached_frame(); diff --git a/tools/retroarch-joyconfig.c b/tools/retroarch-joyconfig.c index 7b32c7eee1..706e3ba43e 100644 --- a/tools/retroarch-joyconfig.c +++ b/tools/retroarch-joyconfig.c @@ -33,6 +33,7 @@ * with special #ifdefs. */ struct settings g_settings; +struct runloop g_runloop; struct global g_extern; driver_t driver; diff --git a/xdk/screenshot_xdk1.c b/xdk/screenshot_xdk1.c index 5db96d2402..e9cf275009 100644 --- a/xdk/screenshot_xdk1.c +++ b/xdk/screenshot_xdk1.c @@ -44,7 +44,7 @@ bool screenshot_dump(const char *folder, const void *frame, if(ret == S_OK) { RARCH_LOG("Screenshot saved: %s.\n", filename); - msg_queue_push(g_extern.msg_queue, "Screenshot saved.", 1, 30); + msg_queue_push(g_runloop.msg_queue, "Screenshot saved.", 1, 30); return true; }