Repository navigation
Conversation
|
Handoff note (for whoever continues this PR). The implementation agent stopped here; everything is on disk and in git. Where the work is
What is done
What remains (in order)
|
The vendored tree is generated from seedds at .upstream-ref plus patches/, so route C M1 is four format-patches with the required header (Upstream-Status: pending; Reason: route C M1: game modules as an opt-in framework; Issue #144): 0020-route-c-loader-image-header dm_set_game_image_header and loader.c's settable IMAGE_MH 0021-route-c-game-framework project-framework.yml, DmGameMarker.m, FrameworkBootstrap and main.m's DM_FRAMEWORK_BUILD blocks 0022-route-c-framework-build build_ipa.sh DM_FRAMEWORK=1, gen_manifest.py, the NSP script's --framework and compile_check.py's second pass 0023-route-c-framework-tests the framework packaging/link tests and --prepare-xcode --framework series and dm/fork_patches.txt list them. `scripts/patches.py apply` reproduces the committed vendored tree; `check` applies all 23 patches to 062cd06 and reports only docs/WORK-IN-PROGRESS.md and docs/probe-dlopen.md, which main's PR #139 (862e937) edited without a patch (the same two lines on plain main).
The vendored tree is generated from seedds at .upstream-ref plus patches/, so route C M1 is four format-patches with the required header (Upstream-Status: pending; Reason: route C M1: game modules as an opt-in framework; Issue #144): 0020-route-c-loader-image-header dm_set_game_image_header and loader.c's settable IMAGE_MH 0021-route-c-game-framework project-framework.yml, DmGameMarker.m, FrameworkBootstrap and main.m's DM_FRAMEWORK_BUILD blocks 0022-route-c-framework-build build_ipa.sh DM_FRAMEWORK=1, gen_manifest.py, the NSP script's --framework and compile_check.py's second pass 0023-route-c-framework-tests the framework packaging/link tests and --prepare-xcode --framework series and dm/fork_patches.txt list them. `scripts/patches.py apply` reproduces the committed vendored tree; `check` applies all 23 patches to 062cd06 and reports only docs/WORK-IN-PROGRESS.md and docs/probe-dlopen.md, which main's PR
|
Both queue repairs landed (#147 drops the revoked prune patch; #148 adds |
|
For M2: would you like me to take the shell's UI (the library, game tiles, the per-game states playable / needs data / needs framework / broken, the data picker) as a view-only PR with mock data, in the Mac launcher's look, the way the onboarding was done (#119)? You'd keep the wiring (dlopen, manifest, GameData.m), and the views would plug into it through a small driver protocol. Per-game settings would stay upstream's Launcher.swift reading the game's launcher.json, as in your plan. |
The vendored tree is generated from seedds at .upstream-ref plus patches/, so route C M1 is four format-patches with the required header (Upstream-Status: pending; Reason: route C M1: game modules as an opt-in framework; Issue #144): 0020-route-c-loader-image-header dm_set_game_image_header and loader.c's settable IMAGE_MH 0021-route-c-game-framework project-framework.yml, DmGameMarker.m, FrameworkBootstrap and main.m's DM_FRAMEWORK_BUILD blocks 0022-route-c-framework-build build_ipa.sh DM_FRAMEWORK=1, gen_manifest.py, the NSP script's --framework and compile_check.py's second pass 0023-route-c-framework-tests the framework packaging/link tests and --prepare-xcode --framework series and dm/fork_patches.txt list them. `scripts/patches.py apply` reproduces the committed vendored tree; `check` applies all 23 patches to 062cd06 and reports only docs/WORK-IN-PROGRESS.md and docs/probe-dlopen.md, which main's PR
|
@LNPANDY, a note on where these patches go, for when this continues after the device run. All five patches (0020 to 0023 and the env-switch row) carry Most of this looks upstream-shaped to me:
One more thing for the rebase: the env-switch patch is numbered |
|
@LNPANDY as agreed, we're continuing M1 from here so the shell (#226, views and host layer done, launching behind a stub) can move on to M2. Plan: rebase onto current main, renumber the five patches to 0034 to 0038 (0032 and 0033 are claimed by open PRs), keep your authorship on the patches you wrote, send the generic parts upstream first (the settable image header at least) so the patches become |
The iOS loader reads the game's embedded module sections (__TEXT,__dm<mod>x0, __DM<mod>W,__img, __TEXT,__dm<mod>x1 and the packed NRO sections) from a fixed &_mh_execute_header, so they must be linked into the app executable. An embedder that links them into another image of the app (a framework it dlopen()s from its signed bundle) had no way to say so. dm_set_game_image_header() (loader_image.h) names that image's mach header. IMAGE_MH, used by map_image() and nro_pieces(), reads it, and unset it is still &_mh_execute_header, so every existing build behaves exactly as before. The host's own tables (__DATA,swforce in force_init(), __DATA,swhle in hle.c) stay the executable's. Nothing calls the setter in this change. Checked: make -C dm/host/tests GAME=010015100B514000 run (includes t_nro and t_symbols, which compile loader.c), and lint_python.py (no Python touched, 0 new findings).
project-framework.yml is the same app target as project.yml without Gen/embed.S
(no embedded modules), plus a DmGame framework target that carries Gen/embed.S and
the marker symbol: embed: true, link: false (the app dlopens it), app rpath
@executable_path/Frameworks, resources Gen/framework/{dm,profile.tsv,
game.manifest.json}. Its framework target gets only gen_embed.py's segment
permissions as link flags (Gen/framework.xcconfig); it links no host framework and
defines no module (DEFINES_MODULE NO: nothing imports it).
DmGameMarker.m exports dmgame_image_marker, the symbol dlsym/dladdr name the
image by. FrameworkBootstrap.m dlopens the framework from the app bundle, dlsyms
the marker, takes the image base with dladdr and hands it to the loader; a failure
is a [RED] line with the dlerror text. Under DM_FRAMEWORK_BUILD (only this project
sets it) main.m points DM_PROFILE at the framework's profile.tsv before the first
dm_profile() call, opens the framework before dm_host_preload_start(), and points
argv[1] and DM_NVN_SHMAP at <framework>/dm; DM_FONT_DIR stays the app's.
Route C M1, docs/launcher-c-plan.md.
build_ipa.sh's framework mode generates Gen/framework/{dm,profile.tsv,
game.manifest.json} and Gen/framework.xcconfig after Gen/dm is complete, runs
xcodegen with project-framework.yml, checks the app embedded DmGame.framework, and
signs it ad-hoc before the app's executable (no entitlements on the framework: a
dylib cannot hold them). Without DM_FRAMEWORK the script runs the same xcodegen
command as before, and pack_ipa.py is unchanged: the framework rides in the app
tree walk. gen_manifest.py writes the plan's game.manifest.json schema.
build_ipa_from_nsp.py --framework sets DM_FRAMEWORK=1 (refused for the Mac
platforms). compile_check.py compiles every source twice, the second time with
DM_FRAMEWORK_BUILD=1, so main.m's dlopen path is checked without Xcode.
Route C M1, docs/launcher-c-plan.md.
The manifest block's FW_SLIM is renamed FW_COPY_ROMFS: it holds DM_COPY_ROMFS's value (YES = the RomFS is packed), so the old name read inverted.
…xcode --framework test_framework_build.py: gen_manifest.py's schema and refusals; build_ipa.sh's --prepare-xcode copies project-framework.yml in with DM_FRAMEWORK=1 and project.yml without it; on a stand-in app and framework, the framework is packed at Frameworks/DmGame.framework with its resources, its signature carries no entitlements, the app's keeps the Increased Memory Limit request, and a default pack has no Frameworks/ entry. test_framework_link.py (skipped without XcodeGen and an iPhoneOS SDK) builds the DmGame target from a synthetic Gen with two stand-in modules and reads it back with otool: __TEXT,__dm<mod>x0, __DM<mod>W,__img, __TEXT,__dm<mod>x1 for each, the NRO pieces and __DATA,__dm_nro_tab, install name @rpath/DmGame.framework/DmGame, and the tables/profile/manifest at the framework's root. The generated project shows the app's Embed Frameworks phase and @executable_path/Frameworks rpath. test_xcode_workflow.py: --prepare-xcode --framework passes DM_FRAMEWORK=1 to the build. CI runs the link test in the ios-build job, which installs XcodeGen. Route C M1, docs/launcher-c-plan.md.
`build_ipa.sh` reads DM_FRAMEWORK (and the NSP script sets it), so dm/tools/env_switches.py --check lists it as a switch the code reads but docs/env_switches.tsv does not describe. One row, class `switch`, with what `=1` does and that the default keeps the in-executable build.
XcodeGen and xcodebuild of the DmGame framework target from a synthetic Gen/. test_framework_build.py's packaging half runs in tool-tests, its link half needs xcodegen, installed only in this job.
The loader's settable image header is forwarded as seedds/nxnative#729. The game framework, its build, tests and env switch row are fork-only until the runtime profile (seedds/nxnative#492) is upstream, because the framework carries profile.tsv and main.m sets DM_PROFILE.
|
Device run prepared, not finished. Built from Not done: the install. Z (iPhone 17 Pro Max) was available, but the BotW app is not installed on it and so there is no game data ( Expected hashes from the Mac: not possible. Next I install the IPA, push the RomFS with |
|
Route C continues in #226. @LNPANDY agreed that I take over Route C, so I merged this branch ( What #226 adds on top of this PR:
The engine changes are patches 0039 and 0040 (fork-only, for the same reason as 0035 to 0038). I'll keep this PR open as a draft until #226 is reviewed, then close it in favour of #226. |
|
Device result for Route C, recorded in #226: on an iPhone 17 Pro Max (iOS 27.0.1) Breath of the Wild loads from its framework inside the shell (module bases from the framework's sections, RomFS image and both DLC from Documents) and plays, and Hades runs next to it in the same shell on one host binary (M3). M1 is therefore verified on a device as part of the shell. Settings chosen in the shell still do not reliably reach the game, which is listed as open in #226. |
…and iPad The view layer of the Route C shell (#144) in a new frontend-ios package, building on a first pass by Codex (input types, focus model, size-driven layouts, state handling). - Library in portrait: the selected game's art as a full-bleed hero with the title over it, a row or grid of covers, recently played, one cream primary action. Two panes with inline settings at regular sizes. - Library wider than tall: Cover Flow over the blurred cover, snapping to the centre, neighbours turned back, a short shelf for one to three games. - Artwork input decoded once by the host (the NACP icon or key art), with a deliberate placeholder when a game has none. - Settings, game data, cloud saves, state views and controllers restyled after the Mac launcher, with fewer cards and stronger type. - Demo games with their own drawn cover art, a foldable stand-in harness, layout unit tests, UI tests for controller input, rotation and folding, and a capture test for visual review.
…and iPad The view layer of the Route C shell (#144) in a new frontend-ios package, building on a first pass by Codex (input types, focus model, size-driven layouts, state handling). - Library in portrait: the selected game's art as a full-bleed hero with the title over it, a row or grid of covers, recently played, one cream primary action. Two panes with inline settings at regular sizes. - Library wider than tall: Cover Flow over the blurred cover, snapping to the centre, neighbours turned back, a short shelf for one to three games. - Artwork input decoded once by the host (the NACP icon or key art), with a deliberate placeholder when a game has none. - Settings, game data, cloud saves, state views and controllers restyled after the Mac launcher, with fewer cards and stronger type. - Demo games with their own drawn cover art, a foldable stand-in harness, layout unit tests, UI tests for controller input, rotation and folding, and a capture test for visual review.
…and iPad The view layer of the Route C shell (#144) in a new frontend-ios package, building on a first pass by Codex (input types, focus model, size-driven layouts, state handling). - Library in portrait: the selected game's art as a full-bleed hero with the title over it, a row or grid of covers, recently played, one cream primary action. Two panes with inline settings at regular sizes. - Library wider than tall: Cover Flow over the blurred cover, snapping to the centre, neighbours turned back, a short shelf for one to three games. - Artwork input decoded once by the host (the NACP icon or key art), with a deliberate placeholder when a game has none. - Settings, game data, cloud saves, state views and controllers restyled after the Mac launcher, with fewer cards and stronger type. - Demo games with their own drawn cover art, a foldable stand-in harness, layout unit tests, UI tests for controller input, rotation and folding, and a capture test for visual review.
…and iPad The view layer of the Route C shell (#144) in a new frontend-ios package, building on a first pass by Codex (input types, focus model, size-driven layouts, state handling). - Library in portrait: the selected game's art as a full-bleed hero with the title over it, a row or grid of covers, recently played, one cream primary action. Two panes with inline settings at regular sizes. - Library wider than tall: Cover Flow over the blurred cover, snapping to the centre, neighbours turned back, a short shelf for one to three games. - Artwork input decoded once by the host (the NACP icon or key art), with a deliberate placeholder when a game has none. - Settings, game data, cloud saves, state views and controllers restyled after the Mac launcher, with fewer cards and stronger type. - Demo games with their own drawn cover art, a foldable stand-in harness, layout unit tests, UI tests for controller input, rotation and folding, and a capture test for visual review.
…and iPad The view layer of the Route C shell (#144) in a new frontend-ios package, building on a first pass by Codex (input types, focus model, size-driven layouts, state handling). - Library in portrait: the selected game's art as a full-bleed hero with the title over it, a row or grid of covers, recently played, one cream primary action. Two panes with inline settings at regular sizes. - Library wider than tall: Cover Flow over the blurred cover, snapping to the centre, neighbours turned back, a short shelf for one to three games. - Artwork input decoded once by the host (the NACP icon or key art), with a deliberate placeholder when a game has none. - Settings, game data, cloud saves, state views and controllers restyled after the Mac launcher, with fewer cards and stronger type. - Demo games with their own drawn cover art, a foldable stand-in harness, layout unit tests, UI tests for controller input, rotation and folding, and a capture test for visual review.
What and why
Route C M1 is opt-in: nothing changes unless
DM_FRAMEWORK=1is asked for. With the switch, the game's rewritten modules compile intoDmIOS.app/Frameworks/DmGame.frameworkinstead of the executable. The appdlopens it at launch, takes its mach header withdlsym+dladdr, and the loader reads__TEXT,__dm<mod>x0,__DM<mod>W,__img,__TEXT,__dm<mod>x1and__DATA,__dm_nro_tabfrom it. Without the switch,build_ipa.shruns the samexcodegen generate -qand the same pack as before, noGen/framework/is generated, no framework is signed, and the IPA has noFrameworks/.dm/ios/project.ymlis not edited. In the loader,IMAGE_MHstill defaults to&_mh_execute_header. Every new block inmain.mis behindDM_FRAMEWORK_BUILD, which onlyproject-framework.ymldefines.This is the off-device half of the milestone in docs/launcher-c-plan.md. The real payload is still unproven until the device run below.
Who continues this
@LNPANDY wrote it and agreed that @v0lumehi continues the branch (rebase, patch numbers, upstream, off-device checks). The device run stays with the owner. The commits Andy wrote keep him as author, and the force push to
route-c-m1replaced the 2026-10-28 state with the same changes on current main.Patches (new numbers)
Main moved to pin
ee6648cband patches up to 0031, and open PRs claim 0032 and 0033, so the old 0020 to 0023 and 0025 became 0034 to 0038, in the same order. The one conflict on the rebase was inmain.mandbuild_ipa.sh(main's per-game data folder, cheats andDMCommitlines), resolved by keeping both sides. AFW_SLIMvariable inbuild_ipa.shis renamedFW_COPY_ROMFS(it heldDM_COPY_ROMFS's value, so the old name read inverted, the first item in the earlier review notes).0034-route-c-loader-image-headerloader_image.h, the settableIMAGE_MHinloader.cforwarded seedds/nxnative#7290035-route-c-game-frameworkproject-framework.yml,DmGameMarker.m,FrameworkBootstrap,main.mblocksfork-only0036-route-c-framework-buildbuild_ipa.shDM_FRAMEWORK=1,gen_manifest.py, NSP--framework,compile_check.pyfork-only0037-route-c-framework-tests--prepare-xcode --frameworktestsfork-only0038-dm-framework-env-switch-rowDM_FRAMEWORKrow indocs/env_switches.tsvfork-onlyNo patch is
pending..github/workflows/tests.yml(the link test in the ios-build job) is not vendored, so it is an ordinary commit by Andy.Upstream first, per patch
loader.c,lint_python.pywith 0 new findings). The upstream text and the two comments that named this repository's plan doc are reworded, the code is the same.profile.tsv,main.msetsDM_PROFILEbefore the firstdm_profile()call, andbuild_ipa.shand the link test callgame.py profile. All of that exists only with our0001-runtime-profilepatch, and upstream has only the design note for it (Proposal: a game profile the host reads at run time (design note and dm_profile() accessor) seedds/nxnative#492). I tried the series on seedds main: the link test fails atgame.py profile. Splitting the profile out of Andy's design would change the manifest and the plan, which is not mine to decide here. TheirReason:says so. When Shared-app build fails at the last step on a read-only volume: a saved shell root of /NX2Apple-shell #492 is taken in some form, they go upstream as one PR, with Keep the selected Python for Mac host generators #729's setter already there. The CONTRIBUTING size rule (an issue first for a second implementation of an existing path) also applies, so that PR should start with an issue.Checked off-device
On
route-c-m1(maindf713726+ this PR), in a worktree on the NX volume, Xcode 27.1 and XcodeGen:python3 scripts/patches.py check: ok, 26 patches apply toee6648cband give the committed vendored tree (2441 files).patches.py statuslists the five route C patches as above.bash -n dm/ios/tools/build_ipa.sh: ok.GAME=010015100B514000 python3 dm/ios/tools/compile_check.py:(default): 188 files, 0 failedand(DM_FRAMEWORK_BUILD=1): 188 files, 0 failed.python3 -m unittest discover -s dm/ios/tests: 51 tests OK (1 skipped, the case-sensitive disk image test that needshdiutil create). It includestest_framework_link.py(xcodebuild -target DmGamefrom a syntheticGen,otool -lshows the module sections of the main and the NRO module,__DATA,__dm_nro_tab, install name@rpath/DmGame.framework/DmGame, the tables,profile.tsvandgame.manifest.jsonat the framework root),test_framework_build.py(the stand-in framework is packed atFrameworks/DmGame.framework, verifies withcodesign -vvv --verify --strict, carries no entitlements, the app executable keeps the Increased Memory Limit request, a default pack has noFrameworks/entry,--prepare-xcodepicksproject-framework.ymlonly with the switch) andtest_xcode_workflow.py.python3 -m unittest discover -s scripts/tests: 40 tests OK.dm.tools.tests.test_env_switchesanddm.tools.tests.test_docs: OK.dm/tools/env_switches.py --checkpasses with theDM_FRAMEWORKrow.GAME=010015100B514000 python3 dm/ios/tools/build_smoke.py: the default project builds and stages its resources (iOS smoke build passed).Not checked: the device run (why this stays draft)
Off-device tests cannot prove
vm_remapof the framework's signed__TEXTpages (copy=FALSE) orgetsectiondataon adlopened dylib. M1's acceptance ends on a phone, and the owner does it.Test game: Breath of the Wild (
01007EF00011E000, profile v1114112, modules main subsdk0 sdk), because it is the only game with a build folder on the Mac that has a profile and is not huge (13.5 GB base plus a 0.9 GB update, the build folder is/Volumes/NX/games/Zelda Breath of the Wild [01007EF00011E000]/01007EF00011E000_build). Hades has smaller NSPs but no build yet. SSBU (01006A800016E000, for the NRO check) is only NSZ and NSP files with no build folder.I did not build the framework IPA. The build folder's iOS shader libraries are for an older chain (
b-157e1b96c8da, this tree wantsb3ca4b7c621f), so the build would redo the iOS shader stage, which took 27 minutes in the last cold BotW run (about 35 minutes with the app build), over the half hour I allowed.Steps (run from this branch's worktree, writing to an APFS clone so the real build folder stays untouched):
On the phone (owner), for each IPA in turn: install, push the RomFS once with the
scripts/push_romfs.shline the build prints, start the game to the title screen, then copyDocuments/log.txtout. Compare:The framework log must also show
boot: game framework <path>, the dlopen handle, the image base and each module's base and size. For the NRO check, build SSBU the same way (--framework, its NSP folder) and look for__DATA,__dm_nro_taband a workingnro.tsvin its log. iOS 26 and 27 if both are at hand.Notes for review
gen_manifest.pywrites"launcher": "dm/launcher.json", while the same build removesGen/framework/dm/launcher.jsonfrom the framework (the app's copy serves it). Nothing reads the manifest in M1, so M2 should make the key true.project-framework.ymlrepeatsproject.yml's app settings on purpose (the default template stays untouched), so the two will drift unless M2 or M3 fold the shared part into an xcconfig.Scope
patches/0034to0038, headers filled, nopending),scripts/patches.py checkis green