Skip to content

[develop] Add optional global saves folder - #431

Open
ricosynth wants to merge 4 commits into
n64brew:developfrom
ricosynth:feature/central-saves-folder
Open

ricosynth wants to merge 4 commits into
n64brew:developfrom
ricosynth:feature/central-saves-folder

Conversation

@ricosynth

@ricosynth ricosynth commented Sep 29, 2026 •

Copy link
Copy Markdown

Description

Adds two optional settings, both OFF by default and listed in Settings below "Use Saves Folder".

Global Saves Folder (use_global_saves_folder): when ON, every save is stored as /saves/<ROM file name>.sav at the root of the SD card instead of next to the ROM, so copies of the same ROM file in different folders share one save. The save path is built in one place (global_save_path() in cart_load.c), which is used for N64 ROMs (including 64DD combo ROMs) and emulated ROMs.

Migrate Old Saves (migrate_saves_to_global_folder): only used while the global folder is ON. When ON, if a ROM has no global save yet but still has one in its own location (its saves subdirectory or next to the ROM, following Use Saves Folder), that save is moved into /saves with f_rename the first time the ROM is launched. If the move fails, the existing save is used where it is rather than starting a new, empty one. When OFF, per-folder saves are never touched.

Keeping migration as a separate choice means users who keep different save files in different folders can leave them as they are, while users who want everything in one place can bring their existing progress along. Turning either setting OFF moves nothing back.

Saves are matched by ROM file name, which is what lets copies share them. Two different ROMs with the same file name in different folders would also share a save; the docs call this out.

Documentation: new sections in 32_menu_settings.md and a tip in 10_getting_started_sd.md.

Motivation and Context

Popular SD card layouts keep the same ROM in more than one folder, for example a "Top 50" or favourites folder next to an A–Z tree. Today each copy gets its own saves folder, so progress made from one folder is missing when the game is started from the other. A global folder keyed by the ROM file name gives every copy the same save, without changing the default behaviour.

How Has This Been Tested?

  • The global folder itself has been running on my SummerCart64 since 2026-09-28, built on V0.3.4 and played on an Analogue 3D. My existing saves were moved to /saves by hand, and games started from the TOP 50 folder and from the A–Z folders now load the same save.
  • This branch builds on current develop with make all (no warnings).
  • The Migrate Old Saves move has not been tested on hardware yet.

Screenshots

Types of changes

  • Improvement (non-breaking change that adds a new feature)
  • Bug fix (fixes an issue)
  • Breaking change (breaking change)
  • Documentation Improvement
  • Config and build (change in the configuration and build system, has no impact on code or features)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

This change was written with help from Claude (Anthropic's AI assistant). I reviewed it, and I have been running the V0.3.4 version on my own hardware.

You agree with the license terms and that other license types may be granted with permission of the original N64FlashcartMenu project license holders.

Signed-off-by: ricosynth 205374161+ricosynth@users.noreply.github.com

🤖 Generated with Claude Code

ricosynth and others added 2 commits September 28, 2026 17:27
Add a "Central Saves Folder" setting (`use_central_saves_folder`, OFF by
default). When it is ON, every save is stored as
`/saves/<ROM file name>.sav` at the root of the SD card instead of next to
the ROM, so copies of the same ROM file in different folders (for example
a favourites folder and an A-Z folder) share one save.

A save that is still in the ROM's own location (its `saves` subdirectory,
or next to the ROM) is moved into the central folder the first time the
ROM is launched, so existing progress carries over when the setting is
turned on. If that move fails, the existing save is used where it is
rather than starting a new, empty one.

This applies to N64 ROMs (including 64DD combo ROMs) and emulated ROMs.
The setting is documented in the menu settings and SD card guides.

Signed-off-by: ricosynth <205374161+ricosynth@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add a "Migrate Old Saves" setting (`migrate_saves_to_central_folder`,
OFF by default, only used while Central Saves Folder is ON). A ROM's
existing save in its own location is moved into /saves only when this is
ON. When it is OFF, per-folder saves are left untouched and a ROM without
a central save starts a new one, so turning on the central folder never
moves saves for users who keep different save files in different folders.

Signed-off-by: ricosynth <205374161+ricosynth@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 141c0936-4c27-4dbf-b6c8-341313965601

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@networkfusion

Copy link
Copy Markdown
Collaborator

Thanks for the PR. I need to find the time to review further, but on first inspection, please use global rather than central.

As requested in review, use "global" rather than "central": the settings
are now "Global Saves Folder" (`use_global_saves_folder`) and "Migrate Old
Saves" (`migrate_saves_to_global_folder`), the helper is
`global_save_path()`, and the docs say "global" throughout.

Signed-off-by: ricosynth <205374161+ricosynth@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ricosynth ricosynth changed the title [develop] Add optional central saves folder [develop] Add optional global saves folder Sep 30, 2026
@ricosynth

Copy link
Copy Markdown
Author

Adjustments made per your request.

@microraptor

Copy link
Copy Markdown

Does this also apply to save files from emulated games (like the Game Boy and SNES emulator on the flashcart)? If this is not feasible, maybe emulator save files could be at least symlinked or copied to a backup folder.

@networkfusion

Copy link
Copy Markdown
Collaborator

A couple of further notes before this is considered for merge:

  • The M64 is not considered a reliable target (partly because I do not have one), and must be tested on a real N64.
  • The develop branch has been updated, and this PR probably needs changes.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants