#!/usr/bin/env bash # Poll the framebuffer for the "PRESS (A) BUTTON" title screen and tap A the # instant it appears — the title auto-returns to the attract loop after a few # seconds, which is why a human-paced tap misses it. # # 🔴 FIXED 2026-08-29. This used to sample the SINGLE PIXEL (625,618) and test it # for green. That is the exact oracle `is_title.py` was written to replace, and # its docstring says why: it is a 1280x720 coordinate sampled against the # 1279x675 game surface, so it always reads the copyright line. The stale copy # survived here and cost a 787 s run that reported "title not seen" while the # game was cycling through the title perfectly normally. # Now delegates to is_title.py, which COUNTS the green (A) glyph's pixels # anywhere in the frame — geometry-independent, and it passes its own controls # (753 px on a real title capture, 327 on the main menu, threshold 400). set -u export HOME=/sylph-home/re TMP=/tmp/title-probe.png deadline=$(( SECONDS + ${1:-900} )) while [ $SECONDS -lt $deadline ]; do if screenshot "$TMP" >/dev/null 2>&1; then if python3 "$(dirname "$0")/is_title.py" "$TMP" >/dev/null 2>&1; then echo "TITLE detected at ${SECONDS}s — tapping A" vgamepad tap A 200 exit 0 fi fi sleep 1 done echo "TIMEOUT: title not seen" exit 1