Run-ahead loads a state every frame, and each load stopped autostart, so
a disk or tape never started with run-ahead on. Autostart and the keys
it types aren't in the snapshot either, so going back to a state from
before they moved on loses the typed LOAD or RUN.
For run-ahead's states, keep autostart going on load, and refuse to save
while autostart is still typing or loading. That holds run-ahead off
until the program is running.
build_dac_table() used IEEE INFINITY as the sentinel for the 6581's
missing termination resistor (term=false). Under -ffinite-math-only
(implied by -Ofast, which jni/Application.mk sets for Android) the
compiler folds the 'Rn == INFINITY' comparisons away, the infinity
leaks into the ladder arithmetic, vbit[] turns NaN and every 6581 DAC
table (wave 12-bit, envelope 8-bit, filter f0 11-bit) collapses to
all-zero, muting the 6581 model entirely. The terminated 8580 never
touches the sentinel and is unaffected. Reproduced on gcc 13 and
clang 18 with -Ofast/-ffast-math.
All DAC tables verified byte-exact against the pre-patch IEEE -O2
reference across g++/clang++ at -O2/-O3/-Ofast; full SID harness
shows 6581 output restored at -Ofast (RMS matches -O2), 8580
unchanged.
Sanitizer sweep (harness at -O1, full init->clock->teardown for both
models and both sampling paths): ASan clean, LSan clean, TSan clean.
UBSan reports one pre-existing finding outside this change
(extfilt.h:146 left shift of negative value), present identically on
the unpatched tree; dac.cc itself is clean.