From e65ff3f8d7e45fcddccc8c35dba7780773f35140 Mon Sep 17 00:00:00 2001 From: Cyd Date: Fri, 10 Jul 2026 12:06:49 -0500 Subject: [PATCH] Deploy: RP loops (no single-shot) + confirm DOSBox needs no bundled DLLs - net-boot/loop_rp.bat: GO.BAT-style netnub loop for RP (mirror of loop.bat, retargeted to rpl4opt). deploy/net_rp.conf.tmpl now calls it instead of the single-shot netnub + DOS pause -- the deployable runs in a loop until the supervisor kills DOSBox (per operator: no single-shot in the product). - DLL closure resolved: dosbox-x.exe is a 182MB STATIC build -- import table is only Windows system DLLs, delay-import table empty, libpng/SDL/zlib embedded. Nothing to bundle; wpcap.dll comes from the Npcap install. package.ps1's "no DLLs" case is now informational, and the plan/README note the static build. Co-Authored-By: Claude Opus 4.8 --- emulator/DEPLOYMENT-PLAN.md | 4 +++- emulator/deploy/README.md | 18 ++++++++++++------ emulator/deploy/net_rp.conf.tmpl | 12 ++++-------- emulator/deploy/package.ps1 | 5 ++++- emulator/net-boot/loop_rp.bat | 10 ++++++++++ 5 files changed, 33 insertions(+), 16 deletions(-) create mode 100644 emulator/net-boot/loop_rp.bat diff --git a/emulator/DEPLOYMENT-PLAN.md b/emulator/DEPLOYMENT-PLAN.md index 37dc7af..44fffb1 100644 --- a/emulator/DEPLOYMENT-PLAN.md +++ b/emulator/DEPLOYMENT-PLAN.md @@ -92,7 +92,9 @@ one NIC) and the `200.0.0.x` hardcoding (postinstall stamps the assigned IPs). Single root folder + `postinstall.bat`. Everything the install needs is inside: -- `dosbox-x.exe` + DLLs (bundle the **VC++ runtime**; don't install it separately) +- `dosbox-x.exe` -- a **static build** (182 MB; imports only Windows system DLLs, + empty delay-import table), so **no MinGW/SDL/VC++ DLLs to bundle**; the only + runtime DLL, `wpcap.dll`, comes from the Npcap install - `ALPHA_1\` game content (REL410\BT, REL410\RP, SB16, GAUGE, ...) + `net-boot\` drivers (LSL/NE2000/ODIPKT/NET.CFG @ PORT 340/INT 10, loop.bat) - **Npcap silent installer** (bundled) diff --git a/emulator/deploy/README.md b/emulator/deploy/README.md index 74d7230..6473b26 100644 --- a/emulator/deploy/README.md +++ b/emulator/deploy/README.md @@ -10,7 +10,7 @@ Sources for the self-contained, air-gapped pod install. See | `postinstall.bat` | elevated entry TeslaLauncher runs after extraction: finds the package folder, installs bundled Npcap, calls `configure.ps1` | | `configure.ps1` | the per-pod step: detects the NIC + bay IP, derives the game IP = **bayIP+100**, binds DOSBox's pcap (`realnic`), renders the conf templates, stamps `WATTCP.CFG my_ip` | | `net_loop.conf.tmpl` | BattleTech conf template (looped netnub) | -| `net_rp.conf.tmpl` | Red Planet conf template (single-shot) | +| `net_rp.conf.tmpl` | Red Planet conf template (looped netnub via `loop_rp.bat`) | | `package.ps1` | assembles the deployable zip from repo sources + a fresh self-contained `pod-launch` publish | Template tokens filled at install: `@@ROOT@@` (package dir), `@@REALNIC@@` (this @@ -71,13 +71,19 @@ zip root + the package folder), and writes `emulator\dist\.zip`. `-NoContent` skips `ALPHA_1`/`net-boot` for a fast structural check. Externally- procured pieces are bundled only when their paths are passed (else flagged). +## DLLs / runtime + +`dosbox-x.exe` is a **static build** (182 MB): its import table is only Windows +system DLLs and the delay-import table is empty, so there are **no MinGW/SDL DLLs +to bundle**. The one runtime DLL it needs, `wpcap.dll`, is provided by the Npcap +install. (Its other `LoadLibrary` strings are optional features our confs don't +use -- Glide/3dfx, ASPI, ANGLE, inpout -- or Windows-provided D3D/DXGI.) + +Both deploy confs run netnub in a **loop** until the supervisor is killed +(`loop.bat` for BT, `loop_rp.bat` for RP) -- no single-shot in the deployable. + ## Not yet in the repo / OPEN - `npcap.exe` (licensed installer -- procured out-of-band) and any `vc_redist`. - The frozen `renderer.exe` (packaging decision with David; `pod-launch` falls back to `pyw live_bridge.py` when absent). -- **DOSBox-X runtime DLL closure** (MinGW/SDL DLLs): none sit beside - `dosbox-x.exe` in the dev tree -- it finds them via MSYS2 on PATH. The air- - gapped package must bundle them; `package.ps1` copies any DLLs beside the exe - and warns when there are none. -- RP loop-vs-single-shot for retail parity (template currently mirrors dev). diff --git a/emulator/deploy/net_rp.conf.tmpl b/emulator/deploy/net_rp.conf.tmpl index 8496411..f28788e 100644 --- a/emulator/deploy/net_rp.conf.tmpl +++ b/emulator/deploy/net_rp.conf.tmpl @@ -2,8 +2,8 @@ # Tokens (filled by postinstall): @@ROOT@@ = package dir (C:\games\), # @@REALNIC@@ = this pod's NIC GUID fragment, @@MACADDR@@ = stable derived MAC. # Red Planet 4.10, networked pod boot (console pushes the mission egg over TCP). -# NOTE: single-shot netnub here (matches dev net_rp.conf); whether RP should loop -# like BT for retail-parity is an OPEN deploy decision (see DEPLOYMENT-PLAN.md). +# Loops netnub (loop_rp.bat) so the pod stays connected + picks up missions; +# runs until the supervisor (pod-launch) kills DOSBox. No single-shot in deploy. [sdl] output=opengl priority=highest,highest @@ -55,9 +55,5 @@ set TEMP=c:\ set HEAPSIZE=15000000 set L4GAUGE=640x480x16 call setenv.bat r f s p -echo === launching Red Planet via NetNub (RIO + sound; waits for console) === -32rtm.exe -x -netnub -p -f rpl4opt > nn.log -32rtm.exe -u -echo === RP-NET-RUN-DONE === -pause +echo === entering netnub loop (waits for console missions; supervisor kills to stop) === +call d:\loop_rp.bat diff --git a/emulator/deploy/package.ps1 b/emulator/deploy/package.ps1 index 5a2589c..0d763ef 100644 --- a/emulator/deploy/package.ps1 +++ b/emulator/deploy/package.ps1 @@ -50,9 +50,12 @@ Copy-Item $podLaunch $root # DOSBox-X + its DLLs $dbDir = Join-Path $Emu 'src\src' Copy-Item (Join-Path $dbDir 'dosbox-x.exe') $root +# The build is statically linked (imports only Windows system DLLs; empty +# delay-import table). No MinGW/SDL DLLs to bundle. wpcap.dll is provided by the +# Npcap install. Copy any DLLs that DO sit beside the exe, just in case. $dlls = Get-ChildItem (Join-Path $dbDir '*.dll') -ErrorAction SilentlyContinue if ($dlls) { $dlls | ForEach-Object { Copy-Item $_.FullName $root } ; Log "copied $($dlls.Count) DLL(s) beside dosbox-x.exe" } -else { Warn "no DLLs beside dosbox-x.exe -- verify the MinGW/SDL runtime DLLs the build needs are present" } +else { Log "no DLLs beside dosbox-x.exe (static build -- only Windows system DLLs + Npcap's wpcap needed)" } # conf templates + configure.ps1 Copy-Item (Join-Path $Emu 'deploy\net_loop.conf.tmpl') $root diff --git a/emulator/net-boot/loop_rp.bat b/emulator/net-boot/loop_rp.bat new file mode 100644 index 0000000..63933d6 --- /dev/null +++ b/emulator/net-boot/loop_rp.bat @@ -0,0 +1,10 @@ +echo off +rem GO.BAT-style loop for Red Planet (mirror of loop.bat, retargeted to rpl4opt): +rem keep relaunching netnub so the pod stays connected to the console and picks up +rem a mission whenever one is queued. Runs until the supervisor kills DOSBox. +:go +32rtm.exe -x +netnub -p -f rpl4opt > c:\rel410\rp\nn.log +32rtm.exe -u +echo ===== netnub cycle ended -- reconnecting to console ===== +goto go