Commit e52d195e (October 2026) made ROM-style keyboard scans stop the tape only after a bounded grace period (250 frames) and made recognised loader reads reset that grace, but added unit coverage only for the ula_read_is_keyboard_scan() detector itself - nothing pins the stop timing, the grace reset after a recognised loader read, or the unchanged ten-consecutive-read limit for non-loader reads.
loader_test_keyboard_scan_grace() in unittests/loader.c drives the real loader_detect_loader() entry point with a real machine and tape state: 250 frames of ROM-style keyboard-scan reads (CPL; AND 1f; RRA) never stop the tape while the grace counts down, the next keyboard-only read stops it exactly when the 250-frame grace expires, a recognised ROM-loader read resets the grace so a further 250 keyboard-only frames are again required, and non-loader reads with implausible counter timing still stop the tape after exactly ten consecutive reads. Test-only: loader.c and the build system are untouched; settings fastload is forced off during the test so tape_stop() cannot initialise the sound subsystem before the sound tests run; the MIC-off events tape_stop() schedules stay queued exactly like the existing tape_edge_unittest leaves them, and the next machine_select() resets the event stack before any later test could dispatch them.
unittests/loader.cRepo-Assist-Effect: e8f9570abdad5267fc5ff1f51021eef1689df6ba44cc57553367453ca366153b
Diff:
Applied in [abb1c5].
Related
Commit: [abb1c5]