Repository navigation
feat(ge): replace textures from a New 3DS texture pack - #62
Merged
Merged
Conversation
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.
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
marked this pull request as ready for review
November 5, 2026 21:23
This was referenced Nov 5, 2026
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.
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:TexturePackreadsindex.bin, validating magic, version, sizes and sort order, and reads texture data on demand. Lookup follows PPSSPP's order.TextureReplacerkeeps the CLUT bytes and the maxSeenV state the keys depend on; both renderers use it.PC
SoftwareRenderer::set_texture_packsamples the replacement with the PSP texture's normalised coordinates.--texture-pack <dir>prints a[TEXPACK]summary.New 3DS
GpuRenderer::bind_texturereads a replacement straight into aC3D_Texof the pack's size and format when it uploads a texture. Textures narrower than 8 texels keep the original.main.cppopenssdmc:/p3p3ds/textures. The report linetexpack:shows the texture count, replaced uploads, KiB and the read time.Verified (Windows) with the Community Expansion 3x pack, converted at max 512:
--texture-keysprobe matched.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.p3p3ds.3dsxbuilds.[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.