# The floppy controller: MB8877A ## The chip Fujitsu's **MB8877A**: a one-chip floppy formatter/controller with a **positive-logic** data bus, "upward compatible with Western Digital FD1793-02" (its sibling MB8876A has the negative-logic bus of the FD1791) (FUJ87 section 4-27, the data sheet of October 1986, features list). So the WD FD179X-02 data sheet (FD179X) is the programmer's model: status and command, track, sector, data registers; type I-IV commands; DRQ and INTRQ. FUJ87 is the judge where the two differ (U14: list the differences FUJ87 states). ## On the X1 (SX1 pp. 13-14, ch. 9) | Port | Use | | --- | --- | | 0FF8h | status (read), command (write) | | 0FF9h, 0FFAh, 0FFBh | track, sector, data | | 0FFCh | write: drive number (bits 1-0, drives 0-3), side (bit 4), motor on (bit 7) | | 0FFDh-0FFFh | read (turbo): FM/MFM select, 2HD (1.6 MB type), 2D/2DD (500 KB/1 MB) switch | | 0FE8h-0FEFh | the same for 8-inch drives on the turbo/Z (unsupported by Sharp's software as of November 1987, SX1 p. 13) | DRQ is polled by the plain X1's software or served by the Z80 DMA on the turbo (SX1 ch. 8 and ch. 9: "a 4 MHz Z80 can barely keep up with 8-inch double density without DMA", ch. 9's note at the 8-inch discussion). INTRQ's wiring to the Z80 (interrupt or polled) is U15. MAME clocks its MB8877 at 1.00 MHz with four 5.25-inch double-density drives (OBSERVED). ## Disk images MAME's software list `x1_flop` (372 entries) and the collections on hand use **D88** (the Japanese sector-image format: a 2B0h-byte header with name, write-protect, media byte 00h 2D / 10h 2DD / 20h 2HD and the image size, then per-sector headers) and raw **2D** images (census.md). D88 has no published specification from an author with terms; the format is documented by MAME's `d88_dsk.cpp` (BSD-3-Clause by its `license:` line, Miodrag Milanovic; not fetched) and by emulator documentation. Proposal: write the D88 reader from the format as observed in images (header fields checked against image sizes, as census.py does), and pin a permissive description if one is found (U16). ## The chip rule (decision 6) The WD179x family is now in many family Phase 0s, each keeping its own in the board: msx-python (WD2793, MB8877A rows), coco-python (FD1793, WD2797), oric-python (FD1793, Microdisc), atari8bit-python (FD1771/WD2793 for drives), bbcmicro-python (WD1770/1772 on the B+ and Master), atarist-python (WD1772), ti99-python (FD1771), and now the X1 (MB8877A). coco-python's decision 5 and oric-python's decision 6 already propose a shared `wd179x-python`. **Proposal: support creating `wd179x-python` now**, with the FD1791/1793, FD1771, WD1770/1772/1773, WD2791/2793/2797 and MB8876A/8877A as variant rows (bus polarity, side-select and head-load pins, the 177x's motor-on and spin-up, the 279x's internal data separator). The X1 needs the 1793-compatible row with a positive bus.