mirror of
https://github.com/libretro/RetroArch
synced 2025-03-25 16:44:01 +00:00
Move global->name to runloop_st
This commit is contained in:
parent
fe2c3a5310
commit
f671ce4f8c
@ -45,6 +45,7 @@
|
|||||||
#include "msg_hash.h"
|
#include "msg_hash.h"
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
#include "retroarch.h"
|
#include "retroarch.h"
|
||||||
|
#include "runloop.h"
|
||||||
#include "dynamic.h"
|
#include "dynamic.h"
|
||||||
#include "core.h"
|
#include "core.h"
|
||||||
#include "verbosity.h"
|
#include "verbosity.h"
|
||||||
@ -693,17 +694,17 @@ static bool cheat_manager_get_game_specific_filename(
|
|||||||
{
|
{
|
||||||
char s1[PATH_MAX_LENGTH];
|
char s1[PATH_MAX_LENGTH];
|
||||||
struct retro_system_info system_info;
|
struct retro_system_info system_info;
|
||||||
global_t *global = global_get_ptr();
|
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
||||||
const char *core_name = NULL;
|
const char *core_name = NULL;
|
||||||
const char *game_name = NULL;
|
const char *game_name = NULL;
|
||||||
|
|
||||||
s1[0] = '\0';
|
s1[0] = '\0';
|
||||||
|
|
||||||
if (!global || !core_get_system_info(&system_info))
|
if (!core_get_system_info(&system_info))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
core_name = system_info.library_name;
|
core_name = system_info.library_name;
|
||||||
game_name = path_basename_nocompression(global->name.cheatfile);
|
game_name = path_basename_nocompression(runloop_st->name.cheatfile);
|
||||||
|
|
||||||
if (string_is_empty(path_cheat_database) ||
|
if (string_is_empty(path_cheat_database) ||
|
||||||
string_is_empty(core_name) ||
|
string_is_empty(core_name) ||
|
||||||
|
34
command.c
34
command.c
@ -1037,13 +1037,13 @@ bool command_event_resize_windowed_scale(settings_t *settings,
|
|||||||
|
|
||||||
bool command_event_save_auto_state(
|
bool command_event_save_auto_state(
|
||||||
bool savestate_auto_save,
|
bool savestate_auto_save,
|
||||||
global_t *global,
|
|
||||||
const enum rarch_core_type current_core_type)
|
const enum rarch_core_type current_core_type)
|
||||||
{
|
{
|
||||||
|
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
char savestate_name_auto[PATH_MAX_LENGTH];
|
char savestate_name_auto[PATH_MAX_LENGTH];
|
||||||
|
|
||||||
if (!global || !savestate_auto_save)
|
if (!savestate_auto_save)
|
||||||
return false;
|
return false;
|
||||||
if (current_core_type == CORE_TYPE_DUMMY)
|
if (current_core_type == CORE_TYPE_DUMMY)
|
||||||
return false;
|
return false;
|
||||||
@ -1058,7 +1058,8 @@ bool command_event_save_auto_state(
|
|||||||
|
|
||||||
savestate_name_auto[0] = '\0';
|
savestate_name_auto[0] = '\0';
|
||||||
|
|
||||||
fill_pathname_noext(savestate_name_auto, global->name.savestate,
|
fill_pathname_noext(savestate_name_auto,
|
||||||
|
runloop_st->name.savestate,
|
||||||
".auto", sizeof(savestate_name_auto));
|
".auto", sizeof(savestate_name_auto));
|
||||||
|
|
||||||
ret = content_save_state((const char*)savestate_name_auto, true, true);
|
ret = content_save_state((const char*)savestate_name_auto, true, true);
|
||||||
@ -1099,9 +1100,10 @@ void command_event_init_cheats(
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void command_event_load_auto_state(global_t *global)
|
void command_event_load_auto_state(void)
|
||||||
{
|
{
|
||||||
char savestate_name_auto[PATH_MAX_LENGTH];
|
char savestate_name_auto[PATH_MAX_LENGTH];
|
||||||
|
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
#ifdef HAVE_CHEEVOS
|
#ifdef HAVE_CHEEVOS
|
||||||
if (rcheevos_hardcore_active())
|
if (rcheevos_hardcore_active())
|
||||||
@ -1114,7 +1116,7 @@ void command_event_load_auto_state(global_t *global)
|
|||||||
|
|
||||||
savestate_name_auto[0] = '\0';
|
savestate_name_auto[0] = '\0';
|
||||||
|
|
||||||
fill_pathname_noext(savestate_name_auto, global->name.savestate,
|
fill_pathname_noext(savestate_name_auto, runloop_st->name.savestate,
|
||||||
".auto", sizeof(savestate_name_auto));
|
".auto", sizeof(savestate_name_auto));
|
||||||
|
|
||||||
if (!path_is_valid(savestate_name_auto))
|
if (!path_is_valid(savestate_name_auto))
|
||||||
@ -1130,9 +1132,7 @@ void command_event_load_auto_state(global_t *global)
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void command_event_set_savestate_auto_index(
|
void command_event_set_savestate_auto_index(settings_t *settings)
|
||||||
settings_t *settings,
|
|
||||||
const global_t *global)
|
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
char state_dir[PATH_MAX_LENGTH];
|
char state_dir[PATH_MAX_LENGTH];
|
||||||
@ -1140,21 +1140,22 @@ void command_event_set_savestate_auto_index(
|
|||||||
|
|
||||||
struct string_list *dir_list = NULL;
|
struct string_list *dir_list = NULL;
|
||||||
unsigned max_idx = 0;
|
unsigned max_idx = 0;
|
||||||
|
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
||||||
bool savestate_auto_index = settings->bools.savestate_auto_index;
|
bool savestate_auto_index = settings->bools.savestate_auto_index;
|
||||||
bool show_hidden_files = settings->bools.show_hidden_files;
|
bool show_hidden_files = settings->bools.show_hidden_files;
|
||||||
|
|
||||||
if (!global || !savestate_auto_index)
|
if (!savestate_auto_index)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
state_dir[0] = state_base[0] = '\0';
|
state_dir[0] = state_base[0] = '\0';
|
||||||
|
|
||||||
/* Find the file in the same directory as global->savestate_name
|
/* Find the file in the same directory as runloop_st->savestate_name
|
||||||
* with the largest numeral suffix.
|
* with the largest numeral suffix.
|
||||||
*
|
*
|
||||||
* E.g. /foo/path/content.state, will try to find
|
* E.g. /foo/path/content.state, will try to find
|
||||||
* /foo/path/content.state%d, where %d is the largest number available.
|
* /foo/path/content.state%d, where %d is the largest number available.
|
||||||
*/
|
*/
|
||||||
fill_pathname_basedir(state_dir, global->name.savestate,
|
fill_pathname_basedir(state_dir, runloop_st->name.savestate,
|
||||||
sizeof(state_dir));
|
sizeof(state_dir));
|
||||||
|
|
||||||
dir_list = dir_list_new_special(state_dir, DIR_LIST_PLAIN, NULL,
|
dir_list = dir_list_new_special(state_dir, DIR_LIST_PLAIN, NULL,
|
||||||
@ -1163,7 +1164,7 @@ void command_event_set_savestate_auto_index(
|
|||||||
if (!dir_list)
|
if (!dir_list)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
fill_pathname_base(state_base, global->name.savestate,
|
fill_pathname_base(state_base, runloop_st->name.savestate,
|
||||||
sizeof(state_base));
|
sizeof(state_base));
|
||||||
|
|
||||||
for (i = 0; i < dir_list->size; i++)
|
for (i = 0; i < dir_list->size; i++)
|
||||||
@ -1197,7 +1198,6 @@ void command_event_set_savestate_auto_index(
|
|||||||
}
|
}
|
||||||
|
|
||||||
void command_event_set_savestate_garbage_collect(
|
void command_event_set_savestate_garbage_collect(
|
||||||
const global_t *global,
|
|
||||||
unsigned max_to_keep,
|
unsigned max_to_keep,
|
||||||
bool show_hidden_files
|
bool show_hidden_files
|
||||||
)
|
)
|
||||||
@ -1205,6 +1205,7 @@ void command_event_set_savestate_garbage_collect(
|
|||||||
size_t i, cnt = 0;
|
size_t i, cnt = 0;
|
||||||
char state_dir[PATH_MAX_LENGTH];
|
char state_dir[PATH_MAX_LENGTH];
|
||||||
char state_base[PATH_MAX_LENGTH];
|
char state_base[PATH_MAX_LENGTH];
|
||||||
|
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
||||||
|
|
||||||
struct string_list *dir_list = NULL;
|
struct string_list *dir_list = NULL;
|
||||||
unsigned min_idx = UINT_MAX;
|
unsigned min_idx = UINT_MAX;
|
||||||
@ -1215,7 +1216,7 @@ void command_event_set_savestate_garbage_collect(
|
|||||||
|
|
||||||
/* Similar to command_event_set_savestate_auto_index(),
|
/* Similar to command_event_set_savestate_auto_index(),
|
||||||
* this will find the lowest numbered save-state */
|
* this will find the lowest numbered save-state */
|
||||||
fill_pathname_basedir(state_dir, global->name.savestate,
|
fill_pathname_basedir(state_dir, runloop_st->name.savestate,
|
||||||
sizeof(state_dir));
|
sizeof(state_dir));
|
||||||
|
|
||||||
dir_list = dir_list_new_special(state_dir, DIR_LIST_PLAIN, NULL,
|
dir_list = dir_list_new_special(state_dir, DIR_LIST_PLAIN, NULL,
|
||||||
@ -1224,7 +1225,7 @@ void command_event_set_savestate_garbage_collect(
|
|||||||
if (!dir_list)
|
if (!dir_list)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
fill_pathname_base(state_base, global->name.savestate,
|
fill_pathname_base(state_base, runloop_st->name.savestate,
|
||||||
sizeof(state_base));
|
sizeof(state_base));
|
||||||
|
|
||||||
for (i = 0; i < dir_list->size; i++)
|
for (i = 0; i < dir_list->size; i++)
|
||||||
@ -1466,7 +1467,6 @@ bool command_event_main_state(unsigned cmd)
|
|||||||
retro_ctx_size_info_t info;
|
retro_ctx_size_info_t info;
|
||||||
char msg[128];
|
char msg[128];
|
||||||
char state_path[16384];
|
char state_path[16384];
|
||||||
const global_t *global = global_get_ptr();
|
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
bool push_msg = true;
|
bool push_msg = true;
|
||||||
@ -1500,7 +1500,7 @@ bool command_event_main_state(unsigned cmd)
|
|||||||
|
|
||||||
/* Clean up excess savestates if necessary */
|
/* Clean up excess savestates if necessary */
|
||||||
if (savestate_auto_index && (savestate_max_keep > 0))
|
if (savestate_auto_index && (savestate_max_keep > 0))
|
||||||
command_event_set_savestate_garbage_collect(global,
|
command_event_set_savestate_garbage_collect(
|
||||||
settings->uints.savestate_max_keep,
|
settings->uints.savestate_max_keep,
|
||||||
settings->bools.show_hidden_files
|
settings->bools.show_hidden_files
|
||||||
);
|
);
|
||||||
|
@ -339,7 +339,6 @@ bool command_event_resize_windowed_scale(settings_t *settings,
|
|||||||
|
|
||||||
bool command_event_save_auto_state(
|
bool command_event_save_auto_state(
|
||||||
bool savestate_auto_save,
|
bool savestate_auto_save,
|
||||||
global_t *global,
|
|
||||||
const enum rarch_core_type current_core_type);
|
const enum rarch_core_type current_core_type);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -363,14 +362,12 @@ void command_event_set_volume(
|
|||||||
void command_event_init_controllers(rarch_system_info_t *info,
|
void command_event_init_controllers(rarch_system_info_t *info,
|
||||||
settings_t *settings, unsigned num_active_users);
|
settings_t *settings, unsigned num_active_users);
|
||||||
|
|
||||||
void command_event_load_auto_state(global_t *global);
|
void command_event_load_auto_state(void);
|
||||||
|
|
||||||
void command_event_set_savestate_auto_index(
|
void command_event_set_savestate_auto_index(
|
||||||
settings_t *settings,
|
settings_t *settings);
|
||||||
const global_t *global);
|
|
||||||
|
|
||||||
void command_event_set_savestate_garbage_collect(
|
void command_event_set_savestate_garbage_collect(
|
||||||
const global_t *global,
|
|
||||||
unsigned max_to_keep,
|
unsigned max_to_keep,
|
||||||
bool show_hidden_files
|
bool show_hidden_files
|
||||||
);
|
);
|
||||||
|
@ -3211,6 +3211,7 @@ static bool config_load_file(global_t *global,
|
|||||||
char *save = NULL;
|
char *save = NULL;
|
||||||
char *override_username = NULL;
|
char *override_username = NULL;
|
||||||
const char *path_config = NULL;
|
const char *path_config = NULL;
|
||||||
|
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
||||||
int bool_settings_size = sizeof(settings->bools) / sizeof(settings->bools.placeholder);
|
int bool_settings_size = sizeof(settings->bools) / sizeof(settings->bools.placeholder);
|
||||||
int float_settings_size = sizeof(settings->floats) / sizeof(settings->floats.placeholder);
|
int float_settings_size = sizeof(settings->floats) / sizeof(settings->floats.placeholder);
|
||||||
int int_settings_size = sizeof(settings->ints) / sizeof(settings->ints.placeholder);
|
int int_settings_size = sizeof(settings->ints) / sizeof(settings->ints.placeholder);
|
||||||
@ -3665,15 +3666,12 @@ static bool config_load_file(global_t *global,
|
|||||||
{
|
{
|
||||||
dir_set(RARCH_DIR_SAVEFILE, tmp_str);
|
dir_set(RARCH_DIR_SAVEFILE, tmp_str);
|
||||||
|
|
||||||
if (global)
|
strlcpy(runloop_st->name.savefile, tmp_str,
|
||||||
{
|
sizeof(runloop_st->name.savefile));
|
||||||
strlcpy(global->name.savefile, tmp_str,
|
fill_pathname_dir(runloop_st->name.savefile,
|
||||||
sizeof(global->name.savefile));
|
path_get(RARCH_PATH_BASENAME),
|
||||||
fill_pathname_dir(global->name.savefile,
|
FILE_PATH_SRM_EXTENSION,
|
||||||
path_get(RARCH_PATH_BASENAME),
|
sizeof(runloop_st->name.savefile));
|
||||||
FILE_PATH_SRM_EXTENSION,
|
|
||||||
sizeof(global->name.savefile));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
RARCH_WARN("[Config]: 'savefile_directory' is not a directory, ignoring ...\n");
|
RARCH_WARN("[Config]: 'savefile_directory' is not a directory, ignoring ...\n");
|
||||||
@ -3688,15 +3686,12 @@ static bool config_load_file(global_t *global,
|
|||||||
{
|
{
|
||||||
dir_set(RARCH_DIR_SAVESTATE, tmp_str);
|
dir_set(RARCH_DIR_SAVESTATE, tmp_str);
|
||||||
|
|
||||||
if (global)
|
strlcpy(runloop_st->name.savestate, tmp_str,
|
||||||
{
|
sizeof(runloop_st->name.savestate));
|
||||||
strlcpy(global->name.savestate, tmp_str,
|
fill_pathname_dir(runloop_st->name.savestate,
|
||||||
sizeof(global->name.savestate));
|
path_get(RARCH_PATH_BASENAME),
|
||||||
fill_pathname_dir(global->name.savestate,
|
".state",
|
||||||
path_get(RARCH_PATH_BASENAME),
|
sizeof(runloop_st->name.savestate));
|
||||||
".state",
|
|
||||||
sizeof(global->name.savestate));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
RARCH_WARN("[Config]: 'savestate_directory' is not a directory, ignoring ...\n");
|
RARCH_WARN("[Config]: 'savestate_directory' is not a directory, ignoring ...\n");
|
||||||
@ -5025,7 +5020,7 @@ bool input_remapping_load_file(void *data, const char *path)
|
|||||||
unsigned i, j;
|
unsigned i, j;
|
||||||
config_file_t *conf = (config_file_t*)data;
|
config_file_t *conf = (config_file_t*)data;
|
||||||
settings_t *settings = config_st;
|
settings_t *settings = config_st;
|
||||||
global_t *global = global_get_ptr();
|
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
||||||
char key_strings[RARCH_FIRST_CUSTOM_BIND + 8][8] = {
|
char key_strings[RARCH_FIRST_CUSTOM_BIND + 8][8] = {
|
||||||
"b", "y", "select", "start",
|
"b", "y", "select", "start",
|
||||||
"up", "down", "left", "right",
|
"up", "down", "left", "right",
|
||||||
@ -5035,12 +5030,12 @@ bool input_remapping_load_file(void *data, const char *path)
|
|||||||
if (!conf || string_is_empty(path))
|
if (!conf || string_is_empty(path))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!string_is_empty(global->name.remapfile))
|
if (!string_is_empty(runloop_st->name.remapfile))
|
||||||
{
|
{
|
||||||
input_remapping_deinit();
|
input_remapping_deinit();
|
||||||
input_remapping_set_defaults(false);
|
input_remapping_set_defaults(false);
|
||||||
}
|
}
|
||||||
global->name.remapfile = strdup(path);
|
runloop_st->name.remapfile = strdup(path);
|
||||||
|
|
||||||
for (i = 0; i < MAX_USERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
{
|
{
|
||||||
|
@ -5214,11 +5214,10 @@ void input_remapping_update_port_map(void)
|
|||||||
|
|
||||||
void input_remapping_deinit(void)
|
void input_remapping_deinit(void)
|
||||||
{
|
{
|
||||||
global_t *global = global_get_ptr();
|
|
||||||
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
||||||
if (global->name.remapfile)
|
if (runloop_st->name.remapfile)
|
||||||
free(global->name.remapfile);
|
free(runloop_st->name.remapfile);
|
||||||
global->name.remapfile = NULL;
|
runloop_st->name.remapfile = NULL;
|
||||||
runloop_st->remaps_core_active = false;
|
runloop_st->remaps_core_active = false;
|
||||||
runloop_st->remaps_content_dir_active = false;
|
runloop_st->remaps_content_dir_active = false;
|
||||||
runloop_st->remaps_game_active = false;
|
runloop_st->remaps_game_active = false;
|
||||||
|
@ -84,7 +84,7 @@ void input_remapping_restore_global_config(bool clear_cache);
|
|||||||
void input_remapping_update_port_map(void);
|
void input_remapping_update_port_map(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Frees global->name.remapfile and sets these runloop_state flags to false:
|
* Frees runloop_st->name.remapfile and sets these runloop_state flags to false:
|
||||||
* remaps_core_active, remaps_content_dir_active, and remaps_game_active.
|
* remaps_core_active, remaps_content_dir_active, and remaps_game_active.
|
||||||
*/
|
*/
|
||||||
void input_remapping_deinit(void);
|
void input_remapping_deinit(void);
|
||||||
|
@ -142,12 +142,12 @@ static void menu_action_setting_disp_set_label_remap_file_load(
|
|||||||
const char *path,
|
const char *path,
|
||||||
char *s2, size_t len2)
|
char *s2, size_t len2)
|
||||||
{
|
{
|
||||||
global_t *global = global_get_ptr();
|
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
||||||
|
|
||||||
*w = 19;
|
*w = 19;
|
||||||
strlcpy(s2, path, len2);
|
strlcpy(s2, path, len2);
|
||||||
if (global && !string_is_empty(global->name.remapfile))
|
if (!string_is_empty(runloop_st->name.remapfile))
|
||||||
fill_pathname_base(s, global->name.remapfile,
|
fill_pathname_base(s, runloop_st->name.remapfile,
|
||||||
len);
|
len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5179,8 +5179,8 @@ static int action_ok_add_to_favorites(const char *path,
|
|||||||
* > If content path is empty, cannot do anything... */
|
* > If content path is empty, cannot do anything... */
|
||||||
if (!string_is_empty(content_path))
|
if (!string_is_empty(content_path))
|
||||||
{
|
{
|
||||||
global_t *global = global_get_ptr();
|
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
||||||
struct retro_system_info *system = &runloop_state_get_ptr()->system.info;
|
struct retro_system_info *system = &runloop_st->system.info;
|
||||||
struct string_list *str_list = NULL;
|
struct string_list *str_list = NULL;
|
||||||
const char *crc32 = NULL;
|
const char *crc32 = NULL;
|
||||||
const char *db_name = NULL;
|
const char *db_name = NULL;
|
||||||
@ -5203,9 +5203,9 @@ static int action_ok_add_to_favorites(const char *path,
|
|||||||
/* Determine playlist parameters */
|
/* Determine playlist parameters */
|
||||||
|
|
||||||
/* > content_label */
|
/* > content_label */
|
||||||
if (global)
|
if (!string_is_empty(runloop_st->name.label))
|
||||||
if (!string_is_empty(global->name.label))
|
strlcpy(content_label, runloop_st->name.label,
|
||||||
strlcpy(content_label, global->name.label, sizeof(content_label));
|
sizeof(content_label));
|
||||||
|
|
||||||
/* Label is empty - use file name instead */
|
/* Label is empty - use file name instead */
|
||||||
if (string_is_empty(content_label))
|
if (string_is_empty(content_label))
|
||||||
|
@ -380,7 +380,7 @@ typedef struct xmb_handle
|
|||||||
/* Cached texts showing current entry index / current list size */
|
/* Cached texts showing current entry index / current list size */
|
||||||
char entry_index_str[32];
|
char entry_index_str[32];
|
||||||
|
|
||||||
/* These have to be huge, because global->name.savestate
|
/* These have to be huge, because runloop_st->name.savestate
|
||||||
* has a hard-coded size of 8192...
|
* has a hard-coded size of 8192...
|
||||||
* (the extra space here is required to silence compiler
|
* (the extra space here is required to silence compiler
|
||||||
* warnings...) */
|
* warnings...) */
|
||||||
@ -1179,21 +1179,18 @@ static void xmb_update_savestate_thumbnail_path(void *data, unsigned i)
|
|||||||
string_is_equal(entry.label, "savestate"))
|
string_is_equal(entry.label, "savestate"))
|
||||||
{
|
{
|
||||||
char path[8204];
|
char path[8204];
|
||||||
global_t *global = global_get_ptr();
|
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
||||||
|
|
||||||
path[0] = '\0';
|
path[0] = '\0';
|
||||||
|
|
||||||
if (global)
|
if (state_slot > 0)
|
||||||
{
|
snprintf(path, sizeof(path), "%s%d",
|
||||||
if (state_slot > 0)
|
runloop_st->name.savestate, state_slot);
|
||||||
snprintf(path, sizeof(path), "%s%d",
|
else if (state_slot < 0)
|
||||||
global->name.savestate, state_slot);
|
fill_pathname_join_delim(path,
|
||||||
else if (state_slot < 0)
|
runloop_st->name.savestate, "auto", '.', sizeof(path));
|
||||||
fill_pathname_join_delim(path,
|
else
|
||||||
global->name.savestate, "auto", '.', sizeof(path));
|
strlcpy(path, runloop_st->name.savestate, sizeof(path));
|
||||||
else
|
|
||||||
strlcpy(path, global->name.savestate, sizeof(path));
|
|
||||||
}
|
|
||||||
|
|
||||||
strlcat(path, FILE_PATH_PNG_EXTENSION, sizeof(path));
|
strlcat(path, FILE_PATH_PNG_EXTENSION, sizeof(path));
|
||||||
|
|
||||||
|
263
retroarch.c
263
retroarch.c
@ -946,7 +946,6 @@ static void path_set_redirect(struct rarch_state *p_rarch,
|
|||||||
char content_dir_name[PATH_MAX_LENGTH];
|
char content_dir_name[PATH_MAX_LENGTH];
|
||||||
char new_savefile_dir[PATH_MAX_LENGTH];
|
char new_savefile_dir[PATH_MAX_LENGTH];
|
||||||
char new_savestate_dir[PATH_MAX_LENGTH];
|
char new_savestate_dir[PATH_MAX_LENGTH];
|
||||||
global_t *global = global_get_ptr();
|
|
||||||
const char *old_savefile_dir = p_rarch->dir_savefile;
|
const char *old_savefile_dir = p_rarch->dir_savefile;
|
||||||
const char *old_savestate_dir = p_rarch->dir_savestate;
|
const char *old_savestate_dir = p_rarch->dir_savestate;
|
||||||
runloop_state_t *runloop_st = &runloop_state;
|
runloop_state_t *runloop_st = &runloop_state;
|
||||||
@ -1086,60 +1085,60 @@ static void path_set_redirect(struct rarch_state *p_rarch,
|
|||||||
RARCH_LOG("Saving save states in content directory is set. This overrides other save state file directory settings.\n");
|
RARCH_LOG("Saving save states in content directory is set. This overrides other save state file directory settings.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (global && system && !string_is_empty(system->library_name))
|
if (system && !string_is_empty(system->library_name))
|
||||||
{
|
{
|
||||||
bool savefile_is_dir = path_is_directory(new_savefile_dir);
|
bool savefile_is_dir = path_is_directory(new_savefile_dir);
|
||||||
bool savestate_is_dir = path_is_directory(new_savestate_dir);
|
bool savestate_is_dir = path_is_directory(new_savestate_dir);
|
||||||
if (savefile_is_dir)
|
if (savefile_is_dir)
|
||||||
strlcpy(global->name.savefile, new_savefile_dir,
|
strlcpy(runloop_st->name.savefile, new_savefile_dir,
|
||||||
sizeof(global->name.savefile));
|
sizeof(runloop_st->name.savefile));
|
||||||
else
|
else
|
||||||
savefile_is_dir = path_is_directory(global->name.savefile);
|
savefile_is_dir = path_is_directory(runloop_st->name.savefile);
|
||||||
|
|
||||||
if (savestate_is_dir)
|
if (savestate_is_dir)
|
||||||
strlcpy(global->name.savestate, new_savestate_dir,
|
strlcpy(runloop_st->name.savestate, new_savestate_dir,
|
||||||
sizeof(global->name.savestate));
|
sizeof(runloop_st->name.savestate));
|
||||||
else
|
else
|
||||||
savestate_is_dir = path_is_directory(global->name.savestate);
|
savestate_is_dir = path_is_directory(runloop_st->name.savestate);
|
||||||
|
|
||||||
if (savefile_is_dir)
|
if (savefile_is_dir)
|
||||||
{
|
{
|
||||||
fill_pathname_dir(global->name.savefile,
|
fill_pathname_dir(runloop_st->name.savefile,
|
||||||
!string_is_empty(runloop_st->runtime_content_path_basename)
|
!string_is_empty(runloop_st->runtime_content_path_basename)
|
||||||
? runloop_st->runtime_content_path_basename
|
? runloop_st->runtime_content_path_basename
|
||||||
: system->library_name,
|
: system->library_name,
|
||||||
FILE_PATH_SRM_EXTENSION,
|
FILE_PATH_SRM_EXTENSION,
|
||||||
sizeof(global->name.savefile));
|
sizeof(runloop_st->name.savefile));
|
||||||
RARCH_LOG("[Overrides]: %s \"%s\".\n",
|
RARCH_LOG("[Overrides]: %s \"%s\".\n",
|
||||||
msg_hash_to_str(MSG_REDIRECTING_SAVEFILE_TO),
|
msg_hash_to_str(MSG_REDIRECTING_SAVEFILE_TO),
|
||||||
global->name.savefile);
|
runloop_st->name.savefile);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (savestate_is_dir)
|
if (savestate_is_dir)
|
||||||
{
|
{
|
||||||
fill_pathname_dir(global->name.savestate,
|
fill_pathname_dir(runloop_st->name.savestate,
|
||||||
!string_is_empty(runloop_st->runtime_content_path_basename)
|
!string_is_empty(runloop_st->runtime_content_path_basename)
|
||||||
? runloop_st->runtime_content_path_basename
|
? runloop_st->runtime_content_path_basename
|
||||||
: system->library_name,
|
: system->library_name,
|
||||||
FILE_PATH_STATE_EXTENSION,
|
FILE_PATH_STATE_EXTENSION,
|
||||||
sizeof(global->name.savestate));
|
sizeof(runloop_st->name.savestate));
|
||||||
RARCH_LOG("[Overrides]: %s \"%s\".\n",
|
RARCH_LOG("[Overrides]: %s \"%s\".\n",
|
||||||
msg_hash_to_str(MSG_REDIRECTING_SAVESTATE_TO),
|
msg_hash_to_str(MSG_REDIRECTING_SAVESTATE_TO),
|
||||||
global->name.savestate);
|
runloop_st->name.savestate);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_CHEATS
|
#ifdef HAVE_CHEATS
|
||||||
if (path_is_directory(global->name.cheatfile))
|
if (path_is_directory(runloop_st->name.cheatfile))
|
||||||
{
|
{
|
||||||
fill_pathname_dir(global->name.cheatfile,
|
fill_pathname_dir(runloop_st->name.cheatfile,
|
||||||
!string_is_empty(runloop_st->runtime_content_path_basename)
|
!string_is_empty(runloop_st->runtime_content_path_basename)
|
||||||
? runloop_st->runtime_content_path_basename
|
? runloop_st->runtime_content_path_basename
|
||||||
: system->library_name,
|
: system->library_name,
|
||||||
FILE_PATH_CHT_EXTENSION,
|
FILE_PATH_CHT_EXTENSION,
|
||||||
sizeof(global->name.cheatfile));
|
sizeof(runloop_st->name.cheatfile));
|
||||||
RARCH_LOG("[Overrides]: %s \"%s\".\n",
|
RARCH_LOG("[Overrides]: %s \"%s\".\n",
|
||||||
msg_hash_to_str(MSG_REDIRECTING_CHEATFILE_TO),
|
msg_hash_to_str(MSG_REDIRECTING_CHEATFILE_TO),
|
||||||
global->name.cheatfile);
|
runloop_st->name.cheatfile);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -1196,9 +1195,9 @@ void path_set_special(char **argv, unsigned num_content)
|
|||||||
unsigned i;
|
unsigned i;
|
||||||
char str[PATH_MAX_LENGTH];
|
char str[PATH_MAX_LENGTH];
|
||||||
union string_list_elem_attr attr;
|
union string_list_elem_attr attr;
|
||||||
|
bool is_dir = false;
|
||||||
struct string_list subsystem_paths = {0};
|
struct string_list subsystem_paths = {0};
|
||||||
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
||||||
global_t *global = global_get_ptr();
|
|
||||||
const char *savestate_dir = runloop_st->savestate_dir;
|
const char *savestate_dir = runloop_st->savestate_dir;
|
||||||
|
|
||||||
|
|
||||||
@ -1226,26 +1225,23 @@ void path_set_special(char **argv, unsigned num_content)
|
|||||||
|
|
||||||
/* We defer SRAM path updates until we can resolve it.
|
/* We defer SRAM path updates until we can resolve it.
|
||||||
* It is more complicated for special content types. */
|
* It is more complicated for special content types. */
|
||||||
if (global)
|
is_dir = path_is_directory(savestate_dir);
|
||||||
|
|
||||||
|
if (is_dir)
|
||||||
|
strlcpy(runloop_st->name.savestate, savestate_dir,
|
||||||
|
sizeof(runloop_st->name.savestate));
|
||||||
|
else
|
||||||
|
is_dir = path_is_directory(runloop_st->name.savestate);
|
||||||
|
|
||||||
|
if (is_dir)
|
||||||
{
|
{
|
||||||
bool is_dir = path_is_directory(savestate_dir);
|
fill_pathname_dir(runloop_st->name.savestate,
|
||||||
|
str,
|
||||||
if (is_dir)
|
".state",
|
||||||
strlcpy(global->name.savestate, savestate_dir,
|
sizeof(runloop_st->name.savestate));
|
||||||
sizeof(global->name.savestate));
|
RARCH_LOG("%s \"%s\".\n",
|
||||||
else
|
msg_hash_to_str(MSG_REDIRECTING_SAVESTATE_TO),
|
||||||
is_dir = path_is_directory(global->name.savestate);
|
runloop_st->name.savestate);
|
||||||
|
|
||||||
if (is_dir)
|
|
||||||
{
|
|
||||||
fill_pathname_dir(global->name.savestate,
|
|
||||||
str,
|
|
||||||
".state",
|
|
||||||
sizeof(global->name.savestate));
|
|
||||||
RARCH_LOG("%s \"%s\".\n",
|
|
||||||
msg_hash_to_str(MSG_REDIRECTING_SAVESTATE_TO),
|
|
||||||
global->name.savestate);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1253,7 +1249,6 @@ static bool path_init_subsystem(void)
|
|||||||
{
|
{
|
||||||
unsigned i, j;
|
unsigned i, j;
|
||||||
const struct retro_subsystem_info *info = NULL;
|
const struct retro_subsystem_info *info = NULL;
|
||||||
global_t *global = global_get_ptr();
|
|
||||||
runloop_state_t *runloop_st = &runloop_state;
|
runloop_state_t *runloop_st = &runloop_state;
|
||||||
rarch_system_info_t *system = &runloop_st->system;
|
rarch_system_info_t *system = &runloop_st->system;
|
||||||
bool subsystem_path_empty = path_is_empty(RARCH_PATH_SUBSYSTEM);
|
bool subsystem_path_empty = path_is_empty(RARCH_PATH_SUBSYSTEM);
|
||||||
@ -1318,26 +1313,24 @@ static bool path_init_subsystem(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (global)
|
/* Let other relevant paths be inferred
|
||||||
{
|
from the main SRAM location. */
|
||||||
/* Let other relevant paths be inferred from the main SRAM location. */
|
if (!retroarch_override_setting_is_set(
|
||||||
if (!retroarch_override_setting_is_set(
|
RARCH_OVERRIDE_SETTING_SAVE_PATH, NULL))
|
||||||
RARCH_OVERRIDE_SETTING_SAVE_PATH, NULL))
|
fill_pathname_noext(runloop_st->name.savefile,
|
||||||
fill_pathname_noext(global->name.savefile,
|
runloop_st->runtime_content_path_basename,
|
||||||
runloop_st->runtime_content_path_basename,
|
".srm",
|
||||||
".srm",
|
sizeof(runloop_st->name.savefile));
|
||||||
sizeof(global->name.savefile));
|
|
||||||
|
|
||||||
if (path_is_directory(global->name.savefile))
|
if (path_is_directory(runloop_st->name.savefile))
|
||||||
{
|
{
|
||||||
fill_pathname_dir(global->name.savefile,
|
fill_pathname_dir(runloop_st->name.savefile,
|
||||||
runloop_st->runtime_content_path_basename,
|
runloop_st->runtime_content_path_basename,
|
||||||
".srm",
|
".srm",
|
||||||
sizeof(global->name.savefile));
|
sizeof(runloop_st->name.savefile));
|
||||||
RARCH_LOG("%s \"%s\".\n",
|
RARCH_LOG("%s \"%s\".\n",
|
||||||
msg_hash_to_str(MSG_REDIRECTING_SAVEFILE_TO),
|
msg_hash_to_str(MSG_REDIRECTING_SAVEFILE_TO),
|
||||||
global->name.savefile);
|
runloop_st->name.savefile);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -1360,13 +1353,13 @@ static void path_init_savefile(runloop_state_t *runloop_st)
|
|||||||
command_event(CMD_EVENT_AUTOSAVE_INIT, NULL);
|
command_event(CMD_EVENT_AUTOSAVE_INIT, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void path_init_savefile_internal(global_t *global)
|
static void path_init_savefile_internal(runloop_state_t *runloop_st)
|
||||||
{
|
{
|
||||||
path_deinit_savefile();
|
path_deinit_savefile();
|
||||||
path_init_savefile_new();
|
path_init_savefile_new();
|
||||||
|
|
||||||
if (!path_init_subsystem())
|
if (!path_init_subsystem())
|
||||||
path_init_savefile_rtc(global->name.savefile);
|
path_init_savefile_rtc(runloop_st->name.savefile);
|
||||||
}
|
}
|
||||||
|
|
||||||
void runloop_path_fill_names(void)
|
void runloop_path_fill_names(void)
|
||||||
@ -1375,40 +1368,35 @@ void runloop_path_fill_names(void)
|
|||||||
#ifdef HAVE_BSV_MOVIE
|
#ifdef HAVE_BSV_MOVIE
|
||||||
input_driver_state_t *input_st = input_state_get_ptr();
|
input_driver_state_t *input_st = input_state_get_ptr();
|
||||||
#endif
|
#endif
|
||||||
global_t *global = global_get_ptr();
|
|
||||||
|
|
||||||
path_init_savefile_internal(global);
|
path_init_savefile_internal(runloop_st);
|
||||||
|
|
||||||
#ifdef HAVE_BSV_MOVIE
|
#ifdef HAVE_BSV_MOVIE
|
||||||
if (global)
|
strlcpy(input_st->bsv_movie_state.movie_path,
|
||||||
strlcpy(input_st->bsv_movie_state.movie_path,
|
runloop_st->name.savefile,
|
||||||
global->name.savefile,
|
sizeof(input_st->bsv_movie_state.movie_path));
|
||||||
sizeof(input_st->bsv_movie_state.movie_path));
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (string_is_empty(runloop_st->runtime_content_path_basename))
|
if (string_is_empty(runloop_st->runtime_content_path_basename))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (global)
|
if (string_is_empty(runloop_st->name.ups))
|
||||||
{
|
fill_pathname_noext(runloop_st->name.ups,
|
||||||
if (string_is_empty(global->name.ups))
|
runloop_st->runtime_content_path_basename,
|
||||||
fill_pathname_noext(global->name.ups,
|
".ups",
|
||||||
runloop_st->runtime_content_path_basename,
|
sizeof(runloop_st->name.ups));
|
||||||
".ups",
|
|
||||||
sizeof(global->name.ups));
|
|
||||||
|
|
||||||
if (string_is_empty(global->name.bps))
|
if (string_is_empty(runloop_st->name.bps))
|
||||||
fill_pathname_noext(global->name.bps,
|
fill_pathname_noext(runloop_st->name.bps,
|
||||||
runloop_st->runtime_content_path_basename,
|
runloop_st->runtime_content_path_basename,
|
||||||
".bps",
|
".bps",
|
||||||
sizeof(global->name.bps));
|
sizeof(runloop_st->name.bps));
|
||||||
|
|
||||||
if (string_is_empty(global->name.ips))
|
if (string_is_empty(runloop_st->name.ips))
|
||||||
fill_pathname_noext(global->name.ips,
|
fill_pathname_noext(runloop_st->name.ips,
|
||||||
runloop_st->runtime_content_path_basename,
|
runloop_st->runtime_content_path_basename,
|
||||||
".ips",
|
".ips",
|
||||||
sizeof(global->name.ips));
|
sizeof(runloop_st->name.ips));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
char *path_get_ptr(enum rarch_path_type type)
|
char *path_get_ptr(enum rarch_path_type type)
|
||||||
@ -1516,30 +1504,26 @@ size_t path_get_realsize(enum rarch_path_type type)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void runloop_path_set_names(runloop_state_t *runloop_st,
|
static void runloop_path_set_names(runloop_state_t *runloop_st)
|
||||||
global_t *global)
|
|
||||||
{
|
{
|
||||||
if (global)
|
if (!retroarch_override_setting_is_set(
|
||||||
{
|
RARCH_OVERRIDE_SETTING_SAVE_PATH, NULL))
|
||||||
if (!retroarch_override_setting_is_set(
|
fill_pathname_noext(runloop_st->name.savefile,
|
||||||
RARCH_OVERRIDE_SETTING_SAVE_PATH, NULL))
|
runloop_st->runtime_content_path_basename,
|
||||||
fill_pathname_noext(global->name.savefile,
|
".srm", sizeof(runloop_st->name.savefile));
|
||||||
runloop_st->runtime_content_path_basename,
|
|
||||||
".srm", sizeof(global->name.savefile));
|
|
||||||
|
|
||||||
if (!retroarch_override_setting_is_set(
|
if (!retroarch_override_setting_is_set(
|
||||||
RARCH_OVERRIDE_SETTING_STATE_PATH, NULL))
|
RARCH_OVERRIDE_SETTING_STATE_PATH, NULL))
|
||||||
fill_pathname_noext(global->name.savestate,
|
fill_pathname_noext(runloop_st->name.savestate,
|
||||||
runloop_st->runtime_content_path_basename,
|
runloop_st->runtime_content_path_basename,
|
||||||
".state", sizeof(global->name.savestate));
|
".state", sizeof(runloop_st->name.savestate));
|
||||||
|
|
||||||
#ifdef HAVE_CHEATS
|
#ifdef HAVE_CHEATS
|
||||||
if (!string_is_empty(runloop_st->runtime_content_path_basename))
|
if (!string_is_empty(runloop_st->runtime_content_path_basename))
|
||||||
fill_pathname_noext(global->name.cheatfile,
|
fill_pathname_noext(runloop_st->name.cheatfile,
|
||||||
runloop_st->runtime_content_path_basename,
|
runloop_st->runtime_content_path_basename,
|
||||||
".cht", sizeof(global->name.cheatfile));
|
".cht", sizeof(runloop_st->name.cheatfile));
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool path_set(enum rarch_path_type type, const char *path)
|
bool path_set(enum rarch_path_type type, const char *path)
|
||||||
@ -1558,7 +1542,7 @@ bool path_set(enum rarch_path_type type, const char *path)
|
|||||||
break;
|
break;
|
||||||
case RARCH_PATH_NAMES:
|
case RARCH_PATH_NAMES:
|
||||||
runloop_path_set_basename(runloop_st, path);
|
runloop_path_set_basename(runloop_st, path);
|
||||||
runloop_path_set_names(runloop_st, global_get_ptr());
|
runloop_path_set_names(runloop_st);
|
||||||
path_set_redirect(p_rarch, config_get_ptr());
|
path_set_redirect(p_rarch, config_get_ptr());
|
||||||
break;
|
break;
|
||||||
case RARCH_PATH_CORE:
|
case RARCH_PATH_CORE:
|
||||||
@ -1704,15 +1688,15 @@ void ram_state_to_file(void)
|
|||||||
|
|
||||||
bool retroarch_get_current_savestate_path(char *path, size_t len)
|
bool retroarch_get_current_savestate_path(char *path, size_t len)
|
||||||
{
|
{
|
||||||
const global_t *global = global_get_ptr();
|
runloop_state_t *runloop_st = &runloop_state;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
int state_slot = settings ? settings->ints.state_slot : 0;
|
int state_slot = settings ? settings->ints.state_slot : 0;
|
||||||
const char *name_savestate = NULL;
|
const char *name_savestate = NULL;
|
||||||
|
|
||||||
if (!path || !global)
|
if (!path)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
name_savestate = global->name.savestate;
|
name_savestate = runloop_st->name.savestate;
|
||||||
if (string_is_empty(name_savestate))
|
if (string_is_empty(name_savestate))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -3256,7 +3240,6 @@ static bool event_init_content(
|
|||||||
bool cheevos_hardcore_mode_enable =
|
bool cheevos_hardcore_mode_enable =
|
||||||
settings->bools.cheevos_hardcore_mode_enable;
|
settings->bools.cheevos_hardcore_mode_enable;
|
||||||
#endif
|
#endif
|
||||||
global_t *global = global_get_ptr();
|
|
||||||
const enum rarch_core_type current_core_type = runloop_st->current_core_type;
|
const enum rarch_core_type current_core_type = runloop_st->current_core_type;
|
||||||
|
|
||||||
content_get_status(&contentless, &is_inited);
|
content_get_status(&contentless, &is_inited);
|
||||||
@ -3276,14 +3259,14 @@ static bool event_init_content(
|
|||||||
* interface, otherwise fill all content-related
|
* interface, otherwise fill all content-related
|
||||||
* paths */
|
* paths */
|
||||||
if (contentless)
|
if (contentless)
|
||||||
path_init_savefile_internal(global);
|
path_init_savefile_internal(runloop_st);
|
||||||
else
|
else
|
||||||
runloop_path_fill_names();
|
runloop_path_fill_names();
|
||||||
|
|
||||||
if (!content_init())
|
if (!content_init())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
command_event_set_savestate_auto_index(settings, global);
|
command_event_set_savestate_auto_index(settings);
|
||||||
|
|
||||||
if (!event_load_save_files(runloop_st->is_sram_load_disabled))
|
if (!event_load_save_files(runloop_st->is_sram_load_disabled))
|
||||||
RARCH_LOG("[SRAM]: %s\n",
|
RARCH_LOG("[SRAM]: %s\n",
|
||||||
@ -3299,8 +3282,8 @@ static bool event_init_content(
|
|||||||
#ifdef HAVE_CHEEVOS
|
#ifdef HAVE_CHEEVOS
|
||||||
if (!cheevos_enable || !cheevos_hardcore_mode_enable)
|
if (!cheevos_enable || !cheevos_hardcore_mode_enable)
|
||||||
#endif
|
#endif
|
||||||
if (global && settings->bools.savestate_auto_load)
|
if (settings->bools.savestate_auto_load)
|
||||||
command_event_load_auto_state(global);
|
command_event_load_auto_state();
|
||||||
|
|
||||||
#ifdef HAVE_BSV_MOVIE
|
#ifdef HAVE_BSV_MOVIE
|
||||||
bsv_movie_deinit(input_st);
|
bsv_movie_deinit(input_st);
|
||||||
@ -4160,8 +4143,9 @@ bool command_event(enum event_command cmd, void *data)
|
|||||||
settings->bools.content_runtime_log_aggregate,
|
settings->bools.content_runtime_log_aggregate,
|
||||||
settings->paths.directory_runtime_log,
|
settings->paths.directory_runtime_log,
|
||||||
settings->paths.directory_playlist);
|
settings->paths.directory_playlist);
|
||||||
command_event_save_auto_state(settings->bools.savestate_auto_save,
|
command_event_save_auto_state(
|
||||||
global, runloop_st->current_core_type);
|
settings->bools.savestate_auto_save,
|
||||||
|
runloop_st->current_core_type);
|
||||||
|
|
||||||
#ifdef HAVE_CONFIGFILE
|
#ifdef HAVE_CONFIGFILE
|
||||||
if (runloop_st->overrides_active)
|
if (runloop_st->overrides_active)
|
||||||
@ -5859,12 +5843,19 @@ static void global_free(struct rarch_state *p_rarch)
|
|||||||
path_clear_all();
|
path_clear_all();
|
||||||
dir_clear_all();
|
dir_clear_all();
|
||||||
|
|
||||||
|
if (!string_is_empty(runloop_st->name.remapfile))
|
||||||
|
free(runloop_st->name.remapfile);
|
||||||
|
runloop_st->name.remapfile = NULL;
|
||||||
|
*runloop_st->name.ups = '\0';
|
||||||
|
*runloop_st->name.bps = '\0';
|
||||||
|
*runloop_st->name.ips = '\0';
|
||||||
|
*runloop_st->name.savefile = '\0';
|
||||||
|
*runloop_st->name.savestate = '\0';
|
||||||
|
*runloop_st->name.cheatfile = '\0';
|
||||||
|
*runloop_st->name.label = '\0';
|
||||||
|
|
||||||
if (global)
|
if (global)
|
||||||
{
|
|
||||||
if (!string_is_empty(global->name.remapfile))
|
|
||||||
free(global->name.remapfile);
|
|
||||||
memset(global, 0, sizeof(struct global));
|
memset(global, 0, sizeof(struct global));
|
||||||
}
|
|
||||||
retroarch_override_setting_free_state();
|
retroarch_override_setting_free_state();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -12747,9 +12738,9 @@ static bool retroarch_parse_input_and_config(
|
|||||||
p_rarch->rarch_ups_pref = false;
|
p_rarch->rarch_ups_pref = false;
|
||||||
p_rarch->rarch_ips_pref = false;
|
p_rarch->rarch_ips_pref = false;
|
||||||
p_rarch->rarch_bps_pref = false;
|
p_rarch->rarch_bps_pref = false;
|
||||||
*global->name.ups = '\0';
|
*runloop_st->name.ups = '\0';
|
||||||
*global->name.bps = '\0';
|
*runloop_st->name.bps = '\0';
|
||||||
*global->name.ips = '\0';
|
*runloop_st->name.ips = '\0';
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_CONFIGFILE
|
#ifdef HAVE_CONFIGFILE
|
||||||
runloop_st->overrides_active = false;
|
runloop_st->overrides_active = false;
|
||||||
@ -12809,15 +12800,15 @@ static bool retroarch_parse_input_and_config(
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
case 's':
|
case 's':
|
||||||
strlcpy(global->name.savefile, optarg,
|
strlcpy(runloop_st->name.savefile, optarg,
|
||||||
sizeof(global->name.savefile));
|
sizeof(runloop_st->name.savefile));
|
||||||
retroarch_override_setting_set(
|
retroarch_override_setting_set(
|
||||||
RARCH_OVERRIDE_SETTING_SAVE_PATH, NULL);
|
RARCH_OVERRIDE_SETTING_SAVE_PATH, NULL);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'S':
|
case 'S':
|
||||||
strlcpy(global->name.savestate, optarg,
|
strlcpy(runloop_st->name.savestate, optarg,
|
||||||
sizeof(global->name.savestate));
|
sizeof(runloop_st->name.savestate));
|
||||||
retroarch_override_setting_set(
|
retroarch_override_setting_set(
|
||||||
RARCH_OVERRIDE_SETTING_STATE_PATH, NULL);
|
RARCH_OVERRIDE_SETTING_STATE_PATH, NULL);
|
||||||
break;
|
break;
|
||||||
@ -13135,8 +13126,8 @@ static bool retroarch_parse_input_and_config(
|
|||||||
|
|
||||||
case RA_OPT_BPS:
|
case RA_OPT_BPS:
|
||||||
#ifdef HAVE_PATCH
|
#ifdef HAVE_PATCH
|
||||||
strlcpy(global->name.bps, optarg,
|
strlcpy(runloop_st->name.bps, optarg,
|
||||||
sizeof(global->name.bps));
|
sizeof(runloop_st->name.bps));
|
||||||
p_rarch->rarch_bps_pref = true;
|
p_rarch->rarch_bps_pref = true;
|
||||||
retroarch_override_setting_set(RARCH_OVERRIDE_SETTING_BPS_PREF, NULL);
|
retroarch_override_setting_set(RARCH_OVERRIDE_SETTING_BPS_PREF, NULL);
|
||||||
#endif
|
#endif
|
||||||
@ -13144,8 +13135,8 @@ static bool retroarch_parse_input_and_config(
|
|||||||
|
|
||||||
case 'U':
|
case 'U':
|
||||||
#ifdef HAVE_PATCH
|
#ifdef HAVE_PATCH
|
||||||
strlcpy(global->name.ups, optarg,
|
strlcpy(runloop_st->name.ups, optarg,
|
||||||
sizeof(global->name.ups));
|
sizeof(runloop_st->name.ups));
|
||||||
p_rarch->rarch_ups_pref = true;
|
p_rarch->rarch_ups_pref = true;
|
||||||
retroarch_override_setting_set(RARCH_OVERRIDE_SETTING_UPS_PREF, NULL);
|
retroarch_override_setting_set(RARCH_OVERRIDE_SETTING_UPS_PREF, NULL);
|
||||||
#endif
|
#endif
|
||||||
@ -13153,8 +13144,8 @@ static bool retroarch_parse_input_and_config(
|
|||||||
|
|
||||||
case RA_OPT_IPS:
|
case RA_OPT_IPS:
|
||||||
#ifdef HAVE_PATCH
|
#ifdef HAVE_PATCH
|
||||||
strlcpy(global->name.ips, optarg,
|
strlcpy(runloop_st->name.ips, optarg,
|
||||||
sizeof(global->name.ips));
|
sizeof(runloop_st->name.ips));
|
||||||
p_rarch->rarch_ips_pref = true;
|
p_rarch->rarch_ips_pref = true;
|
||||||
retroarch_override_setting_set(RARCH_OVERRIDE_SETTING_IPS_PREF, NULL);
|
retroarch_override_setting_set(RARCH_OVERRIDE_SETTING_IPS_PREF, NULL);
|
||||||
#endif
|
#endif
|
||||||
@ -13317,12 +13308,12 @@ static bool retroarch_parse_input_and_config(
|
|||||||
|
|
||||||
/* Copy SRM/state dirs used, so they can be reused on reentrancy. */
|
/* Copy SRM/state dirs used, so they can be reused on reentrancy. */
|
||||||
if (retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_SAVE_PATH, NULL) &&
|
if (retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_SAVE_PATH, NULL) &&
|
||||||
path_is_directory(global->name.savefile))
|
path_is_directory(runloop_st->name.savefile))
|
||||||
dir_set(RARCH_DIR_SAVEFILE, global->name.savefile);
|
dir_set(RARCH_DIR_SAVEFILE, runloop_st->name.savefile);
|
||||||
|
|
||||||
if (retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_STATE_PATH, NULL) &&
|
if (retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_STATE_PATH, NULL) &&
|
||||||
path_is_directory(global->name.savestate))
|
path_is_directory(runloop_st->name.savestate))
|
||||||
dir_set(RARCH_DIR_SAVESTATE, global->name.savestate);
|
dir_set(RARCH_DIR_SAVESTATE, runloop_st->name.savestate);
|
||||||
|
|
||||||
return verbosity_enabled;
|
return verbosity_enabled;
|
||||||
}
|
}
|
||||||
@ -14251,7 +14242,6 @@ bool retroarch_main_quit(void)
|
|||||||
runloop_state_t *runloop_st = &runloop_state;
|
runloop_state_t *runloop_st = &runloop_state;
|
||||||
video_driver_state_t*video_st = video_state_get_ptr();
|
video_driver_state_t*video_st = video_state_get_ptr();
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
global_t *global = global_get_ptr();
|
|
||||||
#ifdef HAVE_DISCORD
|
#ifdef HAVE_DISCORD
|
||||||
discord_state_t *discord_st = discord_state_get_ptr();
|
discord_state_t *discord_st = discord_state_get_ptr();
|
||||||
if (discord_st->inited)
|
if (discord_st->inited)
|
||||||
@ -14281,7 +14271,6 @@ bool retroarch_main_quit(void)
|
|||||||
{
|
{
|
||||||
command_event_save_auto_state(
|
command_event_save_auto_state(
|
||||||
settings->bools.savestate_auto_save,
|
settings->bools.savestate_auto_save,
|
||||||
global,
|
|
||||||
runloop_st->current_core_type);
|
runloop_st->current_core_type);
|
||||||
|
|
||||||
/* If any save states are in progress, wait
|
/* If any save states are in progress, wait
|
||||||
|
@ -332,18 +332,6 @@ typedef struct rarch_resolution
|
|||||||
|
|
||||||
typedef struct global
|
typedef struct global
|
||||||
{
|
{
|
||||||
struct
|
|
||||||
{
|
|
||||||
char *remapfile;
|
|
||||||
char savefile[8192];
|
|
||||||
char savestate[8192];
|
|
||||||
char cheatfile[8192];
|
|
||||||
char ups[8192];
|
|
||||||
char bps[8192];
|
|
||||||
char ips[8192];
|
|
||||||
char label[8192];
|
|
||||||
} name;
|
|
||||||
|
|
||||||
/* Recording. */
|
/* Recording. */
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
|
12
runloop.h
12
runloop.h
@ -242,6 +242,18 @@ struct runloop
|
|||||||
char savefile_dir[PATH_MAX_LENGTH];
|
char savefile_dir[PATH_MAX_LENGTH];
|
||||||
char savestate_dir[PATH_MAX_LENGTH];
|
char savestate_dir[PATH_MAX_LENGTH];
|
||||||
|
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
char *remapfile;
|
||||||
|
char savefile[8192];
|
||||||
|
char savestate[8192];
|
||||||
|
char cheatfile[8192];
|
||||||
|
char ups[8192];
|
||||||
|
char bps[8192];
|
||||||
|
char ips[8192];
|
||||||
|
char label[8192];
|
||||||
|
} name;
|
||||||
|
|
||||||
bool is_inited;
|
bool is_inited;
|
||||||
bool missing_bios;
|
bool missing_bios;
|
||||||
bool force_nonblock;
|
bool force_nonblock;
|
||||||
|
@ -1535,6 +1535,7 @@ static void task_push_to_history_list(
|
|||||||
{
|
{
|
||||||
bool contentless = false;
|
bool contentless = false;
|
||||||
bool is_inited = false;
|
bool is_inited = false;
|
||||||
|
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
||||||
|
|
||||||
content_get_status(&contentless, &is_inited);
|
content_get_status(&contentless, &is_inited);
|
||||||
|
|
||||||
@ -1570,7 +1571,6 @@ static void task_push_to_history_list(
|
|||||||
const char *db_name = NULL;
|
const char *db_name = NULL;
|
||||||
playlist_t *playlist_hist = g_defaults.content_history;
|
playlist_t *playlist_hist = g_defaults.content_history;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
global_t *global = global_get_ptr();
|
|
||||||
|
|
||||||
switch (path_is_media_type(tmp))
|
switch (path_is_media_type(tmp))
|
||||||
{
|
{
|
||||||
@ -1641,8 +1641,8 @@ static void task_push_to_history_list(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (global && !string_is_empty(global->name.label))
|
if (!string_is_empty(runloop_st->name.label))
|
||||||
label = global->name.label;
|
label = runloop_st->name.label;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
settings && settings->bools.history_list_enable
|
settings && settings->bools.history_list_enable
|
||||||
@ -1770,7 +1770,6 @@ bool task_push_start_dummy_core(content_ctx_info_t *content_info)
|
|||||||
content_state_t *p_content = content_state_get_ptr();
|
content_state_t *p_content = content_state_get_ptr();
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
char *error_string = NULL;
|
char *error_string = NULL;
|
||||||
global_t *global = global_get_ptr();
|
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
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;
|
||||||
@ -1801,15 +1800,12 @@ bool task_push_start_dummy_core(content_ctx_info_t *content_info)
|
|||||||
content_ctx.subsystem.data = NULL;
|
content_ctx.subsystem.data = NULL;
|
||||||
content_ctx.subsystem.size = 0;
|
content_ctx.subsystem.size = 0;
|
||||||
|
|
||||||
if (global)
|
if (!string_is_empty(runloop_st->name.ips))
|
||||||
{
|
content_ctx.name_ips = strdup(runloop_st->name.ips);
|
||||||
if (!string_is_empty(global->name.ips))
|
if (!string_is_empty(runloop_st->name.bps))
|
||||||
content_ctx.name_ips = strdup(global->name.ips);
|
content_ctx.name_bps = strdup(runloop_st->name.bps);
|
||||||
if (!string_is_empty(global->name.bps))
|
if (!string_is_empty(runloop_st->name.ups))
|
||||||
content_ctx.name_bps = strdup(global->name.bps);
|
content_ctx.name_ups = strdup(runloop_st->name.ups);
|
||||||
if (!string_is_empty(global->name.ups))
|
|
||||||
content_ctx.name_ups = strdup(global->name.ups);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!string_is_empty(path_dir_system))
|
if (!string_is_empty(path_dir_system))
|
||||||
content_ctx.directory_system = strdup(path_dir_system);
|
content_ctx.directory_system = strdup(path_dir_system);
|
||||||
@ -1868,7 +1864,6 @@ bool task_push_load_content_from_playlist_from_menu(
|
|||||||
content_state_t *p_content = content_state_get_ptr();
|
content_state_t *p_content = content_state_get_ptr();
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
char *error_string = NULL;
|
char *error_string = NULL;
|
||||||
global_t *global = global_get_ptr();
|
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
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;
|
||||||
@ -1898,19 +1893,16 @@ bool task_push_load_content_from_playlist_from_menu(
|
|||||||
content_ctx.subsystem.data = NULL;
|
content_ctx.subsystem.data = NULL;
|
||||||
content_ctx.subsystem.size = 0;
|
content_ctx.subsystem.size = 0;
|
||||||
|
|
||||||
if (global)
|
if (!string_is_empty(runloop_st->name.ips))
|
||||||
{
|
content_ctx.name_ips = strdup(runloop_st->name.ips);
|
||||||
if (!string_is_empty(global->name.ips))
|
if (!string_is_empty(runloop_st->name.bps))
|
||||||
content_ctx.name_ips = strdup(global->name.ips);
|
content_ctx.name_bps = strdup(runloop_st->name.bps);
|
||||||
if (!string_is_empty(global->name.bps))
|
if (!string_is_empty(runloop_st->name.ups))
|
||||||
content_ctx.name_bps = strdup(global->name.bps);
|
content_ctx.name_ups = strdup(runloop_st->name.ups);
|
||||||
if (!string_is_empty(global->name.ups))
|
if (label)
|
||||||
content_ctx.name_ups = strdup(global->name.ups);
|
strlcpy(runloop_st->name.label, label, sizeof(runloop_st->name.label));
|
||||||
if (label)
|
else
|
||||||
strlcpy(global->name.label, label, sizeof(global->name.label));
|
runloop_st->name.label[0] = '\0';
|
||||||
else
|
|
||||||
global->name.label[0] = '\0';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!string_is_empty(path_dir_system))
|
if (!string_is_empty(path_dir_system))
|
||||||
content_ctx.directory_system = strdup(path_dir_system);
|
content_ctx.directory_system = strdup(path_dir_system);
|
||||||
@ -2011,7 +2003,6 @@ bool task_push_start_current_core(content_ctx_info_t *content_info)
|
|||||||
content_state_t *p_content = content_state_get_ptr();
|
content_state_t *p_content = content_state_get_ptr();
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
char *error_string = NULL;
|
char *error_string = NULL;
|
||||||
global_t *global = global_get_ptr();
|
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
||||||
const char *path_dir_system = settings->paths.directory_system;
|
const char *path_dir_system = settings->paths.directory_system;
|
||||||
@ -2041,15 +2032,12 @@ bool task_push_start_current_core(content_ctx_info_t *content_info)
|
|||||||
content_ctx.subsystem.data = NULL;
|
content_ctx.subsystem.data = NULL;
|
||||||
content_ctx.subsystem.size = 0;
|
content_ctx.subsystem.size = 0;
|
||||||
|
|
||||||
if (global)
|
if (!string_is_empty(runloop_st->name.ips))
|
||||||
{
|
content_ctx.name_ips = strdup(runloop_st->name.ips);
|
||||||
if (!string_is_empty(global->name.ips))
|
if (!string_is_empty(runloop_st->name.bps))
|
||||||
content_ctx.name_ips = strdup(global->name.ips);
|
content_ctx.name_bps = strdup(runloop_st->name.bps);
|
||||||
if (!string_is_empty(global->name.bps))
|
if (!string_is_empty(runloop_st->name.ups))
|
||||||
content_ctx.name_bps = strdup(global->name.bps);
|
content_ctx.name_ups = strdup(runloop_st->name.ups);
|
||||||
if (!string_is_empty(global->name.ups))
|
|
||||||
content_ctx.name_ups = strdup(global->name.ups);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!string_is_empty(path_dir_system))
|
if (!string_is_empty(path_dir_system))
|
||||||
content_ctx.directory_system = strdup(path_dir_system);
|
content_ctx.directory_system = strdup(path_dir_system);
|
||||||
@ -2144,7 +2132,6 @@ bool task_push_load_content_with_new_core_from_menu(
|
|||||||
content_state_t *p_content = content_state_get_ptr();
|
content_state_t *p_content = content_state_get_ptr();
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
char *error_string = NULL;
|
char *error_string = NULL;
|
||||||
global_t *global = global_get_ptr();
|
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
||||||
bool check_firmware_before_loading = settings->bools.check_firmware_before_loading;
|
bool check_firmware_before_loading = settings->bools.check_firmware_before_loading;
|
||||||
@ -2184,17 +2171,14 @@ bool task_push_load_content_with_new_core_from_menu(
|
|||||||
content_ctx.subsystem.data = NULL;
|
content_ctx.subsystem.data = NULL;
|
||||||
content_ctx.subsystem.size = 0;
|
content_ctx.subsystem.size = 0;
|
||||||
|
|
||||||
if (global)
|
if (!string_is_empty(runloop_st->name.ips))
|
||||||
{
|
content_ctx.name_ips = strdup(runloop_st->name.ips);
|
||||||
if (!string_is_empty(global->name.ips))
|
if (!string_is_empty(runloop_st->name.bps))
|
||||||
content_ctx.name_ips = strdup(global->name.ips);
|
content_ctx.name_bps = strdup(runloop_st->name.bps);
|
||||||
if (!string_is_empty(global->name.bps))
|
if (!string_is_empty(runloop_st->name.ups))
|
||||||
content_ctx.name_bps = strdup(global->name.bps);
|
content_ctx.name_ups = strdup(runloop_st->name.ups);
|
||||||
if (!string_is_empty(global->name.ups))
|
|
||||||
content_ctx.name_ups = strdup(global->name.ups);
|
|
||||||
|
|
||||||
global->name.label[0] = '\0';
|
runloop_st->name.label[0] = '\0';
|
||||||
}
|
|
||||||
|
|
||||||
if (!string_is_empty(path_dir_system))
|
if (!string_is_empty(path_dir_system))
|
||||||
content_ctx.directory_system = strdup(path_dir_system);
|
content_ctx.directory_system = strdup(path_dir_system);
|
||||||
@ -2266,7 +2250,6 @@ static bool task_load_content_internal(
|
|||||||
content_state_t *p_content = content_state_get_ptr();
|
content_state_t *p_content = content_state_get_ptr();
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
char *error_string = NULL;
|
char *error_string = NULL;
|
||||||
global_t *global = global_get_ptr();
|
|
||||||
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
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;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
@ -2314,15 +2297,12 @@ static bool task_load_content_internal(
|
|||||||
content_ctx.subsystem.size = sys_info->subsystem.size;
|
content_ctx.subsystem.size = sys_info->subsystem.size;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (global)
|
if (!string_is_empty(runloop_st->name.ips))
|
||||||
{
|
content_ctx.name_ips = strdup(runloop_st->name.ips);
|
||||||
if (!string_is_empty(global->name.ips))
|
if (!string_is_empty(runloop_st->name.bps))
|
||||||
content_ctx.name_ips = strdup(global->name.ips);
|
content_ctx.name_bps = strdup(runloop_st->name.bps);
|
||||||
if (!string_is_empty(global->name.bps))
|
if (!string_is_empty(runloop_st->name.ups))
|
||||||
content_ctx.name_bps = strdup(global->name.bps);
|
content_ctx.name_ups = strdup(runloop_st->name.ups);
|
||||||
if (!string_is_empty(global->name.ups))
|
|
||||||
content_ctx.name_ups = strdup(global->name.ups);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!string_is_empty(path_dir_system))
|
if (!string_is_empty(path_dir_system))
|
||||||
content_ctx.directory_system = strdup(path_dir_system);
|
content_ctx.directory_system = strdup(path_dir_system);
|
||||||
@ -2389,6 +2369,7 @@ bool task_push_load_content_with_new_core_from_companion_ui(
|
|||||||
void *user_data)
|
void *user_data)
|
||||||
{
|
{
|
||||||
global_t *global = global_get_ptr();
|
global_t *global = global_get_ptr();
|
||||||
|
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
||||||
content_state_t *p_content = content_state_get_ptr();
|
content_state_t *p_content = content_state_get_ptr();
|
||||||
|
|
||||||
path_set(RARCH_PATH_CONTENT, fullpath);
|
path_set(RARCH_PATH_CONTENT, fullpath);
|
||||||
@ -2411,13 +2392,10 @@ bool task_push_load_content_with_new_core_from_companion_ui(
|
|||||||
|
|
||||||
global->launched_from_cli = false;
|
global->launched_from_cli = false;
|
||||||
|
|
||||||
if (global)
|
if (label)
|
||||||
{
|
strlcpy(runloop_st->name.label, label, sizeof(runloop_st->name.label));
|
||||||
if (label)
|
else
|
||||||
strlcpy(global->name.label, label, sizeof(global->name.label));
|
runloop_st->name.label[0] = '\0';
|
||||||
else
|
|
||||||
global->name.label[0] = '\0';
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Load content */
|
/* Load content */
|
||||||
if (!task_load_content_internal(content_info, true, false, true))
|
if (!task_load_content_internal(content_info, true, false, true))
|
||||||
@ -2772,7 +2750,6 @@ bool content_init(void)
|
|||||||
|
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
char *error_string = NULL;
|
char *error_string = NULL;
|
||||||
global_t *global = global_get_ptr();
|
|
||||||
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
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;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
@ -2804,15 +2781,12 @@ bool content_init(void)
|
|||||||
content_ctx.subsystem.data = NULL;
|
content_ctx.subsystem.data = NULL;
|
||||||
content_ctx.subsystem.size = 0;
|
content_ctx.subsystem.size = 0;
|
||||||
|
|
||||||
if (global)
|
if (!string_is_empty(runloop_st->name.ips))
|
||||||
{
|
content_ctx.name_ips = strdup(runloop_st->name.ips);
|
||||||
if (!string_is_empty(global->name.ips))
|
if (!string_is_empty(runloop_st->name.bps))
|
||||||
content_ctx.name_ips = strdup(global->name.ips);
|
content_ctx.name_bps = strdup(runloop_st->name.bps);
|
||||||
if (!string_is_empty(global->name.bps))
|
if (!string_is_empty(runloop_st->name.ups))
|
||||||
content_ctx.name_bps = strdup(global->name.bps);
|
content_ctx.name_ups = strdup(runloop_st->name.ups);
|
||||||
if (!string_is_empty(global->name.ups))
|
|
||||||
content_ctx.name_ups = strdup(global->name.ups);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sys_info)
|
if (sys_info)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user