Desktop default platform = GLASS (kills the recurring "old keymap" trap)

Root cause of the keymap whack-a-mole: three input layers exist (PadRIO/
bindings.txt under glass; btinput/CONTROLS.MAP under DEV; the bring-up
drive bridge also under DEV, which clobbers e.g. Alt-reverse every frame),
and DEV was the DEFAULT -- so every launcher that forgot BT_PLATFORM=glass
booted the old stack: the play bats, then play_steam, then the operator
console's local instances, each fixed with the same one line.

Omission can't resurrect it now: with no BT_PLATFORM, desktop boots GLASS
(and the menu on a zero-arg launch -- bare double-click of btl4.exe opens
the mission menu).  BT_PLATFORM=dev explicitly opts into the legacy DEV
profile for debugging.  BT_PLATFORM=pod is the cabinet profile; the real
pod's SETENV.BAT must set it (contract recorded in glass-cockpit.md --
the old "bare boot == cabinet shape" menu-guard assumption is retired).

Verified: no-env mission launch boots GLASS; bare no-env launch opens the
MENU; BT_PLATFORM=dev boots DEV.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
arcattack
2026-07-22 09:18:19 -05:00
co-authored by Claude Opus 4.8
parent 18ce589f4c
commit 9e85f6dc56
2 changed files with 26 additions and 8 deletions
+3 -1
View File
@@ -25,7 +25,9 @@ version skew (a stale steam exe shipped 2 days behind), tripled build time, and
|---|---|
| `BT_PLATFORM=glass` | the desktop-cockpit profile: `L4CONTROLS=PAD` → PadRIO (clickable cockpit buttons, bindings.txt keymap), plasma window, and the miniconsole menu on a zero-arg launch |
| `BT_STEAM_NET=1` | the Steam transport (FakeIP/SDR; degrades to Winsock without the Steam client). `steam_api.dll` is **DELAY-LOADED** (`/DELAYLOAD` + delayimp) — machines without the DLL run everything else |
| (nothing) | the old pod-build behavior byte-for-byte: DEV profile, no menu, waits for the console egg — **the cabinet default is unchanged** |
| (nothing) | **GLASS is the desktop DEFAULT (2026-07-22)** — a bare boot gets PadRIO/bindings.txt (and the menu on zero args). The old accidental-DEV trap ("the old keymap again") is closed: every launcher that forgot the env used to boot DEV (play bats, steam bat, the operator console — each needed the same one-line fix). |
| `BT_PLATFORM=dev` | the legacy DEV profile (keyboard-only, the bring-up drive bridge) — explicit opt-in for debugging |
| `BT_PLATFORM=pod` | the cabinet profile. **CONTRACT: the real pod's SETENV.BAT must set this** — the old "bare boot == cabinet shape" assumption no longer holds. |
- The `BT_GLASS` macro is now ALWAYS defined (a seam marker only — the `#ifdef` sites remain
as documentation of the layer boundary). Every gated code path was audited: all are
+23 -7
View File
@@ -293,8 +293,10 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
int gBTPlatformGlass = 0;
{
const char *pe = getenv("BT_PLATFORM");
int platform_dev = 0;
if (pe && _stricmp(pe, "pod") == 0) gBTPlatformPod = 1;
if (pe && _stricmp(pe, "glass") == 0) gBTPlatformGlass = 1;
if (pe && _stricmp(pe, "dev") == 0) platform_dev = 1;
// Convenience: also accept a raw `-platform pod` on the command line,
// parsed off lpCmdLine independently of L4Application::ParseCommandLine.
const char *pf = lpCmdLine ? strstr(lpCmdLine, "-platform") : 0;
@@ -305,16 +307,30 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
gBTPlatformPod = 1;
if (pv[0] && _stricmp(pv, "glass") == 0)
gBTPlatformGlass = 1;
if (pv[0] && _stricmp(pv, "dev") == 0)
platform_dev = 1;
}
//
// DESKTOP DEFAULT = GLASS (2026-07-22, "competing keymaps" fix): every
// launcher that forgot BT_PLATFORM=glass booted the DEV profile -- no
// PadRIO, the bring-up keyboard bridge owning the keys ("the old
// keymap again": play bats, steam bat, then the operator console,
// each needed the same one-line fix). Glass is now the DEFAULT when
// no platform is chosen, so omission can never resurrect the old
// input stack. BT_PLATFORM=dev opts back into the legacy DEV profile
// for debugging; the FUTURE pod cabinet must set BT_PLATFORM=pod in
// its SETENV.BAT (contract recorded in context/glass-cockpit.md --
// note this changes the old "bare boot == cabinet shape" assumption).
//
if (!gBTPlatformPod && !gBTPlatformGlass && !platform_dev)
gBTPlatformGlass = 1;
}
// UNIFIED-BUILD GUARD (2026-07-21): the miniconsole menu is a GLASS-
// platform feature. It must NOT claim a bare zero-arg boot -- that is
// the POD CABINET's launch shape (DEV profile, wait for the console
// egg). The menu runs only when the glass platform is selected
// (BT_PLATFORM=glass / -platform glass, e.g. play_steam.bat) or forced
// with BT_FE_MENU=1. (Platform parse moved ABOVE this block so the
// flag is available; it reads only env/cmdline, no profile putenvs.)
// MENU GATE (2026-07-21, amended 2026-07-22): the miniconsole menu runs
// on a zero-arg GLASS boot. With glass now the desktop DEFAULT, a bare
// double-click of btl4.exe opens the menu -- the desired desktop UX.
// The pod cabinet opts out via BT_PLATFORM=pod (SETENV.BAT contract);
// BT_PLATFORM=dev keeps the old bare-boot wait-for-egg shape.
int fe_menu_mode = 0;
{
int fe_has_egg = lpCmdLine && strstr(lpCmdLine, "-egg") != NULL;