#!/usr/bin/env bash # SPDX-License-Identifier: MIT # Rung 4 (the reference's): MAME 0.285's traces of real SPC700 code (five games' sound # drivers and spctest) replayed on the core with the I/O answered from MAME's log # (src/bin/mame_replay.rs, the reference's replay.replay_file): no divergence, and every # summary line (lines compared, I/O reads and writes, the dummy and repeated reads, the # opcodes seen) equal to the reference's (conformance/expected/mame/, from # scripts/reference_replay.py). The traces are the reference's ($MAME_TRACES; never committed). set -euo pipefail source "$(dirname "$0")/env.sh" nice -n 19 cargo build --release -q --manifest-path "$ROOT/Cargo.toml" failed=0 count=0 for expected in "$ROOT"/conformance/expected/mame/*.txt; do name=$(basename "$expected" .txt) count=$((count + 1)) if nice -n 19 "$ROOT/target/release/mame_replay" "$IPL_ROM" "$MAME_TRACES/$name/error.log" | diff - "$expected"; then echo "$name: $(cut -d, -f1 "$expected"), summary identical" else echo "$name: FAILED (the summary differs from the reference's, above)" failed=1 fi done if [ "$failed" != 0 ]; then echo "rung 4: FAILED" exit 1 fi echo "rung 4: passed, $count of $count traces, every summary the reference's"