Skip to content

TPM: build from the disc image alone - #4

Merged
finger563 merged 1 commit into
mainfrom
feat/tpm-disc-only
Oct 18, 2026
Merged

finger563 merged 1 commit into
mainfrom
feat/tpm-disc-only

Conversation

@finger563

Copy link
Copy Markdown
Contributor

Summary

Building TPM used to take two of your own files: the executable, extracted by hand into the gitignored components/tpm/tpm-decomp/disks/us/, and the disc image for the movies. A fresh checkout gave only the warning that SLUS_008.84 was not found.

Now CONFIG_TPM_DISC_PATH is the only setting:

  • If there is no file at CONFIG_TPM_EXE_PATH, CMake extracts SLUS_008.84 from the disc image into build/esp-idf/tpm/disc/. It extracts again only when the image is newer than that copy.
  • The executable's SHA-1 is checked against USA Rev 1 (the value already in tpm-decomp's splat.us.yaml). Any other file builds without the game and warns, instead of recompiling into something that crashes.
  • The warnings now say what is missing and which setting to use. With no input: "no SLUS_008.84: set CONFIG_TPM_DISC_PATH to your disc image (or CONFIG_TPM_EXE_PATH to the executable)…".
  • CONFIG_TPM_EXE_PATH still works when the file exists, so existing setups are unchanged.
  • Kconfig lists the disc image first, and its help text says it is the only setting a build needs.
  • The top-level README's Build section and components/tpm/README.md say to set the disc path.

tpm-decomp 00fcb3b: tools/extract_disc.py <disc> <outdir> NAME... extracts just the files named, matched by path or basename, case-insensitively. It exits non-zero if one is missing.

Testing

Local configures:

  • Only the disc path set (no disks/us/SLUS_008.84): extracted, "recomp: 1573 functions, 121575 instructions -> 16 files". A full build succeeds with the runtime and the game linked.
  • CONFIG_TPM_EXE_PATH pointed at a wrong file: the not-USA-Rev-1 warning; builds without the game.
  • Neither set: the new "no SLUS_008.84" warning; builds without the game.

Not flashed to the board; the generated code is the same as before.

🤖 Generated with Claude Code

CONFIG_TPM_DISC_PATH is now the only setting the game needs: when there is
no executable at CONFIG_TPM_EXE_PATH, CMake extracts SLUS_008.84 from the
disc image into the build directory (again only when the image changes),
checks its SHA-1 against USA Rev 1, and recompiles it with the movie
overlay as before. The warnings say what is missing and what to set.
The disc option comes first in menuconfig; the READMEs say to set it.

tpm-decomp 00fcb3b: extract_disc.py can extract just the files named.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@github-actions

Copy link
Copy Markdown

ESP-IDF Size Report for 'Tab5 Emu'

Metric Base PR Delta
FLASH 0 bytes (0.00%) 0 bytes (0.00%) 0 bytes (0.00%)
DRAM 266,582 bytes (60.41%) 266,582 bytes (60.41%) 0 bytes (0.00%)
IRAM 0 bytes 0 bytes 0 bytes
RAM (DRAM+IRAM) 266,582 bytes 266,582 bytes 0 bytes (0.00%)

FLASH uses app .bin size or json2 flash sum. RAM sums DRAM+IRAM via idf_size. Percentages shown when totals are available.
DRAM/IRAM usage does not include memory used by the heap allocator at runtime.
This report was generated by esp-idf-size-delta.

@finger563
finger563 merged commit c53425c into main Oct 18, 2026
1 check passed
@finger563
finger563 deleted the feat/tpm-disc-only branch October 18, 2026 13:15
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