Fix TTPF logical texture addresses above 4 GiB #12
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/rpatty-dev--PercyStar!12
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/12/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@techfoundrynz on GitHub · 2026-11-21 13:09 UTC · original
techfoundrynz:fix/ttpf-large-logical-offsets→main· +83 −2 · 2 files · 2 commits · closed without mergingSome TTPF texture descriptors resolve to logical offsets above 4 GiB. Reading the logical size as 32 bits and masking page addresses to 20 bits wraps those addresses and can select incorrect texture data.
Read the 40-bit logical size and preserve all 21 page-address bits. The existing decompression and mip fallback behavior is unchanged. Synthetic fixtures cover both sides of the 4 GiB boundary, high flag bits, and the final texture allocation size without allocating a large file.
Validation:
cargo test --offline --locked -- --nocapturepassed (28 passed, 3 ignored). WithPERCYSTAR_LEVELS_RPFpointing to a local archive, the tests also verified map and vehicle texture descriptors above 4 GiB. No game assets are included.The Cargo.lock package version is synchronized with the existing 1.3.6 manifest; dependencies are unchanged.
@rpatty-dev on GitHub · 2026-11-21 13:19 UTC · original
Awesome catch @techfoundrynz! Integrated into main for v1.3.8 with full credit in README & release notes (40-bit TTPF logical size + 21-bit page addresses so >4 GiB map/vehicle textures resolve without wrapping).
Pull request closed