environ.ini is self-documenting: every option shipped with comments

The environ.ini reader now skips comments (# or ;), blank lines, and
anything that is not KEY=VALUE, so the shipped file documents the
whole configuration surface: the core settings as-shipped (controls,
renderer, gauge canvas, plasma, single-window cockpit, frame rate,
Steam networking), the optional toggles (keyboard lighting, stick
flip, AA, particles, plasma scale/position, fixed seed), LAN hosting
without Steam, the developer/testing switches (RP412DEVKEYS,
L4CONSOLELEN, the Steam self-test), and the arcade multi-monitor
heritage variables. Stale L4MFDSCALE reference dropped from the
README.

Verified: the game boots on the commented file with values applied
(controls line honored, Steam transport up from the in-file switch).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Cyd
2026-07-13 11:00:19 -05:00
co-authored by Claude Fable 5
parent 0ca6b5b01f
commit 29f8572d5c
2 changed files with 98 additions and 4 deletions
+9 -1
View File
@@ -163,7 +163,15 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
for (int i = strlen(line); i >= 0; i--)
if (line[i] == '\n' || line[i] == '\r')
line[i] = 0;
putenv(line);
// the file is self-documenting: skip comments, blanks,
// and anything that is not KEY=VALUE
char *setting = line;
while (*setting == ' ' || *setting == '\t')
++setting;
if (*setting == '\0' || *setting == '#' || *setting == ';' ||
strchr(setting, '=') == NULL)
continue;
putenv(setting);
}
}
fclose(file);
+89 -3
View File
@@ -73,14 +73,100 @@ if (Test-Path $openal) {
# --- desktop configuration -------------------------------------------------
Set-Content -Path "$dist\environ.ini" -Encoding ascii -Value @"
# ============================================================================
# environ.ini - Red Planet 4.12 configuration
# ============================================================================
# One KEY=VALUE per line, read at game start. Lines starting with # or ;
# are comments; anything without an = is ignored. Delete a line (or
# comment it out) to fall back to the built-in default.
#
# Input bindings live in bindings.txt beside the exe (written with the
# full documented layout on first run; delete it to restore defaults).
# ---- Core (the shipped configuration) --------------------------------------
# Control stack. PAD;KEYBOARD = the virtual RIO (XInput controller +
# keyboard, rebindable via bindings.txt). RIO;KEYBOARD = real serial
# cockpit hardware. KEYBOARD = engine keyboard only (no virtual RIO).
L4CONTROLS=PAD;KEYBOARD
# Renderer selection argument and its config file. Leave as shipped.
DPLARG=1
L4DPLCFG=RPDPL.INI
# Gauge (MFD/instrument) canvas: WIDTHxHEIGHTxDEPTH.
L4GAUGE=640x480x16
# Plasma display: SCREEN renders the pod's plasma glass in-window
# (currently parked off-layout); hardware values drive real glass.
L4PLASMA=SCREEN
# 1 = the single-window cockpit: all seven displays composed on a
# locked 1920x1080 canvas around the viewscreen.
L4MFDSPLIT=1
# Simulation/render frame rate.
TARGETFPS=60
# 1 = Steam networking (lobbies, FakeIP mesh). Needs the Steam client
# running and steam_appid.txt beside the exe; without them the game
# logs the reason and falls back to plain TCP. 0 = TCP only.
RP412STEAM=1
# ---- Optional ---------------------------------------------------------------
# RGB keyboard lamp mirror (Windows Dynamic Lighting): keys bound to
# lamp buttons glow with the panel, flash modes and all. Default on;
# set 0 to disable.
#RP412KEYLIGHT=0
# Invert the stick on top of whatever bindings.txt produces: X, Y, XY.
#L4PADFLIP=XY
# Anti-aliasing samples (0 = off).
#MULTISAMPLE=0
# Particle budget.
#MAXPARTICLES=8192
# On-screen plasma glass pixel size and position (when re-homed).
#L4PLASMASCALE=4
#L4PLASMAPOS=0,0
# Fixed random seed (repeatable runs).
#RANDOM=12345
# ---- LAN play without Steam -------------------------------------------------
# Host a race over plain TCP: list the member pods' console channels
# (members run: rpl4opt.exe -windowed -res 1920 1080 -net 1501).
# HOSTADDR is this machine's LAN IP as members can reach it.
#RP412HOSTPODS=192.168.1.20:1501,192.168.1.21:1501
#RP412HOSTPORT=1501
#RP412HOSTADDR=192.168.1.10
# ---- Developer / testing ----------------------------------------------------
# 1 arms the debug keys: Alt+W wireframe, Alt+V predator vision,
# Alt+F frame dump, Alt+/ perf stats, Alt+E event-queue dump.
# (Alt+Q, the mission abort, is always live.)
#RP412DEVKEYS=1
# Console race-length override in seconds (short test races).
#L4CONSOLELEN=30
# Steam transport loopback self-test at boot (logs PASS/FAIL).
#RP412STEAMSELFTEST=1
# ---- Arcade heritage (multi-monitor pods; not used on the desktop) ----------
#PRIMGAUGE=1
#SECGAUGE=2
#MFDGAUGE=3
#MFDGAUGE2=4
#SPANDISABLE=1
#L4EYES=1
#L4INTERCOM=COM2
#NOMODES=1
#LOGSIZE=1000000
"@
Set-Content -Path "$dist\start-windowed.bat" -Encoding ascii -Value @"
@@ -121,9 +207,9 @@ at its left, and the lower MFDs flanking the portrait map. The red
buttons around each MFD and the amber buttons beside the map are the
pod's real button banks: click them with the mouse, and they light up
as the game commands their lamps.
environ.ini options: L4PADFLIP=XY inverts the stick axes, L4MFDSCALE=n
sizes the MFD/map windows (percent, default 50), L4PLASMASCALE=n sets
the plasma pixel size (default 4), L4PLASMAPOS=x,y places the plasma.
environ.ini is self-documenting: every option ships in the file with
a comment (Steam networking, keyboard lighting, stick inversion, LAN
hosting, developer keys, and more).
Known prototype notes: pods race untextured (the player1-8 skins come
from the presets system, not shipped data), and text drawn on the plasma