#!/usr/bin/env bash # Part of JoeyLib, Copyright (c) 2026 Scott Duensing, under the MIT License. # See LICENSE.md for license information. # SPDX-License-Identifier: MIT # # verify-amiga-display.sh - the Amiga's present, checked on the planes the # copper shows. UBER's golden hashes are of the stage; a present that leaves # stale rows on screen passes them. The display flips between two plane # sets: each present draws into the one not shown, which holds the frame # before last, from the union of two frames' dirty bands # (src/amiga/presentScan.s). UBERPROB (UBER with UBER_PROBE, # make/examples.mk) runs its Amiga display row (op_probePresentPageSum): a # battery of draws, each presented and the shown planes summed against the # stage's (jlAmigaProbePresentPageSums in src/amiga/hal.c). It must PASS. # # Usage: scripts/verify-amiga-display.sh # Exit: 0 PASS, 1 FAIL # Requires: FS-UAE and a Kickstart (install.sh install emulator:amiga); it # builds the probe (make -f make/amiga.mk amiga-uberprob). set -uo pipefail repo=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd) label=verify-amiga-display dir=$repo/build/amiga/probe if ! make -s -f "$repo/make/amiga.mk" amiga-uberprob; then echo "$label: FAIL - building the UBERPROB failed" >&2 exit 1 fi rm -f "$dir/joeylog.txt" BENCH_PROG=Uberprob BENCH_BIN_DIR="$dir" TIMEOUT="${TIMEOUT:-300}" "$repo/scripts/bench-amiga.sh" > /dev/null 2>&1 line=$(grep "UBER-PROBE: presentPageSum" "$dir/joeylog.txt" 2>/dev/null) if [[ "$line" == *"presentPageSum PASS"* ]]; then echo "$label: PASS - ${line#UBER-PROBE: }" exit 0 fi echo "$label: FAIL - ${line:-no presentPageSum line in its log}" >&2 exit 1