Common options

Every driver of the program (scarletnx for the Switch, scarletnx-3ds, scarletnx-vita, scarletnx-agb, scarletnx-nds, scarletnx-android, scarletnx-gnuabi) reads the options below from one table, src/common/utilities/cli.c. Each --help shows them first, with the same words in the same column, then the driver's own options. Each option that takes a value takes it as --option VALUE or as --option=VALUE. A common option that a driver cannot do stops the run with the same message in each driver, scarletnx-agb does not take --update. An older name of an option still works for now, and the run says once what it is called now (Deprecations).

Each driver that recompiles (scarletnx, scarletnx-3ds, scarletnx-vita, scarletnx-agb, scarletnx-nds) also takes --aot-threads=N, the setting aot_threads: the threads compiling the game's code, 0 (the default) up to the computer's cores with a quarter left free. Each also takes --aot-threads-most=N, the most 0 takes (scarletnx's open one at a time, as the memory holds them: Extract → AOT → run), which the launcher's Gentle queue gives every driver. A GBA ROM's code is one module and compiles on one thread whatever N, which its recompile says. A value that is not a whole number from 0 to 1024 stops the run. --jobs N is the same setting for the Switch, 3DS, Vita and GBA drivers, which the launcher gives every one of them. The recompile's options take effect when the game is made: a game made already keeps its code until -r.

The recompile's options mean on each system:

OptionSwitch3DSVitaGBA
--chunk Nthe instructions of a code unit, whole functions (default: the setting unit_instructions)the instructions of a chunk, whole blocks (default: 512 blocks a chunk)the same as the 3DS'sone module compiled whole, said
--jit-cache PATHa profile run's .jitcache, linked into the module (AOT packs)the list of the blocks a run compiled at run time that discovery starts from, another game folder's <title ID>.hints (default: the game's own)the same as the 3DS'sthe map of the blocks runs reached, another game folder's <name>_code.map (default: the game's own)
--jit-onlya module with no code: the JIT compiles all of ita module of no blocks: the run-time compiler compiles every onethe same as the 3DS'sno module: every block compiled as the run reaches it

On GNU ABI and Android the code compiles as it runs: GNU ABI's --jit-cache DIR is the folder its JIT keeps code in between runs, and --jit-only what both do anyway.

OptionMeaningSwitch3DSVitaAGBNDSAndroidGNU ABI
-x, --extractExtract the game, without playing ityesyesyes
--extract-containerExtract the game into its folder and play it from there. Without it, the game is read where it liesyesyes
-r, --recompile (--recomp)Recompile the game, without playing ityesyesyesyesyes
--game DIRPlay the game in its folder DIR (recompiled/<name>), as its copy of the runtime doesyesyesyesyesyes
--update PATH (--patch)An update or a DLC of the game, played with it. Give it once for each. For the Vita, it is the dumped game's update folder, given onceyesyesyes
--data DIR (--repo)The data folder (Folders)yesyesyesyesyesyes
--outdir DIRThe folder of the games, in which the game's folder is made (default: recompiled/ of the data folder)yesyesyesyesyes
--output DIRThe game's folder itself (default: <outdir>/<the game's name>)yesyesyesyes
--keys FILEThe console's keys: prod.keys for the Switch, Azahar's aes_keys.txt for the 3DSyesyes
--seconds NStop after N secondsyesyesyesyes
--frames NStop after N frames (the AGB's run has no window, sound or pacing)yesyesyesyes
--shot PATHSave the screen to PATH when the run ends (Android: each frame --shot-frame names)yesyesyesyesyesyes
--script SPECPress buttons at times of the run, MS:BUTTONS,... (each platform's page names the buttons)yesyesyesyesyes
-f, --fullscreen[=0|1]Start fullscreen for this run, or windowed with =0yesyesyesyes
-H, --headlessRun without a windowyesyesyesyes
--jobs NThe threads compiling the game's code, the setting aot_threads: 1 to 1024, or 0 (the default), Autoyesyesyesyes
--chunk NThe instructions of a unit of code compiled at once (below)yesyesyesyes
--jit-cache PATHThe run-time compiler's record of the game's code, which the recompile starts from (below)yesyesyesyesyes
--jit-only (--interp-only)Compile no code ahead of time: the run-time compiler compiles all of ityesyesyesyesyesyes
-q, --quietSay no progress of the recompileyesyesyesyes
-h, --helpShow the helpyesyesyesyesyesyesyes

The Switch's --seconds, --frames, --shot and --script are settings of the game's run (Settings), which reach the game as --key=value in both forms. The 3DS's --script is its setting ctr_script, and its --frames counts the frames it decodes (the top screen's, or the bottom screen's until the game first draws a top screen). Its --shot writes both screens as one PPM to exactly PATH. Its -H starts no SDL video, audio or gamepad subsystem, so it needs no display server and only --script presses reach the game. Its --seconds counts host seconds, which are the console's seconds at the default pace. The Vita's --script is vita_script. The Switch driver also keeps its combined letters, as -rx and -Hs.


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