Skip to content

feat: take the app icon from Pocket3D on every console - #36

Merged
doodlewind merged 1 commit into
mainfrom
feat/pocket3d-icon
Oct 5, 2026
Merged

doodlewind merged 1 commit into
mainfrom
feat/pocket3d-icon

Conversation

@doodlewind

Copy link
Copy Markdown
Contributor

What changed

On PSP, PS Vita, Nintendo 3DS and iPod touch 4 the app icon is now the Pocket3D app icon that PocketJS provides, and this repository tracks no icon file.

vendor/pocketjs moves from 223be88d to 81a100ba on PocketJS main (v0.14.0 and pocketjs#534; the old pin is an ancestor of the new one). That commit adds engine/pocket3d/icon/, tools/pocket3d-icon.ts (POCKET3D_ICON) and icon on packageVitaVpk. No Rust crate changed between the two pins, so no Cargo.lock changes.

Console Icon file under vendor/pocketjs/engine/pocket3d/icon/ Wiring
PSP psp/ICON0.PNG (144×80) xmb_icon_png in crates/openstrike-psp/Psp.toml
PS Vita vita/icon0.png (128×128, 8-bit indexed) icon: POCKET3D_ICON.vita to packageVitaVpk in scripts/vita.ts; scripts/e2e-vita.ts expects the same file in the VPK
Nintendo 3DS 3ds/icon.png (48×48), 3ds/icon-small.png (24×24) ICON and SMALL_ICON in scripts/3ds.ts, which PocketJS's 3DS Makefile gives to smdhtool
iPod touch 4 ios/Icon@2x.png (114×114) icon in hosts/ipodtouch4/ipodtouch4.json; PocketJS's packager writes the bundle's 114- and 57-pixel icons from it, and its Info.plist sets UIPrerenderedIcon

Deleted:

  • crates/openstrike-psp/assets/ICON0.png
  • crates/openstrike-vita/static/sce_sys/icon0.png
  • crates/openstrike-3ds/icon.svg, with render3dsIcons() in scripts/3ds.ts and its test in test/3ds-tooling.test.ts
  • test/openstrike-vita-artwork.test.ts (it checked the deleted Vita icon)

scripts/gen-cover.ts now builds crates/openstrike-psp/assets/PIC1.png only. PIC1.png, the XMB backdrop, is unchanged and stays OpenStrike's own picture.

test/pocket3d-icon.test.ts is the guard: it fails when Git tracks an icon file (ICON0.png, icon0.png, a 3DS icon*.png / icon.svg, a bundle Icon*.png) or when one of the four builds stops reading the PocketJS files. bun run test:icon runs it (replacing test:vita-package), and .github/workflows/icon.yml runs it on every pull request with no path filter.

README.md gains a "Pocket3D app icon" section beside the title card section, with the table above, the rule and a pointer to vendor/pocketjs/skills/pocket3d-brand/SKILL.md. The PSP and Vita sections and crates/openstrike-vita/README.md no longer describe an OpenStrike icon.

Verification

All from artifacts built on the host. No console was used.

bun run setup
MAPS=<a directory holding the nine cooked .p3d maps>
ICONS=vendor/pocketjs/engine/pocket3d/icon

# PSP: release EBOOT and the Memory Stick package
bun scripts/psp.ts -r --cooked-maps $MAPS --package
bun -e 'const d=require("fs").readFileSync(process.argv[1]);const o=i=>d.readUInt32LE(8+4*i);
  process.stdout.write(d.subarray(o(1),o(2)))' dist/PSP/GAME/OpenStrike/EBOOT.PBP | cmp - $ICONS/psp/ICON0.PNG
bun -e 'const d=require("fs").readFileSync(process.argv[1]);const o=i=>d.readUInt32LE(8+4*i);
  process.stdout.write(d.subarray(o(4),o(5)))' dist/PSP/GAME/OpenStrike/EBOOT.PBP | cmp - crates/openstrike-psp/assets/PIC1.png

# PS Vita: release VPK (default build, USB debug driver included)
OPENSTRIKE_COOKED_MAPS=$MAPS bun scripts/vita.ts --release
unzip -p dist/vita/OpenStrike.vpk sce_sys/icon0.png | cmp - $ICONS/vita/icon0.png

# Nintendo 3DS: release .3dsx
OPENSTRIKE_COOKED_MAPS=$MAPS bun scripts/3ds.ts

# iPod touch 4: bundle and .ipa
OPENSTRIKE_COOKED_MAPS=$MAPS bun run build:ipod
Artifact Compared with Result
crates/openstrike-psp/target/mipsel-sony-psp/release/EBOOT.PBP and dist/PSP/GAME/OpenStrike/EBOOT.PBP, PBP entry 1 (ICON0.PNG) psp/ICON0.PNG byte-identical
the same two EBOOTs, PBP entry 4 (PIC1.PNG) crates/openstrike-psp/assets/PIC1.png byte-identical
dist/vita/OpenStrike.vpk, sce_sys/icon0.png vita/icon0.png byte-identical
dist/3ds/openstrike.3dsx, dist/3ds/sd/3ds/OpenStrike/OpenStrike.3dsx and the copy inside OpenStrike-3DS-SD.zip: the 14016-byte SMDH at the offset the 3DSX extended header records an SMDH made by smdhtool --create with the same three strings from 3ds/icon.png and 3ds/icon-small.png, in devkitpro/devkitarm@sha256:116afba8… (the build's image) byte-identical
the same SMDH an SMDH made from 3ds/icon.png alone, so smdhtool halves it for the small slot different, as it should be: the build uses the 24-pixel drawing
OpenStrike.app/PocketClassic-User-v7@2x.png (114×114), also inside OpenStrike.ipa ios/Icon@2x.png decoded pixels identical; the packager re-encodes the PNG, so the bytes differ
OpenStrike.app/PocketClassic-User-v7.png (57×57) ios/Icon.png not identical: the packager reduces the 114-pixel file. 958 of 12996 channel values differ, by at most 8
OpenStrike.app/Info.plist — UIPrerenderedIcon true, CFBundleIconFile PocketClassic-User-v7.png, CFBundleDisplayName OpenStrike

Host checks:

  • bun run check:platforms (typecheck, pocket check for psp and vita): pass.
  • bun test on test/pocket3d-icon.test.ts, 3ds-tooling, tactical-touch, primary-touch, primary-touch-gesture, strike-sdk, psp-memory, psp-toolchain, psp-map-read, cook-map, symbian-tooling, map-viewer: 48 pass, 0 fail.
  • bun run test:icon in a clean clone with only vendor/pocketjs initialised and no node_modules: 6 pass. With an ICON0.png added to the index it fails and names the file.

Not run:

  • test/3ds-device-lease.test.ts and test/test_3ds_deploy.py: the first takes the 3DS wire lease, so both are left to CI.
  • scripts/e2e-vita.ts (Vita3K), scripts/e2e-psp.ts and scripts/e2e-3ds.ts: emulator golden runs. The one line changed in e2e-vita.ts is the expected icon path; the VPK comparison above is the same check.
  • The 3DS capture configuration: it passes the same ICON and SMALL_ICON.
  • No install or launch on a PSP, PS Vita, 3DS or iPod touch.

Out of scope: the desktop and Nokia E7 builds do not take the Pocket3D app icon.

🤖 Generated with Claude Code

vendor/pocketjs moves from 223be88d to 81a100ba on PocketJS main (v0.14.0 and
pocketjs#534). That commit adds engine/pocket3d/icon/, the Pocket3D app icon in
the size and file form each console's launcher reads, and `icon` on
packageVitaVpk. Every console build now reads its icon from that checkout, and
this repository tracks no icon file.

- psp: xmb_icon_png in Psp.toml names psp/ICON0.PNG. assets/ICON0.png is
  deleted. assets/PIC1.png, the XMB backdrop, stays OpenStrike's own.
- vita: scripts/vita.ts gives POCKET3D_ICON.vita to packageVitaVpk as `icon`,
  which replaces sce_sys/icon0.png. static/sce_sys/icon0.png is deleted, so
  the static tree holds the staged maps only. scripts/e2e-vita.ts expects the
  same file in the VPK.
- 3ds: scripts/3ds.ts passes 3ds/icon.png and 3ds/icon-small.png as ICON and
  SMALL_ICON to PocketJS's Makefile, which gives both to smdhtool. icon.svg
  and the build step that rasterized it are deleted.
- ipod: hosts/ipodtouch4/ipodtouch4.json names ios/Icon@2x.png as `icon`.
  PocketJS's packager writes the bundle's 114- and 57-pixel icons from it, and
  its Info.plist sets UIPrerenderedIcon.
- scripts/gen-cover.ts builds PIC1.png only.

test/pocket3d-icon.test.ts fails when Git tracks an icon file here or a build
stops reading the PocketJS files. It replaces
test/openstrike-vita-artwork.test.ts, which checked the deleted Vita icon, and
runs on every pull request from .github/workflows/icon.yml.

Verified from artifacts built on the host, with no console:
- PSP release EBOOT: PBP entry 1 equals psp/ICON0.PNG, entry 4 equals
  assets/PIC1.png.
- Vita release VPK: sce_sys/icon0.png equals vita/icon0.png.
- 3DS release .3dsx: its SMDH equals one made from the two files by the same
  smdhtool in the same Docker image, and differs from one made from icon.png
  alone.
- iPod touch bundle and .ipa: the 114-pixel icon decodes to the pixels of
  ios/Icon@2x.png.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@doodlewind
doodlewind merged commit fffcd76 into main Oct 5, 2026
6 checks passed
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