Skip to content

mvgl.py: read MVGL archives with 24-byte data entries (The Hundred Line) - #751

Open
buinghia98 wants to merge 1 commit into
igawa6:mainfrom
buinghia98:thl/pr-a-mvgl24
Open

buinghia98 wants to merge 1 commit into
igawa6:mainfrom
buinghia98:thl/pr-a-mvgl24

Conversation

@buinghia98

Copy link
Copy Markdown

Commit: tools: mvgl.py reads MVGL archives with 24-byte data entries
Base: upstream main @ 0766fc9 (Peanuts Native 0.1.8 + catalog update).
Dependencies: none. The Hundred Line profile PR (PR B) depends on this PR.

Issue

The Hundred Line -Last Defense Academy- (010093C0215B4000) keeps its shaders in Media.Vision's MVGL archives (*.nx64.mvgl). The shader split found only the shaders in main (178). It found no shader in the archives. Without them, the game cannot get a full shader library.

Feature description

  • The archives use the 64-bit MVGL layout of Digimon Story Time Stranger. But each data entry is 24 bytes (u64 offset, u64 length, u64 stored length), not 16.
  • mvgl.py did not identify these archives as the 64-bit layout, because the tables do not end at the data start with 16-byte entries.
  • New function data_entry: it finds the entry size from the point where the tables end. It tries 16 first, then 24. wide accepts both sizes. Archive reads the entries with that size.
  • Digimon's archives (16-byte entries) read as before. The 16-byte path is not changed.
  • New test test_reader_24 in peanuts/tests/test_mvgl_wide.py.
  • No change to the shader chain (dmsh_*, chain headers, dmsh_chain.lock). mvgl.py only reads archives for the split. The libraries of other games do not change.

Test results

Split and pack (Windows PC, The Hundred Line 1.2.1):

  • shader_split.py finds 7,204 shaders (4,779 pixel, 2,425 vertex): 7,026 from the archives and 178 from main. No [RED] line. The conflict table is empty.
  • The Android library holds 9,060 modules. All pass spirv-val --target-env vulkan1.3.
  • The game plays on a Retroid Pocket Nova with Turnip with this library (see PR B).

PC tests on this branch:

  • test_mvgl_wide.py: 6 of 7 pass, including the new test_reader_24. test_reader has an error on Windows only: the test cannot delete its temporary archive while it is open (PermissionError WinError 32). It fails the same way on the clean base 0766fc9.
  • mvgl.py list on the game's app_0.nx64.mvgl tables: 64,274 entries, 16,810 of them shad. On the clean base, the same command gives 1 entry.
  • upstream-update.sh --check origin/main: passed. check-publish.sh origin/main: clean.
  • gen_runtime_profile.py check-all, docs_patches.py --check, docs_symptoms.py --check, env_switches.py --check, advanced_switches.py --check, check-runtime-profile.sh, check-profiles.sh: all pass.
  • test_game_profile.py, test_docs.py, test_android_frame_rate_caps.py: pass.
  • Fail on the clean base 0766fc9 too (not caused by this PR):
    • test_fpslocker_rows.py, test_fpslocker_plan.py: the Windows MinGW compiler cannot build them (-fsanitize=undefined: no ubsan library; a 16 KB alignment is too large for the object format).
    • test_android_frame_rate_games.py: EA SPORTS FC 27 (0100C49025D3E000) does not offer 45 fps.
  • Not run: the C unit tests (make -C dm/host/tests). They need clang and AddressSanitizer, which this Windows PC does not have. This PR does not change C code.
  • Not run: the Mac split of Digimon Story Time Stranger (no Mac). The 16-byte path is covered by test_reader (its error is in the cleanup only) and by test_reader_24, which checks that data_entry gives 16 for a 16-byte archive.

Files changed

  • dm/gfx/tools/mvgl.py (3 hunks, PEANUTS markers)
  • peanuts/tests/test_mvgl_wide.py (test_reader_24)
  • peanuts/UPSTREAM-EDITS.md (one entry)

3 files. No binary files.

The Hundred Line -Last Defense Academy- (010093C0215B4000) keeps its
shaders in MVGL archives of the 64-bit layout, but each data entry is
24 bytes (u64 offset, u64 length, u64 stored length), not 16 as in
Digimon Story Time Stranger. The reader did not take these archives as
the 64-bit layout, so the shader split found only the 179 shaders in
main. data_entry now tells the entry size by where the tables end,
16 first, so Digimon's archives read as before. The split of
The Hundred Line 1.2.1 finds 7,204 shaders (7,026 from the archives),
and all 9,060 Vulkan modules pass spirv-val. test_reader_24 covers the
new layout.
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