/* Cloud sync on content unload, in the shipping frontend. * * With Cloud Sync in automatic mode, closing content asks for a sync * so the save the content leaves behind reaches the server. The save * RAM only reaches disk when the content's deinit flushes it, which a * close from the menu runs a frame or more later, and until that * deinit finishes the save file belongs to the running core (the sync * defers anything it would write there). A sync started before then * uploads, and hashes, whatever the file held last. * * This links the real retroarch.c and loads sram_core.so, writes a * pattern into the core's save RAM and closes the content through * CMD_EVENT_UNLOAD_CORE, running frames until the close completes. * task_push_cloud_sync is wrapped (-Wl,--wrap): at each call the * harness records what the save file holds and whether a core still * owns it. No server is contacted. * * Lanes: * startup content from the command line: the startup sync runs to * its end before the core takes the save file. * unload one sync, pushed once the file on disk is the core's * last save RAM and no core owns it. * no content unloading with no content running syncs at once, as * before: nothing waits to be flushed. */ #include #include #include #include #include #include #include "../../../runloop.h" #include "../../../retroarch.h" #include "../../../command.h" #include "../../../content.h" #include "../../../configuration.h" #include "../../../frontend/frontend_driver.h" #include "../../../tasks/tasks_internal.h" #include "../../../verbosity.h" #include