Repository navigation
Conversation
…sync-patcher alignment) - **A trailing slash names the same directory in the RomFS archive** (romfs_arc.c find_dir): Bayonetta 3 opens "movie/" at boot, and the archive's byte-for-byte directory lookup said the folder did not exist — the game sat at the swirling scene and never started its opening movie, iOS only (opendir on a plain tree ignores the slash, which is why the Mac never saw it). find_dir trims trailing slashes; t_romfs_arc now checks every directory again with one appended (the old code fails for movie/, movie/skilltree/, movie/tutorial/). Verified on a fixture archive: all checks passed. - **The iOS build was broken for every game** (issue #32, PR #31 item 2): 73a89fb moved main.m to hle_profile.h but left two uses of DM_GAME_ID — a macro defined in game_profile.h, which main.m no longer includes. Both read dm_profile()->id now, like the marker beside them. - **sync_upstream.py's main.m patcher text aligned** with those two uses (the replacement emitted DM_GAME_ID; without this the next sync would have restored the broken build — the same patcher-text drift class as last night's three). From ufooer's PR #31, items 1 and 2, applied by hand so they could ship now (the PR as a whole conflicts with the launcher merge in ContentView.swift and needs a rebase for its frontend half). The host builds, the archive test passes with the trailing-slash checks, and the patcher consistency holds.
|
Excellent report — four real fixes, one commit each, and the install script is a feature I had on the list. Items 1 and 2 are applied now ( What I verified:
Why I did not take the whole PR as it stands: since your base, the launcher library (#27) landed in What I would like: a rebase of your branch onto current main (or push the item-4 half separately from the Rosetta check in item 3, which is in One thing I will ask when the frontend half comes back: the staging logic that brings the folder's other NSPs along ("a ROMs folder with several games") stages by title ID arithmetic (base + 0x800 the update, base + 0x1000+n add-on content). That matches how dumps name updates, but DLC numbering is not always contiguous — does it hold on your dumps across games, or should it be a prefix match ( |
An Intel Python (an Intel Homebrew in /usr/local on an Apple silicon Mac) runs under Rosetta, and its children prefer the x86_64 slice: the shader translator's universal apphost then wants an x86_64 .NET, finds the arm64 one, prints nothing, and the build stops at the iOS shader step with "xlate_source: lock … / actual" (empty) and advice to rebuild dmsh_xlate, which is not the problem. sysctl.proc_translated says so up front now. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Three things a first build on an Apple silicon Mac ran into: - Python under Rosetta. The venv was made from the first python3 with a usable version, which on a Mac with an Intel Homebrew is /usr/local's x86_64 one; the shader step then failed (see the build script commit). Interpreters that do not run natively are skipped now, and a venv made from one is made again from a native one (the row says why). - A ROMs folder with several games. Picking only the base game passed its whole folder to the script, which refuses more than one game per folder. The picked files are staged whenever the folder holds other games, together with that game's own update / add-on content found by title ID. The output IPA's path is read from the script's "output IPA:" line as the comment beside ipaPath already said (it stayed empty without an output folder). - Installing. scripts/install_ios.py signs the IPA with the Mac's Apple Development certificate (profile from Xcode's automatic signing through a throwaway project, with increased-memory-limit when the team can have it), installs it with devicectl and copies the romfs/ archive into Documents/romfs, only the files whose SHA-1 changed and the index last. The save, the learned pipelines and the launcher's settings are copied to the Mac first and put back if the install emptied the app's data; a listing that cannot be read stops the install rather than risk the save. When org.nxnative.<title ID> already belongs to another team (App IDs are global, first come first served), the app is signed as a team-specific variant of it. The window gets a device / team picker, "after the build, sign and install on …" and Install now. Tested on an iPad mini (A17 Pro): Bayonetta 3 (install, re-install that sent nothing, one changed shard resent alone) and Super Mario Bros. Wonder from the app (build, App ID taken → team variant, 3.5 GB of game files, boots to the title at 60 fps). Co-Authored-By: Claude Opus 5.5 <[email protected]>
e2f650c to
e2d929b
Compare
|
Thanks for applying 1 and 2 ahead, and for catching the sync patcher text — I would have missed that one. Rebased onto current main (
Built with On the DLC staging question: it is a range check, not a walk, so gaps in DLC numbering do not matter. An add-on's title ID is the application's ID + 0x1000 with the add-on index in the low 12 bits, so every add-on of a game lands in |
An Intel Python (an Intel Homebrew in /usr/local) runs under Rosetta on an Apple silicon Mac, and its children prefer the x86_64 slice: the shader translator's universal apphost asks for an x86_64 .NET, finds only the arm64 one, prints nothing, and the build stops at the iOS shader step with an empty "xlate_source: lock … / actual" — advice that points at the translator when the problem is the interpreter. One sysctl call turns a mystery into a one-line fix. ufooer found this on an iPad bring-up (PR #31, item 3). The check is a carrier entry in sync_upstream.py, because build_ipa_from_nsp.py is a vendored file: added by hand without the patcher entry, it would have been silently reverted by the next sync, which is exactly how the NRO header skip was lost earlier today.
|
Closing this in favour of #28, which merged as What is on
What I did not take, and why:
So: one item in already, one merged today, one tracked as #58, one superseded by design. If you have more from that iPad bring-up — and a Mario Wonder build that boots to the title at 60 fps suggests you do — they will be read on their own merits, as this one was. |
…ssue #58) The launcher passed the picked game's whole folder to the script, and the script refuses a folder with more than one title family ("more than one game in the folder, keep one game per folder") — so a `~/ROMs` with five games could not build any of them, and nothing said why. The staging that already existed for "base game and update in different folders" now also covers "this folder holds other games": the picked files are symlinked into a temporary folder, and that game's own update and add-on content come along. Siblings are classified exactly as build_ipa_from_nsp.py:445 does — low 12 bits 0x000 base, 0x800 update, anything else add-on below the base — so the two cannot disagree about what belongs to which game. The log says when this happens, so it is not silent magic. ufooer wrote this in PR #31 and I could not take that commit as-is (it carried the install script this fork now does through Xcode, and a Rosetta guard that is already on main); the staging half is applied here, with the classification matching the script's rather than the approximation in the original. **Also fixes a test that never ran.** `testLastMeaningfulLineSkipsProgressEventsAndBlankLines` (issue #52's test, `dc65dbab`) was added *after* LibraryTests' closing brace, so it sat at file scope and XCTest never collected it: `swift test` reported 32 tests both before and after it existed, and I read that as "it passed". It is inside the class now, and the count went 32 → 35 with the two new ones. Nothing was wrong with the code it covers, only with my evidence for it. Swift 35 tests, 0 failures.
Four things found while taking Bayonetta 3 and Super Mario Bros. Wonder from NSPs to an iPad mini (A17 Pro) with NS Port Builder on an Apple silicon Mac. One commit each.
1. RomFS archive: a trailing slash names the same directory
Bayonetta 3 never started its opening movie on iOS (both update 1.1.0 and 1.2.0): the game sat on the swirling scene at 60 fps and no movie decoder was ever created.
DM_FS=1showed why, once at boot:The game opens
movie/with a trailing slash.opendir(3)on a plain tree ignores it, so the Mac never saw this; the archive'sfind_dircompared byte for byte and said the folder did not exist.find_dirnow drops trailing slashes (coversromfsarc_is_dir/_list/_count), andt_romfs_arcchecks every directory again with a slash appended — the old code fails it formovie/,movie/skilltree/,movie/tutorial/. With the fix the movie plays on the device.2. iOS app:
main.mtakes the game ID from the runtime profile73a89fb moved
main.mfromgame_profile.htohle_profile.hbut left two uses ofDM_GAME_ID, so every IPA build currently stops in xcodebuild (use of undeclared identifier 'DM_GAME_ID', main.m:46 and :95). Both readdm_profile()->idnow, like the RomFS marker beside them.3. Build script: stop early under Rosetta
On a Mac with an Intel Homebrew in
/usr/local, the firstpython3is x86_64. Its children prefer the x86_64 slice, so the shader translator's universal apphost looks for an x86_64 .NET, finds only the arm64 one, prints nothing, and the build stops at the iOS shader step withxlate_source: lock … / actual(empty) — which reads like a stale translator.sysctl.proc_translatedis checked up front and the message says what to do.4. NS Port Builder: native Python, one game per folder, install on a device
ipaPathis now read from the script'soutput IPA:line, as its comment already said (it stayed empty without an output folder).scripts/install_ios.py, also usable from a terminal). It signs the IPA with the Mac's own Apple Development certificate — the profile comes from Xcode's automatic signing through a throwaway project, withincreased-memory-limitwhen the team can have it — installs withdevicectl, and copies theromfs/archive intoDocuments/romfs: only files whose SHA-1 changed, the index last, sizes checked. The save,pso_user.tsvand the launcher's settings are copied to the Mac first and put back if the install emptied the app's data; if the app's data cannot be listed (it happens over Wi-Fi) it stops instead of installing without a backup. App IDs are global, so whenorg.nxnative.<title ID>already belongs to another team (it did for Mario Wonder), the app is signed as a stable team-specific variant. Nothing about the account is stored but the team picked in the window. The window gets a device / team picker, "after the build, sign and install on …" and Install now.Tested
t_romfs_arcon both games' archives (551 and 19,012 files).swift build -c releasefor the front end; the iOS app builds with item 2.🤖 Generated with Claude Code