Files
TeslaRel410/emulator/render-bridge/launch_pod.ps1
T
CydandClaude Fable 5 0f5b2e28da Renderer: vendor live-bridge scripts; GPU backend unblocked (60fps)
- emulator/render-bridge/: the pod->Dave's-renderer live bridge (rescued
  from session scratchpad): live_bridge.py (first-person cam from the 0x1f
  pose, arrow-key eye-height trim), fp/chase offline renders, fifobridge,
  diagnostics, gauge_arena[_sound].conf, and launch_pod.ps1 (one-command
  pod+bridge restart: pentapus VPX_EXPLODE + AWE32 sound + GL bridge).
- _backend.py: renderer selection -- vrview_gl.GLRenderer (moderngl) by
  default, VRVIEW_SOFT=1 for the software reference; backend-agnostic
  frame save via last_frame.
- GPU backend runs on side-by-side CPython 3.13 (moderngl/glcontext cp313
  wheels; no MSVC needed): 63fps headless / 60.7 windowed vs 21fps software
  on the same scene, and the GL path also draws the vertex-alpha cloud dome.
- vrview.py: VRVIEW_GAMMA env selects DAC gamma (1.25 live-renderer legacy
  vs 1.7 per the original GAMMA.C) for A/B against the real pod.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 13:34:02 -05:00

68 lines
3.3 KiB
PowerShell

# Launch the full pod experience: DOSBox-X pod (pentapus 7-display explode
# mode + dual-AWE32 sound) + Dave's GL renderer bridged to the live wire.
#
# .\launch_pod.ps1 # restart pod + bridge (stops previous run)
# .\launch_pod.ps1 -NoSound # skip AWE32 (saves the ~4 min SBK upload)
# .\launch_pod.ps1 -NoBridge # pod only
# .\launch_pod.ps1 -Conf <path> # different mission/conf
#
# Pentapus mode (VPX_EXPLODE=1): all 7 cockpit displays as desktop windows --
# 5 mono MFDs (green phosphor), portrait radar, Division main -- needs a wide
# desktop (~2830px). Per-window override: VPX_WIN<g>/VPX_MAIN = "x,y[,w,h]".
# Eye height for the bridge camera: FP_UPOFF env (see live_bridge.py).
param(
[string]$Conf = "$PSScriptRoot\gauge_arena_sound.conf",
[string]$Work = "$env:LOCALAPPDATA\Temp\vwe-pod",
[switch]$NoBridge,
[switch]$NoSound
)
$ErrorActionPreference = 'Stop'
New-Item -ItemType Directory -Force $Work | Out-Null
# a restart means the previous run dies first (COM1 + the fifodump are exclusive)
foreach ($pidfile in "$Work\pod_pid.txt", "$Work\bridge_pid.txt") {
if (Test-Path $pidfile) {
$old = Get-Process -Id (Get-Content $pidfile) -ErrorAction SilentlyContinue
if ($old) { Write-Host "stopping previous $([IO.Path]::GetFileNameWithoutExtension($pidfile)) ($($old.Id))"; $old | Stop-Process -Force }
}
}
# the bridge pid file records the py.exe wrapper; its python child holds the
# fifodump open (blocks the Remove-Item below) -- sweep it by command line
Get-CimInstance Win32_Process -Filter "Name like 'py%'" |
Where-Object { $_.CommandLine -match 'live_bridge' } |
ForEach-Object { Stop-Process -Id $_.ProcessId -Force -ErrorAction SilentlyContinue }
# fresh wire artifacts each run (the RIO tap APPENDS across runs otherwise --
# stale init sequences from the previous run poison diagnosis)
Remove-Item "$Work\live.fifodump", "$Work\riotap.txt" -ErrorAction SilentlyContinue
$env:VPXLOG = "$Work\vpxresp.txt"
$env:VPX_RESPOND = '1'
$env:VPX_RENDER = '1'
$env:VPX_EXPLODE = '1' # pentapus: 7 cockpit displays
$env:VPX_DUMPDIR = $Work
$env:VPX_FIFODUMP = "$Work\live.fifodump"
$env:RIO_TAP = "$Work\riotap.txt"
if ($NoSound) {
Remove-Item Env:VWE_AWE32, Env:VWE_AWE_ROM -ErrorAction SilentlyContinue
} else {
$env:VWE_AWE32 = '1'
$env:VWE_AWE_ROM = (Resolve-Path "$PSScriptRoot\..\roms\awe32.raw").Path
}
$dosbox = (Resolve-Path "$PSScriptRoot\..\src\src\dosbox-x.exe").Path
$p = Start-Process $dosbox -ArgumentList '-conf', $Conf `
-RedirectStandardError "$Work\pod_err.txt" `
-RedirectStandardOutput "$Work\pod_out.txt" -PassThru
$p.Id | Set-Content "$Work\pod_pid.txt"
Write-Host "pod PID $($p.Id) conf=$([IO.Path]::GetFileName($Conf)) work=$Work"
if (-not $NoSound) { Write-Host "sound ON: boot adds ~4 min for the SoundFont upload" }
if (-not $NoBridge) {
# live_bridge waits for the fifodump itself; start it right away
$b = Start-Process py -ArgumentList '-3.13', "$PSScriptRoot\live_bridge.py", "$Work\live.fifodump" `
-RedirectStandardError "$Work\bridge_err.txt" `
-RedirectStandardOutput "$Work\bridge_out.txt" -PassThru
$b.Id | Set-Content "$Work\bridge_pid.txt"
Write-Host "bridge PID $($b.Id) [GL] (arrows in its window tune eye height)"
}