mirror of
https://github.com/libretro/RetroArch
synced 2025-03-26 11:37:30 +00:00
Cleanups
This commit is contained in:
parent
35b8c4cb05
commit
96018412c0
@ -210,7 +210,8 @@ enum event_command
|
|||||||
CMD_EVENT_CHEAT_INDEX_PLUS,
|
CMD_EVENT_CHEAT_INDEX_PLUS,
|
||||||
CMD_EVENT_CHEAT_INDEX_MINUS,
|
CMD_EVENT_CHEAT_INDEX_MINUS,
|
||||||
CMD_EVENT_CHEAT_TOGGLE,
|
CMD_EVENT_CHEAT_TOGGLE,
|
||||||
CMD_EVENT_AI_SERVICE_CALL
|
CMD_EVENT_AI_SERVICE_CALL,
|
||||||
|
CMD_EVENT_SAVE_FILES
|
||||||
};
|
};
|
||||||
|
|
||||||
bool command_set_shader(const char *arg);
|
bool command_set_shader(const char *arg);
|
||||||
|
@ -91,7 +91,7 @@ static void emscripten_mainloop(void)
|
|||||||
|
|
||||||
void cmd_savefiles(void)
|
void cmd_savefiles(void)
|
||||||
{
|
{
|
||||||
event_save_files();
|
command_event(CMD_EVENT_SAVE_FILES, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmd_save_state(void)
|
void cmd_save_state(void)
|
||||||
|
@ -551,7 +551,6 @@ void input_config_save_keybind(void *data, const char *prefix,
|
|||||||
void input_config_reset(void);
|
void input_config_reset(void);
|
||||||
|
|
||||||
void set_connection_listener(pad_connection_listener_t *listener);
|
void set_connection_listener(pad_connection_listener_t *listener);
|
||||||
void fire_connection_listener(unsigned port, input_device_driver_t *driver);
|
|
||||||
|
|
||||||
extern input_device_driver_t dinput_joypad;
|
extern input_device_driver_t dinput_joypad;
|
||||||
extern input_device_driver_t linuxraw_joypad;
|
extern input_device_driver_t linuxraw_joypad;
|
||||||
|
2
paths.h
2
paths.h
@ -75,8 +75,6 @@ void path_deinit_subsystem(void);
|
|||||||
|
|
||||||
void path_deinit_savefile(void);
|
void path_deinit_savefile(void);
|
||||||
|
|
||||||
void path_init_savefile(void);
|
|
||||||
|
|
||||||
bool path_set(enum rarch_path_type type, const char *path);
|
bool path_set(enum rarch_path_type type, const char *path);
|
||||||
|
|
||||||
void path_set_special(char **argv, unsigned num_content);
|
void path_set_special(char **argv, unsigned num_content);
|
||||||
|
29
retroarch.c
29
retroarch.c
@ -1191,6 +1191,8 @@ static bool midi_driver_set_all_sounds_off(void);
|
|||||||
static const void *midi_driver_find_handle(int index);
|
static const void *midi_driver_find_handle(int index);
|
||||||
static bool midi_driver_flush(void);
|
static bool midi_driver_flush(void);
|
||||||
|
|
||||||
|
static void bsv_movie_set_path(const char *path);
|
||||||
|
|
||||||
struct string_list *dir_list_new_special(const char *input_dir,
|
struct string_list *dir_list_new_special(const char *input_dir,
|
||||||
enum dir_list_type type, const char *filter)
|
enum dir_list_type type, const char *filter)
|
||||||
{
|
{
|
||||||
@ -1815,14 +1817,14 @@ static bool path_init_subsystem(void)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void path_init_savefile(void)
|
static void path_init_savefile(void)
|
||||||
{
|
{
|
||||||
bool should_sram_be_used = rarch_ctl(RARCH_CTL_IS_SRAM_USED, NULL)
|
bool should_sram_be_used = rarch_use_sram
|
||||||
&& !rarch_ctl(RARCH_CTL_IS_SRAM_SAVE_DISABLED, NULL);
|
&& !rarch_ctl(RARCH_CTL_IS_SRAM_SAVE_DISABLED, NULL);
|
||||||
|
|
||||||
rarch_use_sram = should_sram_be_used;
|
rarch_use_sram = should_sram_be_used;
|
||||||
|
|
||||||
if (!rarch_ctl(RARCH_CTL_IS_SRAM_USED, NULL))
|
if (!rarch_use_sram)
|
||||||
{
|
{
|
||||||
RARCH_LOG("%s\n",
|
RARCH_LOG("%s\n",
|
||||||
msg_hash_to_str(MSG_SRAM_WILL_NOT_BE_SAVED));
|
msg_hash_to_str(MSG_SRAM_WILL_NOT_BE_SAVED));
|
||||||
@ -6421,6 +6423,9 @@ bool command_event(enum event_command cmd, void *data)
|
|||||||
|
|
||||||
switch (cmd)
|
switch (cmd)
|
||||||
{
|
{
|
||||||
|
case CMD_EVENT_SAVE_FILES:
|
||||||
|
event_save_files(rarch_use_sram);
|
||||||
|
break;
|
||||||
case CMD_EVENT_OVERLAY_DEINIT:
|
case CMD_EVENT_OVERLAY_DEINIT:
|
||||||
#ifdef HAVE_OVERLAY
|
#ifdef HAVE_OVERLAY
|
||||||
retroarch_overlay_deinit();
|
retroarch_overlay_deinit();
|
||||||
@ -12340,7 +12345,7 @@ static bool bsv_movie_init(void)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void bsv_movie_set_path(const char *path)
|
static void bsv_movie_set_path(const char *path)
|
||||||
{
|
{
|
||||||
strlcpy(bsv_movie_state.movie_path,
|
strlcpy(bsv_movie_state.movie_path,
|
||||||
path, sizeof(bsv_movie_state.movie_path));
|
path, sizeof(bsv_movie_state.movie_path));
|
||||||
@ -13436,12 +13441,10 @@ void set_connection_listener(pad_connection_listener_t *listener)
|
|||||||
pad_connection_listener = listener;
|
pad_connection_listener = listener;
|
||||||
}
|
}
|
||||||
|
|
||||||
void fire_connection_listener(unsigned port, input_device_driver_t *driver)
|
static void fire_connection_listener(unsigned port, input_device_driver_t *driver)
|
||||||
{
|
{
|
||||||
if (!pad_connection_listener)
|
if (pad_connection_listener)
|
||||||
return;
|
pad_connection_listener->connected(port, driver);
|
||||||
|
|
||||||
pad_connection_listener->connected(port, driver);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -13781,7 +13784,7 @@ static int16_t input_state_device(
|
|||||||
if (id < RARCH_FIRST_META_KEY
|
if (id < RARCH_FIRST_META_KEY
|
||||||
#ifdef HAVE_NETWORKGAMEPAD
|
#ifdef HAVE_NETWORKGAMEPAD
|
||||||
/* Don't process binds if input is coming from Remote RetroPad */
|
/* Don't process binds if input is coming from Remote RetroPad */
|
||||||
&& remote_input == false
|
&& !remote_input
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -14026,7 +14029,7 @@ static int16_t input_state_device(
|
|||||||
|
|
||||||
if (id < RARCH_FIRST_META_KEY
|
if (id < RARCH_FIRST_META_KEY
|
||||||
#ifdef HAVE_NETWORKGAMEPAD
|
#ifdef HAVE_NETWORKGAMEPAD
|
||||||
&& remote_input == false
|
&& !remote_input
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -25790,7 +25793,7 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data)
|
|||||||
|
|
||||||
command_event(CMD_EVENT_RECORD_DEINIT, NULL);
|
command_event(CMD_EVENT_RECORD_DEINIT, NULL);
|
||||||
|
|
||||||
event_save_files();
|
command_event(CMD_EVENT_SAVE_FILES, NULL);
|
||||||
|
|
||||||
command_event(CMD_EVENT_REWIND_DEINIT, NULL);
|
command_event(CMD_EVENT_REWIND_DEINIT, NULL);
|
||||||
cheat_manager_state_free();
|
cheat_manager_state_free();
|
||||||
@ -25813,8 +25816,6 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data)
|
|||||||
return rarch_is_sram_load_disabled;
|
return rarch_is_sram_load_disabled;
|
||||||
case RARCH_CTL_IS_SRAM_SAVE_DISABLED:
|
case RARCH_CTL_IS_SRAM_SAVE_DISABLED:
|
||||||
return rarch_is_sram_save_disabled;
|
return rarch_is_sram_save_disabled;
|
||||||
case RARCH_CTL_IS_SRAM_USED:
|
|
||||||
return rarch_use_sram;
|
|
||||||
case RARCH_CTL_SET_BLOCK_CONFIG_READ:
|
case RARCH_CTL_SET_BLOCK_CONFIG_READ:
|
||||||
rarch_block_config_read = true;
|
rarch_block_config_read = true;
|
||||||
break;
|
break;
|
||||||
|
@ -100,8 +100,6 @@ enum rarch_ctl_state
|
|||||||
RARCH_CTL_IS_IPS_PREF,
|
RARCH_CTL_IS_IPS_PREF,
|
||||||
RARCH_CTL_UNSET_IPS_PREF,
|
RARCH_CTL_UNSET_IPS_PREF,
|
||||||
|
|
||||||
RARCH_CTL_IS_SRAM_USED,
|
|
||||||
|
|
||||||
RARCH_CTL_IS_SRAM_LOAD_DISABLED,
|
RARCH_CTL_IS_SRAM_LOAD_DISABLED,
|
||||||
RARCH_CTL_IS_SRAM_SAVE_DISABLED,
|
RARCH_CTL_IS_SRAM_SAVE_DISABLED,
|
||||||
|
|
||||||
@ -1923,8 +1921,6 @@ extern const shader_backend_t gl_cg_backend;
|
|||||||
|
|
||||||
void bsv_movie_frame_rewind(void);
|
void bsv_movie_frame_rewind(void);
|
||||||
|
|
||||||
void bsv_movie_set_path(const char *path);
|
|
||||||
|
|
||||||
/* Location */
|
/* Location */
|
||||||
|
|
||||||
typedef struct location_driver
|
typedef struct location_driver
|
||||||
|
@ -1553,13 +1553,12 @@ bool content_save_ram_file(unsigned slot)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool event_save_files(void)
|
bool event_save_files(bool is_sram_used)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
|
|
||||||
cheat_manager_save_game_specific_cheats();
|
cheat_manager_save_game_specific_cheats();
|
||||||
if (!task_save_files ||
|
if (!task_save_files || !is_sram_used)
|
||||||
!rarch_ctl(RARCH_CTL_IS_SRAM_USED, NULL))
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
for (i = 0; i < task_save_files->size; i++)
|
for (i = 0; i < task_save_files->size; i++)
|
||||||
|
@ -168,7 +168,7 @@ bool take_screenshot(
|
|||||||
|
|
||||||
bool event_load_save_files(void);
|
bool event_load_save_files(void);
|
||||||
|
|
||||||
bool event_save_files(void);
|
bool event_save_files(bool sram_used);
|
||||||
|
|
||||||
void path_init_savefile_rtc(const char *savefile_path);
|
void path_init_savefile_rtc(const char *savefile_path);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user