close
Skip to content

Add real-PSP USB debug loop: bun run psp:hw#37

Merged
doodlewind merged 1 commit into
mainfrom
psp-hw-debug
Jul 2, 2026
Merged

Add real-PSP USB debug loop: bun run psp:hw#37
doodlewind merged 1 commit into
mainfrom
psp-hw-debug

Conversation

@doodlewind

Copy link
Copy Markdown
Owner

What

bun run psp:hw <game> runs a freshly compiled game on a real PSP over USB — no memory-stick copy. It drives the PSPLINK + usbhostfs debug chain so you get a tight edit → build → run loop on real hardware.

bun run psp:hw walk3d   # build, load onto the PSP, then press Enter to hot-reload
  • usbhostfs_pc serves the cargo output dir to the PSP as host0:
  • pspsh ldstarts the raw pspjs-runtime.prx through PSPLINK (stays resident)
  • Reload = reset (clean memory) + ldstart (your latest build)

No env vars. The script auto-picks a free TCP port block and waits for the USB reconnect after each reset.

Why these specifics (encoded so you don't hit them)

  • Load the raw .prx, not EBOOT.PBP — PSPLINK doesn't unwrap the PBP container → 0x80020148 UNSUPPORTED_PRX_TYPE.
  • reset before each reload, not modstun — rust-psp modules don't free memory on stop → 0x800200D9 MEMBLOCK_ALLOC_FAILED on the 2nd load.
  • Auto-avoid a squatter on the default PSPLINK port 10000 (e.g. Baidu Netdisk).

Contents

  • scripts/psp-hw.ts — the wrapper (build + serve + reload loop; --once, --no-build, -r).
  • docs/psp-hardware-debugging.md — one-time host-tools + PSPLINK setup, usage, troubleshooting, and the manual command equivalent.
  • package.json psp:hw script + README pointer.

Test

Validated end-to-end on a real PSP (Pro CFW): auto-selected port 10100, detected the PSP, reset + reconnect, ldstart succeeded, clean exit. Full bun run psp:hw walk3d --once (bundle + cargo build + load) also verified.

🤖 Generated with Claude Code

Run a freshly compiled game on a real PSP over USB (PSPLINK + usbhostfs),
with no memory-stick copy. `scripts/psp-hw.ts` serves the cargo output as
host0:, ldstarts the raw .prx through PSPLINK, and gives an edit -> build ->
run reload loop (Enter to rebuild+reload). No env vars: it auto-picks a free
TCP port block and waits for the USB reconnect after each reset.

Encodes the hard-won details so callers don't hit them:
- load the raw pspjs-runtime.prx, not EBOOT.PBP (PSPLINK doesn't unwrap PBP
  -> 0x80020148 UNSUPPORTED_PRX_TYPE)
- reset before each reload, not modstun (rust-psp modules don't free memory
  -> 0x800200D9 MEMBLOCK_ALLOC_FAILED)
- auto-avoid a squatter on the default port 10000

Adds docs/psp-hardware-debugging.md (host tools + PSPLINK setup, usage,
troubleshooting, manual equivalent) and a README pointer.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@doodlewind
doodlewind merged commit 4584803 into main Jul 2, 2026
2 checks passed
@doodlewind
doodlewind deleted the psp-hw-debug branch July 2, 2026 08:08
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