mirror of
https://github.com/libretro/RetroArch.git
synced 2025-02-05 08:57:38 +00:00
Move more global->savefiles usage to task_save.c
This commit is contained in:
parent
f91a8eacdb
commit
2277428f52
10
command.c
10
command.c
@ -2419,16 +2419,6 @@ bool command_event(enum event_command cmd, void *data)
|
||||
if (!runloop_ctl(RUNLOOP_CTL_SHADER_DIR_INIT, NULL))
|
||||
return false;
|
||||
break;
|
||||
case CMD_EVENT_SAVEFILES:
|
||||
{
|
||||
global_t *global = global_get_ptr();
|
||||
if (!global->savefiles || !global->sram.use)
|
||||
return false;
|
||||
|
||||
for (i = 0; i < global->savefiles->size; i++)
|
||||
content_save_ram_file(i);
|
||||
}
|
||||
return true;
|
||||
case CMD_EVENT_BSV_MOVIE_DEINIT:
|
||||
bsv_movie_ctl(BSV_MOVIE_CTL_DEINIT, NULL);
|
||||
break;
|
||||
|
@ -157,7 +157,6 @@ enum event_command
|
||||
CMD_EVENT_SHADER_DIR_DEINIT,
|
||||
/* Initializes controllers. */
|
||||
CMD_EVENT_CONTROLLERS_INIT,
|
||||
CMD_EVENT_SAVEFILES,
|
||||
/* Initializes cheats. */
|
||||
CMD_EVENT_CHEATS_INIT,
|
||||
/* Deinitializes cheats. */
|
||||
|
@ -39,6 +39,7 @@
|
||||
#include "../../retroarch.h"
|
||||
#include "../../runloop.h"
|
||||
#include "../../command.h"
|
||||
#include "../../tasks/tasks_internal.h"
|
||||
#include "../../file_path_special.h"
|
||||
|
||||
static void emscripten_mainloop(void)
|
||||
@ -57,7 +58,7 @@ static void emscripten_mainloop(void)
|
||||
|
||||
void cmd_savefiles(void)
|
||||
{
|
||||
command_event(CMD_EVENT_SAVEFILES, NULL);
|
||||
event_save_files();
|
||||
}
|
||||
|
||||
void cmd_save_state(void)
|
||||
|
@ -1149,7 +1149,8 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data)
|
||||
command_event(CMD_EVENT_AUTOSAVE_DEINIT, NULL);
|
||||
|
||||
command_event(CMD_EVENT_RECORD_DEINIT, NULL);
|
||||
command_event(CMD_EVENT_SAVEFILES, NULL);
|
||||
|
||||
event_save_files();
|
||||
|
||||
command_event(CMD_EVENT_REWIND_DEINIT, NULL);
|
||||
command_event(CMD_EVENT_CHEATS_DEINIT, NULL);
|
||||
|
@ -837,6 +837,20 @@ bool content_save_ram_file(unsigned slot)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool event_save_files(void)
|
||||
{
|
||||
unsigned i;
|
||||
global_t *global = global_get_ptr();
|
||||
|
||||
if (!global || !global->savefiles || !global->sram.use)
|
||||
return false;
|
||||
|
||||
for (i = 0; i < global->savefiles->size; i++)
|
||||
content_save_ram_file(i);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool event_load_save_files(void)
|
||||
{
|
||||
unsigned i;
|
||||
|
@ -148,6 +148,8 @@ bool dump_to_file_desperate(const void *data,
|
||||
|
||||
bool event_load_save_files(void);
|
||||
|
||||
bool event_save_files(void);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user