Skip to content

feat(ge): replace textures from a New 3DS texture pack - #62

Merged
github-actions[bot] merged 2 commits into
masterfrom
feat/texture-pack-pc-23
Nov 5, 2026
Merged

github-actions[bot] merged 2 commits into
masterfrom
feat/texture-pack-pc-23

Conversation

@endercodezz

Copy link
Copy Markdown
Owner

Texture replacement from a New 3DS texture pack (p3p-texpack build, #56): verified on the PC; on the New 3DS built but not yet tested.

Core

  • core/src/ge/texture_pack.cpp: TexturePack reads index.bin, validating magic, version, sizes and sort order, and reads texture data on demand. Lookup follows PPSSPP's order.
  • TextureReplacer keeps the CLUT bytes and the maxSeenV state the keys depend on; both renderers use it.

PC

  • SoftwareRenderer::set_texture_pack samples the replacement with the PSP texture's normalised coordinates.
  • Runner option --texture-pack <dir> prints a [TEXPACK] summary.

New 3DS

  • GpuRenderer::bind_texture reads a replacement straight into a C3D_Tex of the pack's size and format when it uploads a texture. Textures narrower than 8 texels keep the original.
  • main.cpp opens sdmc:/p3p3ds/textures. The report line texpack: shows the texture count, replaced uploads, KiB and the read time.
  • Without a pack on the SD card nothing changes.

Verified (Windows) with the Community Expansion 3x pack, converted at max 512:

  • 20M title replay: 10,288 of 10,341 textured draws replaced, 7 textures loaded, 0 read errors.
  • First-battle route: 6,910,728 of 8,713,539 textured draws replaced, 0 read errors. These are the same draws the --texture-keys probe matched.
  • Frame dumps show the pack's art in place and aligned: title logo, Dark Hour scenes, Yukari's portrait, font, hospital background.
  • Guest execution is unchanged: same stop PC, same event types and counts; only frame hashes differ. Without a pack the replay SHA-256 stays 1a5f566002148933....
  • test_texture_replacement: pack parsing, lookup with fallback, keep-original entries, RGBA8/RGB565 decode with bottom-up rows, rejection of malformed indexes. CTest 28/28.
  • devkitARM p3p3ds.3dsx builds.

[UNVERIFIED] New 3DS / Azahar: the picture, memory use, and stalls from SD reads on the render thread. Opened as a draft until that check.

Part of #23.

TexturePack reads the pack written by `p3p-texpack build` and finds an
entry in PPSSPP's lookup order; TextureReplacer keeps the CLUT bytes and
maxSeenV state the keys depend on and is shared by both renderers. The
PC reference renderer samples a replacement with the PSP texture's
normalised coordinates (--texture-pack <dir>). On the New 3DS,
GpuRenderer reads a replacement straight into a C3D_Tex when it uploads
a texture, from sdmc:/p3p3ds/textures; the report shows a texpack line.

Verified on the PC with the Community Expansion 3x pack: title replay
10,288/10,341 textured draws replaced, first battle 6,910,728/8,713,539,
0 read errors; frame dumps show the pack's art aligned; guest execution
unchanged (same stop PC and event counts, replay SHA-256 1a5f5660...
without a pack). CTest 28/28, devkitARM .3dsx builds. The 3DS path is
not yet tested in Azahar or on hardware.
@endercodezz

Copy link
Copy Markdown
Owner Author

The maintainer decided to merge without the Azahar/hardware check. The New 3DS path stays [UNVERIFIED] in docs/CURRENT_STATE.md until a report with the texpack line exists.

@endercodezz
endercodezz marked this pull request as ready for review November 5, 2026 21:23
@github-actions
github-actions Bot merged commit a94131a into master Nov 5, 2026
8 checks passed
@endercodezz
endercodezz deleted the feat/texture-pack-pc-23 branch November 6, 2026 15:04
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