Skip to content

win: lay mods and split data over a RomFS image - #14

Open
wagcbjr wants to merge 1 commit into
zenvyzenshiro:mainfrom
wagcbjr:fix/win-mods-split-romfs-image
Open

wagcbjr wants to merge 1 commit into
zenvyzenshiro:mainfrom
wagcbjr:fix/win-mods-split-romfs-image

Conversation

@wagcbjr

@wagcbjr wagcbjr commented Nov 13, 2026

Copy link
Copy Markdown

What and why

A build with a mods folder (win/mods.py) stopped at the app build:

FAIL: mods' RomFS folders are laid over a RomFS folder, and this extraction is one RomFS image (RomFS.img)

A split build (--split-data, "App + data folder" in the window) stops the same way. The NSP script now extracts every version with nx_extract --romfs-image, so the extraction never holds a RomFS folder, while both steps lay the RomFS out as a folder.

win/build_app.py now unpacks the image into <work>/build/romfs_unpacked when mods or split data need a folder, and reuses it while the image's size and modification time are unchanged. A bundled build without mods still packs the image as before. The two die() lines that refused these builds can no longer be reached, so they are removed.

With the image unpacked, the overlay hit a second error: main() imported win/mods.py as mods, which replaced its list of code modules (main sdk), and gen_embed.py then failed with TypeError: Value after * must be an iterable, not module. The module is now imported as mod_overlay.

Checked

  • Tests: python3 win/tests/test_win.py, with a new UnpackRomfsImage test that packs a folder with romfs_image.py, unpacks it, compares every file and checks that the folder is reused. PackIpa.test_exec_bit_on_windows fails the same way on main when run on Linux, so that failure is unrelated.
  • Games run, with title ID and version: Pokémon Legends: Z-A (0100F43008C44000) 2.0.2 + Mega Dimension DLC, with a RomFS translation mod (1 file replaced, 1,561 added), as a split data build. The 5.6 GB image unpacked in 10 s, the mod was laid over it, the IPA and data folder were built, and the game started and showed the translated text on the iPhone.
  • Devices and OS: built on Windows 11 (10.0.26300); played on an iPhone with an A18 Pro, iOS 27.2.
  • Not checked: a split build without mods, and a Linux build.

Docs

  • No docs changed.
  • No game files, keys or data extracted from a game in the change or the attachments.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VDGHF5LyEKSqoK23EvYr6W

A build with a mods folder stopped at the app build with "mods' RomFS
folders are laid over a RomFS folder, and this extraction is one RomFS
image (RomFS.img)", and a split build (--split-data) stopped the same
way. The NSP script now extracts every version with nx_extract
--romfs-image, so the extraction never holds a RomFS folder, and both
steps lay the RomFS out as one.

build_app.py now unpacks the image into <work>/build/romfs_unpacked
when mods or split data ask for a folder, and reuses that folder while
the image's size and time are unchanged. A bundled build without mods
still packs the image as before.

With the image unpacked, the overlay hit a second error: main() imported
win/mods.py as "mods", which replaced its list of code modules, and
gen_embed.py then failed with "Value after * must be an iterable, not
module". The module is imported as mod_overlay now.

Checked: win/tests/test_win.py with a new test that packs a folder with
romfs_image.py, unpacks it and compares every file, and checks the reuse
(PackIpa.test_exec_bit_on_windows fails the same on main when run on
Linux). Pokémon Legends: Z-A 2.0.2 + DLC with a RomFS translation mod,
split data build on Windows 11: the 5.6 GB image unpacked in 10 s, the
mod laid over it (1 file replaced, 1,561 added), the IPA and data folder
built, and the game ran translated on an iPhone (A18 Pro, iOS 27.2).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VDGHF5LyEKSqoK23EvYr6W
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