Back to Supersonic RC Revive
SOURCE / PINNED RELEASE

Made of little things.

Supersonic RC Revive

Release
1ba42f1ca1d6…
Author-recorded commit
baecad10b1cd…
License
LICENSE
Author’s source reference
nostr://npub1ye5ptcxfyyxl5vjvdjar2ua3f0hynkjzpx552mu5snj3qmx5pzjscpknpr/wss%3A%2F%2Fgit.napplet.soy%2F/n-143146b0d6f

Archive hash verified: 90d22b206672eba4…. The source-to-build association is the author’s claim; it has not been independently rebuilt.

tools/sim/wine-reference.sh
#!/bin/bash
# Drive the ORIGINAL game under Wine on a private virtual display and capture
# a screenshot sequence for side-by-side comparison with the port.
#   tools/sim/wine-reference.sh <outdir> "<keys>:<seconds>,..." [shots-per-second]
# keys: u d l r s (space) or - ; e.g. "-:1,u:2.5,ul:0.6,u:0.5"
# Needs: wine, Xvfb, xdotool, ImageMagick import. Uses a scratch copy of ref/.
set -euo pipefail
OUT=${1:?outdir}; SCRIPT=${2:?script}; RATE=${3:-4}
ROOT=$(cd "$(dirname "$0")/../.." && pwd)
WORK=${SSRC_WINE_WORK:-/tmp/ssrc-wine}
DISPLAY_NUM=${SSRC_WINE_DISPLAY:-:77}
mkdir -p "$OUT" "$WORK"
[ -d "$WORK/SuperSonicRC" ] || cp -r "$ROOT/ref/SuperSonicRC" "$WORK/"
export WINEPREFIX="$WORK/prefix" WINEDEBUG=-all DISPLAY=$DISPLAY_NUM WINEDLLOVERRIDES="mscoree,mshtml="
Xvfb "$DISPLAY_NUM" -screen 0 1024x768x24 >/dev/null 2>&1 & XV=$!
cleanup() { wineserver -k 2>/dev/null || true; kill $XV 2>/dev/null || true; }
trap cleanup EXIT
sleep 2
(cd "$WORK/SuperSonicRC" && wine Projector.exe >/dev/null 2>&1 &)
for _ in $(seq 60); do xdotool search --name "Supersonic RC" >/dev/null 2>&1 && break; sleep 1; done
sleep 4
# Window at (50,50): title -> select level (Free Driving) -> help -> drive.
xdotool mousemove 370 400 click 1; sleep 4
xdotool mousemove 225 145 click 1; sleep 8
xdotool mousemove 370 512 click 1; sleep 10
key() { case $1 in u) echo Up;; d) echo Down;; l) echo Left;; r) echo Right;; s) echo space;; esac; }
n=0; t0=$(date +%s.%N)
shot() { import -window root -crop 640x480+50+50 "$OUT/$(printf %04d $n).png"; n=$((n+1)); }
IFS=, read -ra STEPS <<< "$SCRIPT"
for step in "${STEPS[@]}"; do
  keys=${step%%:*}; secs=${step##*:}
  [ "$keys" = "-" ] && keys=""
  for ((i=0; i<${#keys}; i++)); do xdotool keydown "$(key "${keys:$i:1}")"; done
  end=$(echo "$(date +%s.%N) + $secs" | bc)
  while (( $(echo "$(date +%s.%N) < $end" | bc) )); do shot; sleep "$(echo "1 / $RATE" | bc -l)"; done
  for ((i=0; i<${#keys}; i++)); do xdotool keyup "$(key "${keys:$i:1}")"; done
done
shot
echo "captured $n frames in $(echo "$(date +%s.%N) - $t0" | bc) s -> $OUT"