Skip to content

decomp-assets 0.3.0: N64 textures found from the display lists that load them - #2

Merged
RetroGameDeveloper merged 1 commit into
mainfrom
feat/display-list-textures
Nov 14, 2026
Merged

RetroGameDeveloper merged 1 commit into
mainfrom
feat/display-list-textures

Conversation

@RetroGameDeveloper

Copy link
Copy Markdown
Contributor

What

New recogniser n64/display_lists.py, part of n64.regions: textures named by uncompressed display lists (Fast3D, F3DEX, F3DEX2 vertex loads; the RDP texture commands are common to all).

  • Texture facts from the list: set texture image + set tile + load block/tile give format (RGBA16/32, CI4/8, IA4/8/16, I4/8), width, height; load TLUT gives the palette, tracked per TMEM entry and resolved when something is drawn (a palette loaded after the tile size is the one used; the TLUT type comes from set other mode H).
  • Where the file is: lists address data in RAM (0x80…) or a segment. Display lists close together form a file; its displacement must put every vertex load on vertices (flag halfword zero, not all zero), keep a RAM file inside 8 MB, and among those the displacement under which most list starts are referenced by a pointer wins, only when unique. Displacements found for one file are tried first on the next (files loaded to the same buffer share one).
  • Assets are confidence='inferred', layout='display-list', with frame_offsets/palette_offsets, so textures.preview shows them unchanged.

Why

Cartridges with no container format (a kart racer, a futuristic racer) had empty texture browsers.

Checked (user's own cartridges, read locally, nothing committed)

Cartridge Textures Time
kart racer (8 MB) 453 ~12–25 s
futuristic racer 395 ~16 s
cartridges whose lists are compressed or built at run time (4 checked) 0, no false positives ≤ 5 s

48 random textures from each of the first two were rendered: all real images with correct palettes.

Tests (homemade cartridge): RAM and segment files, palette loaded before or after the tile size, no pointer → nothing guessed, RAM bounds, each microcode's vertex load, stop. pytest: 149 passed; ruff clean.

Not covered yet: display lists inside compressed blocks (e.g. RNC-packed models), textures loaded as sub-rectangles of a wider image, and multi-tile/mipmapped tiles.

🤖 Generated with Claude Code

…oad them

Cartridges that store their display lists and textures uncompressed, with no
container format, had no textures found: a kart racer and a futuristic racer showed
none. Each texture load in a display list names the image's format, size and palette,
but by its RAM or segment address. The file's displacement is worked out from the
file itself: its vertex loads must land on vertices, and of those displacements the
one under which most of its list starts are named by a pointer wins, only when
unique (and a RAM file must fit in 8 MB). Palettes are tracked per TMEM entry and
taken when the tile is drawn, so a palette loaded after the tile size is the one used.

On the two cartridges (read locally, nothing committed): 453 and 395 textures, every
one of 48 random samples each a real image with the right palette.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@RetroGameDeveloper
RetroGameDeveloper merged commit 435ad74 into main Nov 14, 2026
1 check passed
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