Repository navigation
TPM: build from the disc image alone - #4
Merged
Merged
Conversation
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) <noreply@anthropic.com>
ESP-IDF Size Report for 'Tab5 Emu'
FLASH uses app .bin size or json2 flash sum. RAM sums DRAM+IRAM via idf_size. Percentages shown when totals are available. |
finger563
added a commit
that referenced
this pull request
Oct 24, 2026
…select) (#10) gpSP's open-source BIOS replacement computes |quotient| into r3 in swi_Div, but its SWI dispatcher restores the caller's r2 / r3 from the stack on the way out, so Div and DivArm never returned it. The real BIOS does, and The Legend of Zelda: The Minish Cap uses it: its file select screen stayed half slid in, with the file slots and the language menu off screen. One instruction in the image (0x17F0): `mov r3, r2` becomes `str r2, [sp, #4]`, which writes |quotient| into the saved r3 slot the dispatcher returns. Found by running the game headless on the Mac: upstream gpSP and ours both showed the broken screen, mGBA (HLE BIOS) did not, mGBA with this open BIOS did, and mGBA with its HLE Div not returning r3 did too. With the patch both gpSP and mGBA (open BIOS) reach the language menu and the file slots. The 11 other GBA games in the library render byte-identical frames (2100 frames each, scripted input) with and without the patch. Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 thatSLUS_008.84was not found.Now
CONFIG_TPM_DISC_PATHis the only setting:CONFIG_TPM_EXE_PATH, CMake extractsSLUS_008.84from the disc image intobuild/esp-idf/tpm/disc/. It extracts again only when the image is newer than that copy.splat.us.yaml). Any other file builds without the game and warns, instead of recompiling into something that crashes.CONFIG_TPM_EXE_PATHstill works when the file exists, so existing setups are unchanged.components/tpm/README.mdsay 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:
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_PATHpointed at a wrong file: the not-USA-Rev-1 warning; builds without the game.Not flashed to the board; the generated code is the same as before.
🤖 Generated with Claude Code