MAME persistence terminology and repair / 2026-07-31

MAME CFG vs NVRAM vs diff vs save state files: reset the right layer

Match controls, bookkeeping, retained machine data, writable disks, and whole-machine snapshots to the file layer that actually owns them.

10 minute diagnostic guideOfficial MAME 0.289 concepts; Android ports can remap or hide upstream directories

MAME CFG vs NVRAM vs diff vs save state files: reset the right layer

Use CFG for MAME configuration such as inputs, DIP settings, and bookkeeping; NVRAM for emulated EEPROM and other non-volatile devices; diff files for writes layered over a compressed hard-disk image; and save states for a serialized running-machine snapshot. Back up every relevant layer, close MAME cleanly, then isolate or restore only the layer that matches the symptom.

Do this in order

  1. 01

    Record the MAME or port version, machine short name, configured CFG, NVRAM, diff, and state directories, and the exact symptom.

  2. 02

    Exit MAME normally so configuration and emulated non-volatile devices finish writing, then copy the relevant machine files to a dated backup.

  3. 03

    Classify the symptom: controls or DIP/bookkeeping, retained machine memory, writes to an emulated hard disk, or a manual/autosave snapshot.

  4. 04

    Move only the suspected machine-specific file out of the active directory; never delete the original or reset every persistence directory at once.

  5. 05

    Cold-start the same lawful test machine with the same MAME version and compare the one changed behavior against the backup.

  6. 06

    Restore the last known-good file if the diagnosis is wrong, and record the port path plus exact layer before upgrading or migrating.

Decision and diagnostic table

LayerWhat it normally storesTypical symptom
CFGInput assignments, DIP switches, bookkeeping, UI/debugger layoutControls or operator settings reset
NVRAMEEPROM and other emulated non-volatile device contentsIn-machine settings or progress reset
diffWrites layered over an emulated compressed hard diskInstalled data or disk changes disappear
Save stateSerialized running-machine snapshotManual state or autosave will not load

CFG and NVRAM represent different owners

MAME writes configuration files when it exits and uses them for emulator-side settings including input assignments, DIP switches, and bookkeeping statistics. NVRAM models storage devices that existed in the emulated machine.

A control remap belongs to CFG; an EEPROM-backed operator value may belong to NVRAM. Back up both before a service-menu change, but diagnose them separately.

A diff file protects the original CHD

MAME's diff directory stores writes made to an emulated compressed hard disk so the original image remains unchanged. A missing or unwritable diff layer can lose installed software or other disk changes even when the CHD itself verifies.

Do not merge, rename, or download another CHD to repair a diff-path problem. Preserve the original authorized image and test the writable layer.

Save states are tied to machine support and build

State files capture a broader running-machine snapshot and are read or written on demand or through autosave. Driver state support is a separate gate, and a state from another MAME generation may be incompatible.

Never make a state the only copy of durable progress. Keep machine-native persistence, a version record, and a last-known-good build where practical.

First-party sources

Related guides