Battery saves that survive the emulator

The first game hosts could launch, play audio, and return to the library. Their battery-backed RAM vanished with the process. A role-playing game, a high-score table, or a memory card needs more than a successful launch.

r31 adds one shared save module for the hosts that expose persistent RAM. It was installed on the games card after host-side tests and package verification, but it has not run on the unit, so write timing and the controller change remain expectations rather than results; installation proves that the package and its files reached the card, whereas restoring a real save after an exit or power interruption still needs observation on the actual head unit. The distinction matters because a successful host fixture can only exercise ordinary file behaviour on its own filesystem, while the installed target has a FAT card, a separate audio and controller lifecycle, and ignition-off timing that the fixture deliberately does not try to simulate.

Save the bytes that changed

Each supported host gives the module its save RAM at launch. An existing image is restored only when its size matches exactly. A missing or truncated primary image falls back to its .bak predecessor, which makes an interrupted write recoverable without pretending the card supports an atomic replacement, while keeping the recovery choice visible as an ordinary file beside the save.

Every ten seconds, and again on exit, the module hashes the RAM. Unchanged bytes leave the card alone. Changed bytes cause the previous image to become the backup before the new image is written. The host policy permits fwrite for this module while keeping destructive file operations unavailable; the two-file arrangement is therefore a constrained substitute for an atomic swap, not evidence that the underlying card has transactional storage semantics.

Battery-save lifecycle

SNES, NES, GBA, PlayStation, Game Boy, Master System and Mega Drive use the path. PlayStation exposes its first memory card through normal save memory. Mega Drive saves declared SRAM. Game Boy and Sega 8-bit cores copy RAM from their internal arenas. GBA receives a fixed 128 KiB image per title.

FBNeo, Amiga, PICO-8 and N64 remain volatile. Their persistence formats need separate work, and this rollout does not make them supported by implication.

Host tests cover restore, change detection, backup rotation, truncated-image recovery, and path resolution. They establish fixture behaviour. The open unit question is stronger: whether a FAT write plus flush has reached the card before ignition cuts power, because the backup can recover a torn write but cannot recover bytes that never left a cache in the first place.

The cold controller was late

Run 13 showed another small startup delay. After the first launch, the adapter streamed reports four milliseconds after the reader opened. On a cold first launch it stayed quiet until a controller handshake completed, with the first report at 3,045 milliseconds. The original handshake waited two seconds.

The reader now starts that handshake after 250 milliseconds when no report has arrived, then retains the two-second path when reports already flow. The expected cold-launch first input is about 1.3 seconds, although acceptance at 250 milliseconds needs a unit run before it can be called an improvement.

r31 is a durable package, not a completed endurance test. The next run needs to save, exit, reload, interrupt a write safely, and cold-launch the controller on the head unit before these mechanisms become observed behaviour.