Repository navigation
decomp-assets 0.7.0: textures and sprites in a table of relocatable files, VPK0 unpacked - #6
Merged
Merged
Conversation
…iles, VPK0 unpacked A fighting game keeps its assets in a table of relocatable files, many packed with VPK0 (ported from the game's own decoder). Following each file's internal and external pointer chains names every display-list texture's file and offset exactly, and finds libultra sprites by their bitmap pointers: 1,422 textures, sprites stacked from their strips with their TMEM-swapped rows put back. The display-list walker now reads a tile when it is drawn, from what TMEM holds then (that game sizes a tile before loading its texels), and records block loads with no row step. Other games' results are unchanged, two gain a few. Co-Authored-By: Claude Opus 5.5 <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.
What
n64/vpk0.py: VPK0 unpacking, ported from the game's own decoder (both sample methods).n64/reloc_files.py: a table of relocatable files (12-byte entries: data offset with a VPK0 flag, internal-chain start, packed words, external-chain start, unpacked words).Sprite/Bitmapstructs are found by their bitmap pointer (+0x34) and buffer pointers (+8). Strips are stacked into one image, and their odd rows are swapped back from TMEM order: measured on the game, nearly every sprite, every format, is stored that way.display_lists._textures: tiles are now resolved at draw time (the ones sized since the last draw, plus the tileG_TEXTUREor a texture rectangle uses), from what TMEM holds then. Block loads with dxt 0 are flaggedswapped. New test for a tile sized before its texels load.Results (read-only, the user's own ROMs)
Tests
tests/test_reloc_files.py(homemade table: chains, external chain, VPK0 file, swapped sprite, rejections) and the walker test. 162 pass, ruff clean.🤖 Generated with Claude Code