Have only one getter for runloop_state

This commit is contained in:
twinaphex 2021-09-21 19:08:26 +02:00
parent 550d3fa766
commit 83ce4259a0
25 changed files with 82 additions and 95 deletions

View File

@ -776,7 +776,7 @@ int cheat_manager_initialize_memory(rarch_setting_t *setting, size_t idx, bool w
retro_ctx_memory_info_t meminfo;
bool refresh = false;
bool is_search_initialization = (setting != NULL);
rarch_system_info_t *system = runloop_get_system_info();
rarch_system_info_t *system = &runloop_state_get_ptr()->system;
unsigned offset = 0;
cheat_manager_t *cheat_st = &cheat_manager_state;

View File

@ -198,7 +198,7 @@ static int rcheevos_init_memory(rcheevos_locals_t* locals)
unsigned i;
int result;
struct retro_memory_map mmap;
rarch_system_info_t* system = runloop_get_system_info();
rarch_system_info_t* system = &runloop_state_get_ptr()->system;
rarch_memory_map_t* mmaps = &system->mmaps;
struct retro_memory_descriptor *descriptors = (struct retro_memory_descriptor*)malloc(mmaps->num_descriptors * sizeof(*descriptors));
if (!descriptors)
@ -1012,7 +1012,7 @@ void rcheevos_validate_config_settings(void)
*disallowed_settings = NULL;
core_option_manager_t* coreopts = NULL;
struct retro_system_info *system =
&runloop_get_system_info()->info;
&runloop_state_get_ptr()->system.info;
if (!system->library_name || !rcheevos_locals.hardcore_active)
return;

View File

@ -115,7 +115,7 @@ void rcheevos_get_user_agent(rcheevos_locals_t *locals,
char *buffer, size_t len)
{
char* ptr;
struct retro_system_info *system = &runloop_get_system_info()->info;
struct retro_system_info *system = &runloop_state_get_ptr()->system.info;
/* if we haven't calculated the non-changing portion yet, do so now
* [retroarch version + os version] */

View File

@ -451,7 +451,7 @@ static int general_push(menu_displaylist_info_t *info,
case PUSH_ARCHIVE_OPEN:
{
struct retro_system_info *system =
&runloop_get_system_info()->info;
&runloop_state_get_ptr()->system.info;
if (system)
if (!string_is_empty(system->valid_extensions))
strlcpy(newstring2, system->valid_extensions,
@ -468,7 +468,7 @@ static int general_push(menu_displaylist_info_t *info,
else
{
struct retro_system_info *system =
&runloop_get_system_info()->info;
&runloop_state_get_ptr()->system.info;
if (system && !string_is_empty(system->valid_extensions))
{
new_exts = strdup(system->valid_extensions);
@ -515,7 +515,7 @@ static int general_push(menu_displaylist_info_t *info,
char newstring[PATH_MAX_LENGTH];
struct string_list str_list2 = {0};
struct retro_system_info *system =
&runloop_get_system_info()->info;
&runloop_state_get_ptr()->system.info;
newstring[0] = '\0';
attr.i = 0;

View File

@ -722,7 +722,7 @@ static void menu_action_setting_disp_set_label_input_desc(
remap_idx = settings->uints.input_remap_ids[user_idx][btn_idx];
if (remap_idx != RARCH_UNMAPPED)
descriptor = runloop_get_system_info()->input_desc_btn[mapped_port][remap_idx];
descriptor = runloop_state_get_ptr()->system.input_desc_btn[mapped_port][remap_idx];
s[0] = '-';
s[1] = '-';
@ -1006,7 +1006,7 @@ static void menu_action_setting_disp_set_label_menu_disk_index(
{
unsigned images = 0;
unsigned current = 0;
rarch_system_info_t *system = runloop_get_system_info();
rarch_system_info_t *system = &runloop_state_get_ptr()->system;
if (!system)
return;

View File

@ -134,14 +134,13 @@ static int action_left_cheat(unsigned type, const char *label,
static int action_left_input_desc(unsigned type, const char *label,
bool wraparound)
{
rarch_system_info_t *system = runloop_get_system_info();
settings_t *settings = config_get_ptr();
unsigned btn_idx;
unsigned user_idx;
unsigned remap_idx;
unsigned bind_idx;
unsigned mapped_port;
settings_t *settings = config_get_ptr();
rarch_system_info_t *system = &runloop_state_get_ptr()->system;
if (!settings || !system)
return 0;

View File

@ -1048,7 +1048,7 @@ int generic_action_ok_displaylist_push(const char *path,
break;
case ACTION_OK_DL_REMAP_FILE:
{
struct retro_system_info *system = &runloop_get_system_info()->info;
struct retro_system_info *system = &runloop_state_get_ptr()->system.info;
const char *core_name = system ? system->library_name : NULL;
if (!string_is_empty(core_name) && !string_is_empty(settings->paths.directory_input_remapping))
@ -2669,7 +2669,7 @@ static int action_ok_load_cdrom(const char *path,
return -1;
}
system = &runloop_get_system_info()->info;
system = &runloop_state_get_ptr()->system.info;
if (system && !string_is_empty(system->library_name))
{
@ -3352,7 +3352,7 @@ static int generic_action_ok_remap_file_operation(const char *path,
char directory[PATH_MAX_LENGTH];
char file[PATH_MAX_LENGTH];
char content_dir[PATH_MAX_LENGTH];
struct retro_system_info *system = &runloop_get_system_info()->info;
struct retro_system_info *system = &runloop_state_get_ptr()->system.info;
const char *core_name = system ? system->library_name : NULL;
settings_t *settings = config_get_ptr();
const char *path_dir_input_remapping = settings->paths.directory_input_remapping;
@ -5182,7 +5182,7 @@ static int action_ok_add_to_favorites(const char *path,
if (!string_is_empty(content_path))
{
global_t *global = global_get_ptr();
struct retro_system_info *system = &runloop_get_system_info()->info;
struct retro_system_info *system = &runloop_state_get_ptr()->system.info;
struct string_list *str_list = NULL;
const char *crc32 = NULL;
const char *db_name = NULL;
@ -6907,7 +6907,7 @@ static int action_ok_disk_cycle_tray_status(const char *path,
{
bool disk_ejected = false;
bool print_log = false;
rarch_system_info_t *sys_info = runloop_get_system_info();
rarch_system_info_t *sys_info = &runloop_state_get_ptr()->system;
settings_t *settings = config_get_ptr();
#ifdef HAVE_AUDIOMIXER
bool audio_enable_menu = settings->bools.audio_enable_menu;
@ -6959,7 +6959,7 @@ static int action_ok_disk_image_append(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
char image_path[PATH_MAX_LENGTH];
rarch_system_info_t *sys_info = runloop_get_system_info();
rarch_system_info_t *sys_info = &runloop_state_get_ptr()->system;
menu_handle_t *menu = menu_state_get_ptr()->driver_data;
const char *menu_path = NULL;
settings_t *settings = config_get_ptr();

View File

@ -175,22 +175,21 @@ static int action_right_input_desc_kbd(unsigned type, const char *label,
static int action_right_input_desc(unsigned type, const char *label,
bool wraparound)
{
rarch_system_info_t *system = runloop_get_system_info();
settings_t *settings = config_get_ptr();
unsigned btn_idx;
unsigned user_idx;
unsigned remap_idx;
unsigned bind_idx;
unsigned mapped_port;
settings_t *settings = config_get_ptr();
rarch_system_info_t *system = &runloop_state_get_ptr()->system;
if (!settings || !system)
return 0;
user_idx = (type - MENU_SETTINGS_INPUT_DESC_BEGIN) / (RARCH_FIRST_CUSTOM_BIND + 8);
btn_idx = (type - MENU_SETTINGS_INPUT_DESC_BEGIN) - (RARCH_FIRST_CUSTOM_BIND + 8) * user_idx;
mapped_port = settings->uints.input_remap_ports[user_idx];
remap_idx = settings->uints.input_remap_ids[user_idx][btn_idx];
remap_idx = settings->uints.input_remap_ids[user_idx][btn_idx];
for (bind_idx = 0; bind_idx < RARCH_ANALOG_BIND_LIST_END; bind_idx++)
{
if (input_config_bind_order[bind_idx] == remap_idx)

View File

@ -187,13 +187,11 @@ static int action_start_input_desc(
const char *path, const char *label,
unsigned type, size_t idx, size_t entry_idx)
{
settings_t *settings = config_get_ptr();
rarch_system_info_t *system = runloop_get_system_info();
unsigned user_idx;
unsigned btn_idx;
unsigned mapped_port;
(void)label;
settings_t *settings = config_get_ptr();
rarch_system_info_t *system = &runloop_state_get_ptr()->system;
if (!settings || !system)
return 0;

View File

@ -1087,8 +1087,8 @@ static int action_bind_sublabel_subsystem_add(
const char *label, const char *path,
char *s, size_t len)
{
rarch_system_info_t *system = runloop_get_system_info();
const struct retro_subsystem_info *subsystem;
rarch_system_info_t *system = &runloop_state_get_ptr()->system;
/* Core fully loaded, use the subsystem data */
if (system->subsystem.data)
@ -1140,8 +1140,8 @@ static int action_bind_sublabel_disk_image_append(
const char *label, const char *path,
char *s, size_t len)
{
rarch_system_info_t *sys_info = runloop_get_system_info();
enum msg_hash_enums enum_idx = MENU_ENUM_SUBLABEL_DISK_IMAGE_APPEND;
rarch_system_info_t *sys_info = &runloop_state_get_ptr()->system;
/* Check whether disk is currently ejected */
if (sys_info &&

View File

@ -9208,7 +9208,7 @@ static int materialui_list_push(void *data, void *userdata,
case DISPLAYLIST_MAIN_MENU:
{
settings_t *settings = config_get_ptr();
rarch_system_info_t *system = runloop_get_system_info();
rarch_system_info_t *system = &runloop_state_get_ptr()->system;
/* If navigation bar is hidden, use default
* main menu */

View File

@ -7627,7 +7627,7 @@ static int ozone_list_push(void *data, void *userdata,
case DISPLAYLIST_MAIN_MENU:
{
settings_t *settings = config_get_ptr();
rarch_system_info_t *system = runloop_get_system_info();
rarch_system_info_t *system = &runloop_state_get_ptr()->system;
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
if (rarch_ctl(RARCH_CTL_CORE_IS_RUNNING, NULL))

View File

@ -6946,7 +6946,7 @@ static int xmb_list_push(void *data, void *userdata,
break;
case DISPLAYLIST_MAIN_MENU:
{
rarch_system_info_t *system = runloop_get_system_info();
rarch_system_info_t *system = &runloop_state_get_ptr()->system;
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
if (rarch_ctl(RARCH_CTL_CORE_IS_RUNNING, NULL))

View File

@ -188,7 +188,7 @@ static void filebrowser_parse(
{
if (filebrowser_type == FILEBROWSER_SELECT_FILE_SUBSYSTEM)
{
rarch_system_info_t *system = runloop_get_system_info();
rarch_system_info_t *system = &runloop_state_get_ptr()->system;
/* Core fully loaded, use the subsystem data */
if (system->subsystem.data)
subsystem = system->subsystem.data + content_get_subsystem();
@ -218,7 +218,7 @@ static void filebrowser_parse(
if (filebrowser_type == FILEBROWSER_SELECT_FILE_SUBSYSTEM)
{
rarch_system_info_t *system = runloop_get_system_info();
rarch_system_info_t *system = &runloop_state_get_ptr()->system;
/* Core fully loaded, use the subsystem data */
if (system->subsystem.data)
subsystem = system->subsystem.data + content_get_subsystem();
@ -1255,7 +1255,7 @@ static unsigned menu_displaylist_parse_supported_cores(menu_displaylist_info_t *
string_is_empty(exts))
#endif
{
struct retro_system_info *system = &runloop_get_system_info()->info;
struct retro_system_info *system = &runloop_state_get_ptr()->system.info;
const char *core_path = core_path_current;
const char *core_name = system ? system->library_name : NULL;
@ -2865,7 +2865,7 @@ static int menu_displaylist_parse_load_content_settings(
#endif
bool quickmenu_show_resume_content = settings->bools.quick_menu_show_resume_content;
bool quickmenu_show_restart_content = settings->bools.quick_menu_show_restart_content;
rarch_system_info_t *system = runloop_get_system_info();
rarch_system_info_t *system = &runloop_state_get_ptr()->system;
if (quickmenu_show_resume_content)
if (menu_entries_append_enum(list,
@ -3395,7 +3395,7 @@ static unsigned menu_displaylist_parse_information_list(file_list_t *info_list)
{
unsigned count = 0;
core_info_t *core_info = NULL;
struct retro_system_info *system = &runloop_get_system_info()->info;
struct retro_system_info *system = &runloop_state_get_ptr()->system.info;
core_info_get_current_core(&core_info);
@ -4361,7 +4361,7 @@ static unsigned menu_displaylist_parse_disk_options(
file_list_t *list)
{
unsigned count = 0;
rarch_system_info_t *sys_info = runloop_get_system_info();
rarch_system_info_t *sys_info = &runloop_state_get_ptr()->system;
bool disk_ejected = false;
/* Sanity Check */
@ -4431,7 +4431,7 @@ static int menu_displaylist_parse_input_device_type_list(
const struct retro_controller_description *desc = NULL;
const char *name = NULL;
rarch_system_info_t *system = runloop_get_system_info();
rarch_system_info_t *system = &runloop_state_get_ptr()->system;
enum msg_hash_enums enum_idx = (enum msg_hash_enums)atoi(info->path);
rarch_setting_t *setting = menu_setting_find_enum(enum_idx);
@ -4530,7 +4530,7 @@ end:
static int menu_displaylist_parse_input_device_index_list(
menu_displaylist_info_t *info, settings_t *settings)
{
rarch_system_info_t *system = runloop_get_system_info();
rarch_system_info_t *system = &runloop_state_get_ptr()->system;
enum msg_hash_enums enum_idx = (enum msg_hash_enums)atoi(info->path);
rarch_setting_t *setting = menu_setting_find_enum(enum_idx);
size_t menu_index = 0;
@ -4642,7 +4642,7 @@ static int menu_displaylist_parse_input_description_list(
menu_displaylist_info_t *info, settings_t *settings)
{
unsigned count = 0;
rarch_system_info_t *system = runloop_get_system_info();
rarch_system_info_t *system = &runloop_state_get_ptr()->system;
size_t menu_index = 0;
bool current_input_mapped = false;
unsigned user_idx;
@ -5496,8 +5496,7 @@ unsigned menu_displaylist_build_list(
case DISPLAYLIST_SUBSYSTEM_SETTINGS_LIST:
{
const struct retro_subsystem_info* subsystem = subsystem_data;
rarch_system_info_t *sys_info =
runloop_get_system_info();
rarch_system_info_t *sys_info = &runloop_state_get_ptr()->system;
/* Core not loaded completely, use the data we
* peeked on load core */
@ -7155,7 +7154,7 @@ unsigned menu_displaylist_build_list(
case DISPLAYLIST_DROPDOWN_LIST_DISK_INDEX:
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, list);
{
rarch_system_info_t *sys_info = runloop_get_system_info();
rarch_system_info_t *sys_info = &runloop_state_get_ptr()->system;
if (sys_info)
{
@ -9807,8 +9806,7 @@ static unsigned print_buf_lines(file_list_t *list, char *buf,
bool menu_displaylist_has_subsystems(void)
{
const struct retro_subsystem_info* subsystem = subsystem_data;
rarch_system_info_t *sys_info =
runloop_get_system_info();
rarch_system_info_t *sys_info = &runloop_state_get_ptr()->system;
/* Core not loaded completely, use the data we
* peeked on load core */
/* Core fully loaded, use the subsystem data */
@ -12224,7 +12222,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
case DISPLAYLIST_MAIN_MENU:
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
{
rarch_system_info_t *sys_info = runloop_get_system_info();
rarch_system_info_t *sys_info = &runloop_state_get_ptr()->system;
bool show_add_content = false;
#if defined(HAVE_RGUI) || defined(HAVE_MATERIALUI) || defined(HAVE_OZONE) || defined(HAVE_XMB)
const char *menu_ident = menu_driver_ident();

View File

@ -2864,7 +2864,7 @@ bool menu_shader_manager_remove_auto_preset(
const char *dir_video_shader,
const char *dir_menu_config)
{
struct retro_system_info *system = &runloop_get_system_info()->info;
struct retro_system_info *system = &runloop_state_get_ptr()->system.info;
settings_t *settings = config_get_ptr();
return menu_shader_manager_operate_auto_preset(
system, settings->bools.video_shader_preset_save_reference_enable,
@ -2885,7 +2885,7 @@ bool menu_shader_manager_auto_preset_exists(
const char *dir_video_shader,
const char *dir_menu_config)
{
struct retro_system_info *system = &runloop_get_system_info()->info;
struct retro_system_info *system = &runloop_state_get_ptr()->system.info;
settings_t *settings = config_get_ptr();
return menu_shader_manager_operate_auto_preset(
system, settings->bools.video_shader_preset_save_reference_enable,
@ -2916,7 +2916,7 @@ bool menu_shader_manager_save_auto_preset(
const char *dir_menu_config,
bool apply)
{
struct retro_system_info *system = &runloop_get_system_info()->info;
struct retro_system_info *system = &runloop_state_get_ptr()->system.info;
settings_t *settings = config_get_ptr();
return menu_shader_manager_operate_auto_preset(
system, settings->bools.video_shader_preset_save_reference_enable,
@ -5133,7 +5133,7 @@ static const char * msvc_vercode_to_str(const unsigned vercode)
* (shown at the top of the UI). */
int menu_entries_get_core_title(char *s, size_t len)
{
struct retro_system_info *system = &runloop_get_system_info()->info;
struct retro_system_info *system = &runloop_state_get_ptr()->system.info;
const char *core_name =
(system && !string_is_empty(system->library_name))
? system->library_name

View File

@ -5422,7 +5422,7 @@ unsigned libretro_device_get_size(unsigned *devices, size_t devices_size, unsign
{
unsigned types = 0;
const struct retro_controller_info *desc = NULL;
rarch_system_info_t *system = runloop_get_system_info();
rarch_system_info_t *system = &runloop_state_get_ptr()->system;
devices[types++] = RETRO_DEVICE_NONE;
devices[types++] = RETRO_DEVICE_JOYPAD;
@ -6328,7 +6328,7 @@ static void setting_get_string_representation_uint_libretro_device(
unsigned index_offset, device;
const struct retro_controller_description *desc = NULL;
const char *name = NULL;
rarch_system_info_t *system = runloop_get_system_info();
rarch_system_info_t *system = &runloop_state_get_ptr()->system;
if (!setting)
return;
@ -7821,8 +7821,8 @@ static void general_write_handler(rarch_setting_t *setting)
break;
case MENU_ENUM_LABEL_VIDEO_ROTATION:
{
rarch_system_info_t *system = runloop_get_system_info();
video_viewport_t vp;
rarch_system_info_t *system = &runloop_state_get_ptr()->system;
struct retro_system_av_info *av_info = video_viewport_get_system_av_info();
video_viewport_t *custom = video_viewport_get_custom();
struct retro_game_geometry *geom = (struct retro_game_geometry*)
@ -8460,7 +8460,7 @@ static bool setting_append_list_input_player_options(
rarch_setting_group_info_t group_info;
rarch_setting_group_info_t subgroup_info;
settings_t *settings = config_get_ptr();
rarch_system_info_t *system = runloop_get_system_info();
rarch_system_info_t *system = &runloop_state_get_ptr()->system;
const struct retro_keybind* const defaults =
(user == 0) ? retro_keybinds_1 : retro_keybinds_rest;
const char *temp_value = msg_hash_to_str

View File

@ -569,7 +569,7 @@ bool netplay_lan_ad_server(netplay_t *netplay)
if (strstr(interfaces.entries[k].host, sub) &&
!strstr(interfaces.entries[k].host, "127.0.0.1"))
{
struct retro_system_info *info = &runloop_get_system_info()->info;
struct retro_system_info *info = &runloop_state_get_ptr()->system.info;
RARCH_LOG ("[Discovery] Query received on common interface: %s/%s (theirs / ours) \n",
reply_addr, interfaces.entries[k].host);
@ -1077,7 +1077,7 @@ static bool netplay_handshake_info(netplay_t *netplay,
{
struct info_buf_s info_buf;
uint32_t content_crc = 0;
struct retro_system_info *system = &runloop_get_system_info()->info;
struct retro_system_info *system = &runloop_state_get_ptr()->system.info;
memset(&info_buf, 0, sizeof(info_buf));
info_buf.cmd[0] = htonl(NETPLAY_CMD_INFO);
@ -1417,7 +1417,7 @@ static bool netplay_handshake_pre_info(netplay_t *netplay,
ssize_t recvd;
uint32_t content_crc = 0;
const char *dmsg = NULL;
struct retro_system_info *system = &runloop_get_system_info()->info;
struct retro_system_info *system = &runloop_state_get_ptr()->system.info;
RECV(&info_buf, sizeof(info_buf.cmd)) {}

View File

@ -27814,15 +27814,6 @@ void runloop_msg_queue_push(const char *msg,
RUNLOOP_MSG_QUEUE_UNLOCK(runloop_state);
}
void runloop_get_status(bool *is_paused, bool *is_idle,
bool *is_slowmotion, bool *is_perfcnt_enable)
{
*is_paused = runloop_state.paused;
*is_idle = runloop_state.idle;
*is_slowmotion = runloop_state.slowmotion;
*is_perfcnt_enable = runloop_state.perfcnt_enable;
}
#ifdef HAVE_MENU
/* Display the libretro core's framebuffer onscreen. */
static bool menu_display_libretro(
@ -29567,9 +29558,9 @@ end:
return 0;
}
rarch_system_info_t *runloop_get_system_info(void)
runloop_state_t *runloop_state_get_ptr(void)
{
return &runloop_state.system;
return &runloop_state;
}
void retroarch_force_video_driver_fallback(const char *driver)

View File

@ -51,6 +51,8 @@
#include "menu/menu_defines.h"
#endif
#include "runloop.h"
RETRO_BEGIN_DECLS
#define RETRO_ENVIRONMENT_RETROARCH_START_BLOCK 0x800000
@ -421,15 +423,10 @@ void runloop_msg_queue_push(const char *msg,
char *title,
enum message_queue_icon icon, enum message_queue_category category);
void runloop_get_status(bool *is_paused, bool *is_idle, bool *is_slowmotion,
bool *is_perfcnt_enable);
void retroarch_menu_running(void);
void retroarch_menu_running_finished(bool quit);
rarch_system_info_t *runloop_get_system_info(void);
void retroarch_force_video_driver_fallback(const char *driver);
enum retro_language rarch_get_language_from_iso(const char *lang);
@ -2095,6 +2092,8 @@ typedef enum apple_view_type
bool retroarch_get_current_savestate_path(char *path, size_t len);
runloop_state_t *runloop_state_get_ptr(void);
RETRO_END_DECLS
#endif

View File

@ -974,7 +974,7 @@ static bool content_file_load(
retro_ctx_load_content_info_t load_info;
bool used_vfs_fallback_copy = false;
#ifdef __WINRT__
rarch_system_info_t *system = runloop_get_system_info();
rarch_system_info_t *system = &runloop_state_get_ptr()->system;
#endif
enum rarch_content_type first_content_type = RARCH_CONTENT_NONE;
@ -1543,7 +1543,7 @@ static void task_push_to_history_list(
{
char tmp[PATH_MAX_LENGTH];
const char *path_content = path_get(RARCH_PATH_CONTENT);
struct retro_system_info *info = &runloop_get_system_info()->info;
struct retro_system_info *info = &runloop_state_get_ptr()->system.info;
tmp[0] = '\0';
@ -1772,7 +1772,7 @@ bool task_push_start_dummy_core(content_ctx_info_t *content_info)
char *error_string = NULL;
global_t *global = global_get_ptr();
settings_t *settings = config_get_ptr();
rarch_system_info_t *sys_info = runloop_get_system_info();
rarch_system_info_t *sys_info = &runloop_state_get_ptr()->system;
const char *path_dir_system = settings->paths.directory_system;
bool check_firmware_before_loading = settings->bools.check_firmware_before_loading;
@ -1870,7 +1870,7 @@ bool task_push_load_content_from_playlist_from_menu(
char *error_string = NULL;
global_t *global = global_get_ptr();
settings_t *settings = config_get_ptr();
rarch_system_info_t *sys_info = runloop_get_system_info();
rarch_system_info_t *sys_info = &runloop_state_get_ptr()->system;
const char *path_dir_system = settings->paths.directory_system;
#ifndef HAVE_DYNAMIC
bool force_core_reload = settings->bools.always_reload_core_on_run_content;
@ -2262,7 +2262,7 @@ static bool task_load_content_internal(
bool ret = false;
char *error_string = NULL;
global_t *global = global_get_ptr();
rarch_system_info_t *sys_info = runloop_get_system_info();
rarch_system_info_t *sys_info = &runloop_state_get_ptr()->system;
settings_t *settings = config_get_ptr();
bool check_firmware_before_loading = settings->bools.check_firmware_before_loading;
bool set_supports_no_game_enable = settings->bools.set_supports_no_game_enable;
@ -2292,7 +2292,7 @@ static bool task_load_content_internal(
if (sys_info)
{
struct retro_system_info *system = &runloop_get_system_info()->info;
struct retro_system_info *system = &runloop_state_get_ptr()->system.info;
content_ctx.set_supports_no_game_enable = set_supports_no_game_enable;
@ -2572,7 +2572,7 @@ void content_clear_subsystem(void)
void content_set_subsystem(unsigned idx)
{
const struct retro_subsystem_info *subsystem;
rarch_system_info_t *system = runloop_get_system_info();
rarch_system_info_t *system = &runloop_state_get_ptr()->system;
content_state_t *p_content = content_state_get_ptr();
/* Core fully loaded, use the subsystem data */
@ -2601,7 +2601,7 @@ void content_set_subsystem(unsigned idx)
/* Sets the subsystem by name */
bool content_set_subsystem_by_name(const char* subsystem_name)
{
rarch_system_info_t *system = runloop_get_system_info();
rarch_system_info_t *system = &runloop_state_get_ptr()->system;
unsigned i = 0;
/* Core not loaded completely, use the data we peeked on load core */
const struct retro_subsystem_info
@ -2625,7 +2625,7 @@ bool content_set_subsystem_by_name(const char* subsystem_name)
void content_get_subsystem_friendly_name(const char* subsystem_name, char* subsystem_friendly_name, size_t len)
{
rarch_system_info_t *system = runloop_get_system_info();
rarch_system_info_t *system = &runloop_state_get_ptr()->system;
unsigned i = 0;
/* Core not loaded completely, use the data we peeked on load core */
const struct retro_subsystem_info *subsystem = subsystem_data;
@ -2742,7 +2742,7 @@ bool content_init(void)
bool ret = true;
char *error_string = NULL;
global_t *global = global_get_ptr();
rarch_system_info_t *sys_info = runloop_get_system_info();
rarch_system_info_t *sys_info = &runloop_state_get_ptr()->system;
settings_t *settings = config_get_ptr();
bool check_firmware_before_loading = settings->bools.check_firmware_before_loading;
bool set_supports_no_game_enable = settings->bools.set_supports_no_game_enable;
@ -2784,7 +2784,7 @@ bool content_init(void)
if (sys_info)
{
struct retro_system_info *system = &runloop_get_system_info()->info;
struct retro_system_info *system = &runloop_state_get_ptr()->system.info;
content_ctx.set_supports_no_game_enable = set_supports_no_game_enable;

View File

@ -92,7 +92,7 @@ static void netplay_crc_scan_callback(retro_task_t *task,
if (!string_is_empty(state->core_path) && !string_is_empty(state->content_path)
&& !state->contentless && !state->current)
{
struct retro_system_info *system = &runloop_get_system_info()->info;
struct retro_system_info *system = &runloop_state_get_ptr()->system.info;
RARCH_LOG("[Lobby]: Loading core %s with content file %s\n",
state->core_path, state->content_path);
@ -120,7 +120,7 @@ static void netplay_crc_scan_callback(retro_task_t *task,
&& state->contentless)
{
content_ctx_info_t content_info = {0};
struct retro_system_info *system = &runloop_get_system_info()->info;
struct retro_system_info *system = &runloop_state_get_ptr()->system.info;
RARCH_LOG("[Lobby]: Loading contentless core %s\n", state->core_path);

View File

@ -584,13 +584,16 @@ bool take_screenshot(
bool silence, bool has_valid_framebuffer,
bool fullpath, bool use_thread)
{
runloop_state_t *runloop_st = runloop_state_get_ptr();
bool is_paused = false;
bool is_idle = false;
bool is_slowmotion = false;
bool is_perfcnt_enable = false;
bool ret = false;
runloop_get_status(&is_paused, &is_idle, &is_slowmotion, &is_perfcnt_enable);
if (runloop_st)
{
is_paused = runloop_st->paused;
is_idle = runloop_st->idle;
}
/* No way to infer screenshot directory. */
if ( string_is_empty(screenshot_dir)

View File

@ -1122,7 +1122,7 @@ void CoreOptionsDialog::buildLayout()
{
QString contentLabel;
QString label;
rarch_system_info_t *system = runloop_get_system_info();
rarch_system_info_t *system = &runloop_state_get_ptr()->system;
/* TODO/FIXME - why have this check here? system is not used */
if (system)

View File

@ -686,7 +686,7 @@ static ui_application_t ui_application_cocoa = {
{
if ((filenames.count == 1) && [filenames objectAtIndex:0])
{
struct retro_system_info *system = &runloop_get_system_info()->info;
struct retro_system_info *system = &runloop_state_get_ptr()->system.info;
NSString *__core = [filenames objectAtIndex:0];
const char *core_name = system->library_name;
@ -724,7 +724,7 @@ static ui_application_t ui_application_cocoa = {
static void open_core_handler(ui_browser_window_state_t *state, bool result)
{
rarch_system_info_t *info = &runloop_get_system_info();
rarch_system_info_t *info = &runloop_state_get_ptr()->system;
settings_t *settings = config_get_ptr();
bool set_supports_no_game_enable =
settings->bools.set_supports_no_game_enable;
@ -753,7 +753,7 @@ static void open_core_handler(ui_browser_window_state_t *state, bool result)
static void open_document_handler(
ui_browser_window_state_t *state, bool result)
{
struct retro_system_info *system = &runloop_get_system_info()->info;
struct retro_system_info *system = &runloop_state_get_ptr()->system.info;
const char *core_name = system ? system->library_name : NULL;
if (!state || string_is_empty(state->result))

View File

@ -2946,7 +2946,7 @@ void MainWindow::onRunClicked()
bool MainWindow::isContentLessCore()
{
rarch_system_info_t *system = runloop_get_system_info();
rarch_system_info_t *system = &runloop_state_get_ptr()->system;
return system->load_no_content;
}
@ -3671,7 +3671,7 @@ void MainWindow::onStopClicked()
void MainWindow::setCurrentCoreLabel()
{
bool update = false;
struct retro_system_info *system = &runloop_get_system_info()->info;
struct retro_system_info *system = &runloop_state_get_ptr()->system.info;
QString libraryName = system->library_name;
const char *no_core_str = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_CORE);