# Floppy disks: three interfaces, the uPD765A, and the 320 KB drive subsystem Sources: UND `io_fdd`, `io_2d`; NEC uPD765 data sheet (December 1978, pinned; the PC-98 uses the uPD765A: UND `io_fdd` head); TDB86; MAME (tier 5). ## The interfaces | Interface | Ports | DMA | Interrupt | Models | Source | | --- | --- | --- | --- | --- | --- | | **1 MB (2HD, 8-inch and later 5.25")** | 90h status, 92h data, 94h control / switch read | channel 2 | IR11 (INT42) | the original's and the M's built-in interface; the PC-9801-15 board; the dual-mode interface in 1 MB mode | UND `io_fdd` 0090h table; `io_dma`; TDB86 level table | | **640 KB (2DD)** | C8h, CAh, CCh | channel 3 | IR10 (INT41) | the F, U and VF built-in interface; the PC-9801-08/09 boards; dual mode in 640 KB mode | same | | **dual-mode ("両用FD I/F")** | either set above, plus **BEh** | 2 or 3 | 11 or 10 | from the PC-98XA and the VM on: one internal 2HD drive pair that reads both formats; the mode is set at boot by DIP SW3-1/3-2 and by the medium booted from (factory setting: automatic) | UND `io_fdd` head | | **320 KB (2D)** | 51h, 53h, 55h, 57h (images at 59h-5Fh) | none (handshake) | none found | **the original, E, F and M only**; never offered as a board for later models | UND `io_2d` | On the original, E, F and M the 1 MB and 640 KB interfaces may coexist with different ports, interrupts, DMA channels and BIOS work areas (UND `io_fdd` head). ## The uPD765A Status bits (UND `io_fdd` 0090h, matching the data sheet): RQM, DIO, NDM, CB, D3B-D0B. The board follows the uPD765 data sheet for commands, phases and result bytes. The PC-98's own additions are outside the chip: the control port (94h/CCh: reset, motor, the drive-select lines' meaning, the DIP switch and "ready" reads) and the dual-mode port BEh. **The chip rule:** a uPD765 core is the most-requested extraction in the family. sms-python has a `UPD765` (SF-7000, non-DMA, one drive); zxspectrum-python, msx-python, cpc-python, x68000-python (uPD72065) and ibmpc-python all support extracting **`upd765-python`** from it (ibmpc decision 5, cpc decision 6, x68000 decision 4). The PC-98 adds: - **DMA mode with TC** (channels 2 and 3; ibmpc-python asks the same); - **two FDCs in one machine** (the original-era 1 MB and 640 KB interfaces coexisting), so the core must be instance-clean (no module state); - **two-sided, 77-cylinder 2HD media at 360 rpm with 1024-byte sectors** and the 2DD/2HD switch of the dual-mode interface: a drive-model concern, kept in the board's drive class, not in the chip; - the **PC-8801's PC-80S31 drive** uses a uPD765 too (below), so pc88-python is one more user. **Support the extraction** (open decision 6); the PC-98 can start with the core in hand if it lands first, or in-board behind a pin-shaped class if it does not. ## The 320 KB drive subsystem (the original, E, F, M) The 320 KB interface is not a disk controller. It is an **8255A whose ports are cross-wired to the 8255A of an independent drive subsystem with its own Z80-class CPU** (UND `io_2d` head and its wiring figure): port A in, port B out, port C carrying the DAV/RFD/DAC/ATN handshake in both directions. The subsystem's CPU sees its 8255A at its I/O FCh-FFh. **This is the same kind of drive as the PC-8000/PC-8800 series' 2D drives** ("PC-8031 and the like": UND `io_2d`), whose firmware takes commands such as Initialize, WriteSector, ReadSector, SendData, FormatDrive, SendResultStatus, TestMemory, SendMemory, ExecuteMemory, Load and Go (UND `io_2d` command table, 00h-1Bh). Consequences for the family: - The drive is a **separate domain**: a Z80 at 4 MHz (MAME `fdd_2d:fdc_cpu`) with its own ROM, RAM, uPD765 and 8255, meeting the PC-98 only at the 8255 handshake (a byte channel). - It is **shared with pc88-python**: the PC-8801's PC-80S31(K) is that drive family (MAME device `pc80s31`, ROM `disk.rom` 2 KB, SHA-1 `bb7103a0818850a039c67ff666a31ce49a8d516f`, and `mk2fr_disk.rom`, both good dumps, both on the mirror: census.md). Whether the PC-9801's external 2D drive ran the same ROM is not established (U13). - **MAME 0.285's `pc9801` set fits the Z80 and uPD765 but no drive ROM** (`-listxml` lists no ROM under `fdd_2d`). Its run polls port 55h **186,986 times** in 32 emulated seconds and then falls through to N88-BASIC(86) (mame-oracle.md). MAME is therefore **no detector at all** for the 320 KB path; the PC-80S31 as pc88-python models it is the better reference. - **Proposal (open decision 7):** the PC-80S31-class drive becomes **one shared device**, a board-level component that both pc88-python and pc98-python pin (it is a whole subsystem, not a chip: Z80 core + upd765 core + 8255 + ROM socket), built by whichever board reaches its disk milestone first. Suggested name `pc80s31-python`, a device repository like the family's add-on boards. ## Images The No-Intro PC-98 set is 24 images, all `.hdm` (raw 2HD: 77 cylinders x 2 heads x 8 sectors x 1024 bytes = 1,261,568 bytes; all 24 files have exactly that size, checked by census.py's reading of the zips, 2026-11-26). The community formats D88 (also the PC-88's), FDI, NFD and HDM are all in common use; the board reads raw `.hdm` and D88 first (the D88 format is shared with pc88-python and x1-python).