`if a.limit: texs = texs[: a.limit]` read --limit 0 as "no limit" and
exported every texture in the index, and a negative --limit silently
dropped the last textures. --limit is now a positive whole number (an
argparse error otherwise, before the output folder is made), and the
slice runs whenever it is given.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tex_export.py called amd_swizzle.load() at import, so the module could not
be imported (or tested) without Mesa's gfx10SwizzlePattern.h. The patterns
are now read once, on the first eq4k call; behaviour is otherwise unchanged.
tests/test_tex_export.py (pytest, skipped without numpy) covers, on
synthetic swizzle equations and textures, with no game data or header:
eq4k picking the entry per bpe and reading the patterns once; detile
offsets (row-major for a linear equation, a permutation of whole tiles,
partial tiles padded); the DX10 DDS header; export_one choosing the top mip
at the data offset or at the end of the mip chain on both scoring paths
(Pillow and raw bytes), gpu_chain reassembly, the blob cache, unsupported
formats and data outside the blob; and main()'s log, ordering and --limit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Shader pipeline (carve, FSSM unpack, gfx1013 disassembly, RDNA2 to SPIR-V),
asset export via rpf9-explorer's Core (submodule), PE loader and shim
skeleton, and make_game.py, which builds from the user's own copy of the game.
No game data, keys or executables are included.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>