#!/bin/bash # # gauge-ab: stage + run one side of the cockpit A/B rig. # # ab.sh rec -- stage the freshly built reconstruction and run it # ab.sh shp -- run the shipped 4.10 binary # # STAGING IS THE WHOLE POINT. The rig's confs run BTL4REC.EXE / BTL4SHP.EXE # out of the shared mount, NOT build410/btl4opt.exe. Forgetting to copy the # new build over BTL4REC.EXE silently measures the PREVIOUS binary -- which # on 2026-07-27 cost a full round of wrong conclusions (a change "did # nothing" three times because the tested exe never changed). So: always # launch through this script, and it always re-stages first. # set -e R=/c/VWE/TeslaRel410/restoration IMG=$R/build410/run/image SIDE=${1:-rec} # one instance at a time -- two DOSBoxes share OUT.TXT and corrupt the trace if tasklist //FI "IMAGENAME eq dosbox-x.exe" 2>/dev/null | grep -qi dosbox-x; then echo "killing running dosbox-x" taskkill //F //IM dosbox-x.exe > /dev/null 2>&1 || true sleep 2 fi if [ "$SIDE" = "rec" ]; then SRC=$R/build410/btl4opt.exe DST=$IMG/BTL4REC.EXE [ -f "$SRC" ] || { echo "no build at $SRC -- run build410.sh link"; exit 1; } cp -f "$SRC" "$DST" echo "staged $(ls -la "$DST" | awk '{print $5, $6, $7, $8}') <- $(basename $SRC)" CONF=$R/build410/run/vis_rec.conf else echo "shipped side (no staging)" CONF=$R/build410/run/vis_shp.conf fi rm -f "$IMG/OUT.TXT" cd /c/VWE/TeslaRel410/emulator/src/src ./dosbox-x.exe -conf "$CONF" > /dev/null 2>&1 & echo "launched $SIDE ($(basename $CONF)) -- pid $!"