#!/bin/bash # Run the C68K harness against whatever tools/bench/prep_dlx.py last laid out, # so it measures byte-for-byte the same code and container MAME did. # tools/bench/c68k/run.sh [out.csv] set -e cd "$(dirname "$0")/../../.." M=tmp/decode_meta.lua [ -f "$M" ] || { echo "no $M -- run tools/bench/prep_dlx.py first"; exit 2; } g() { sed -n "s/.*[ ,{]$1=\([0-9]*\).*/\1/p" "$M" | head -1; } # Same anchor offsets decode.lua times, so the two instruments are quoted on the # same frames -- including the four synthetic single-mode ones, which sit past # the end of the real stream and price each block mode on its own. ANCH=() while read -r o; do ANCH+=(--anchor "$o"); done < <(sed -n 's/.*off=\([0-9]*\).*/\1/p' "$M") tools/bench/c68k/c68k_bench \ --code tmp/decode.bin --data tmp/decode_data.bin \ --cb1 "$(g cb1_len)" --cb4 "$(g cb4_len)" --pal "$(g pal_len)" \ --stream "$(g stream_len)" --nframes "$(g nframes)" \ --W "$(g W)" --H "$(g H)" --fps "$(g fps)" --dark "$(g dark)" \ "${ANCH[@]}" \ --dump tmp/c68k_screen.bin > "${1:-tmp/c68k_frames.csv}" 2> >(tee tmp/c68k.log >&2)