NRO applications

Pass an uncompressed NRO directly to recompile and play, without keys or extraction:

./build/scarletnx "app.nro" -H

The .nro extension is case-insensitive. NRO launches always recompile and restage the input, so a same-named cached executable or extraction directory cannot silently select an older program. Embedded RomFS assets are staged by the recompiler. Compressed NROs are not supported. This uses ScarletNX's existing guest runtime, not a complete homebrew-loader environment. Compatibility still depends on the application's runtime and service requirements. See NRO implementation notes for the reference and validation policy.

To run the steps separately, here in folders of the current one (--out and --outdir; without them, the data folder's work/ and recompiled/):

./build/scarletnx -x "Game.xci" --out work/Game
./build/scarletnx -r work/Game Game --outdir recompiled
recompiled/Game/Game
.\build\scarletnx.exe -x "Game.xci" --out work/Game
.\build\scarletnx.exe -r work/Game Game --outdir games
.\games\Game\Game.exe

Remaining examples: POSIX.

# NSP + same-title update
./build/scarletnx -x Game.nsp --update update.nsp --name Game \
  --keys /path/prod.keys --title-keys /path/title.keys

./build/scarletnx -r work/Game Game --outdir games --jobs 8
./build/scarletnx -r app.nro --name App --outdir games
./build/scarletnx -r -h

With --out work/Game and --outdir games as above (without them, see Folders):

OutputContents
work/Game/{exefs,romfs}Extracted input
recompiled/<id>/<id>[.exe], <id>_code.so/.dllRuntime + AOT module
recompiled/<id>/<id>_data/, <id>.iniData/saves (and control.nacp) + settings
recompiled/<id>/shader_cache/vk_pipelines.<driver>.binVulkan pipeline cache, one per driver (<driver>: d<driver ID>-<GPU vendor>-<GPU device>, and -<package> for a gpu_driver package's), so going back to a driver finds its own
recompiled/<id>/shader_cache/<id>.<driver>.vkshadersOne per driver: translated shaders and the pipelines made, made again at the next start, compute pipelines too (before the game starts, from their programs, so a new build or driver compiles them there); held in memory while the game runs and written when it closes, packed with zstd at its highest level: a run that crashes keeps none of what it made
recompiled/<id>/shader_cache/<id>.<driver>.vkshippedOne per driver: the shaders found in the game's own files and executables, prepared ahead of time (prepare_shaders), each read when the game first draws with it, each packed with zstd on its own (compress_prepared_shaders). Unpacked it can be large: one game's 2,700 shaders took 245 MB, another's 18,500 took 2 GB; packed, about a quarter of that
recompiled/<id>/shader_cache/<id>.vkscanThe game's files found to hold no shaders, so that after an update of ScarletNX or the driver the files aren't all read again to look for them

Made from docs/user/usage.md at 69237645142c. GPL-3.0-or-later.