Files
vt1200/harness/badapple/demo.sh
T
arti 8f831eaf33 fix(video): model the real unit's VR319 monitor
The harness forced the VR150 monitor switch, so the firmware wrote the OS
screen at 1024 px / 128-byte rows.  VT1200_VRAM_REAL then re-read that
framebuffer at the VR319 pitch, which sheared the OS and wrapped the right
quarter of every row.

Model VR319 (switch 0x60) by default -- the real unit's mode -- so the
firmware itself programs 1280x1024 with a 256-byte row pitch (CONVDP=0x14).
The renderer's pitch follows VT1200_MONITOR, and the destination span now
comes from HEBLNK..HSBLNK instead of x=0, placing the active 1280 px at
x=336 in MAME's 1696-wide raster.

Verified: clean Terminal Manager at frame 600, legible faithful diagnostics
menu and level-1 error screens, tile mode PASS with tile_check 1280/1280
tiles, tablet/mouse pixel-identical.  VT1200_MONITOR=VR150 reproduces the
old geometry; the regression baseline moves 198 -> 199 (2 PCs) and is
recorded in harness/mame/README.md.
2026-10-31 20:53:51 +02:00

70 lines
2.6 KiB
Bash
Executable File

#!/bin/sh
# Play the streaming demo on a RUNNING terminal: wait for its OS network stack,
# deliver the payload over rdebug, then send the clip with the host sender.
#
# The terminal itself is started separately -- `harness/mame/run.sh net` for the
# emulator (its default VR319 monitor already gives the real unit's 1280-px /
# 256-byte framebuffer layout; `VT1200_MONITOR=VR150` reproduces the old derived
# 1024-px view), or a real VT1200 on the network. This script only talks
# to it, so one instance serves one demo: the jump hands the payload the
# remote-debug process and it never returns.
#
# demo.sh # committed 30-frame cache
# demo.sh --tiles /tmp/badapple --frames 3292 --fps 15
# demo.sh --host 192.168.99.2 --iface vt1200
# demo.sh --no-load # send only, payload already running
set -eu
HERE=$(cd "$(dirname "$0")" && pwd)
ROOT=$(cd "$HERE/../.." && pwd)
HOST=192.168.99.2
IFACE=vt1200
TILES=$ROOT/harness/udpstream/tiles
FRAMES=200
FPS=15
LOAD=1
SEND=1
WAIT=180
while [ $# -gt 0 ]; do
case "$1" in
--host) HOST=$2; shift 2 ;;
--iface) IFACE=$2; shift 2 ;;
--tiles) TILES=$2; shift 2 ;;
--frames) FRAMES=$2; shift 2 ;;
--fps) FPS=$2; shift 2 ;;
--wait) WAIT=$2; shift 2 ;;
--no-load) LOAD=0; shift ;;
--no-send) SEND=0; shift ;;
-h|--help) sed -n '2,20p' "$0"; exit 0 ;;
*) echo "demo.sh: unknown option $1" >&2; exit 2 ;;
esac
done
# --- readiness: an ICMP reply from the terminal's own stack -----------------
start=$(date +%s)
while ! ping -c1 -W1 "$HOST" > /dev/null 2>&1; do
if [ $(( $(date +%s) - start )) -ge "$WAIT" ]; then
echo "demo.sh: $HOST did not answer within ${WAIT}s" >&2
echo " is the terminal booted and on the tap? (harness/mame/run.sh net)" >&2
exit 1
fi
done
echo "demo.sh: $HOST answers ($(( $(date +%s) - start ))s)"
# --- the payload, over the firmware's own remote-debug service --------------
if [ "$LOAD" = 1 ]; then
python3 "$HERE/rdebug_load.py" --host "$HOST"
# The payload takes the LANCE and the remote-debug process with it, so the
# sender is started once the machine has had time to arm its ring.
sleep 3
fi
# --- the clip ---------------------------------------------------------------
if [ "$SEND" = 1 ]; then
echo "demo.sh: sending $FRAMES frame(s) from $TILES at $FPS fps on $IFACE"
sudo -n python3 "$ROOT/harness/udpstream/vidsend.py" --iface "$IFACE" \
--tiles --tiles-dir "$TILES" --frames "$FRAMES" --fps "$FPS"
fi