mirror of
https://github.com/libretro/RetroArch
synced 2025-03-02 19:13:34 +00:00
Avoid false positives with code analysis tools - rename
variables called 'system'
This commit is contained in:
parent
e961dcf550
commit
d514f1ded3
@ -786,7 +786,7 @@ int cheat_manager_initialize_memory(rarch_setting_t *setting, size_t idx, bool w
|
||||
unsigned i;
|
||||
retro_ctx_memory_info_t meminfo;
|
||||
bool is_search_initialization = (setting != NULL);
|
||||
rarch_system_info_t *system = &runloop_state_get_ptr()->system;
|
||||
rarch_system_info_t *sys_info = &runloop_state_get_ptr()->system;
|
||||
unsigned offset = 0;
|
||||
cheat_manager_t *cheat_st = &cheat_manager_state;
|
||||
#ifdef HAVE_MENU
|
||||
@ -809,14 +809,14 @@ int cheat_manager_initialize_memory(rarch_setting_t *setting, size_t idx, bool w
|
||||
cheat_st->memory_size_list = NULL;
|
||||
}
|
||||
|
||||
if (system && system->mmaps.num_descriptors > 0)
|
||||
if (sys_info && sys_info->mmaps.num_descriptors > 0)
|
||||
{
|
||||
for (i = 0; i < system->mmaps.num_descriptors; i++)
|
||||
for (i = 0; i < sys_info->mmaps.num_descriptors; i++)
|
||||
{
|
||||
if ((system->mmaps.descriptors[i].core.flags
|
||||
& RETRO_MEMDESC_SYSTEM_RAM) != 0 &&
|
||||
system->mmaps.descriptors[i].core.ptr &&
|
||||
system->mmaps.descriptors[i].core.len > 0)
|
||||
if ((sys_info->mmaps.descriptors[i].core.flags
|
||||
& RETRO_MEMDESC_SYSTEM_RAM) != 0
|
||||
&& sys_info->mmaps.descriptors[i].core.ptr
|
||||
&& sys_info->mmaps.descriptors[i].core.len > 0)
|
||||
{
|
||||
cheat_st->num_memory_buffers++;
|
||||
|
||||
@ -839,12 +839,12 @@ int cheat_manager_initialize_memory(rarch_setting_t *setting, size_t idx, bool w
|
||||
cheat_st->memory_size_list = val;
|
||||
}
|
||||
|
||||
cheat_st->memory_buf_list[cheat_st->num_memory_buffers - 1] = (uint8_t*)system->mmaps.descriptors[i].core.ptr;
|
||||
cheat_st->memory_size_list[cheat_st->num_memory_buffers - 1] = (unsigned)system->mmaps.descriptors[i].core.len;
|
||||
cheat_st->total_memory_size += system->mmaps.descriptors[i].core.len;
|
||||
cheat_st->memory_buf_list[cheat_st->num_memory_buffers - 1] = (uint8_t*)sys_info->mmaps.descriptors[i].core.ptr;
|
||||
cheat_st->memory_size_list[cheat_st->num_memory_buffers - 1] = (unsigned)sys_info->mmaps.descriptors[i].core.len;
|
||||
cheat_st->total_memory_size += sys_info->mmaps.descriptors[i].core.len;
|
||||
|
||||
if (!cheat_st->curr_memory_buf)
|
||||
cheat_st->curr_memory_buf = (uint8_t*)system->mmaps.descriptors[i].core.ptr;
|
||||
cheat_st->curr_memory_buf = (uint8_t*)sys_info->mmaps.descriptors[i].core.ptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
38
command.c
38
command.c
@ -879,19 +879,19 @@ static const rarch_memory_descriptor_t* command_memory_get_descriptor(const rarc
|
||||
}
|
||||
|
||||
uint8_t *command_memory_get_pointer(
|
||||
const rarch_system_info_t* system,
|
||||
const rarch_system_info_t* sys_info,
|
||||
unsigned address,
|
||||
unsigned int* max_bytes,
|
||||
int for_write,
|
||||
char *reply_at,
|
||||
size_t len)
|
||||
{
|
||||
if (!system || system->mmaps.num_descriptors == 0)
|
||||
if (!sys_info || sys_info->mmaps.num_descriptors == 0)
|
||||
strlcpy(reply_at, " -1 no memory map defined\n", len);
|
||||
else
|
||||
{
|
||||
size_t offset;
|
||||
const rarch_memory_descriptor_t* desc = command_memory_get_descriptor(&system->mmaps, address, &offset);
|
||||
const rarch_memory_descriptor_t* desc = command_memory_get_descriptor(&sys_info->mmaps, address, &offset);
|
||||
if (!desc)
|
||||
strlcpy(reply_at, " -1 no descriptor for address\n", len);
|
||||
else if (!desc->core.ptr)
|
||||
@ -949,16 +949,16 @@ bool command_get_status(command_t *cmd, const char* arg)
|
||||
bool command_read_memory(command_t *cmd, const char *arg)
|
||||
{
|
||||
unsigned i;
|
||||
char* reply = NULL;
|
||||
char* reply_at = NULL;
|
||||
const uint8_t* data = NULL;
|
||||
unsigned int nbytes = 0;
|
||||
unsigned int alloc_size = 0;
|
||||
unsigned int address = -1;
|
||||
size_t len = 0;
|
||||
unsigned int max_bytes = 0;
|
||||
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
||||
const rarch_system_info_t* system = &runloop_st->system;
|
||||
char* reply = NULL;
|
||||
char* reply_at = NULL;
|
||||
const uint8_t* data = NULL;
|
||||
unsigned int nbytes = 0;
|
||||
unsigned int alloc_size = 0;
|
||||
unsigned int address = -1;
|
||||
size_t len = 0;
|
||||
unsigned int max_bytes = 0;
|
||||
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
||||
const rarch_system_info_t* sys_info= &runloop_st->system;
|
||||
|
||||
if (sscanf(arg, "%x %u", &address, &nbytes) != 2)
|
||||
return false;
|
||||
@ -969,7 +969,7 @@ bool command_read_memory(command_t *cmd, const char *arg)
|
||||
reply_at = reply + snprintf(reply, alloc_size - 1, "READ_CORE_MEMORY %x", address);
|
||||
|
||||
if ((data = command_memory_get_pointer(
|
||||
system, address, &max_bytes,
|
||||
sys_info, address, &max_bytes,
|
||||
0, reply_at, alloc_size - strlen(reply))))
|
||||
{
|
||||
if (nbytes > max_bytes)
|
||||
@ -996,9 +996,9 @@ bool command_write_memory(command_t *cmd, const char *arg)
|
||||
char reply[128] = "";
|
||||
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
||||
const rarch_system_info_t
|
||||
*system = &runloop_st->system;
|
||||
*sys_info = &runloop_st->system;
|
||||
char *reply_at = reply + snprintf(reply, sizeof(reply) - 1, "WRITE_CORE_MEMORY %x", address);
|
||||
uint8_t *data = command_memory_get_pointer(system, address, &max_bytes, 1, reply_at, sizeof(reply) - strlen(reply) - 1);
|
||||
uint8_t *data = command_memory_get_pointer(sys_info, address, &max_bytes, 1, reply_at, sizeof(reply) - strlen(reply) - 1);
|
||||
|
||||
if (data)
|
||||
{
|
||||
@ -1100,11 +1100,11 @@ void command_event_set_mixer_volume(
|
||||
audio_set_float(AUDIO_ACTION_VOLUME_GAIN, new_volume);
|
||||
}
|
||||
|
||||
void command_event_init_controllers(rarch_system_info_t *info,
|
||||
void command_event_init_controllers(rarch_system_info_t *sys_info,
|
||||
settings_t *settings, unsigned num_active_users)
|
||||
{
|
||||
unsigned port;
|
||||
unsigned num_core_ports = info->ports.size;
|
||||
unsigned num_core_ports = sys_info->ports.size;
|
||||
|
||||
for (port = 0; port < num_core_ports; port++)
|
||||
{
|
||||
@ -1133,7 +1133,7 @@ void command_event_init_controllers(rarch_system_info_t *info,
|
||||
}
|
||||
|
||||
desc = libretro_find_controller_description(
|
||||
&info->ports.data[port], device);
|
||||
&sys_info->ports.data[port], device);
|
||||
|
||||
if (desc && !desc->desc)
|
||||
{
|
||||
|
@ -4124,9 +4124,9 @@ bool config_load_override(void *data)
|
||||
char config_directory[PATH_MAX_LENGTH];
|
||||
bool should_append = false;
|
||||
bool show_notification = true;
|
||||
rarch_system_info_t *system = (rarch_system_info_t*)data;
|
||||
const char *core_name = system ?
|
||||
system->info.library_name : NULL;
|
||||
rarch_system_info_t *sys_info = (rarch_system_info_t*)data;
|
||||
const char *core_name = sys_info
|
||||
? sys_info->info.library_name : NULL;
|
||||
const char *rarch_path_basename = path_get(RARCH_PATH_BASENAME);
|
||||
const char *game_name = NULL;
|
||||
settings_t *settings = config_st;
|
||||
@ -4410,8 +4410,8 @@ bool config_load_remap(const char *directory_input_remapping,
|
||||
/* final path for content-dir-specific configuration (prefix+suffix) */
|
||||
char content_path[PATH_MAX_LENGTH];
|
||||
config_file_t *new_conf = NULL;
|
||||
rarch_system_info_t *system = (rarch_system_info_t*)data;
|
||||
const char *core_name = system ? system->info.library_name : NULL;
|
||||
rarch_system_info_t *sys_info = (rarch_system_info_t*)data;
|
||||
const char *core_name = sys_info ? sys_info->info.library_name : NULL;
|
||||
const char *rarch_path_basename = path_get(RARCH_PATH_BASENAME);
|
||||
const char *game_name = NULL;
|
||||
bool has_content = !string_is_empty(rarch_path_basename);
|
||||
@ -5233,8 +5233,8 @@ int8_t config_save_overrides(enum override_type type, void *data, bool remove)
|
||||
int size_settings_size = sizeof(settings->sizes) / sizeof(settings->sizes.placeholder);
|
||||
int array_settings_size = sizeof(settings->arrays) / sizeof(settings->arrays.placeholder);
|
||||
int path_settings_size = sizeof(settings->paths) / sizeof(settings->paths.placeholder);
|
||||
rarch_system_info_t *system = (rarch_system_info_t*)data;
|
||||
const char *core_name = system ? system->info.library_name : NULL;
|
||||
rarch_system_info_t *sys_info = (rarch_system_info_t*)data;
|
||||
const char *core_name = sys_info ? sys_info->info.library_name : NULL;
|
||||
const char *rarch_path_basename = path_get(RARCH_PATH_BASENAME);
|
||||
const char *game_name = NULL;
|
||||
bool has_content = !string_is_empty(rarch_path_basename);
|
||||
|
@ -1140,22 +1140,22 @@ static void menu_action_setting_disp_set_label_menu_disk_index(
|
||||
const char *path,
|
||||
char *s2, size_t len2)
|
||||
{
|
||||
unsigned images = 0;
|
||||
unsigned current = 0;
|
||||
rarch_system_info_t *system = &runloop_state_get_ptr()->system;
|
||||
unsigned images = 0;
|
||||
unsigned current = 0;
|
||||
rarch_system_info_t *sys_info = &runloop_state_get_ptr()->system;
|
||||
|
||||
if (!system)
|
||||
if (!sys_info)
|
||||
return;
|
||||
|
||||
if (!disk_control_enabled(&system->disk_control))
|
||||
if (!disk_control_enabled(&sys_info->disk_control))
|
||||
return;
|
||||
|
||||
*w = 19;
|
||||
*s = '\0';
|
||||
strlcpy(s2, path, len2);
|
||||
|
||||
images = disk_control_get_num_images(&system->disk_control);
|
||||
current = disk_control_get_image_index(&system->disk_control);
|
||||
images = disk_control_get_num_images(&sys_info->disk_control);
|
||||
current = disk_control_get_image_index(&sys_info->disk_control);
|
||||
|
||||
if (current >= images)
|
||||
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_DISK), len);
|
||||
|
@ -144,8 +144,8 @@ static int action_left_input_desc(unsigned type, const char *label,
|
||||
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)
|
||||
rarch_system_info_t *sys_info = &runloop_state_get_ptr()->system;
|
||||
if (!settings || !sys_info)
|
||||
return 0;
|
||||
|
||||
user_idx = (type - MENU_SETTINGS_INPUT_DESC_BEGIN) / (RARCH_FIRST_CUSTOM_BIND + 8);
|
||||
@ -184,7 +184,7 @@ static int action_left_input_desc(unsigned type, const char *label,
|
||||
also skip all the axes until analog remapping is implemented */
|
||||
if (remap_idx != RARCH_UNMAPPED)
|
||||
{
|
||||
if ((string_is_empty(system->input_desc_btn[mapped_port][remap_idx]) && remap_idx < RARCH_CUSTOM_BIND_LIST_END) /*||
|
||||
if ((string_is_empty(sys_info->input_desc_btn[mapped_port][remap_idx]) && remap_idx < RARCH_CUSTOM_BIND_LIST_END) /*||
|
||||
(remap_idx >= RARCH_FIRST_CUSTOM_BIND && remap_idx < RARCH_CUSTOM_BIND_LIST_END)*/)
|
||||
action_left_input_desc(type, label, wraparound);
|
||||
}
|
||||
|
@ -3549,8 +3549,8 @@ static int generic_action_ok_remap_file_operation(const char *path,
|
||||
char content_dir_name[PATH_MAX_LENGTH];
|
||||
char remap_file_path[PATH_MAX_LENGTH];
|
||||
struct menu_state *menu_st = menu_state_get_ptr();
|
||||
rarch_system_info_t *system = &runloop_state_get_ptr()->system;
|
||||
const char *core_name = system ? system->info.library_name : NULL;
|
||||
rarch_system_info_t *sys_info = &runloop_state_get_ptr()->system;
|
||||
const char *core_name = sys_info ? sys_info->info.library_name : NULL;
|
||||
const char *rarch_path_basename = path_get(RARCH_PATH_BASENAME);
|
||||
bool has_content = !string_is_empty(rarch_path_basename);
|
||||
settings_t *settings = config_get_ptr();
|
||||
@ -3658,7 +3658,7 @@ static int generic_action_ok_remap_file_operation(const char *path,
|
||||
/* After removing a remap file, attempt to
|
||||
* load any remaining remap file with the
|
||||
* next highest priority */
|
||||
config_load_remap(directory_input_remapping, system);
|
||||
config_load_remap(directory_input_remapping, sys_info);
|
||||
}
|
||||
else
|
||||
runloop_msg_queue_push(
|
||||
@ -5494,7 +5494,7 @@ static int action_ok_add_to_favorites(const char *path,
|
||||
if (!string_is_empty(content_path))
|
||||
{
|
||||
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
||||
struct retro_system_info *system = &runloop_st->system.info;
|
||||
struct retro_system_info *sysinf = &runloop_st->system.info;
|
||||
struct string_list *str_list = NULL;
|
||||
const char *crc32 = NULL;
|
||||
const char *db_name = NULL;
|
||||
@ -5528,7 +5528,7 @@ static int action_ok_add_to_favorites(const char *path,
|
||||
sizeof(content_label));
|
||||
|
||||
/* > core_path + core_name */
|
||||
if (system)
|
||||
if (sysinf)
|
||||
{
|
||||
if (!string_is_empty(path_get(RARCH_PATH_CORE)))
|
||||
{
|
||||
@ -5547,8 +5547,8 @@ static int action_ok_add_to_favorites(const char *path,
|
||||
|
||||
/* >> core_name (continued) */
|
||||
if ( string_is_empty(core_name) &&
|
||||
!string_is_empty(system->library_name))
|
||||
strlcpy(core_name, system->library_name, sizeof(core_name));
|
||||
!string_is_empty(sysinf->library_name))
|
||||
strlcpy(core_name, sysinf->library_name, sizeof(core_name));
|
||||
}
|
||||
|
||||
if (string_is_empty(core_path) || string_is_empty(core_name))
|
||||
|
@ -176,8 +176,8 @@ static int action_right_input_desc(unsigned type, const char *label,
|
||||
bool wraparound)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
rarch_system_info_t *system = &runloop_state_get_ptr()->system;
|
||||
if (settings && system)
|
||||
rarch_system_info_t *sys_info = &runloop_state_get_ptr()->system;
|
||||
if (settings && sys_info)
|
||||
{
|
||||
unsigned bind_idx;
|
||||
unsigned user_idx = (type - MENU_SETTINGS_INPUT_DESC_BEGIN) / (RARCH_FIRST_CUSTOM_BIND + 8);
|
||||
@ -219,7 +219,7 @@ static int action_right_input_desc(unsigned type, const char *label,
|
||||
also skip all the axes until analog remapping is implemented */
|
||||
if (remap_idx != RARCH_UNMAPPED)
|
||||
{
|
||||
if ((string_is_empty(system->input_desc_btn[mapped_port][remap_idx]) && remap_idx < RARCH_CUSTOM_BIND_LIST_END))
|
||||
if ((string_is_empty(sys_info->input_desc_btn[mapped_port][remap_idx]) && remap_idx < RARCH_CUSTOM_BIND_LIST_END))
|
||||
action_right_input_desc(type, label, wraparound);
|
||||
}
|
||||
}
|
||||
|
@ -9509,9 +9509,8 @@ static int materialui_list_push(void *data, void *userdata,
|
||||
break;
|
||||
case DISPLAYLIST_MAIN_MENU:
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
rarch_system_info_t *system = &runloop_state_get_ptr()->system;
|
||||
uint32_t flags = runloop_get_flags();
|
||||
settings_t *settings = config_get_ptr();
|
||||
uint32_t flags = runloop_get_flags();
|
||||
|
||||
/* If navigation bar is hidden, use default
|
||||
* main menu */
|
||||
@ -9533,7 +9532,8 @@ static int materialui_list_push(void *data, void *userdata,
|
||||
}
|
||||
else
|
||||
{
|
||||
if (system && system->load_no_content)
|
||||
rarch_system_info_t *sys_info = &runloop_state_get_ptr()->system;
|
||||
if (sys_info && sys_info->load_no_content)
|
||||
{
|
||||
MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(
|
||||
info->list,
|
||||
|
@ -9472,7 +9472,6 @@ 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_state_get_ptr()->system;
|
||||
uint32_t flags = runloop_get_flags();
|
||||
|
||||
menu_entries_clear(info->list);
|
||||
@ -9490,7 +9489,8 @@ static int ozone_list_push(void *data, void *userdata,
|
||||
}
|
||||
else
|
||||
{
|
||||
if (system && system->load_no_content)
|
||||
rarch_system_info_t *sys_info = &runloop_state_get_ptr()->system;
|
||||
if (sys_info && sys_info->load_no_content)
|
||||
{
|
||||
MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(
|
||||
info->list,
|
||||
|
@ -206,10 +206,10 @@ static int filebrowser_parse(
|
||||
if (filebrowser_type == FILEBROWSER_SELECT_FILE_SUBSYSTEM)
|
||||
{
|
||||
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
||||
rarch_system_info_t *system = &runloop_st->system;
|
||||
rarch_system_info_t *sys_info = &runloop_st->system;
|
||||
/* Core fully loaded, use the subsystem data */
|
||||
if (system->subsystem.data)
|
||||
subsystem = system->subsystem.data + content_get_subsystem();
|
||||
if (sys_info->subsystem.data)
|
||||
subsystem = sys_info->subsystem.data + content_get_subsystem();
|
||||
/* Core not loaded completely, use the data we peeked on load core */
|
||||
else
|
||||
subsystem = runloop_st->subsystem_data + content_get_subsystem();
|
||||
@ -240,11 +240,11 @@ static int filebrowser_parse(
|
||||
|
||||
if (filebrowser_type == FILEBROWSER_SELECT_FILE_SUBSYSTEM)
|
||||
{
|
||||
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
||||
rarch_system_info_t *system = &runloop_st->system;
|
||||
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
||||
rarch_system_info_t *sys_info = &runloop_st->system;
|
||||
/* Core fully loaded, use the subsystem data */
|
||||
if (system->subsystem.data)
|
||||
subsystem = system->subsystem.data + content_get_subsystem();
|
||||
if (sys_info->subsystem.data)
|
||||
subsystem = sys_info->subsystem.data + content_get_subsystem();
|
||||
/* Core not loaded completely, use the data we peeked on load core */
|
||||
else
|
||||
subsystem = runloop_st->subsystem_data + content_get_subsystem();
|
||||
@ -1585,9 +1585,9 @@ static unsigned menu_displaylist_parse_supported_cores(menu_displaylist_info_t *
|
||||
string_is_empty(exts))
|
||||
#endif
|
||||
{
|
||||
struct retro_system_info *system = &runloop_state_get_ptr()->system.info;
|
||||
struct retro_system_info *sysinf = &runloop_state_get_ptr()->system.info;
|
||||
const char *core_path = core_path_current;
|
||||
const char *core_name = system ? system->library_name : NULL;
|
||||
const char *core_name = sysinf ? sysinf->library_name : NULL;
|
||||
|
||||
if (!string_is_empty(core_path))
|
||||
{
|
||||
@ -2189,7 +2189,7 @@ static int menu_displaylist_parse_playlist(file_list_t *info_list,
|
||||
* 'download thumbnails' option, we must also extend
|
||||
* this to music_history and video_history */
|
||||
if (
|
||||
string_is_equal(path_playlist, "history")
|
||||
string_is_equal(path_playlist, "history")
|
||||
|| string_is_equal(path_playlist, "favorites")
|
||||
|| string_ends_with_size(path_playlist, "_history",
|
||||
strlen(path_playlist), STRLEN_CONST("_history")))
|
||||
@ -3366,7 +3366,7 @@ static int menu_displaylist_parse_load_content_settings(
|
||||
bool quickmenu_show_resume_content = settings->bools.quick_menu_show_resume_content;
|
||||
bool quickmenu_show_restart_content = settings->bools.quick_menu_show_restart_content;
|
||||
bool savestates_enabled = core_info_current_supports_savestate();
|
||||
rarch_system_info_t *system = &runloop_state_get_ptr()->system;
|
||||
rarch_system_info_t *sys_info = &runloop_state_get_ptr()->system;
|
||||
|
||||
if (quickmenu_show_resume_content)
|
||||
if (menu_entries_append(list,
|
||||
@ -3484,7 +3484,7 @@ static int menu_displaylist_parse_load_content_settings(
|
||||
}
|
||||
|
||||
if ((!retroarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL))
|
||||
&& disk_control_enabled(&system->disk_control))
|
||||
&& disk_control_enabled(&sys_info->disk_control))
|
||||
if (menu_entries_append(list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_DISK_OPTIONS),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_DISK_OPTIONS),
|
||||
@ -3922,13 +3922,13 @@ 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_state_get_ptr()->system.info;
|
||||
struct retro_system_info *sysinf = &runloop_state_get_ptr()->system.info;
|
||||
|
||||
core_info_get_current_core(&core_info);
|
||||
|
||||
if ( system
|
||||
&& (!string_is_empty(system->library_name)
|
||||
&& !string_is_equal(system->library_name,
|
||||
if ( sysinf
|
||||
&& (!string_is_empty(sysinf->library_name)
|
||||
&& !string_is_equal(sysinf->library_name,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_CORE))
|
||||
)
|
||||
&& core_info
|
||||
@ -5205,7 +5205,7 @@ static int menu_displaylist_parse_input_device_type_list(
|
||||
const char *val_retropad = NULL;
|
||||
const char *val_retropad_an = NULL;
|
||||
const char *val_unknown = NULL;
|
||||
rarch_system_info_t *system = &runloop_state_get_ptr()->system;
|
||||
rarch_system_info_t *sys_info= &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;
|
||||
@ -5220,7 +5220,7 @@ static int menu_displaylist_parse_input_device_type_list(
|
||||
char device_id[10];
|
||||
device_id[0] = '\0';
|
||||
|
||||
if (!system || !settings || !setting)
|
||||
if (!sys_info || !settings || !setting)
|
||||
return 0;
|
||||
|
||||
port = setting->index_offset;
|
||||
@ -5242,9 +5242,9 @@ static int menu_displaylist_parse_input_device_type_list(
|
||||
desc = NULL;
|
||||
name = NULL;
|
||||
|
||||
if (system && port < system->ports.size)
|
||||
if (sys_info && port < sys_info->ports.size)
|
||||
desc = libretro_find_controller_description(
|
||||
&system->ports.data[port],
|
||||
&sys_info->ports.data[port],
|
||||
devices[i]);
|
||||
if (desc)
|
||||
name = desc->desc;
|
||||
@ -5303,7 +5303,6 @@ static int menu_displaylist_parse_input_select_physical_keyboard_list(
|
||||
{
|
||||
char device_label[128];
|
||||
const char *val_disabled = NULL;
|
||||
rarch_system_info_t *system = &runloop_state_get_ptr()->system;
|
||||
enum msg_hash_enums enum_idx = (enum msg_hash_enums)atoi(info_path);
|
||||
struct menu_state *menu_st = menu_state_get_ptr();
|
||||
rarch_setting_t *setting = menu_setting_find_enum(enum_idx);
|
||||
@ -5318,7 +5317,7 @@ static int menu_displaylist_parse_input_select_physical_keyboard_list(
|
||||
|
||||
device_label[0] = '\0';
|
||||
|
||||
if (!system || !settings || !setting || !is_android_driver)
|
||||
if (!settings || !setting || !is_android_driver)
|
||||
return 0;
|
||||
|
||||
val_disabled = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NONE);
|
||||
@ -5413,10 +5412,10 @@ static int menu_displaylist_parse_input_select_physical_keyboard_list(
|
||||
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_state_get_ptr()->system;
|
||||
size_t menu_index = 0;
|
||||
bool current_input_mapped = false;
|
||||
unsigned count = 0;
|
||||
rarch_system_info_t *sys_info = &runloop_state_get_ptr()->system;
|
||||
size_t menu_index = 0;
|
||||
bool current_input_mapped = false;
|
||||
unsigned user_idx;
|
||||
unsigned btn_idx;
|
||||
unsigned current_remap_idx;
|
||||
@ -5426,7 +5425,7 @@ static int menu_displaylist_parse_input_description_list(
|
||||
|
||||
entry_label[0] = '\0';
|
||||
|
||||
if (!system || !settings)
|
||||
if (!settings)
|
||||
return 0;
|
||||
|
||||
/* Determine user/button indices */
|
||||
@ -5463,7 +5462,7 @@ static int menu_displaylist_parse_input_description_list(
|
||||
const char *input_desc_btn;
|
||||
|
||||
i = (j < RARCH_ANALOG_BIND_LIST_END) ? input_config_bind_order[j] : j;
|
||||
input_desc_btn = system->input_desc_btn[mapped_port][i];
|
||||
input_desc_btn = sys_info->input_desc_btn[mapped_port][i];
|
||||
|
||||
/* Check whether an input is defined for
|
||||
* this button */
|
||||
|
@ -2590,8 +2590,8 @@ static void menu_driver_set_last_shader_path_int(
|
||||
/* If parent directory is empty, then file name
|
||||
* is only valid if 'shader_path' refers to an
|
||||
* existing file in the root of the file system */
|
||||
if (string_is_empty(shader_dir) &&
|
||||
!path_is_valid(shader_path))
|
||||
if ( string_is_empty(shader_dir)
|
||||
&& !path_is_valid(shader_path))
|
||||
return;
|
||||
|
||||
/* Cache file name */
|
||||
@ -6486,9 +6486,9 @@ bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data)
|
||||
if (frontend_driver_has_fork())
|
||||
#endif
|
||||
{
|
||||
rarch_system_info_t *system = &runloop_state_get_ptr()->system;
|
||||
libretro_free_system_info(&system->info);
|
||||
memset(&system->info, 0, sizeof(struct retro_system_info));
|
||||
rarch_system_info_t *sys_info = &runloop_state_get_ptr()->system;
|
||||
libretro_free_system_info(&sys_info->info);
|
||||
memset(&sys_info->info, 0, sizeof(struct retro_system_info));
|
||||
}
|
||||
|
||||
gfx_animation_deinit();
|
||||
|
@ -564,7 +564,7 @@ explore_state_t *menu_explore_build_list(const char *directory_playlist,
|
||||
|
||||
systemname_len = db_ext - db_name;
|
||||
if (systemname_len >= sizeof(newrdb.systemname))
|
||||
systemname_len = sizeof(newrdb.systemname)-1;
|
||||
systemname_len = sizeof(newrdb.systemname)-1;
|
||||
memcpy(newrdb.systemname, db_name, systemname_len);
|
||||
newrdb.systemname[systemname_len] = '\0';
|
||||
|
||||
|
@ -5406,20 +5406,20 @@ 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_state_get_ptr()->system;
|
||||
rarch_system_info_t *sys_info = &runloop_state_get_ptr()->system;
|
||||
|
||||
devices[types++] = RETRO_DEVICE_NONE;
|
||||
devices[types++] = RETRO_DEVICE_JOYPAD;
|
||||
|
||||
if (system)
|
||||
if (sys_info)
|
||||
{
|
||||
/* Only push RETRO_DEVICE_ANALOG as default if we use an
|
||||
* older core which doesn't use SET_CONTROLLER_INFO. */
|
||||
if (!system->ports.size)
|
||||
if (!sys_info->ports.size)
|
||||
devices[types++] = RETRO_DEVICE_ANALOG;
|
||||
|
||||
if (port < system->ports.size)
|
||||
desc = &system->ports.data[port];
|
||||
if (port < sys_info->ports.size)
|
||||
desc = &sys_info->ports.data[port];
|
||||
}
|
||||
|
||||
if (desc)
|
||||
@ -6474,8 +6474,8 @@ 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_state_get_ptr()->system;
|
||||
const char *name = NULL;
|
||||
rarch_system_info_t *sys_info = &runloop_state_get_ptr()->system;
|
||||
|
||||
if (!setting)
|
||||
return;
|
||||
@ -6483,11 +6483,11 @@ static void setting_get_string_representation_uint_libretro_device(
|
||||
index_offset = setting->index_offset;
|
||||
device = input_config_get_device(index_offset);
|
||||
|
||||
if (system)
|
||||
if (sys_info)
|
||||
{
|
||||
if (index_offset < system->ports.size)
|
||||
if (index_offset < sys_info->ports.size)
|
||||
desc = libretro_find_controller_description(
|
||||
&system->ports.data[index_offset],
|
||||
&sys_info->ports.data[index_offset],
|
||||
device);
|
||||
}
|
||||
|
||||
@ -8189,12 +8189,12 @@ static void general_write_handler(rarch_setting_t *setting)
|
||||
case MENU_ENUM_LABEL_VIDEO_ROTATION:
|
||||
{
|
||||
video_viewport_t vp;
|
||||
rarch_system_info_t *system = &runloop_state_get_ptr()->system;
|
||||
rarch_system_info_t *sys_info = &runloop_state_get_ptr()->system;
|
||||
video_driver_state_t *video_st = video_state_get_ptr();
|
||||
struct retro_system_av_info *av_info = &video_st->av_info;
|
||||
video_viewport_t *custom_vp = &settings->video_viewport_custom;
|
||||
|
||||
if (system)
|
||||
if (sys_info)
|
||||
{
|
||||
unsigned int rotation = retroarch_get_rotation();
|
||||
struct retro_game_geometry *geom = (struct retro_game_geometry*)
|
||||
@ -8202,7 +8202,7 @@ static void general_write_handler(rarch_setting_t *setting)
|
||||
|
||||
video_driver_set_rotation(
|
||||
(*setting->value.target.unsigned_integer +
|
||||
system->rotation) % 4);
|
||||
sys_info->rotation) % 4);
|
||||
|
||||
/* Update Custom Aspect Ratio values */
|
||||
video_driver_get_viewport_info(&vp);
|
||||
@ -8907,7 +8907,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_state_get_ptr()->system;
|
||||
rarch_system_info_t *sys_info = &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
|
||||
@ -9166,9 +9166,9 @@ static bool setting_append_list_input_player_options(
|
||||
&& (i != RARCH_TURBO_ENABLE)
|
||||
)
|
||||
{
|
||||
if (system->input_desc_btn[user][i])
|
||||
if (sys_info->input_desc_btn[user][i])
|
||||
strlcpy(label + _len,
|
||||
system->input_desc_btn[user][i],
|
||||
sys_info->input_desc_btn[user][i],
|
||||
sizeof(label) - _len);
|
||||
else
|
||||
{
|
||||
|
12
retroarch.c
12
retroarch.c
@ -2468,8 +2468,8 @@ bool command_event(enum event_command cmd, void *data)
|
||||
break;
|
||||
case CMD_EVENT_LOAD_CORE_PERSIST:
|
||||
{
|
||||
rarch_system_info_t *system_info = &runloop_st->system;
|
||||
struct retro_system_info *system = &system_info->info;
|
||||
rarch_system_info_t *sys_info = &runloop_st->system;
|
||||
struct retro_system_info *system = &sys_info->info;
|
||||
const char *core_path = path_get(RARCH_PATH_CORE);
|
||||
|
||||
#if defined(HAVE_DYNAMIC)
|
||||
@ -2480,7 +2480,7 @@ bool command_event(enum event_command cmd, void *data)
|
||||
if (!libretro_get_system_info(
|
||||
core_path,
|
||||
system,
|
||||
&system_info->load_no_content))
|
||||
&sys_info->load_no_content))
|
||||
return false;
|
||||
|
||||
if (!core_info_load(core_path))
|
||||
@ -4391,9 +4391,9 @@ bool command_event(enum event_command cmd, void *data)
|
||||
}
|
||||
case CMD_EVENT_CONTROLLER_INIT:
|
||||
{
|
||||
rarch_system_info_t *info = &runloop_st->system;
|
||||
if (info)
|
||||
command_event_init_controllers(info, settings,
|
||||
rarch_system_info_t *sys_info = &runloop_st->system;
|
||||
if (sys_info)
|
||||
command_event_init_controllers(sys_info, settings,
|
||||
settings->uints.input_max_users);
|
||||
}
|
||||
break;
|
||||
|
@ -405,8 +405,8 @@ static void runloop_perf_log(void)
|
||||
|
||||
static bool runloop_environ_cb_get_system_info(unsigned cmd, void *data)
|
||||
{
|
||||
runloop_state_t *runloop_st = &runloop_state;
|
||||
rarch_system_info_t *system = &runloop_st->system;
|
||||
runloop_state_t *runloop_st = &runloop_state;
|
||||
rarch_system_info_t *sys_info = &runloop_st->system;
|
||||
|
||||
switch (cmd)
|
||||
{
|
||||
@ -453,11 +453,11 @@ static bool runloop_environ_cb_get_system_info(unsigned cmd, void *data)
|
||||
RARCH_WARN("Subsystems exceed subsystem max, clamping to %d\n", SUBSYSTEM_MAX_SUBSYSTEMS);
|
||||
}
|
||||
|
||||
if (system)
|
||||
if (sys_info)
|
||||
{
|
||||
for (i = 0; i < size && i < SUBSYSTEM_MAX_SUBSYSTEMS; i++)
|
||||
{
|
||||
struct retro_subsystem_info *subsys_info = &runloop_st->subsystem_data[i];
|
||||
struct retro_subsystem_info *subsys_info = &runloop_st->subsystem_data[i];
|
||||
struct retro_subsystem_rom_info *subsys_rom_info = runloop_st->subsystem_data_roms[i];
|
||||
/* Nasty, but have to do it like this since
|
||||
* the pointers are const char *
|
||||
|
@ -947,7 +947,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_state_get_ptr()->system;
|
||||
rarch_system_info_t *sys_info = &runloop_state_get_ptr()->system;
|
||||
#endif
|
||||
enum rarch_content_type first_content_type = RARCH_CONTENT_NONE;
|
||||
|
||||
@ -1019,8 +1019,8 @@ static bool content_file_load(
|
||||
#ifdef __WINRT__
|
||||
/* TODO: When support for the 'actual' VFS is added,
|
||||
* there will need to be some more logic here */
|
||||
if (!system->supports_vfs &&
|
||||
!is_path_accessible_using_standard_io(content_path))
|
||||
if ( !sys_info->supports_vfs
|
||||
&& !is_path_accessible_using_standard_io(content_path))
|
||||
{
|
||||
/* Try to copy ACL to file first. If successful, this should mean that cores using standard I/O can still access them
|
||||
* It would be better to set the ACL to allow full access for all application packages. However,
|
||||
@ -1506,7 +1506,7 @@ void menu_content_environment_get(int *argc, char *argv[],
|
||||
{
|
||||
struct rarch_main_wrap *wrap_args = (struct rarch_main_wrap*)params_data;
|
||||
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
||||
rarch_system_info_t *sys_info = &runloop_st->system;
|
||||
rarch_system_info_t *sys_info = &runloop_st->system;
|
||||
|
||||
if (!wrap_args)
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user