Skip to content

feat: add MMC snapshot/restore support for Atom #655

@mattgodbolt

Description

@mattgodbolt

The AtomMMC2 device does not currently have snapshotState/restoreState methods. This means:

  • Rewind will reset the MMC to its initial state (losing any file pointer positions, open files, CWD)
  • Save-to-file snapshots won't capture MMC state

The PPIA and Branquart bank state are captured (added in #653), but the MMC is not.

What to save

  • allfiles array (the virtual SD card filesystem)
  • filenum, fildataIndex, fildata (open file state)
  • CWD (current working directory)
  • configByte, heartbeat
  • MMCtoAtom, MCUStatus (register state)
  • globalData, globalAmount (command buffer)
  • branquartLatch value (already saved in CPU snapshot)

Notes

  • The allfiles array contains WFNFile objects with path (string) and data (Uint8Array). The snapshot system's TypedArray-to-base64 handling should cover the data fields.
  • For rewind (in-memory snapshots), the WFNFile references survive without serialization. For save-to-file, they need proper serialization.

Metadata

Metadata

Assignees

No one assigned

    Labels

    acorn-atomSpecific to the Acorn atomdiscIssues with the disc emulation or accessfeatureA feature request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions