• Pascal 89.5%
  • Makefile 10.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Your Name 805193a334 gp5gen: match known-good reference output
Two divergences from a known-good prospero-pub-cmd project, found by
diffing generated output against a real title reference (PPSA03671):

- <package> no longer emits a content_id attribute; the SDK takes it
  from param.json at build time and the reference omits it.
- skip build-time SDK scratch a proper project excludes:
  sce_sys/origin-*, sce_sys/target-* (param + relocinfo) and the
  regenerated sce_sys/about/ rights stub.

Output is now byte-for-byte identical to the reference (280/280 files).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-24 16:23:42 +01:00
reference initial commit 2026-08-24 03:57:56 +01:00
.gitignore initial commit 2026-08-24 03:57:56 +01:00
ccon.pas initial commit 2026-08-24 03:57:56 +01:00
gengp5.dpr initial commit 2026-08-24 03:57:56 +01:00
gengp5.dproj initial commit 2026-08-24 03:57:56 +01:00
gp5compat.pas initial commit 2026-08-24 03:57:56 +01:00
gp5gen.pas gp5gen: match known-good reference output 2026-09-24 16:23:42 +01:00
main.dfm initial commit 2026-08-24 03:57:56 +01:00
main.pas initial commit 2026-08-24 03:57:56 +01:00
Makefile initial commit 2026-08-24 03:57:56 +01:00
README.md initial commit 2026-08-24 03:57:56 +01:00

gengp5 — PS5 .gp5 project generator

PS5 counterpart of gengp4-src (the reconstructed "GP4 Generator v1.8"). Point it at a PS5 title folder and it writes a prospero-pub-cmd project file listing everything that belongs in the package.

gengp5 <PPSAxxxxx-dir>     ->  <PPSAxxxxx-dir>/<TITLEID>.gp5

Unlike gengp4 this is read-only: it does not patch param.json and does not rewrite executables. Those PS4 fake-PKG steps have no PS5 equivalent.

What it does

GenerateGP5(dir)
  ├─ read   dir/sce_sys/param.json
  │           titleId, contentId, contentVersion,
  │           applicationCategoryType, pubtools.creationDate
  ├─ read   dir/sce_sys/playgo-chunk.dat  ('plgx'), or 1-chunk/1-scenario defaults
  └─ emit   dir/<TITLEID>.gp5
              <volume>  volume_type / package / chunk_info → chunks + scenarios
              <files>   every file, minus tool-generated artefacts

applicationCategoryType picks the volume type: 0 → prospero_app, 1 → prospero_ac. There is deliberately no patch mode — PS5 has no prospero_patch volume; a patch is img_create --ref_pkg_path over an ordinary app project. See reference/gp5-schema.md.

Verified end to end

Not just written — exercised against the real toolchain and a real title (PPSA01547, a full dump with its own known-good .gp5):

  1. Built with FPC 3.2.2 — 0 errors, 0 warnings.

  2. Ran against the title. The generated <volume> / <chunk_info> block is structurally identical to the reference project, and the file list reproduces all 44 of the reference's entries.

  3. Fed the generated .gp5 straight to the SDK:

    prospero-pub-cmd img_create --oformat nwonly PPSA01547.gp5 test.pkg
    

    It produced a valid 29 MB PS5 Application Package — only the routine "not built for submission" warnings. img_info on the result reports the correct Content ID, Title ID and Content Version.

The one difference from the reference: our output also lists seven root-level .prx files (libc.prx, EAWebKit.prx, libSceFace.prx, …) that duplicate entries in sce_module/. They exist in that dump but the reference project omits them. They look like extraction leftovers rather than something the format excludes, so the tool lists what is actually on disk instead of guessing a rule. Delete them from the folder if they shouldn't ship.

Files

File
gp5gen.pas all the logic — param.json, playgo, skip list, emitter
gp5compat.pas Delphi/FPC shim: stream type, path/wildcard constants, dotted-path JSON reader, XML escaping
main.pas, main.dfm VCL form (plain TEdit + browse button — no RX dependency)
ccon.pas console-in-a-GUI-app helper, carried over from gengp4
gengp5.dpr, gengp5.dproj, Makefile build
reference/gp5-schema.md the schema, and how each part of it was established

Building

Two flavours, selected by the GP5GEN_GUI conditional.

Console (Linux / macOS / Windows, Free Pascal) — make

sudo apt install fpc     # fcl-json ships with it; make deps checks
make
./gengp5 /path/to/PPSA01234

make deps reports what was found, make win32 / make win64 cross-compile Windows binaries, make help lists everything. This flavour builds all of gp5gen.pas; only the window is missing.

VCL GUI (Windows + Delphi)

Open gengp5.dproj and build for Win32, or msbuild gengp5.dproj /p:Config=Release /p:Platform=Win32. No third-party components needed.

Caveats

  • The GUI flavour is not build-tested here (no Delphi on this machine). The console flavour — which is the whole generator — is.
  • JSON parsing uses System.JSON on Delphi and fpjson on FPC, behind gp5compat.JsonGet. Only scalar values by dotted path are supported, which is all param.json needs.
  • Chunk assignment is not emitted per file (<file chunk="…">). Every file lands in the default chunk, matching the reference project. Titles that genuinely split content across PlayGo chunks would need that added.
  • supported_languages / default_language / per-chunk languages are accepted by the format but not emitted; the reference project omits them too.