Skip to content

Sync upstream 5d2bf73f → a662f29e (64 upstream commits) - #223

Merged
v0lumehi merged 1 commit into
mainfrom
sync/upstream-a662f29
Oct 29, 2026
Merged

v0lumehi merged 1 commit into
mainfrom
sync/upstream-a662f29

Conversation

@v0lumehi

Copy link
Copy Markdown
Collaborator

What and why

Bumps the upstream pin from 5d2bf73f to seedds/nxnative main a662f29ee791 (64 upstream commits, range seedds/nxnative@5d2bf73...a662f29). The nightly bump was blocked by five patches, so this one is by hand with patches.py bump and refresh.

Upstream highlights: cloud saves (123c7ff0, see below), 13 new game profiles (EA SPORTS FC 27, Need for Speed Hot Pursuit Remastered, Team Sonic Racing, Well Dweller, SteamWorld Dig, Dig 2, Heist and Heist II, Subnautica and Below Zero, Streets of Rage 4, Baba Is You, Mario Party Superstars 1.1.1), NVN texture, alpha test and early fragment test fixes, a chain-built alpha test library, Capstone 5 pinned, Frostbite frame lock, nacp and RomFS input checks, regress.py capture and replay per game.

Shader chain: DMSH_CHAIN changes from 373efc7add5f to f3ceca86cac5. Every game's shaders rebuild on the next build.

Dropped patches (upstream has them)

