Skip to main content
NESdev Wiki
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

FDS disk format

The Famicom Disk System uses disks that are a modified version of Mitsumi Quick Disk hardware, with a custom data format stored on the disk.

Each side can hold more than 64KB of data.

For archive and emulation, dumps of these disks are often preserved using the FDS file format (.FDS).

FDS Disk Side format

Each disk side must be structured into block as follows :

1, 2, 3, 4, 3, 4, …., 3, 4

The 3, 4 pattern should be repeated once per file present on the disk.

Blocks type 1 and 2 represent information about the disk and how many files it has, and each block type 3 and 4 pair represents a single file. See Block format below.

Gaps

Physically on the disk, there are “gaps” of 0 recorded between blocks and before the start of the disk. Length of the gaps are as follows:

  • Before the start of the disk : At least 26150 bits, 28300 typical.
  • Gap between blocks : At least 480 bits, 976 bits typical.

Gaps are teminated by a single ‘1’ bit. In terms of bytes, it would be $80, as the data is stored in little endian format.

CRCs

At the end of each block, a 16-bit CRC is stored. This CRC is not calculated by the CPU executing the BIOS code, but by the RP2C33 handling the disk drive signals. It will automatically set $4030.D4 = 1 (leading to error code 27) if a block’s CRC value does not match the calculated one during loading.

The CRC algorithm used is the common CRC-16/KERMIT algorithm. The ‘1’ bit at the end of the gap is included in the calculation.

True disk capacity

The commonly used FDS file format is limited to 65500 bytes per side and does not contain CRCs or gaps. The QD file format observed in rereleases on Nintendo platforms is limited to 65536 bytes per side and contains CRCs, but no gaps.

The actual disk capacity is somewhat larger, and there are a few variant disk formats that may have even more capacity.

Block format

Disk info block (block 1)

OffsetLength (bytes)DescriptionDetails
$001Block codeRaw byte: $01
$0114Disk verificationLiteral ASCII string: *NINTENDO-HVC*
Used by BIOS to verify legitimate disk image
$0F1Licensee codeSee Licensee codes
$103Game name3-letter ASCII code per game (e.g. ZEL for The Legend of Zelda)
$131Game type$20 = " " — Normal disk
$45 = "E" — Event (e.g. Japanese national DiskFax tournaments)
$4A = "J" — Unknown. May indicate Family Computer Network Adapter
$52 = "R" — Reduction in price via advertising
$141Game versionStarts at $00, increments per revision
$151Side number$00 = Side A, $01 = Side B. Single-sided disks use $00
$161Disk numberFirst disk is $00, second is $01, etc.
$171Disk type (FMC)$01 for FMC blue-disk releases, and $00 otherwise [1]
$181Unknown$00 in all known games
$191Boot read file codeRefers to the file code/file number to load upon boot/start-up
$1A5UnknownRaw bytes: $FF $FF $FF $FF $FF
$1F3Manufacturing dateSee Date format
$221Country code$49 = Japan
$231UnknownRaw byte: $61. Speculative: Region code?
$241UnknownRaw byte: $00. Speculative: Location/site?
$252UnknownRaw bytes: $00 $02
$275UnknownSpeculative: some kind of game information representation?
$2C3"Rewritten disk" dateSee Date format. It's speculated this refers to the date the disk was formatted and rewritten by something like a Disk Writer kiosk.
In the case of an original (non-copied) disk, this should be the same as Manufacturing date
$2F1Unknown
$301UnknownRaw byte: $80
$312Disk Writer serial number
$331UnknownRaw byte: $07
$341Disk rewrite countValue stored in BCD format. $00 = Original (no copies).
$351Actual disk side$00 = Side A, $01 = Side B
$361Disk type (other)$00 = yellow disk, $FF = blue disk, $FE = prototype, sample, or internal-use (white or pink) disk. Some prototype disks have been observed with value $00, but this may indicate the field was simply not filled in.
$371Disk versionUnknown how this differs from game version ($14). Disk version numbers indicate different software revisions. Speculation is that disk version incremented with each disk received from a licensee.
$382CRC(Omitted from .FDS files)

The *NINTENDO-HVC* string, stored in ASCII, proves that this is a FDS disk. If the string doesn’t match, the BIOS will refuse to read the disk further.

