Format:PS2 memory card image
| On this wiki | Facts · Code · Notes · Topics |
|---|
Raw image of a PlayStation 2 Memory Card (8 MB card, .ps2/.bin/.mc2): a superblock at offset 0 starting with the text "Sony PS2 Memory Card Format ", 512-byte pages grouped in 1 KiB clusters and 8 KiB blocks, optionally with 16 spare bytes of ECC per page (528-byte pages), and a FAT-like directory of 512-byte entries.
Overview
A PlayStation 2 memory card holds a small file system of saves (one directory per game save, with files such as icon.sys, the icon models and the save data). Emulators and card tools keep it as one flat image. Two variants exist: the raw dump with 528-byte pages (512 data bytes plus 16 spare bytes, of which 12 hold the ECC) and the "no ECC" variant with 512-byte pages that PCSX2 and mymc-style tools convert from and to. Related containers for single saves are in Format:PSU and MAX (PS2 save containers); the PS1 card files use another layout (the first bytes of a PS1 card image are "MC", which PCSX2 also accepts as formatted).
Identification
A formatted image starts with the ASCII text Sony PS2 Memory Card Format (27 characters without the trailing space, 28 bytes in the superblock magic field), followed by a 12-byte version text field. Unverified: the usual version string is 1.2.0.0. PCSX2 tests the first 27 characters, or the two characters MC, to decide whether an image file is formatted.
Geometry
PCSX2's folder-card code gives the layout constants: a page is 0x200 bytes of data (raw 0x210 with 0x10 spare bytes), a cluster is 2 pages (1 KiB), a block is 8 clusters (8 KiB), and the standard card has 0x4000 pages = 0x2000 clusters = 1024 blocks = 8 MiB (8,650,752 bytes raw). Images of exactly 8, 16, 32 or 64 MiB are treated as the no-ECC form; PCSX2 adds the ECC when converting (FileMcd_InsertECC) by computing a 3-byte code for each 128-byte chunk of a page and storing the four codes in the spare bytes after the 512 data bytes.
Superblock
The first block holds the superblock (struct in the fact below): page length, pages per cluster, pages per block, clusters per card, alloc_offset and alloc_end (the data area in clusters), rootdir_cluster (the root directory cluster relative to alloc_offset), two backup block numbers, an indirect FAT cluster list (ifc_list, 32 entries, PCSX2 only ever uses one) and a bad block list, then card type and card flags bytes. The FAT entries use the top bit as the in-use flag (mask 0x80000000), the low 31 bits as the next cluster, 0x7FFFFFFF ends a chain and 0xFFFFFFFF marks an unused indirect FAT slot.
Directory entries
Directories and files are 0x200-byte entries read from clusters: a 32-bit mode, a length (bytes for a file, number of entries for a directory), creation time, first cluster, parent entry number (used in the . entry), modification time, attributes, and a 32-byte name. Mode bits: 0x0001 read, 0x0002 write, 0x0004 execute, 0x0008 copy protected, 0x0010 file, 0x0020 directory, 0x0800 PocketStation, 0x1000 PlayStation 1 save, 0x8000 entry in use; PCSX2's default directory mode also sets 0x0400 and the default file mode 0x0080 and 0x0400 (meaning unknown). Dates are 8 bytes: unused, second, minute, hour, day, month, 16-bit year.
Code & repositories
- https://github.com/PCSX2/pcsx2 @
091ab68708a555198d80a7216965481c7ddd0d98· license: GPL-3.0
PS2 emulator (GPL-3.0): pcsx2/SIO/Memcard/MemoryCardFolder.h (superblock and directory entry structs), MemoryCardFile.cpp (format check, ECC), pcsx2/CDVD/CDVD.cpp (SYSTEM.CNF parsing).
Tested on: source read, not run: source read, not run or built · checked 2026-10-19; last activity 2026-10-17; Note: the latest release ships binaries; the wiki links only the source, never the binaries - https://github.com/ps2dev/mymc @
db5d9e1c141cbbc4ba4e374f73a0518a8d75b7ef· license: LicenseRef-Public-Domain (declared by the contributor; GitHub's detector did not recognize a license file)
Python PS2 memory card manager by Ross Ridge; ps2save.py (icon.sys unpack, PSU/MAX/EMS saves) and ps2mc.py (card file system) are marked Public Domain in their headers; GitHub shows no license file.
Tested on: source read, not run · checked 2026-10-19; last activity 2023-07-29
Pitfalls
- The same 0x200-byte entry layout is what PSU files store, so a directory entry reader can be reused for Format:PSU and MAX (PS2 save containers).
- PCSX2 keeps cards that are plain host folders with a marker file named
_pcsx2_superblock; such a folder is not a card image. - Unverified: mode value 0x8427 for a directory and 0x8497 for a file are the usual values written by the console (Apollo's PSV converter comments name them); not tested against a real card.