Repository navigation
fix(engine): Valkyria Chronicles 4 builds: read Fenrir's gzip streams of BNSH shaders - #1280
Open
XeresRazor wants to merge 1 commit into
Open
XeresRazor wants to merge 1 commit into
XeresRazor wants to merge 1 commit into
Conversation
… of BNSH shaders
Valkyria Chronicles 4 stops at the shader split ("found no shaders"). Fixes LNPANDY#1279.
- 0046 adds a reader for the gzip streams of BNSH files that hold its shaders:
6,712 in the HSPK package FENRIR_SHADER_NEW_NX64_.HSG and 158 in main
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
Fix or feature
Feature from outside: not applicable, this is a fix.
What and why
Problem. Valkyria Chronicles 4 stops at the shader split ("found no shaders"). Fixes #1279.
Cause. Its shaders are gzip streams of BNSH files, 6,712 in
FENRIR_SHADER_NEW_NX64_.HSGand 158 inmain. No reader decompresses them.Change.
0046adds a reader for them. The split then finds all 6,870, the same set the game creates at boot.Details
1f 8b 08 00 00 00 00 00 00 0b). The reader takes a stream only with that header, complete and withBNSHinside, and bounds the decoded size.scan_blobcalls it for anHSPKfile,main()for each version'smain.mainhave no stream with that header, so no other game's tables change.pending: the same change goes to seedds/nxnative as its own PR. The game has no registered profile yet.Checked
python3 tools/engine.py checkpasses (45 patches apply to upstream0c078130f6db). The reader has 7 tests. 204 of 206 test files indm/tools/tests,dm/gfx/testsanddm/ios/testspass (the other two need .NET in my test shell). The generated doc indexes are current.dm/tools/tests/test_gzip_bnsh.py(synthetic packages and images, no game files).01005C600AC680001.0.0 (base, 8 DLC), MacBook Pro M1 Max, macOS 27.2. A build from this branch withtry-localwas installed on the connected iPad Pro 13-inch (M5) from the launcher and reached gameplay (reported by the tester, not measured). Also, the Mac build passes all steps (6,870 of 6,870 shaders translate), and a headless run reached the opening scenes and the first map screen at about 30 fps. iOS shaders: 6,870 of 6,870 compile.Screenshots
None, no visible change.
Scope
dm/,scripts/,docs/,ref/) is added to the repository: the change is one patch inpatches/, andtools/engine.py checkpasses.0046sayspendinguntil its seedds/nxnative PR is open.