From e4a7fbf3452bdd37baef8e5be292c799c244fd3f Mon Sep 17 00:00:00 2001 From: "Yifeng \"Evan\" Wang" <7312949+doodlewind@users.noreply.github.com> Date: Thu, 1 Oct 2026 08:03:58 +0800 Subject: [PATCH 1/3] feat(3ds): deploy the console binary over the dev connection `bun run deploy` builds the .3dsx, the running shell writes it to sdmc:/3ds/pocketshell-main.3dsx and the console restarts into it through the Homebrew Launcher's loader, running the guest the new file embeds. ftpd is now needed once, to pair; `deploy --ftp --host ` copies one binary through ftpd for a Runtime older than this. The PocketJS pin moves to pocket-nexus/pocketjs#504, which adds .3dsx install and launch to the 3DS dev connection. Co-Authored-By: Claude Opus 5.5 --- AGENTS.md | 14 +++++++++----- README.md | 1 + package.json | 1 + shells/3ds/README.md | 15 ++++++++++----- shells/3ds/package.json | 1 + shells/3ds/scripts/deploy.ts | 18 ++++++++++++++++++ vendor/pocketjs | 2 +- 7 files changed, 41 insertions(+), 11 deletions(-) create mode 100644 shells/3ds/scripts/deploy.ts diff --git a/AGENTS.md b/AGENTS.md index c95322f..4193ee0 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -58,8 +58,9 @@ documentation or tests. New validation runs stay in ignored artifact folders. ```sh bun run check # typecheck + all four shells' unit and sim tests bun run push --host # rebuild the guest, hot-push it (~20 s) +bun run deploy --host # rebuild the .3dsx, install it over the wire, restart into it bun run shot --host # a screenshot of both screens -bun run 3ds # the full .3dsx — needed for a reflash +bun run 3ds # the full .3dsx in dist/3ds bun run film # re-record media/ from the tapes bun run goldens # byte-compare the pinned frames ``` @@ -90,10 +91,13 @@ bun run check:desktop # or check:3ds / check:ipod Run these commands from the repository root. Each shell also has its own package.json; desktop artifacts land in `shells/desktop/dist/`. -`shells/3ds/src/` changes are hot pushes. A change under `vendor/pocketjs/hosts/3ds` is -native: rebuild the `.3dsx`, copy it to the SD card, relaunch. **ftpd cannot -run while Pocket Runtime does** — one homebrew at a time — so pairing happens -with ftpd up and pushing happens with the shell up. +`shells/3ds/src/` changes are hot pushes, and an accepted push persists on +the card for this app. A change under `vendor/pocketjs/hosts/3ds` is native: +`bun run deploy` writes the new `.3dsx` to `sdmc:/3ds/` through the running +shell and restarts into it, and the restarted `.3dsx` boots the guest it +embeds. **ftpd is needed once, to pair** (ftpd and Pocket Runtime are both +homebrew, and one runs at a time); a Runtime that predates `deploy` takes one +`bun run deploy --ftp --host ` with ftpd open. ## What the tapes are for diff --git a/README.md b/README.md index ee5329b..aab5e45 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,7 @@ to list its commands, including captures, benchmarks and the text companion. bun run guest # bundle the 3DS guest for the simulator bun run 3ds # full console binary in dist/3ds bun run push --host # rebuild and hot-push the 3DS guest +bun run deploy --host # install the .3dsx over the wire and restart into it bun run shot --host # capture both console screens bun run film # regenerate shells/3ds/media from tapes bun run goldens # compare pinned 3DS frames diff --git a/package.json b/package.json index af9d382..b16b7ce 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "guest": "bun run --cwd shells/3ds guest", "pair": "bun run --cwd shells/3ds pair", "push": "bun run --cwd shells/3ds push", + "deploy": "bun run --cwd shells/3ds deploy", "probe": "bun run --cwd shells/3ds probe", "shot": "bun run --cwd shells/3ds shot", "film": "bun run --cwd shells/3ds film", diff --git a/shells/3ds/README.md b/shells/3ds/README.md index 5127ab4..c52f389 100644 --- a/shells/3ds/README.md +++ b/shells/3ds/README.md @@ -188,13 +188,18 @@ To iterate without reflashing, pair once while the console is running ftpd, then hot-push the guest package — the app keeps running: ```sh -bun run pair --host 192.168.1.20 # once, with ftpd open on the console -bun run push --host 192.168.1.20 # rebuild + push, about 20 s -bun run shot --host 192.168.1.20 # a screenshot of both screens +bun run pair --host 192.168.1.20 # once, with ftpd open on the console +bun run push --host 192.168.1.20 # rebuild + push, about 20 s +bun run deploy --host 192.168.1.20 # new .3dsx over the wire, then restart into it +bun run shot --host 192.168.1.20 # a screenshot of both screens ``` -A change under `vendor/pocketjs/hosts/3ds` is native and needs `bun run 3ds` -and a reflash; everything in `src/` is a hot push. +Everything in `src/` is a hot push, and an accepted push is what the shell +boots next time. A change under `vendor/pocketjs/hosts/3ds` is native: +`bun run deploy` builds the `.3dsx`, the running shell writes it to +`/3ds/pocketshell-main.3dsx`, and the console restarts into it through the +Homebrew Launcher's loader, running the guest the new file embeds. ftpd is +not part of either loop after pairing. ## Checks diff --git a/shells/3ds/package.json b/shells/3ds/package.json index c67869c..fcea3e1 100644 --- a/shells/3ds/package.json +++ b/shells/3ds/package.json @@ -10,6 +10,7 @@ "guest": "bun scripts/guest.ts", "pair": "bun scripts/pair.ts", "push": "bun scripts/push.ts", + "deploy": "bun scripts/deploy.ts", "probe": "bun scripts/probe.ts", "shot": "bun scripts/shot.ts", "film": "bun scripts/film.ts", diff --git a/shells/3ds/scripts/deploy.ts b/shells/3ds/scripts/deploy.ts new file mode 100644 index 0000000..83ba071 --- /dev/null +++ b/shells/3ds/scripts/deploy.ts @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +// bun run deploy [--host ] [--no-launch] — build the console binary and +// install it over the Pocket Runtime dev wire at sdmc:/3ds/pocketshell-main.3dsx, +// then restart into it. The running shell receives the file, so ftpd is not +// involved; a Runtime older than this needs one copy through ftpd first: +// bun run deploy --ftp --host , with ftpd open. + +import { resolve } from "node:path"; +import { $ } from "bun"; +import { passThrough, plantDeviceKeys } from "../../../scripts/run.ts"; +import { DIST_3DS, ROOT, VENDOR } from "./paths.ts"; + +await plantDeviceKeys(); +await passThrough($`bun ${resolve(import.meta.dir, "3ds.ts")}`.cwd(ROOT)); +await passThrough( + $`bun ${VENDOR}/tools/3ds-dev.ts install --file ${DIST_3DS}/pocketshell-main.3dsx ${process.argv.slice(2)}` + .cwd(ROOT), +); diff --git a/vendor/pocketjs b/vendor/pocketjs index 50b4471..6e5def9 160000 --- a/vendor/pocketjs +++ b/vendor/pocketjs @@ -1 +1 @@ -Subproject commit 50b4471b161858889cda41e6ad666f58d49cc089 +Subproject commit 6e5def9c0647243626ad9c304a0f546cab469f1d From 5d2b961b77ba92d63567b30c967952b15f87f238 Mon Sep 17 00:00:00 2001 From: "Yifeng \"Evan\" Wang" <7312949+doodlewind@users.noreply.github.com> Date: Thu, 1 Oct 2026 08:38:50 +0800 Subject: [PATCH 2/3] docs(3ds): name hb:ldr and route native changes to deploy Co-Authored-By: Claude Opus 5.5 --- shells/3ds/README.md | 4 ++-- shells/3ds/scripts/push.ts | 2 +- vendor/pocketjs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/shells/3ds/README.md b/shells/3ds/README.md index c52f389..aca9c1f 100644 --- a/shells/3ds/README.md +++ b/shells/3ds/README.md @@ -197,8 +197,8 @@ bun run shot --host 192.168.1.20 # a screenshot of both screens Everything in `src/` is a hot push, and an accepted push is what the shell boots next time. A change under `vendor/pocketjs/hosts/3ds` is native: `bun run deploy` builds the `.3dsx`, the running shell writes it to -`/3ds/pocketshell-main.3dsx`, and the console restarts into it through the -Homebrew Launcher's loader, running the guest the new file embeds. ftpd is +`/3ds/pocketshell-main.3dsx`, and the console restarts into it through +Luma3DS's `hb:ldr` loader, running the guest the new file embeds. ftpd is not part of either loop after pairing. ## Checks diff --git a/shells/3ds/scripts/push.ts b/shells/3ds/scripts/push.ts index f0cbb2b..006d8b9 100644 --- a/shells/3ds/scripts/push.ts +++ b/shells/3ds/scripts/push.ts @@ -2,7 +2,7 @@ // bun run push [--host ] — rebuild the guest package and hot-push it to a // paired console over the Pocket Runtime dev wire, without touching the native // binary. This is the loop for app changes; a change under -// vendor/pocketjs/hosts/3ds needs `bun run 3ds` and a reflash. +// vendor/pocketjs/hosts/3ds is a native one, for `bun run deploy`. import { resolve } from "node:path"; import { $ } from "bun"; diff --git a/vendor/pocketjs b/vendor/pocketjs index 6e5def9..52e5f79 160000 --- a/vendor/pocketjs +++ b/vendor/pocketjs @@ -1 +1 @@ -Subproject commit 6e5def9c0647243626ad9c304a0f546cab469f1d +Subproject commit 52e5f7916ab04a84281473b2045824e7d4f75eaa From d719be35e32580e5cd5f3d31947437903a90abb5 Mon Sep 17 00:00:00 2001 From: "Yifeng \"Evan\" Wang" <7312949+doodlewind@users.noreply.github.com> Date: Thu, 1 Oct 2026 08:46:43 +0800 Subject: [PATCH 3/3] chore: move the PocketJS pin to 4198f71c Co-Authored-By: Claude Opus 5.5 --- vendor/pocketjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/pocketjs b/vendor/pocketjs index 52e5f79..4198f71 160000 --- a/vendor/pocketjs +++ b/vendor/pocketjs @@ -1 +1 @@ -Subproject commit 52e5f7916ab04a84281473b2045824e7d4f75eaa +Subproject commit 4198f71ce5cfc9bbb31f5800969f8e06ce6941a1