#!/bin/bash # Measure the cost of a row-linear literal span on the 68000 (FINDINGS 30). # ~25 s. Run from the repo root. Needs tmp/frame256.bin (check.sh makes it). # # NOT part of check.sh, for the same reason blit.s is not: the output is a wall # timing, so gating on it would make the green light host-sensitive. What IS # gated here is correctness -- all 23 configs must draw a pixel-exact frame, # which is what stops a config timing fast by quietly writing nothing. set -e cd "$(dirname "$0")/../.." [ -f tmp/frame256.bin ] || { echo "need tmp/frame256.bin -- run tools/bench/check.sh"; exit 2; } python3 tools/bench/prep_spans.py tools/vasm/vasmm68k_mot -Fbin -o tmp/blit.bin tools/bench/blit.s > /dev/null mkdir -p tmp/snap_span rm -f tmp/snap_span/x68000/*.png ( cd tmp && SDL_VIDEODRIVER=dummy timeout -k 5 1800 mame x68000 -bios ipl10 \ -ramsize 2M -video soft -window -sound none -nothrottle -plugins \ -autoboot_script ../tools/bench/span.lua \ -snapshot_directory ./snap_span -snapview native -seconds_to_run 150 \ > span.log 2>&1 ) grep -a "^\[SPAN\]" tmp/span.log n=0 for f in tmp/snap_span/x68000/*.png; do python3 tools/bench/verify_frame256.py "$f" > /dev/null || { echo "FAIL: $f is not pixel-exact"; python3 tools/bench/verify_frame256.py "$f"; exit 1; } n=$((n+1)) done [ "$n" -eq 23 ] || { echo "FAIL: $n snapshots, expected 23"; exit 1; } echo "OK $n/23 span configs drew a pixel-exact frame"