Refreshed patches

  • 0001-runtime-profile: conflicts in hle_fpslock.c and dm/host/tests/Makefile. Upstream added Frostbite frame locks (fb_find) and new test targets (t_save_sync, t_uecvar, save_sync.c in the t_fs family). Kept upstream's code and re-applied only dm_profile()->fps_target and hle_profile.c in the test link lines.
  • 0003-ios-game-data-folder: conflicts in the iOS launcher, main.m, front_ios.m, the bridging header, project.yml and the startup test. Upstream now has its own CloudSaves.m and bridging header, and a letter-case-tolerant romfs_document_images. Kept both: the bridging header imports CloudSaves.h and DataBookmark.h, romfs_locate tries the picked location and the per-game folder first and then walks upstream's romfs_document_images, the launcher shows GameDataSection and upstream's CloudSavesSection (the picker takes types, ours passes .item). The per-game DLC lookup (Slim iOS build: selected DLC reaches the game folder and the app finds it #212) and the cheats folder (DM_CHEATS) lines are unchanged. DataBookmark now holds only the game data pick, the cloud saves bookmark is upstream's.
  • 0024-games-md-gallery: upstream dropped IPA sizes from the gallery, made every name a link and uses <small>. Took upstream's cell and kept only the output file (GAMES.md). GAMES.md is regenerated.
  • 0027-nsp-title-id-from-package and 0028-cheats-engine: additive conflicts in Program.cs, docs/reference/packing.md and docs/frontends.md, kept both sides.
  • scripts/patches.py (the tool's own file) now decodes an RFC 2047 subject. refresh could not match the cheats patch, whose subject has an è, to its commit. Test added.

All other patches applied cleanly. patches.py check passes (20 patches).

Cloud saves

How a player's choice is stored today:

Side Stored as After the bump
Mac app, settings window explicit path, cloudSaves.folder in the app's preferences, passed on by launcher.c as DM_SAVE_SYNC unchanged, same key upstream
iPhone app security-scoped bookmark under cloudSavesBookmark in UserDefaults, resolved to a path and put into DM_SAVE_SYNC unchanged, upstream's CloudSaves.m uses the same key, so existing bookmarks still resolve
DM_SAVE_SYNC=icloud the keyword, only on the Mac, only from a line in the app's env.txt or the launch environment (the iPhone app answers it with "off") the folder changed from NX2Apple Saves to nxnative Saves

The NX2Apple launcher (frontend/) never sets DM_SAVE_SYNC or cloudSaves.folder. The file format is the same (<folder>/<title ID>/save.dmsync, <DM_SAVE>.sync, <DM_SAVE>-backups), checked by diffing 0025's save_sync.c against upstream's: only the folder name differs, plus a limit of 10 backups per side, which is upstream's addition.

Cases:

  1. Folder chosen in the Mac window and bookmark chosen on the iPhone: nothing changes, both are paths.
  2. Mac on icloud and iPhone on a bookmark to NX2Apple Saves: this is the only case the rename could split. CloudSavesMigration (new, frontend/) runs when the launcher opens and before each Play. For a game whose env.txt (~/Library/Application Support/nxnative/<title ID>/env.txt) has DM_SAVE_SYNC=icloud as its effective line, and when iCloud Drive/NX2Apple Saves exists, it writes that folder's path in place of the keyword (with a # comment above, which the launcher ignores). Both apps then stay in the folder they share. Nothing is copied, moved or deleted, so no save can be lost and the old folder stays as it is. Older Mac apps accept an explicit path too, so the order of launcher and app updates does not matter.
  3. icloud and no NX2Apple Saves folder: the Mac never synced through the keyword, the keyword keeps its new meaning (nxnative Saves).
  4. A Mac app rebuilt before the launcher ran the migration and already wrote to nxnative Saves: the migration still points it back to NX2Apple Saves where the iPhone is. The engine's sync then decides by hash and date, the newer save wins and the other is kept in -backups. The nxnative Saves folder is left alone.
  5. DM_SAVE_SYNC=icloud in the launch environment (a shell) cannot be migrated, such a player writes the path or lets the window choose the folder. Not something the launcher or docs ever offered besides env.txt.

I chose to keep the player's folder with an explicit path instead of copying NX2Apple Saves into nxnative Saves: a copy only helps when both devices switch together, and the iPhone cannot be told from the Mac. This needs no engine patch.

Docs: the upstream docs/settings.md and docs/env_switches.tsv now say nxnative Saves (vendored, from upstream). Our README, GAMES and CHANGELOG do not mention the old folder. The Saves sheet and SaveTransfer.swift are ours and stay, upstream's comments just no longer name them.

@LNPANDY for the release notes: cloud saves now come from the engine. Existing players keep their folder, whether chosen in the Mac window or on the iPhone. The icloud keyword in a Mac env.txt is turned into the path of NX2Apple Saves for players who have that folder. New icloud users get nxnative Saves. Also new in the engine: the newest 10 backups of each side stay, older ones are removed.

Checked

  • Tests: python3 scripts/patches.py check ok (20 patches, 2398 files), python3 -m unittest discover -s scripts/tests (40), dm/tools/tests all 649 ok (17 skipped), dm/ios/tests 42 ok, python3 -m unittest discover -s frontend-qt/tests 172 ok, cd frontend && swift build -c release && swift test 434 tests ok (7 new for the migration), make -C dm/host GAME=010015100B514000 and make -C dm/host/tests GAME=010015100B514000 run ok, GAME=010015100B514000 python3 dm/ios/tools/compile_check.py 187 files 0 failed. The iOS Swift sources (Launcher.swift with the bridging header, which compile_check skips) type-check against the iPhoneOS 27.1 SDK.
  • Lint: lint_python.py with the lint venv, compared with the tree before the bump: the new findings are in upstream's new and changed files, none in ours beyond scripts/patches.py (fixed).
  • scripts/regress.py impact 5d2bf73f..a662f29ee79: 4 games affected (Hades, Breath of the Wild, Pokémon Scarlet, Tears of the Kingdom), 109 profiles have no usage manifest. regress.py check --games was not run: there is no baseline under /Volumes/NX/harness (the folder is empty).
  • Run on a device or Mac: nothing played. The cloud saves migration is covered by unit tests on temporary folders, not by a run between a real Mac and iPhone.

Scope

  • No vendored file is edited directly: the changes are in patches/ and patches.py check passes
  • Nothing new for the engine in the patches: the cloud saves migration is in frontend/
  • No keys, game files or data extracted from a game in the change

Bumps the pin to seedds/nxnative a662f29. Drops cloud-saves and lm3-depth-mode, which upstream took (123c7ff and ac9598a). Refreshes runtime-profile, ios-game-data-folder, games-md-gallery, nsp-title-id-from-package and cheats-engine against upstream's new code.

The engine's cloud saves read DM_SAVE_SYNC=icloud as iCloud Drive/nxnative Saves, where the fork's read it as NX2Apple Saves. CloudSavesMigration gives a game's Mac env.txt that says icloud the explicit path of an existing NX2Apple Saves folder, so its Mac and iPhone apps stay in one folder. Nothing is copied, moved or deleted.

scripts/patches.py now reads an RFC 2047 subject (a patch whose subject has a non-ASCII character), so refresh can match its commit.
@v0lumehi

Copy link
Copy Markdown
Collaborator Author

Rebased onto main 142c3d8 (#219). Patch 0030 stays after 0029 and applies on the new pin as it is. Checked again: patches.py check (21 patches), host build and host tests, scripts tests, swift test (434).

@v0lumehi
v0lumehi force-pushed the sync/upstream-a662f29 branch from ef66e77 to 6137483 Compare October 29, 2026 20:59
@v0lumehi
v0lumehi merged commit 2a7079e into main Oct 29, 2026
10 checks passed
@v0lumehi
v0lumehi deleted the sync/upstream-a662f29 branch October 29, 2026 21:37
@v0lumehi

Copy link
Copy Markdown
Collaborator Author

@LNPANDY merged with all checks green. Two lines for the release notes:

  • Shaders rebuild once: the shader chain moved from 373efc7add5f to f3ceca86cac5, so the first build of every game after this update translates its shaders again and takes noticeably longer.
  • Cloud saves: upstream's version replaced our patch. The iCloud keyword icloud now means iCloud Drive/nxnative Saves. Folders picked in the Mac settings window or on the iPhone keep working unchanged, and a Mac app whose env.txt used icloud with an existing NX2Apple Saves folder is pointed at that folder by the launcher, so its devices stay in sync.

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.

1 participant