If the FDS is started with a disk whose side number and disk number aren’t both $00, it will be prompted to insert the first disk side. However, some games make this number $00, even for the second disk to make it bootable too.

All files with IDs smaller or equals to the boot read file code will be loaded when the game is booting.

Date format

All bytes are stored in BCD format, in order of year, month, and day. The year is usually represented as the 1-indexed number of years since the start of the current Japanese calendar era, either the Shōwa era (1926) or Heisei era (1989). Values observed are $61-63 for 1986-1988 and $01-03 for 1989-1991. Disk Writer kiosks continued to use Shōwa era dates beyond the end of the Shōwa era, so disks written by the service up to its discontinuation in 2003 may have year values as high as $78.

A small number of games used the last two digits of the current year instead of a Japanese calendar date. Values observed are $85-$86 for 1985-1986.

File amount block (block 2)

This block contains the total number of files recorded on disk.

OffsetLength (bytes)DescriptionDetails
$001Block codeRaw byte: $02
$011File Amount
$022CRC(Omitted from .FDS files)

More files might exist on the disk, but the BIOS load routine will ignore them, those files are called “hidden” files. Some games have a simple copy protection this way: They have their own loading routine similar to the one from the BIOS but hard-code the file amount to a higher number, which will allow for loading hidden files. This also allows the game to load faster because the BIOS will stop reading the disk after the last non-hidden file.

File header block (block 3)

This block stores metadata for the file data block which follows it. Because the BIOS has to manually seek through the disk one byte at a time, it relies on the header block fields to correctly load or skip file data blocks.

OffsetLength (bytes)DescriptionDetails
$001Block codeRaw byte: $03
$011File Number
$021File IDThe ID specified at disk-read function call.
$038File NameTypically in uppercase ASCII.
$0B2File Address16-bit little-endian. The destination address when loading.
$0D2File Size16-bit little-endian.
$0F1File Type0: Program (PRG-RAM)
1: Character (CHR-RAM)
2: Nametable (VRAM)
$102CRC(Omitted from .FDS files)

File Numbers are generally in increasing order, first file is 0. The BIOS does not use file Numbers during reads, and file Numbers written when calling AppendFile/WriteFile are manually counted from the first file.

File IDs can be freely assigned, and this is the number which will decide which file is loaded from the disk (instead of the file number). For example, the parameter disks for Quick Hunter uses identical file Numbers for everything except the first file and only distinguishes them by file IDs. A file ID smaller or equal to than the boot read file code means the file is a boot file, and will be loaded on first start up.

The BIOS only writes to the PPU when the file type is not equal to 0, so types 2 and above are functionally identical to type 1.

File data block (block 4)

This block stores the actual file data.

OffsetLength (bytes)DescriptionDetails
$001Block codeRaw byte: $04
$01–File data
–2CRC(Omitted from .FDS files)

Test data block (block 5)

OffsetLength (bytes)DescriptionDetails
$001Block codeRaw byte: $05
$01–Test dataRepeating sequence of $6D, $B6, $DB to fill the disk side.
–2CRC(Omitted from .FDS files)

This block type and fragments of its data has been observed in retail disks. It appears to be test data used during the disk formatting process. FMC Disk Card Checker is capable of writing and verifying this block.

Non-standard disk formats

Because the disk format is only enforced in software by the BIOS disk I/O routines, custom formats are possible through the use of low-level disk I/O routines.

Some unlicensed disks have been observed to use non-standard formats, often as a means of copy-protection:

  • Kosodate Gokko stores its main program without any block indicator and loads it using the BIOS’ disk IRQ handler. (data is prefixed with a $12 byte)
  • Quick Hunter uses a block type of 0 to store its encrypted main program. (data is XORed with $C9) Note that common dumps of this disk lack the needed 0 byte.
  • Graphic Editor Hokusai and Jingorou use a custom format (interleaved + encrypted PRG/CHR data) with fake file header/data blocks for their main programs.
  • Game Doctor/Magic Card devices switch in a replacement BIOS to load custom disk formats.
    • Block type 5 is used by some Magic Card 1M/2M/4M disks to store trainer data.

See also

References

  1. ↑ FamicomWorld: FMC and FSC product codes

Edit this page on GitHub