From 74aa5ae98d5f61576d622c46f24ba9335c8fa5b6 Mon Sep 17 00:00:00 2001 From: Cyd Date: Sun, 9 Aug 2026 13:13:16 -0500 Subject: [PATCH] A hand-fed egg can run a whole race '-egg' skips the menu and drops straight into a mission, which is the developer shortcut - and it installs no console, so nothing ever ends the race. Everything after the chequered flag was therefore unreachable from the command line: the buzzer, the fade, the winners' circle, the teardown. All of it could only be exercised by hand through the menu. RP412MISSIONSECONDS now marshals a hand-fed run as well, so a whole race plays out unattended. That is the difference between a shortcut that can be watched and one that can be TESTED, and it immediately earned itself: it caught RP412PODIUM=0 holding the mission open for its full eleven seconds with the podium switched off. The environ file promises "straight to the results"; the hold is applied without asking whether the podium is on, so what you actually get is the same wait against a black screen. That one is not fixed here - it wants a decision about the hold's length as well - but it is now reproducible in one command. pack-dist keeps frontend.egg for the same reason. It is written on launch and holds the menu's last selection, so it is what lets '-egg frontend.egg' drop back into the track under test - and a repack was wiping it, which turns the next run into a zero-byte file and an abort on "no map in egg". Co-Authored-By: Claude Opus 5 (1M context) --- RP_L4/RPL4.CPP | 25 +++++++++++++++++++++++++ pack-dist.ps1 | 7 ++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/RP_L4/RPL4.CPP b/RP_L4/RPL4.CPP index 7fe3c33..95cc489 100644 --- a/RP_L4/RPL4.CPP +++ b/RP_L4/RPL4.CPP @@ -459,6 +459,31 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine int last_launch_mode = FELaunchSingle; + // + //------------------------------------------------------------------------- + // A hand-fed egg run stays unmarshaled - no console, so the race never + // ends - UNLESS it is given a length. RP412MISSIONSECONDS supplies one, + // and with it '-egg' can play a whole race through to the buzzer, the + // podium and the results. + // + // That is the difference between a shortcut that can only be watched and + // one that can be TESTED: everything after the chequered flag - the fade, + // the winners' circle, the teardown - was unreachable from the command + // line, so it could only ever be exercised by hand through the menu. + //------------------------------------------------------------------------- + // + if (!front_end_mode && L4Application::GetEggNotationFileName()) + { + const char *egg_seconds = getenv("RP412MISSIONSECONDS"); + if (egg_seconds != NULL && atoi(egg_seconds) > 0) + { + DEBUG_STREAM << "LocalConsole: marshalling the hand-fed egg run (" + << atoi(egg_seconds) << "s, RP412MISSIONSECONDS)\n" << std::flush; + L4Application::SetNetworkCommonFlatAddress(0); + RPL4LocalConsole_Install(atoi(egg_seconds)); + } + } + for (;;) { if (front_end_mode) diff --git a/pack-dist.ps1 b/pack-dist.ps1 index 8674eb0..c076990 100644 --- a/pack-dist.ps1 +++ b/pack-dist.ps1 @@ -62,7 +62,12 @@ Write-Host "Packing into $dist" # setting. This script rebuilds dist\ from scratch, which would throw exactly # those away - the one place the promise did not hold, and it is the folder we # do most of our own testing in. Carry them across. -Fresh to start over. -$keepFiles = @('environ.ini', 'bindings.txt', 'pilot.cfg', 'mfd_layout.cfg') +# frontend.egg is the menu's last selection, written on launch. It is not a +# setting, but it IS what lets '-egg frontend.egg' drop straight back into +# the track you were just testing - and a repack wiping it turns that into a +# zero-byte file and an abort on "no map in egg". +$keepFiles = @('environ.ini', 'bindings.txt', 'pilot.cfg', 'mfd_layout.cfg', + 'frontend.egg') $kept = @{} if (-not $Fresh) { foreach ($name in $keepFiles) {