Files
vt1200/apps/termtris/tests/render.sh
T

30 lines
1.3 KiB
Bash
Executable File

#!/bin/sh
# render.sh -- Task 3 acceptance: paint the cell-grid test pattern, then
# snapshot the window. The PNG is the evidence.
set -eu
DIR=$(cd "$(dirname "$0")" && pwd)
APP=$(cd "$DIR/.." && pwd)
ROOT=$(cd "$APP/../.." && pwd)
M=${MAME:-/home/arti/code/k-space/mame0289/vt1200}
EV="$APP/evidence"
LOG="$APP/build/render.log"
mkdir -p "$EV" "$APP/build"
"$APP/build.sh" "$DIR/render.c" "$APP/src/vt1200/x11.c" "$APP/src/vt1200/xgfix.c" >"$APP/build/render-build.log" 2>&1
rm -f "$EV/loader_frame3400.png"
MARK=$(awk '/_mark/ {print $1; exit}' "$APP/build/render.map")
PROG=$(awk '/_vt_x11_progress/ {print $1; exit}' "$APP/build/render.map")
VT1200_SKIP_LEVEL1=1 LOADER_SNAP=1 RENDER_MARK="0x$MARK" X11_PROGRESS="0x$PROG" \
LOADER_AT=2500 LOADER_END=3400 \
LOADER_BIN="$ROOT/dwt/loader/build/loader.bin" \
LOADER_COFF="$APP/build/render.coff" \
LOADER_OUT="$EV" \
"$M" vt1200 -rompath "$ROOT/harness/mame/roms" \
-video none -sound none -nothrottle -skip_gameinfo \
-debug -debugger none \
-autoboot_script "$DIR/render.lua" -autoboot_delay 0 \
>"$LOG" 2>&1 || true
grep -E 'LOADER: snapshot|LOADER: result' "$LOG" | tail -4
[ -s "$EV/loader_frame3400.png" ] || { echo "render.sh: no snapshot (see $LOG)" >&2; exit 1; }
cp "$EV/loader_frame3400.png" "$EV/render_frame3400.png"
echo "render: $EV/render_frame3400.png"