Repository navigation
cra.py reads the 2021 layout of Camelot's archive (Mario Golf: Super Rush 4.0.0) - #2216
Closed
secretlemur28 wants to merge 1 commit into
Closed
secretlemur28 wants to merge 1 commit into
secretlemur28 wants to merge 1 commit into
Conversation
…Rush 4.0.0): the shader split stopped with 'a CRA archive, and no NRO holds its file table' The game keeps its 5,101 files in rom:/42 as Mario Tennis Fever does, but its NRO reads another file table and another scramble: i32 record distances, sizes and offsets under other masks, bit-reversed path characters, and files xored in 16-byte blocks with two keys from the last path element, each byte bit-reversed, checked by a CRC-32. Index() returns the layout the NRO's code reads. Checked: all files' names decode, the split finds 25,270 shaders, test_cra.py passes. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This was referenced Nov 10, 2026
seedds
added a commit
that referenced
this pull request
Nov 12, 2026
…r Rush's (PR #2216) Mario Golf: Super Rush 4.0.0 keeps its 5,101 files in rom:/42 as Mario Tennis Fever does, but its NRO reads another layout, so the shader split stopped with "a CRA archive, and no NRO in DM_NRO_DIR holds its file table". Index2021 reads it: an i32 per file with the records behind the table, size, CRC-32 checksum and offset under other masks, bit-reversed path characters, files xored in 16-byte blocks with two keys from the last path element and each byte bit-reversed (the game's reader at nro0+0x54b6d4). The table is found by the code that reads it, in any build. cra.index(nro) takes the layout the NRO's code reads, and each file's entry names its layout (LAYOUT / LAYOUT_2021), which read() and head() take it in. Reference entry: "One scrambled archive indexed by the NRO" in docs/reference/shaders.md. Checked on Mario Golf 4.0.0 from its NSPs (--platform mac, with b9615a1): all 5,101 files (4.1 GB) pass the game's checksums in 37 s, the split finds 25,270 shaders in 18 s, all translate, and the game boots with subsdk0 loaded and plays its opening movie at 60 fps. test_cra.py, test_split_narc.py. Mario Tennis Fever not run (no files here); its layout keeps its logic and tests. Co-authored-by: secretlemur28 <354896836+secretlemur28@users.noreply.github.com>
Owner
|
Landed on main as 275b11a, with you as co-author. Your decoding of the layout is unchanged, and so are your three tests. Two structural changes:
The reference entry "One scrambled archive indexed by the NRO" in Checked here on Mario Golf 4.0.0 from its NSPs, with #2215 from main: all 5,101 files (4.1 GB) pass the game's checksums, read in 37 s, and the split finds 25,270 shaders in 18 s (the same count as yours). All of them translate, |
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.
What and why
Mario Golf: Super Rush (
0100C9C00E25C000, update v262144 / 4.0.0) keeps its files in one CRA archive,rom:/42, as Mario Tennis Fever does, but in an older layout, so the shader split stopped with "a CRA archive, and no NRO holds its file table" (#814).cra.pygains that layout (Index2021,index_2021,keys_2021,plain_2021);Indexpicks it when the NRO has no table of today's layout, andread/headtake either kind of entry. The layout, from the game's reader atnro0+0x54b6d4:mov/movkafteradrp+add+ldrsw): one i32 per file, records attable - i32[i];0xce462eca, +8 u32 checksum, +0xc u40 offset ^0x46f636762a, +0x11 the rest of the path, each character bit-reversed and xored with(i & 15) + 1;0x12345678.Checked
dm/gfx/tests/test_cra.py, 11 of 11 (three new, on synthetic data: paths through two prefix records, the keys, read / head and a wrong checksum).mainat25c2546.Indextries first and its tests pass unchanged. No iOS build.Docs
cra.pyis not in the chain's file list;dmsh_chain.py --headergives the same header.🤖 Generated with Claude Code