# Disks: the disk ROM, the interfaces and the FDCs Disk drives were optional on MSX1 and usual on MSX2 [TH2 ch. 1, 2.1.2]. MAME 0.285 gives 89 of its 264 MSX rows a built-in drive (census.md), and carries 18 disk cartridge devices and 26 built-in interface variants (`devices/bus/msx/cart/disk.cpp`, `slot/disk.cpp`, by `-listsource` counts). ## Two halves 1. **The disk ROM** (Disk BASIC and the BDOS, 16 KB in page 1 of the interface's slot), maker firmware from Microsoft/ASCII adapted per interface. It reaches the drive only through its maker's driver entries: DSKIO (4010h), DSKCHG (4013h), GETDPB (4016h), CHOICE (4019h), DSKFMT (401Ch) (entry list as C-BIOS's `disk.asm` comments give it, BSD-2-Clause). Never shipped; bring-your-own by SHA-1 (bios.md). 2. **The interface**: an FDC and drive latches, memory-mapped in the same slot on most designs (the TH2 I/O map's D0-D7h FDC block saw little use). There is no single standard; each maker wired its own. ## The controllers [WD279X, TC8566AF, MB8877A data sheets] | FDC | Family | Where (examples) | Family code | | --- | --- | --- | --- | | WD2793 (and Mitsubishi M5W1793) | WD179x family | the "Philips-style" interface below; which makers used it per machine is MAME's list to read (U18) | none | | Fujitsu MB8877A | WD179x-compatible | some early Japanese interfaces (per machine: U18) | none | | Toshiba TC8566AF | uPD765A-compatible | Panasonic-style interfaces, the turbo R (per machine: U18) | **sms-python's in-board `UPD765`** (the SF-7000's uPD765A) | The common "Philips-style" WD2793 map, as Clock Signal implements it (MIT, tier 5, `Machines/MSX/DiskROM.cpp` at `cc085c4`): 7FF8-7FFB the FDC's four registers, 7FFC bit 0 side select, 7FFD bit 0 drive and bit 7 motor, 7FFF read: bit 7 = not DRQ, bit 6 = not INTRQ. Other makers differ (Sony, National, Canon, Panasonic): each interface is a machine-row or cartridge row with its own map and its own evidence (U18). ## Recommended path - **Milestone A (functional):** a disk interface device at the register level (the Philips-style WD2793 first) over sector images (`.dsk`, 360/720 KB, 512-byte sectors), with the WD279X's commands, status bits and DRQ/INTRQ as the data sheet gives them and seek/rotation timing as one table tagged FITTED. The real disk ROM (or C-BIOS's `cbios_disk.rom`, a WD2793 driver, BSD-2-Clause) runs unmodified on it. - **Not** a DSKIO patch (replacing the ROM's driver with a host call): it hides the interface the specification exists to describe; at most a host convenience in a downstream tier, named as a concession. - **Milestone B (bit level, later):** the drive as its own domain with the FDC's clock, MFM flux and index timing, only if software needs it (copy protection, timing loops). ## Chip rule WD179x-family FDCs: other family boards that could use one (Atari ST, CoCo, BBC Micro style machines) are not in the family yet: **in the board**. The TC8566AF is uPD765-compatible, and sms-python already holds a `UPD765`: when a Panasonic disk row is wanted, that is the second consumer, and the charter's rule says extract (`upd765-python` from sms-python with history; decision 9). Not needed for the first rows.