Format:FDS disk image
| Platforms | Platform:Nintendo Entertainment System |
|---|---|
| Magic | 46 44 53 1A ("FDS" 1A) at offset 0, or none (headerless: block 01 then "*NINTENDO-HVC*") |
| Extensions | .fds, .qd |
| Endianness | little |
| On this wiki | Facts · Code · Notes · Topics |
Famicom Disk System images (.fds, .qd): optionally a 16-byte "FDS\x1A" header giving the number of disk sides, then 65500-byte raw sides (65536 bytes with CRCs in .qd) made of typed blocks: disk header, file count, file header and file data.
Layout
With the header: 16 bytes, 46 44 53 1A, byte 4 = number of disk sides, the rest zero. Without it (headerless dump), the side count is the file size divided by the side size. Then the sides back to back. A side is 65500 bytes in an .fds image and 65536 bytes in a .qd image (Mesen2 FdsLoader.h). Extra trailing bytes are cut to numberOfSides times the side size.
Blocks on a side
A side is a sequence of blocks, each starting with a type byte:
| Type | Length in the image | Content |
|---|---|---|
| 1 | 56 | disk info block (its bytes 1-14 are the text "NINTENDO-HVC", which is why a headerless image starts 01 2A 4E 49 4E 54 45 4E 44 4F 2D 48 56 43 2A)
|
| 2 | 2 | file count |
| 3 | 16 | file header: file id and number, 8-byte name at +3, load address at +0x0B (16-bit LE), data size at +0x0D (16-bit LE) |
| 4 | 1 + size | file data, size taken from the preceding file header |
On real disks each block is preceded by a gap and followed by a 2-byte CRC. An .fds file drops the gaps and the CRCs; Mesen2 re-inserts a gap (28300 bits at the start, 976 bits after each block) and a fake CRC (4D 62) when it loads one. A .qd file keeps the CRCs, so every block is 2 bytes longer. Any other type byte ends the parse: Mesen2 then copies the rest of the side as it is.
Identification
Recognise a disk by FDS\x1A or by the 15 bytes 01 "*NINTENDO-HVC*" at offset 0 (Mesen2 RomLoader.cpp). Mesen2 treats an FDS image as a mapper of its own with vertical mirroring and hashes the whole file.
Code & repositories
- https://github.com/SourMesen/Mesen2 @
b9fa69ddc6d0a331fb103fdb5eef6904305703c2· license: GPL-3.0-only (declared by the contributor for the files used; GitHub reports GPL-3.0 for the repository)
Core/NES/Loaders/UnifLoader.cpp, FdsLoader.cpp and RomLoader.cpp: UNIF chunks, FDS side layout, format detection
Tested on: source read, not run · checked 2026-10-19; archived; last activity 2026-06-04; Note: the latest release ships binaries; the wiki links only the source, never the binaries
Pitfalls
- Unverified: the field layout inside the 56-byte disk info block (maker code, game name, disk number, side) is not covered here; see the NESdev wiki FDS file format page.
- A side shorter than 65500 bytes is padded by Mesen2; truncated dumps are not an error there.
Evidence and references
Mesen2 (GPL-3.0) Core/NES/Loaders/FdsLoader.cpp, FdsLoader.h and RomLoader.cpp at commit b9fa69ddc6d0a331fb103fdb5eef6904305703c2. See Format:INES and NES 2.0 ROM image, Format:UNIF ROM image.