Recompiler + module ABI

NX tooling under src/nx/runtime/driver/ and src/nx/loader/: a dump, read in place, or work/<Game>/{exefs,romfs} -> recompiled/<id>/: <id>[.exe], <id>_code.{so,dll}, <id>_data/, and the dump's path as source= in the game's <id>.ini (<id>.source, a link to it, from older versions):

An update or a DLC is recorded beside its game (snx_addon_name), its own .ini naming only its dump, and checked in the game's addons= (common/utilities/game_ini.c, which the driver and the launcher write). An update also gets a program, recompiled/<id>/<id>_<its title ID>; a DLC runs its game's code. The runtime (main.c's addon_init) runs an update's program with the game's .ini and data folder, and fs.c lays the checked DLCs' data folders and then the update's over that folder (fs_tree_overlay, which takes only their ExeFS, RomFS, control data and system/). It reads an update's dump with the game's in one SnxDump (its Patch RomFS reads the game's NCA), and each checked DLC's in one of its own (HleFs.aocs), whose image OpenDataStorageByDataId serves by its title ID.

A game's mods are the folders of <id>_data/mods/ (common/utilities/mods.c), each played unless the game's mods_off= names it. The data folder's index leaves mods/ out (fs_tree_init_skipping). The recompile loads the program with the played mods' ExeFS files over its own (snx_exefs_mods) and records their stamp in <id>.abi, which the driver compares (stamped) to recompile a game whose mods changed. The runtime's fs.c serves those files in place of the game's when the stamp matches, grafts each played mod's romfs/ as mods.<i>, and romfs_init makes the RomFS image up from the game's (its romfs/ folder, or its image's tables) with the mods' laid over it, a file of the game's image read from that image.


Made from docs/dev/architecture.md at 69237645142c. GPL-3.0-or-later.