From 0e3b478f8c00b015aec9a78d13e73277500e5449 Mon Sep 17 00:00:00 2001 From: libretroadmin Date: Sun, 8 Jan 2023 08:56:57 +0100 Subject: [PATCH] Header cleanups - don't include retroarch.h everywhere --- core_info.c | 1 - core_option_manager.c | 1 + disk_control_interface.c | 2 +- gfx/common/d3d8_common.h | 1 - gfx/common/d3d9_common.h | 1 - gfx/drivers/d3d10.c | 2 +- gfx/drivers/d3d8.c | 1 - gfx/drivers/d3d9cg.c | 2 +- gfx/drivers/gl1.c | 1 - gfx/drivers/metal.m | 2 +- gfx/drivers/vulkan.c | 2 +- gfx/drivers_context/opendingux_fbdev_ctx.c | 2 - gfx/drivers_context/w_vk_ctx.c | 1 - gfx/drivers_context/wgl_ctx.c | 1 - gfx/drivers_display/gfx_display_d3d10.c | 1 - gfx/drivers_display/gfx_display_d3d11.c | 1 - gfx/drivers_display/gfx_display_d3d12.c | 1 - gfx/drivers_display/gfx_display_d3d8.c | 1 - gfx/drivers_display/gfx_display_d3d9cg.c | 1 - gfx/drivers_display/gfx_display_d3d9hlsl.c | 1 - gfx/drivers_display/gfx_display_gdi.c | 2 - gfx/drivers_display/gfx_display_gl1.c | 1 - gfx/drivers_display/gfx_display_gl2.c | 1 - gfx/drivers_display/gfx_display_gl3.c | 2 - gfx/drivers_display/gfx_display_metal.m | 1 - gfx/drivers_display/gfx_display_vulkan.c | 1 - gfx/drivers_font/gdi_font.c | 2 +- gfx/drivers_shader/slang_process.h | 1 - gfx/font_driver.h | 3 +- gfx/gfx_display.h | 1 - gfx/video_shader_parse.c | 1 + gfx/video_thread_wrapper.c | 1 - input/drivers/dinput.c | 2 - input/drivers/sdl_input.c | 2 - input/drivers/winraw_input.c | 17 ++---- input/drivers/x11_input.c | 3 +- input/drivers_joypad/dinput_joypad.c | 3 +- input/drivers_joypad/xinput_hybrid_joypad.c | 7 +-- led/drivers/led_overlay.c | 3 +- led/drivers/led_win32_keyboard.c | 3 +- menu/cbs/menu_cbs_deferred_push.c | 1 + menu/cbs/menu_cbs_get_value.c | 2 + menu/cbs/menu_cbs_sublabel.c | 1 - menu/drivers/materialui.c | 2 + menu/drivers/ozone.c | 2 + menu/drivers/rgui.c | 1 + menu/drivers/xmb.c | 2 + menu/menu_contentless_cores.c | 1 - menu/menu_driver.c | 2 + menu/menu_explore.c | 2 +- menu/menu_screensaver.h | 1 - record/drivers/record_ffmpeg.c | 2 - record/record_driver.c | 66 --------------------- retroarch.c | 44 ++++++++------ retroarch.h | 6 -- runloop.h | 6 ++ tasks/task_autodetect.c | 1 + tasks/task_manual_content_scan.c | 1 + tasks/task_screenshot.c | 1 + ui/drivers/qt/qt_dialogs.cpp | 1 + ui/drivers/qt/qt_options.cpp | 3 - ui/drivers/ui_qt.h | 1 - ui/drivers/ui_win32.c | 1 - ui/ui_companion_driver.c | 3 - 64 files changed, 70 insertions(+), 166 deletions(-) diff --git a/core_info.c b/core_info.c index f9e571a7ef..34651235ff 100644 --- a/core_info.c +++ b/core_info.c @@ -30,7 +30,6 @@ #include "config.h" #endif -#include "retroarch.h" #include "verbosity.h" #include "core_info.h" diff --git a/core_option_manager.c b/core_option_manager.c index 20da42c1ca..ca83a0e5d2 100644 --- a/core_option_manager.c +++ b/core_option_manager.c @@ -26,6 +26,7 @@ #include "core_option_manager.h" #include "msg_hash.h" +#include "retroarch.h" /*********************/ /* Option Conversion */ diff --git a/disk_control_interface.c b/disk_control_interface.c index 74f55b6e6c..3774457d7a 100644 --- a/disk_control_interface.c +++ b/disk_control_interface.c @@ -24,7 +24,7 @@ #include #include "paths.h" -#include "retroarch.h" +#include "runloop.h" #include "verbosity.h" #include "msg_hash.h" diff --git a/gfx/common/d3d8_common.h b/gfx/common/d3d8_common.h index bf3bf684fb..557a0a389b 100644 --- a/gfx/common/d3d8_common.h +++ b/gfx/common/d3d8_common.h @@ -22,7 +22,6 @@ #include -#include "../../retroarch.h" #include "../../verbosity.h" RETRO_BEGIN_DECLS diff --git a/gfx/common/d3d9_common.h b/gfx/common/d3d9_common.h index f534b06be8..b59c698452 100644 --- a/gfx/common/d3d9_common.h +++ b/gfx/common/d3d9_common.h @@ -24,7 +24,6 @@ #include #include "d3d_common.h" -#include "../../retroarch.h" #include "../../verbosity.h" #define D3D9_DECL_FVF_TEXCOORD(stream, offset, index) \ diff --git a/gfx/drivers/d3d10.c b/gfx/drivers/d3d10.c index 3d22d403c3..1162034098 100644 --- a/gfx/drivers/d3d10.c +++ b/gfx/drivers/d3d10.c @@ -35,9 +35,9 @@ #include #include "../../driver.h" +#include "../../retroarch.h" #include "../../verbosity.h" #include "../../configuration.h" -#include "../../retroarch.h" #ifdef HAVE_REWIND #include "../../state_manager.h" #endif diff --git a/gfx/drivers/d3d8.c b/gfx/drivers/d3d8.c index f577a159a0..ab7f2722da 100644 --- a/gfx/drivers/d3d8.c +++ b/gfx/drivers/d3d8.c @@ -43,7 +43,6 @@ #include "../common/d3d_common.h" #include "../video_coord_array.h" #include "../../configuration.h" -#include "../../retroarch.h" #include "../../dynamic.h" #include "../../frontend/frontend_driver.h" diff --git a/gfx/drivers/d3d9cg.c b/gfx/drivers/d3d9cg.c index 3e00090920..8e6f91ea97 100644 --- a/gfx/drivers/d3d9cg.c +++ b/gfx/drivers/d3d9cg.c @@ -50,6 +50,7 @@ #include "../include/Cg/cgD3D9.h" #include "../video_coord_array.h" #include "../../configuration.h" +#include "../../retroarch.h" #include "../../dynamic.h" #include "../../frontend/frontend_driver.h" @@ -66,7 +67,6 @@ #include "../../core.h" #include "../../verbosity.h" -#include "../../retroarch.h" #ifdef __WINRT__ #error "UWP does not support D3D9" diff --git a/gfx/drivers/gl1.c b/gfx/drivers/gl1.c index f3b16efc44..536b78edaf 100644 --- a/gfx/drivers/gl1.c +++ b/gfx/drivers/gl1.c @@ -47,7 +47,6 @@ #include "../../driver.h" #include "../../configuration.h" -#include "../../retroarch.h" #include "../../verbosity.h" #include "../../frontend/frontend_driver.h" #include "../common/gl1_common.h" diff --git a/gfx/drivers/metal.m b/gfx/drivers/metal.m index ec9dfe3dff..cb4dfee0bd 100644 --- a/gfx/drivers/metal.m +++ b/gfx/drivers/metal.m @@ -54,10 +54,10 @@ #include "../../driver.h" #include "../../configuration.h" -#include "../../retroarch.h" #ifdef HAVE_REWIND #include "../../state_manager.h" #endif +#include "../../retroarch.h" #include "../../verbosity.h" #include "../video_coord_array.h" diff --git a/gfx/drivers/vulkan.c b/gfx/drivers/vulkan.c index 014e160c89..82d4d84083 100644 --- a/gfx/drivers/vulkan.c +++ b/gfx/drivers/vulkan.c @@ -49,8 +49,8 @@ #ifdef HAVE_REWIND #include "../../state_manager.h" #endif - #include "../../retroarch.h" + #include "../../verbosity.h" #include "../../record/record_driver.h" diff --git a/gfx/drivers_context/opendingux_fbdev_ctx.c b/gfx/drivers_context/opendingux_fbdev_ctx.c index f7a0f46d18..0863daeb9b 100644 --- a/gfx/drivers_context/opendingux_fbdev_ctx.c +++ b/gfx/drivers_context/opendingux_fbdev_ctx.c @@ -15,7 +15,6 @@ */ #include -#include #ifdef HAVE_CONFIG_H #include "../../config.h" @@ -26,7 +25,6 @@ #endif #include "../../frontend/frontend_driver.h" -#include "../../verbosity.h" typedef struct { diff --git a/gfx/drivers_context/w_vk_ctx.c b/gfx/drivers_context/w_vk_ctx.c index cf46c7c94c..32ed539dc8 100644 --- a/gfx/drivers_context/w_vk_ctx.c +++ b/gfx/drivers_context/w_vk_ctx.c @@ -42,7 +42,6 @@ #include "../../configuration.h" #include "../../dynamic.h" -#include "../../retroarch.h" #include "../../verbosity.h" #include "../../frontend/frontend_driver.h" diff --git a/gfx/drivers_context/wgl_ctx.c b/gfx/drivers_context/wgl_ctx.c index 89515283b0..4201ad7bc9 100644 --- a/gfx/drivers_context/wgl_ctx.c +++ b/gfx/drivers_context/wgl_ctx.c @@ -41,7 +41,6 @@ #include "../../configuration.h" #include "../../dynamic.h" -#include "../../retroarch.h" #include "../../verbosity.h" #include "../../frontend/frontend_driver.h" diff --git a/gfx/drivers_display/gfx_display_d3d10.c b/gfx/drivers_display/gfx_display_d3d10.c index 6c64896d9d..f92797ffb0 100644 --- a/gfx/drivers_display/gfx_display_d3d10.c +++ b/gfx/drivers_display/gfx_display_d3d10.c @@ -24,7 +24,6 @@ #include "../gfx_display.h" -#include "../../retroarch.h" #include "../common/d3d10_common.h" static void gfx_display_d3d10_blend_begin(void *data) diff --git a/gfx/drivers_display/gfx_display_d3d11.c b/gfx/drivers_display/gfx_display_d3d11.c index a04caeb073..b295a14189 100644 --- a/gfx/drivers_display/gfx_display_d3d11.c +++ b/gfx/drivers_display/gfx_display_d3d11.c @@ -23,7 +23,6 @@ #include "../gfx_display.h" -#include "../../retroarch.h" #include "../common/d3d11_common.h" static void gfx_display_d3d11_blend_begin(void *data) diff --git a/gfx/drivers_display/gfx_display_d3d12.c b/gfx/drivers_display/gfx_display_d3d12.c index eecdd89b34..f2c92d0ba6 100644 --- a/gfx/drivers_display/gfx_display_d3d12.c +++ b/gfx/drivers_display/gfx_display_d3d12.c @@ -23,7 +23,6 @@ #include "../gfx_display.h" -#include "../../retroarch.h" #include "../common/d3d12_common.h" static void gfx_display_d3d12_blend_begin(void *data) diff --git a/gfx/drivers_display/gfx_display_d3d8.c b/gfx/drivers_display/gfx_display_d3d8.c index 30c72899fa..ae0d227d64 100644 --- a/gfx/drivers_display/gfx_display_d3d8.c +++ b/gfx/drivers_display/gfx_display_d3d8.c @@ -25,7 +25,6 @@ #include "../gfx_display.h" -#include "../../retroarch.h" #include "../common/d3d_common.h" #include "../common/d3d8_common.h" diff --git a/gfx/drivers_display/gfx_display_d3d9cg.c b/gfx/drivers_display/gfx_display_d3d9cg.c index 3ed178cf9f..0b15ae43c7 100644 --- a/gfx/drivers_display/gfx_display_d3d9cg.c +++ b/gfx/drivers_display/gfx_display_d3d9cg.c @@ -25,7 +25,6 @@ #include "../gfx_display.h" -#include "../../retroarch.h" #include "../common/d3d_common.h" #include "../common/d3d9_common.h" diff --git a/gfx/drivers_display/gfx_display_d3d9hlsl.c b/gfx/drivers_display/gfx_display_d3d9hlsl.c index ebbb86c517..85d760c82d 100644 --- a/gfx/drivers_display/gfx_display_d3d9hlsl.c +++ b/gfx/drivers_display/gfx_display_d3d9hlsl.c @@ -25,7 +25,6 @@ #include "../gfx_display.h" -#include "../../retroarch.h" #include "../common/d3d_common.h" #include "../common/d3d9_common.h" diff --git a/gfx/drivers_display/gfx_display_gdi.c b/gfx/drivers_display/gfx_display_gdi.c index 3903821727..3a797ba8b9 100644 --- a/gfx/drivers_display/gfx_display_gdi.c +++ b/gfx/drivers_display/gfx_display_gdi.c @@ -21,8 +21,6 @@ #include #include "../../config.def.h" -#include "../../retroarch.h" -#include "../../verbosity.h" #include "../gfx_display.h" diff --git a/gfx/drivers_display/gfx_display_gl1.c b/gfx/drivers_display/gfx_display_gl1.c index 22be7fdfcd..82ee04efe5 100644 --- a/gfx/drivers_display/gfx_display_gl1.c +++ b/gfx/drivers_display/gfx_display_gl1.c @@ -20,7 +20,6 @@ #include "../../config.h" #endif -#include "../../retroarch.h" #include "../common/gl1_common.h" #include "../gfx_display.h" diff --git a/gfx/drivers_display/gfx_display_gl2.c b/gfx/drivers_display/gfx_display_gl2.c index 6d0493bbd6..ff15498226 100644 --- a/gfx/drivers_display/gfx_display_gl2.c +++ b/gfx/drivers_display/gfx_display_gl2.c @@ -19,7 +19,6 @@ #include "../../config.h" #endif -#include "../../retroarch.h" #include "../common/gl2_common.h" #include "../gfx_display.h" diff --git a/gfx/drivers_display/gfx_display_gl3.c b/gfx/drivers_display/gfx_display_gl3.c index 9cb98f9bbb..fcd299ae14 100644 --- a/gfx/drivers_display/gfx_display_gl3.c +++ b/gfx/drivers_display/gfx_display_gl3.c @@ -24,8 +24,6 @@ #include "../gfx_display.h" -#include "../../retroarch.h" - static const float gl3_vertexes[] = { 0, 0, 1, 0, diff --git a/gfx/drivers_display/gfx_display_metal.m b/gfx/drivers_display/gfx_display_metal.m index 9a790d4e7c..6c65c0e490 100644 --- a/gfx/drivers_display/gfx_display_metal.m +++ b/gfx/drivers_display/gfx_display_metal.m @@ -21,7 +21,6 @@ #include "../gfx_display.h" -#include "../../retroarch.h" #import "../common/metal_common.h" static const float *gfx_display_metal_get_default_vertices(void) diff --git a/gfx/drivers_display/gfx_display_vulkan.c b/gfx/drivers_display/gfx_display_vulkan.c index b98eb0dcbb..58686c1114 100644 --- a/gfx/drivers_display/gfx_display_vulkan.c +++ b/gfx/drivers_display/gfx_display_vulkan.c @@ -22,7 +22,6 @@ #include "../gfx_display.h" -#include "../../retroarch.h" #include "../common/vulkan_common.h" /* Will do Y-flip later, but try to make it similar to GL. */ diff --git a/gfx/drivers_font/gdi_font.c b/gfx/drivers_font/gdi_font.c index 4a1649fb58..3187109438 100644 --- a/gfx/drivers_font/gdi_font.c +++ b/gfx/drivers_font/gdi_font.c @@ -27,7 +27,7 @@ #include "../../config.h" #endif -#include "../../retroarch.h" +#include "../video_defines.h" #include "../common/gdi_common.h" #include "../common/win32_common.h" diff --git a/gfx/drivers_shader/slang_process.h b/gfx/drivers_shader/slang_process.h index 8f00cf9d9e..9595ae530c 100644 --- a/gfx/drivers_shader/slang_process.h +++ b/gfx/drivers_shader/slang_process.h @@ -21,7 +21,6 @@ #include #include "../video_shader_parse.h" -#include "../../retroarch.h" #include "slang_reflection.h" #include "glslang_util.h" diff --git a/gfx/font_driver.h b/gfx/font_driver.h index 9c83c322de..8e97a58f45 100644 --- a/gfx/font_driver.h +++ b/gfx/font_driver.h @@ -22,9 +22,8 @@ #include #include -#include "../retroarch.h" - #include "video_defines.h" +#include "video_driver.h" RETRO_BEGIN_DECLS diff --git a/gfx/gfx_display.h b/gfx/gfx_display.h index a8cf0ae659..e06947be00 100644 --- a/gfx/gfx_display.h +++ b/gfx/gfx_display.h @@ -29,7 +29,6 @@ #include #include -#include "../retroarch.h" #include "../gfx/font_driver.h" RETRO_BEGIN_DECLS diff --git a/gfx/video_shader_parse.c b/gfx/video_shader_parse.c index 9e02ac5f86..c677b66f3f 100644 --- a/gfx/video_shader_parse.c +++ b/gfx/video_shader_parse.c @@ -45,6 +45,7 @@ #include "../file_path_special.h" #include "../paths.h" #include "../retroarch.h" +#include "../runloop.h" #if defined(HAVE_GFX_WIDGETS) #include "gfx_widgets.h" diff --git a/gfx/video_thread_wrapper.c b/gfx/video_thread_wrapper.c index bc4e1f9f6b..cfa68f95ab 100644 --- a/gfx/video_thread_wrapper.c +++ b/gfx/video_thread_wrapper.c @@ -27,7 +27,6 @@ #include "video_thread_wrapper.h" #include "font_driver.h" -#include "../retroarch.h" #include "../runloop.h" #include "../verbosity.h" diff --git a/input/drivers/dinput.c b/input/drivers/dinput.c index c3617e65ee..62d68acda6 100644 --- a/input/drivers/dinput.c +++ b/input/drivers/dinput.c @@ -52,8 +52,6 @@ #include "../input_keymaps.h" #include "../../configuration.h" -#include "../../retroarch.h" -#include "../../verbosity.h" /* Context has to be global as joypads also ride on this context. */ LPDIRECTINPUT8 g_dinput_ctx; diff --git a/input/drivers/sdl_input.c b/input/drivers/sdl_input.c index 8d9114e19b..e49f3f73af 100644 --- a/input/drivers/sdl_input.c +++ b/input/drivers/sdl_input.c @@ -27,8 +27,6 @@ #include "../input_keymaps.h" #include "../../configuration.h" -#include "../../retroarch.h" -#include "../../verbosity.h" #include "../../tasks/tasks_internal.h" #ifdef HAVE_SDL2 diff --git a/input/drivers/winraw_input.c b/input/drivers/winraw_input.c index c1cce3edf8..8ca061e652 100644 --- a/input/drivers/winraw_input.c +++ b/input/drivers/winraw_input.c @@ -42,7 +42,6 @@ extern "C" { #include "../input_keymaps.h" #include "../../configuration.h" -#include "../../retroarch.h" #include "../../verbosity.h" typedef struct @@ -130,17 +129,13 @@ static void winraw_destroy_window(HWND wnd) static BOOL winraw_set_keyboard_input(HWND window) { RAWINPUTDEVICE rid; - settings_t *settings; - - settings = config_get_ptr(); - - rid.dwFlags = window ? 0 : RIDEV_REMOVE; - rid.hwndTarget = window; - rid.usUsagePage = 0x01; /* Generic desktop */ - rid.usUsage = 0x06; /* Keyboard */ + settings_t *settings = config_get_ptr(); + rid.dwFlags = window ? 0 : RIDEV_REMOVE; + rid.hwndTarget = window; + rid.usUsagePage = 0x01; /* Generic desktop */ + rid.usUsage = 0x06; /* Keyboard */ if (settings->bools.input_nowinkey_enable) - rid.dwFlags |= RIDEV_NOHOTKEYS; /* Disable win keys while focused */ - + rid.dwFlags |= RIDEV_NOHOTKEYS; /* Disable win keys while focused */ return RegisterRawInputDevices(&rid, 1, sizeof(RAWINPUTDEVICE)); } diff --git a/input/drivers/x11_input.c b/input/drivers/x11_input.c index 0c0ba91042..3e46e39f78 100644 --- a/input/drivers/x11_input.c +++ b/input/drivers/x11_input.c @@ -1,6 +1,6 @@ /* RetroArch - A frontend for libretro. * Copyright (C) 2010-2015 - Hans-Kristian Arntzen - * Copyright (C) 2011-2017 - Daniel De Matteis + * Copyright (C) 2011-2023 - Daniel De Matteis * * RetroArch is free software: you can redistribute it and/or modify it under the terms * of the GNU General Public License as published by the Free Software Found- @@ -29,7 +29,6 @@ #include "../common/input_x11_common.h" #include "../../configuration.h" -#include "../../retroarch.h" #include "../../verbosity.h" typedef struct x11_input diff --git a/input/drivers_joypad/dinput_joypad.c b/input/drivers_joypad/dinput_joypad.c index cfddb30181..97be98db6a 100644 --- a/input/drivers_joypad/dinput_joypad.c +++ b/input/drivers_joypad/dinput_joypad.c @@ -31,8 +31,9 @@ #endif #include "../../tasks/tasks_internal.h" +#include "../../gfx/video_driver.h" +#include "../input_driver.h" #include "../input_keymaps.h" -#include "../../retroarch.h" #include "../../verbosity.h" #include "dinput_joypad.h" diff --git a/input/drivers_joypad/xinput_hybrid_joypad.c b/input/drivers_joypad/xinput_hybrid_joypad.c index eb558b8aa3..710e50bb9d 100644 --- a/input/drivers_joypad/xinput_hybrid_joypad.c +++ b/input/drivers_joypad/xinput_hybrid_joypad.c @@ -42,12 +42,9 @@ #include "../../config.h" #endif -#include "../../config.def.h" - -#include "../../tasks/tasks_internal.h" #include "../input_driver.h" - -#include "../../retroarch.h" +#include "../../gfx/video_driver.h" +#include "../../tasks/tasks_internal.h" #include "../../verbosity.h" #include "dinput_joypad.h" diff --git a/led/drivers/led_overlay.c b/led/drivers/led_overlay.c index c42db71487..dd87672453 100644 --- a/led/drivers/led_overlay.c +++ b/led/drivers/led_overlay.c @@ -1,11 +1,10 @@ -#include +#include #include "../led_driver.h" #include "../led_defines.h" #include "../../input/input_overlay.h" #include "../../configuration.h" -#include "../../retroarch.h" typedef struct { diff --git a/led/drivers/led_win32_keyboard.c b/led/drivers/led_win32_keyboard.c index 1c89ddcd7d..534dc180de 100644 --- a/led/drivers/led_win32_keyboard.c +++ b/led/drivers/led_win32_keyboard.c @@ -1,9 +1,8 @@ -#include +#include #include "../led_driver.h" #include "../led_defines.h" #include "../../configuration.h" -#include "../../retroarch.h" #include diff --git a/menu/cbs/menu_cbs_deferred_push.c b/menu/cbs/menu_cbs_deferred_push.c index 8f6cca20ff..821b8fca1d 100644 --- a/menu/cbs/menu_cbs_deferred_push.c +++ b/menu/cbs/menu_cbs_deferred_push.c @@ -25,6 +25,7 @@ #include "../menu_driver.h" #include "../menu_cbs.h" #include "../../msg_hash.h" +#include "../../runloop.h" #include "../../database_info.h" diff --git a/menu/cbs/menu_cbs_get_value.c b/menu/cbs/menu_cbs_get_value.c index 45b88b0c2e..68d3efbada 100644 --- a/menu/cbs/menu_cbs_get_value.c +++ b/menu/cbs/menu_cbs_get_value.c @@ -41,6 +41,8 @@ #endif #include "../../performance_counters.h" #include "../../paths.h" +#include "../../retroarch.h" +#include "../../runloop.h" #include "../../verbosity.h" #ifdef HAVE_BLUETOOTH #include "../../bluetooth/bluetooth_driver.h" diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c index 206998a7cf..522fd8cb70 100644 --- a/menu/cbs/menu_cbs_sublabel.c +++ b/menu/cbs/menu_cbs_sublabel.c @@ -23,7 +23,6 @@ #include "../menu_cbs.h" #include "../../input/input_remapping.h" -#include "../../retroarch.h" #include "../../core_option_manager.h" #ifdef HAVE_CHEEVOS diff --git a/menu/drivers/materialui.c b/menu/drivers/materialui.c index 353b3c6ca6..6a1bbb6a90 100644 --- a/menu/drivers/materialui.c +++ b/menu/drivers/materialui.c @@ -52,6 +52,8 @@ #include "../../audio/audio_driver.h" #include "../../tasks/tasks_internal.h" #include "../../runtime_file.h" +#include "../../retroarch.h" +#include "../../runloop.h" #include "../../file_path_special.h" #include "../../list_special.h" diff --git a/menu/drivers/ozone.c b/menu/drivers/ozone.c index a4fb321b28..4e882b2c89 100644 --- a/menu/drivers/ozone.c +++ b/menu/drivers/ozone.c @@ -35,6 +35,8 @@ #include "../../config.def.h" #include "../../file_path_special.h" +#include "../../retroarch.h" +#include "../../runloop.h" #ifdef HAVE_DISCORD_OWN_AVATAR #include "../../discord/discord.h" diff --git a/menu/drivers/rgui.c b/menu/drivers/rgui.c index 9fa77d8d98..de019d8959 100644 --- a/menu/drivers/rgui.c +++ b/menu/drivers/rgui.c @@ -52,6 +52,7 @@ #include "../../configuration.h" #include "../../file_path_special.h" +#include "../../runloop.h" #include "../../gfx/drivers_font_renderer/bitmap.h" #ifdef HAVE_LANGEXTRA diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index b23638aa4e..153f6fd733 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -50,6 +50,8 @@ #include "../../core_info.h" #include "../../core.h" +#include "../../retroarch.h" +#include "../../runloop.h" #include "../../input/input_osk.h" diff --git a/menu/menu_contentless_cores.c b/menu/menu_contentless_cores.c index 878e155251..aa6a958c18 100644 --- a/menu/menu_contentless_cores.c +++ b/menu/menu_contentless_cores.c @@ -24,7 +24,6 @@ #include "menu_driver.h" #include "menu_displaylist.h" #include "../file_path_special.h" -#include "../retroarch.h" #include "../core_info.h" #include "../configuration.h" diff --git a/menu/menu_driver.c b/menu/menu_driver.c index bb3bd8c622..a7507ed30f 100644 --- a/menu/menu_driver.c +++ b/menu/menu_driver.c @@ -46,9 +46,11 @@ #include "menu_driver.h" #include "menu_cbs.h" +#include "../core_option_manager.h" #include "../driver.h" #include "../list_special.h" #include "../paths.h" +#include "../retroarch.h" #include "../tasks/task_powerstate.h" #include "../tasks/tasks_internal.h" #include "../verbosity.h" diff --git a/menu/menu_explore.c b/menu/menu_explore.c index e42181e845..886ba3592d 100644 --- a/menu/menu_explore.c +++ b/menu/menu_explore.c @@ -25,10 +25,10 @@ #include "menu_driver.h" #include "menu_cbs.h" -#include "../retroarch.h" #include "../configuration.h" #include "../file_path_special.h" #include "../playlist.h" +#include "../runloop.h" #include "../verbosity.h" #include "../libretro-db/libretrodb.h" #include "../tasks/tasks_internal.h" diff --git a/menu/menu_screensaver.h b/menu/menu_screensaver.h index ab8c45edd7..5c18ee2997 100644 --- a/menu/menu_screensaver.h +++ b/menu/menu_screensaver.h @@ -21,7 +21,6 @@ #include #include "menu_defines.h" -#include "../retroarch.h" #include "../gfx/gfx_display.h" #include "../gfx/gfx_animation.h" diff --git a/record/drivers/record_ffmpeg.c b/record/drivers/record_ffmpeg.c index d07ff913ba..4a13e561d7 100644 --- a/record/drivers/record_ffmpeg.c +++ b/record/drivers/record_ffmpeg.c @@ -16,7 +16,6 @@ */ #include -#include #include #include @@ -67,7 +66,6 @@ extern "C" { } #endif -#include "../../retroarch.h" #include "../../verbosity.h" #define FFMPEG3 (LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 10, 100)) diff --git a/record/record_driver.c b/record/record_driver.c index 8e6d9d58c5..94d1bf28d4 100644 --- a/record/record_driver.c +++ b/record/record_driver.c @@ -25,7 +25,6 @@ #include "../list_special.h" #include "../gfx/video_driver.h" #include "../paths.h" -#include "../retroarch.h" #include "../runloop.h" #include "../verbosity.h" @@ -67,71 +66,6 @@ const char* config_get_record_driver_options(void) return char_list_new_special(STRING_LIST_RECORD_DRIVERS, NULL); } -#if 0 -/* TODO/FIXME - not used apparently */ -static void find_record_driver(const char *prefix, - bool verbosity_enabled) -{ - settings_t *settings = config_get_ptr(); - int i = (int)driver_find_index( - "record_driver", - settings->arrays.record_driver); - - if (i >= 0) - recording_state.driver = (const record_driver_t*)record_drivers[i]; - else - { - if (verbosity_enabled) - { - unsigned d; - - RARCH_ERR("[Recording]: Couldn't find any %s named \"%s\".\n", prefix, - settings->arrays.record_driver); - RARCH_LOG_OUTPUT("Available %ss are:\n", prefix); - for (d = 0; record_drivers[d]; d++) - RARCH_LOG_OUTPUT("\t%s\n", record_drivers[d].ident); - RARCH_WARN("[Recording]: Going to default to first %s...\n", prefix); - } - - recording_state.driver = (const record_driver_t*)record_drivers[0]; - - if (!recording_state.driver) - retroarch_fail(1, "find_record_driver()"); - } -} - -/** - * ffemu_find_backend: - * @ident : Identifier of driver to find. - * - * Finds a recording driver with the name @ident. - * - * Returns: recording driver handle if successful, otherwise - * NULL. - **/ -static const record_driver_t *ffemu_find_backend(const char *ident) -{ - unsigned i; - - for (i = 0; record_drivers[i]; i++) - { - if (string_is_equal(record_drivers[i]->ident, ident)) - return record_drivers[i]; - } - - return NULL; -} - -static void recording_driver_free_state(void) -{ - /* TODO/FIXME - this is not being called anywhere */ - recording_state.gpu_width = 0; - recording_state.gpu_height = 0; - recording_state.width = 0; - recording_stte.height = 0; -} -#endif - /** * gfx_ctx_init_first: * @param backend diff --git a/retroarch.c b/retroarch.c index 1441ba95e7..0cdf1ff60e 100644 --- a/retroarch.c +++ b/retroarch.c @@ -700,14 +700,10 @@ char *path_get_ptr(enum rarch_path_type type) return p_rarch->path_content; case RARCH_PATH_DEFAULT_SHADER_PRESET: return p_rarch->path_default_shader_preset; - case RARCH_PATH_BASENAME: - return runloop_st->runtime_content_path_basename; case RARCH_PATH_CORE_OPTIONS: if (!path_is_empty(RARCH_PATH_CORE_OPTIONS)) return p_rarch->path_core_options_file; break; - case RARCH_PATH_SUBSYSTEM: - return runloop_st->subsystem_path; case RARCH_PATH_CONFIG: if (!path_is_empty(RARCH_PATH_CONFIG)) return p_rarch->path_config_file; @@ -721,6 +717,11 @@ char *path_get_ptr(enum rarch_path_type type) case RARCH_PATH_NONE: case RARCH_PATH_NAMES: break; + /* Runloop-related paths */ + case RARCH_PATH_BASENAME: + return runloop_st->runtime_content_path_basename; + case RARCH_PATH_SUBSYSTEM: + return runloop_st->subsystem_path; } return NULL; @@ -737,14 +738,10 @@ const char *path_get(enum rarch_path_type type) return p_rarch->path_content; case RARCH_PATH_DEFAULT_SHADER_PRESET: return p_rarch->path_default_shader_preset; - case RARCH_PATH_BASENAME: - return runloop_st->runtime_content_path_basename; case RARCH_PATH_CORE_OPTIONS: if (!path_is_empty(RARCH_PATH_CORE_OPTIONS)) return p_rarch->path_core_options_file; break; - case RARCH_PATH_SUBSYSTEM: - return runloop_st->subsystem_path; case RARCH_PATH_CONFIG: if (!path_is_empty(RARCH_PATH_CONFIG)) return p_rarch->path_config_file; @@ -758,6 +755,11 @@ const char *path_get(enum rarch_path_type type) case RARCH_PATH_NONE: case RARCH_PATH_NAMES: break; + /* Runloop-related paths */ + case RARCH_PATH_BASENAME: + return runloop_st->runtime_content_path_basename; + case RARCH_PATH_SUBSYSTEM: + return runloop_st->subsystem_path; } return NULL; @@ -833,6 +835,7 @@ bool path_set(enum rarch_path_type type, const char *path) strlcpy(p_rarch->path_content, path, sizeof(p_rarch->path_content)); break; + /* Runloop-related paths */ case RARCH_PATH_BASENAME: runloop_st = runloop_state_get_ptr(); strlcpy(runloop_st->runtime_content_path_basename, path, @@ -924,6 +927,7 @@ void path_clear(enum rarch_path_type type) case RARCH_PATH_NONE: case RARCH_PATH_NAMES: break; + /* Runloop-related paths */ case RARCH_PATH_BASENAME: runloop_st = runloop_state_get_ptr(); *runloop_st->runtime_content_path_basename = '\0'; @@ -1074,6 +1078,7 @@ void dir_clear(enum rarch_dir_type type) break; case RARCH_DIR_NONE: break; + /* Runloop-related paths */ case RARCH_DIR_CURRENT_SAVEFILE: runloop_st = runloop_state_get_ptr(); *runloop_st->savefile_dir = '\0'; @@ -1138,6 +1143,7 @@ void dir_set(enum rarch_dir_type type, const char *path) break; case RARCH_DIR_NONE: break; + /* Runloop-related paths */ case RARCH_DIR_CURRENT_SAVEFILE: runloop_st = runloop_state_get_ptr(); strlcpy(runloop_st->savefile_dir, path, @@ -3357,10 +3363,6 @@ static void global_free(struct rarch_state *p_rarch) retro_main_log_file_deinit(); - runloop_st->flags &= ~( - RUNLOOP_FLAG_IS_SRAM_LOAD_DISABLED - | RUNLOOP_FLAG_IS_SRAM_SAVE_DISABLED - | RUNLOOP_FLAG_USE_SRAM); #ifdef HAVE_PATCH p_rarch->flags &= ~( RARCH_FLAGS_BPS_PREF @@ -3376,13 +3378,13 @@ static void global_free(struct rarch_state *p_rarch) | RUNLOOP_FLAG_REMAPS_GAME_ACTIVE | RUNLOOP_FLAG_REMAPS_CONTENT_DIR_ACTIVE); #endif - - runloop_st->current_core.flags &= ~(RETRO_CORE_FLAG_HAS_SET_INPUT_DESCRIPTORS - | RETRO_CORE_FLAG_HAS_SET_SUBSYSTEMS); - - global = global_get_ptr(); - path_clear_all(); - dir_clear_all(); + runloop_st->flags &= ~( + RUNLOOP_FLAG_IS_SRAM_LOAD_DISABLED + | RUNLOOP_FLAG_IS_SRAM_SAVE_DISABLED + | RUNLOOP_FLAG_USE_SRAM); + runloop_st->current_core.flags &= ~( + RETRO_CORE_FLAG_HAS_SET_INPUT_DESCRIPTORS + | RETRO_CORE_FLAG_HAS_SET_SUBSYSTEMS); if (!string_is_empty(runloop_st->name.remapfile)) free(runloop_st->name.remapfile); @@ -3395,6 +3397,10 @@ static void global_free(struct rarch_state *p_rarch) *runloop_st->name.cheatfile = '\0'; *runloop_st->name.label = '\0'; + global = global_get_ptr(); + path_clear_all(); + dir_clear_all(); + if (global) memset(global, 0, sizeof(struct global)); retroarch_override_setting_free_state(); diff --git a/retroarch.h b/retroarch.h index 76dbe60c60..ed81314869 100644 --- a/retroarch.h +++ b/retroarch.h @@ -146,12 +146,6 @@ unsigned int retroarch_get_rotation(void); void retroarch_init_task_queue(void); -/* Creates folder and core options stub file for subsequent runs */ -bool core_options_create_override(bool game_specific); -bool core_options_remove_override(bool game_specific); -void core_options_reset(void); -void core_options_flush(void); - enum rarch_state_flags { RARCH_FLAGS_HAS_SET_USERNAME = (1 << 0), diff --git a/runloop.h b/runloop.h index 94b4347322..9ad24f1d2e 100644 --- a/runloop.h +++ b/runloop.h @@ -314,6 +314,12 @@ typedef struct runloop runloop_state_t; RETRO_BEGIN_DECLS +/* Creates folder and core options stub file for subsequent runs */ +bool core_options_create_override(bool game_specific); +bool core_options_remove_override(bool game_specific); +void core_options_reset(void); +void core_options_flush(void); + void runloop_path_fill_names(void); /** diff --git a/tasks/task_autodetect.c b/tasks/task_autodetect.c index a2d02197d3..2d4b01d12d 100644 --- a/tasks/task_autodetect.c +++ b/tasks/task_autodetect.c @@ -28,6 +28,7 @@ #include "../configuration.h" #include "../file_path_special.h" #include "../list_special.h" +#include "../runloop.h" #include "../verbosity.h" #include "../input/input_driver.h" #include "../input/input_remapping.h" diff --git a/tasks/task_manual_content_scan.c b/tasks/task_manual_content_scan.c index 0b3cfcec9d..7a58dda2c7 100644 --- a/tasks/task_manual_content_scan.c +++ b/tasks/task_manual_content_scan.c @@ -33,6 +33,7 @@ #include "../msg_hash.h" #include "../playlist.h" #include "../manual_content_scan.h" +#include "../runloop.h" #ifdef RARCH_INTERNAL #ifdef HAVE_MENU diff --git a/tasks/task_screenshot.c b/tasks/task_screenshot.c index 1c2be4d46a..85f548e9e8 100644 --- a/tasks/task_screenshot.c +++ b/tasks/task_screenshot.c @@ -46,6 +46,7 @@ #include "../gfx/gfx_widgets.h" #endif +#include "../core.h" #include "../defaults.h" #include "../command.h" #include "../configuration.h" diff --git a/ui/drivers/qt/qt_dialogs.cpp b/ui/drivers/qt/qt_dialogs.cpp index a641b70cf8..52b29d6f9d 100644 --- a/ui/drivers/qt/qt_dialogs.cpp +++ b/ui/drivers/qt/qt_dialogs.cpp @@ -61,6 +61,7 @@ extern "C" { #include "../../../msg_hash.h" #include "../../../paths.h" #include "../../../retroarch.h" +#include "../../../runloop.h" #ifndef CXX_BUILD } diff --git a/ui/drivers/qt/qt_options.cpp b/ui/drivers/qt/qt_options.cpp index c560cfc1f5..9c3e6e43a5 100644 --- a/ui/drivers/qt/qt_options.cpp +++ b/ui/drivers/qt/qt_options.cpp @@ -16,9 +16,6 @@ extern "C" { #include "../../../input/input_driver.h" #include "../../../input/input_remapping.h" #include "../../../network/netplay/netplay.h" -#include "../../../retroarch.h" - -#include "../../../verbosity.h" #ifndef CXX_BUILD } diff --git a/ui/drivers/ui_qt.h b/ui/drivers/ui_qt.h index aaacd70ad1..6ec47d9726 100644 --- a/ui/drivers/ui_qt.h +++ b/ui/drivers/ui_qt.h @@ -58,7 +58,6 @@ extern "C" { #include #include "../ui_companion_driver.h" -#include "../../retroarch.h" #ifndef CXX_BUILD } diff --git a/ui/drivers/ui_win32.c b/ui/drivers/ui_win32.c index 0b95605d8f..037d2f6f2b 100644 --- a/ui/drivers/ui_win32.c +++ b/ui/drivers/ui_win32.c @@ -52,7 +52,6 @@ #include "../../driver.h" #include "../../paths.h" #include "../../configuration.h" -#include "../../retroarch.h" #include "../../tasks/tasks_internal.h" #include "../../frontend/drivers/platform_win32.h" diff --git a/ui/ui_companion_driver.c b/ui/ui_companion_driver.c index 392d85eb4e..ea9b68a932 100644 --- a/ui/ui_companion_driver.c +++ b/ui/ui_companion_driver.c @@ -22,9 +22,6 @@ #include "../driver.h" #include "../list_special.h" -#include "../retroarch.h" -#include "../runloop.h" -#include "../verbosity.h" #include "ui_companion_driver.h"