Repository navigation
Launcher: take the game as an .nx archive - #632
Merged
Merged
Conversation
The launcher unpacked a .nup into nup_dump and took nothing else as one file (#456). An .nx (NXFormat) is now unpacked the same way. The order of work a package is unpacked in (every program's ExeFS and the main build ID check, the free-space check, then the chosen RomFS, each file to .part and renamed once its size and SHA-256 match) moves out of nup.rs into unpack.rs, behind a Package trait. nup.rs keeps what is .nup: its table of contents and the base layered under an update. nx.rs reads the .nx: the valid header with the highest generation, the Catalog, Manifest and block index against their SHA-256, the snapshots that hold exefs/ and romfs/, and each file as its row of stored or Zstandard blocks. A snapshot is a whole version, so nothing is layered. An archive made straight from an .nsp or .xci holds NCA packages and is refused with a message that says how to make a usable one. The commands, the event and the page state are named for packages now (import_package, cancel_unpack, pick_package, unpack-progress). The folder stays nup_dump: one unpacked package, whichever format it was. Co-Authored-By: Claude <noreply@anthropic.com>
3 tasks done
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.
What it changes
The launcher took the game as a folder of extracted files or as a
.nup. An.nxarchive (NXFormat) had to be unpacked with another tool first.Choose a .nup or .nx file (or dropping the file on the page) now unpacks an
.nxonce intonup_dump, in the layout a dump folder has (base/,updates/<version>/,aoc/<id>/romfs/), and the usual game files check runs on the result.unpack.rs(new): the order of work a package is unpacked in, moved out ofnup.rsbehind aPackagetrait: every program's ExeFS and the main build ID check, the free-space check, then the chosen RomFS, each file written to.partand renamed once its size and SHA-256 match. Both formats go through it.nup.rs: keeps what is.nup: its table of contents and the base game layered under an update.nx.rs(new): reads header versions 0.2 and 0.3. The valid header with the highest generation is used (the other one when the newest generation is damaged); the Catalog, the Manifest and the block index are checked against their SHA-256 before anything is written; every table range and block range is bounds checked. A snapshot is a whole version of the game, so nothing is layered. Files are rows of stored or Zstandard blocks.import_package,cancel_unpack,pick_package,unpack-progress..nxnext to.nup.An
.nxmade straight from an.nspor.xciholds the NCA packages themselves, which the launcher does not read (it does not read an.nspor.xciof the game either). It is refused with a message that says to make the.nxfrom extracted files or from a.nup(nxconvert pack-treeorpack-nup).Fixes #456
For players
CHANGELOG.md## Unreleasedhas an entry (Before / Now / Still not), or this change is not player-facingPros
.nxgoes through the same checks as a.nup(version before the big unpack, free space, per-file checksum).nup.rs..nxunpack usesnup_dumptoo, so picking another package replaces the unpacked one and no second copy of the game is left on disk.Cons
.nxsaves no disk space while playing, and the random-read speed NXFormat is built for does not apply. Serving the game straight from an.nxwould be runtime work (Zstandard and block-mapped RomFS reads in nxrt) and is not part of this..nxmade from an.nspor.xciis refused.nup_dumpand the marker.nup_done, although an.nxcan be in it now.saveimport.rs,nsp.rs, and now read bynx.rsfromsaveimport.rs), and the list of folders the launcher keeps (nup_dumpamong them) is repeated inrepair.rs,update_apply.rsandwritecheck.rs.🤖 Generated with Claude Code