feat(fs): Cross-Compatible Emulator Save Pathing w/ Custom Save Paths #79
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/cross-compatible-saves"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This commit introduces a new way for users to be able to enjoy their saves not only on Citron, but any emulator they choose using "Intelligent Mirroring" between directories, a new layer that allows users to seamlessly use and sync save data from other emulators (Ryujinx, Ryubing, Eden, Suyu, Yuzu, and Sudachi) without the need for manual file management or risky symlinks. It effectively treats external emulator save directories as a synchronized "Remote Source," enabling a shared save environment across different platforms and file structures.
Key Changes:
Frontend: Implemented a structural fingerprinting system in the Game List to identify specific emulator save paths (e.g., Ryujinx's bis/user/save structure vs. the standard AccountID/TitleID structure used by Citron and other forks).
Frontend: Added a non-destructive "Initial Pull" mechanism. When mirroring is enabled, existing Citron NAND data is timestamped and backed up before being replaced by the data from the external source.
Core: Extended DirectorySaveDataFileSystem to support a mirror_fs handle, allowing the filesystem manager to maintain a persistent connection to the external save path during gameplay sessions.
Core: Hooked the atomic Commit() process to implement a "Push" mechanism. Every time a game performs a save commit within Citron, the updated data is automatically mirrored back to the external emulator's directory.
Logic: Resolved a potential circular dependency by making the "NAND Backup" and "Mirroring" features mutually exclusive within the commit logic, ensuring data integrity and preventing race conditions.
Config: Centralized custom save path and mirroring logic within the core configuration to ensure settings persist correctly across different frontend states.
Keep in mind, to use this feature successfully, you must:
Ensure you select the ABSOLUTE location of the save path you want. It must be the folder pertaining to the save data files from the separate emulator (TitleID for Yuzu, 000000000001 (or 2, 3) & 0 (or wherever Ryujinx takes you) for the save data location, and copy and paste the ABSOLUTE location into your Custom Save Path manually doing so within Citorn.
Do NOT keep both emulators open at the same time, or play the game at the same time between emulators.
You will always have a backup stored within NAND of what is currently in Citron's location if you do not wish to use Ryujinx/Eden/Yuzu's save. The reason for it currently pulling the data from the separate emulator is incase users are trying to sync FROM. In the not so distant future you'll be able to sync TO.