Repository navigation
feat(tools): texpack build writes the New 3DS texture pack - #61
Merged
Merged
Conversation
`p3p-texpack build <pack> <out>` converts a PPSSPP pack into the P3P3DS 3DS pack: index.bin (entries sorted by PPSSPP key: offset, size, power-of-two size, citro3d format) and textures.bin (PICA200 data, rows bottom-up like the 3DS renderer's uploads). Images are box- downscaled with premultiplied alpha to at most --max-size texels per side; the format follows the alpha channel (RGB565, RGBA5551, RGBA4). Verified: the Community Expansion 3x pack converts in 52 s (4,580 textures, 10 missing from the pack itself; 872 MB at max 512, 302 MB at 256); replacements on the battle route are uniform 2x/3x/4.5x multiples of the PSP texture; the ATLUS entry decodes back correctly; cargo test 14/14, clippy clean.
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.
Second step of #56:
p3p-texpack build <pack dir> <out dir> [--max-size 512] [--format auto|<fmt>]converts a PPSSPP pack into the New 3DS pack format.index.bin: magicP3TXPACK, version 1, ignoreAddress flag, 32-byte entries sorted by PPSSPP key (data offset and size, power-of-two width/height, citro3dGPU_TEXCOLOR). An entry with width 0 means "keep the original". Format documented intools/texpack/src/build.rs.textures.bin: PICA200 tiled data, 128-byte aligned. Rows are bottom-up like the 3DS renderer's own uploads (tiled_rowinplatform/3ds/gpu_renderer.cpp).--max-sizeper side, keeping the power-of-two aspect ratio. Pixel format chosen from alpha: RGB565 if opaque, RGBA5551 for 0/255 alpha, else RGBA4. Uses all cores (std threads, no new dependency).Verified (Windows) with the Community Expansion 3x v3.0 pack:
--max-size 512, 302 MB at 256. Formats: RGBA4 2,813, RGB565 1,673, RGBA5551 94.cargo test14/14 (target sizes, box filter, alpha-based format, index layout and sort order, alignment, row order), clippy-D warningsclean.[UNVERIFIED] Not loaded by the runtime yet: that is the next step of #23.
Part of #56.