Memory card



The NeoGeo home console and some MVS cabs can use JEIDA V3 memory cards to store game saves and/or high scores, allowing players to save their progress and continue on any system running the same game.

Even if the memory card address space can be freely used, games should only perform memory card operations through the CARD system ROM call to avoid data corruption.

=Supported card types=

The SP-S2 system ROM (and probably all the others) can handle 8 memory card sizes from 2KiB up to 16KiB, in 2KiB steps:
 * 2KiB
 * 4KiB
 * 6KiB
 * 8KiB
 * 10KiB
 * 14KiB
 * 16KiB

And 4 different card types:
 * 8 bits wide (only the low byte is used)
 * 16 bits wide
 * 16 bits wide "doubled"
 * "SNK ROM" cards

=Original SNK card=

The original SNK-branded memory card was a battery-backed 8-bit wide 2KiB card using a LH5116 SRAM chip and voltage switching circuitry.

Since it uses a battery, it may be prone to data loss if the voltage drops below 2V. It is unclear if the battery is charged up when plugged into a powered system or not.

=CD systems=

A "virtual" memory card is embedded in CD systems as a 8KiB battery-backed SRAM chip.

=Data format=

All cards use the same format regardless of capacity, only regions sizes differ. Since the JEIDA data bus is 16-bits wide, make sure to double the address for 8-bit cards if you choose to access their memory directly.

The data is referred to as "blocks", one block being 64 bytes. The header always occupies the first block. Eg. A 2KiB card can hold (2048/64)-1 = 31 blocks.

The data is split into 5 regions:

Header
Always 64 bytes.

Directory
List of saves of 32, 64, 96, 128, 160, 192, 224 or 256 entries. The size depends on the card's capacity.

Note that since the header occupies the first block, there will always be at least one unused directory entry.

Each entry is 4 bytes, with the following format:

FAT 1
List of used blocks of 64, 128, 192, or 256 entries. The size depends on the card's capacity.
 * $02 is a block reserved by the system ROM
 * $01 is a block used by a game
 * $00 is a free block

FAT 2
FAT 2 is simply a mirror of FAT 1.

If any of the FAT tables checksum is bad, the correct table is written over the other one. If both checksums are bad, the system ROM displays an error.

Game Data
Many games use only one block, but some may use more.

The first 20 bytes contain the data title (usually the game and stage name).

=Registers=


 * Write is enabled if and  are written to
 * The WP (Write Protect) pin is read through bit 6 of
 * CD1 (Card Detect 1) is read through bit 4 of
 * CD2 (Card Detect 2) is read through bit 5 of
 * Both must be 0 if the card is inserted correctly
 * Attribute memory is selected if is written to, never used ?

=Pinout=

See Memory card pinout.