/src/*.als, docs/language.md)
$sourceArg = in_array('--source', $argv, true);
// --hd: the HD edition's text capture (fn/hd.php): glyphs-NNNNN.json beside each saved frame
$hdArg = in_array('--hd', $argv, true);
// --hd-capture=
: every bitmap the game draws, as a PNG in its palette (App\Alis\HdSprites, tools/hd/)
foreach ($argv as $a) {
if (str_starts_with($a, '--hd-capture=')) {
\App\Alis\HdSprites::$capture = substr($a, 13);
\App\Alis\HdSprites::$on = true;
@mkdir(\App\Alis\HdSprites::$capture, 0777, true);
}
}
$argv = array_values(array_filter($argv, fn ($a) => !str_starts_with($a, '--hd-capture=')));
// --hd-sprites: the sprite pack of the HD edition (/hd/), how much of each frame it covers (hd-sprites.txt)
$hdSpritesArg = in_array('--hd-sprites', $argv, true);
$argv = array_values(array_filter($argv, fn ($a) => $a !== '--hd-sprites'));
// --skip-intro: the "Skip intro" button pressed whenever it is offered (App\Alis\IntroSkip)
$skip = in_array('--skip-intro', $argv, true) ? new \App\Alis\IntroSkip() : null;
$argv = array_values(array_filter($argv, fn ($a) => $a !== '--skip-intro'));
// --watch=0x184c: print that byte of the main script's variables (mb[0x184c]) when it changes
$watch = null;
foreach ($argv as $a) { if (str_starts_with($a, '--watch=')) $watch = intval(substr($a, 8), 0); }
$argv = array_values(array_filter($argv, fn ($a) => !str_starts_with($a, '--watch=')));
// --hd3d: the HD edition's land (fn/hd3d.php): land-NNNNN.bmp beside each saved frame
$hd3dArg = in_array('--hd3d', $argv, true);
$hd3dCompare = in_array('--hd3d-compare', $argv, true);
$panelArg = in_array('--panel', $argv, true);
// --memcrc: a checksum of the whole VM memory and registers at each new picture, in var//memcrc.txt (compare runs)
$memcrcArg = in_array('--memcrc', $argv, true);
$argv = array_values(array_filter($argv, fn ($a) => $a !== '--memcrc'));
$memcrc = [];
// --compiled: the scripts compiled to PHP (App\Alis\Compiled\Compiler); --compiled-dump: their PHP kept in var//compiled/
\App\Alis\Compiled\Compiler::$on = in_array('--compiled', $argv, true) || in_array('--compiled-dump', $argv, true);
$compiledDump = in_array('--compiled-dump', $argv, true);
$argv = array_values(array_filter($argv, fn ($a) => $a !== '--compiled' && $a !== '--compiled-dump'));
// --compiled-only=Flow,Expressions: only these template groups (src/Alis/Compiled/Templates/.php)
foreach ($argv as $a) { if (str_starts_with($a, '--compiled-only=')) { \App\Alis\Compiled\Templates::$only = explode(',', substr($a, 16)); \App\Alis\Compiled\Compiler::$on = true; } }
$argv = array_values(array_filter($argv, fn ($a) => !str_starts_with($a, '--compiled-only=')));
// --compiled-from=: the scripts in PHP of that folder (tools/compiled/readable.php, edited or not) run the game
foreach ($argv as $a) { if (str_starts_with($a, '--compiled-from=')) { $d = substr($a, 16); \App\Alis\Compiled\Compiler::$fromDir = str_starts_with($d, '/') ? $d : __DIR__ . '/../' . $d; \App\Alis\Compiled\Compiler::$on = true; } }
$argv = array_values(array_filter($argv, fn ($a) => !str_starts_with($a, '--compiled-from=')));
foreach ($argv as $a) { if (str_starts_with($a, '--film-dump=')) $filmDumpAt = (int) substr($a, 12); }
$argv = array_values(array_filter($argv, fn ($a) => !str_starts_with($a, '--film-dump=')));
// --lazy-delay=0.1,20: the files loaded on demand come 0.1 s + size / 20 MB/s after they are asked (like the browser)
foreach ($argv as $a) { if (str_starts_with($a, '--lazy-delay=')) { $dp = explode(',', substr($a, 13)) + [1 => 20, 2 => '.']; SysVars::$lazyDelay = [(float) $dp[0], max(0.01, (float) $dp[1]), $dp[2]]; } }
$argv = array_values(array_filter($argv, fn ($a) => !str_starts_with($a, '--lazy-delay=')));
$argv = array_values(array_filter($argv, fn ($a) => $a !== '--panel'));
$panelLog = [];
\App\Alis\Hd3d::$allSprites = in_array('--hd3d-all-sprites', $argv, true);
$argv = array_values(array_filter($argv, fn ($a) => $a !== '--hd3d-all-sprites'));
$skipSeen = 0;
// --hd3d-budget=0.01: the share of the time the HD passes may take (App\Alis\Hd3d::$budget; tiny = a slow computer)
foreach ($argv as $a) { if (str_starts_with($a, '--hd3d-budget=')) \App\Alis\Hd3d::$budget = (float) substr($a, 14); }
$argv = array_values(array_filter($argv, fn ($a) => !str_starts_with($a, '--hd3d-budget=')));
$argv = array_values(array_filter($argv, fn ($a) => $a !== '--hd3d-compare'));
$argv = array_values(array_filter($argv, fn ($a) => $a !== '--hd3d'));
\App\Alis\Hd3d::$on = $hd3dArg;
\App\Alis\Hd3d::$debug = in_array('--hd3d-debug', $argv, true);
foreach ($argv as $a) { if (str_starts_with($a, '--hd3d-scale=')) \App\Alis\Hd3d::$passScale = (int) substr($a, 13); }
$argv = array_values(array_filter($argv, fn ($a) => !str_starts_with($a, '--hd3d-scale=')));
$argv = array_values(array_filter($argv, fn ($a) => $a !== '--hd3d-debug'));
$argv = array_values(array_filter($argv, fn ($a) => $a !== '--hd'));
// --profile=N: every N frames, print the time per VM cycle and the memory
$profileEvery = 0;
foreach ($argv as $a) { if (str_starts_with($a, '--profile=')) $profileEvery = (int) substr($a, 10); }
$argv = array_values(array_filter($argv, fn ($a) => !str_starts_with($a, '--profile=')));
$argv = array_values(array_filter($argv, fn ($a) => $a !== '--audio' && $a !== '--source'));
// --replay=var/trace/