# The DMA chip, the WD1772 and the floppy images ## The DMA chip (DOC: HWSPEC 2.3, 5.6, 9, Appendix C; SVC "Direct Memory Access") One channel shared by the floppy controller (low speed, 250-500 kbit/s) and the ACSI hard-disk port (high speed): one DMA operation at a time. - Registers: FF8604 (word access) reaches the FDC's registers, the HDC's, or the DMA sector count, chosen by FF8606's mode bits (A0, A1, HDC/FDC select, sector-count select, DMA enable/disable, FDC/HDC, write/read); FF8606 read is the status (error, sector count zero, DRQ); FF8609/0B/0D the base address and counter (HWSPEC 9). Toggling write/read clears the status (HWSPEC 2.3); the address must be loaded low, mid, high (Appendix C 841017B). - A **32-byte FIFO** buffers transfers so the device need not wait while the 68000 holds the bus (HWSPEC 2.3; SVC: "can store up to 32 bytes"). How the FIFO drains to RAM (in bursts of how many words, in which MMU slots) is U12. - The floppy sequence Atari prescribes (HWSPEC 5.6) and its notes: poll the MFP's GPIP 5 for completion, never the FDC busy bit or sector count (841017F); select the sector count before reading the error bit (G); no 30 ms settle flag on Type II/III (H); force interrupt after a time-out (I); wait for Motor On low before deselecting (J). "The detection of floppy disk removal is not supported in hardware" (HWSPEC 5.6): TOS infers a change from the write-protect line (HYPOTHESIS for the mechanism: U13). - **C**: HWSPEC 2.3 gives the high-speed rate as "up to 12 Mbits/sec"; the service manual says "up to 8 Megabits/sec" (SVC). The board needs the DMA chip's own timing, not the port's rated speed (U12). - ACSI: a 6-byte command block, the AHDI command set (HWSPEC 5.6); a hard disk is a socket on this port (milestone 6). ## The WD1772 (DOC: WD177X, the preliminary data sheet Atari shipped; WD86, WD's 1986 handbook; WDST) Western Digital's WD1770 family: single-chip FM/MFM controller with a built-in data separator and write precompensation, motor control and spin-up (six index pulses), the 179x's command set (Type I restore/seek/step; Type II read/write sector; Type III read address/read track/write track; Type IV force interrupt), clocked at 8 MHz. On the ST: drive and side select come from the PSG's port A (HWSPEC 9); its INTRQ reaches GPIP 5 and DRQ the DMA chip (SVC). **C (conflict) on step rates**: the preliminary data sheet in Atari's toolkit gives the WD1772's rates as **2, 3, 5, 6 ms** for codes 00-11 (WD177X p. 6 table, and its feature list); WD's 1986 handbook gives **6, 12, 2, 3 ms** for both the WD1772-00 and the WD1772-02, and the -02 settles in 15 ms rather than 30 (WD86). Which revision is in which ST is U14; the board follows WD86 (the later, production data sheet) and keeps the preliminary figures in a comment until a measurement settles it. **Chip rule**: the WD177x/279x family is used by the BBC Micro Phase 0 (WD1770/1772: it proposes `wd177x-python` "with an FD179x row" "when a second family board needs it, atari-st ..."), the MSX Phase 0 (WD2793: in the board for now) and this board. **Propose `wd177x-python`** (or `wd17xx-python`) with rows WD1770, WD1772 (-00, -02), WD1773 and the FD179x/WD279x, extracted when the second board is built; the drive (motor, index, head position, rotation) is part of it, the disk image formats are not (open decision 6). ## The library is flux-level: IPF (census.md) The No-Intro "Atari - Atari ST" set holds **420 images, all IPF** (the Software Preservation Society's container: magic "CAPS"), none in ST, MSA or STX. IPF stores each track as encoded MFM cells with sync, gaps, weak bits and the timing copy protections depend on. So: - The board's disk model must be **track-level with bit cells** (MFM at 250 kbit/s on a 300 rpm drive: 200 ms a revolution, 50,000 data bits = 100,000 MFM cells = 6,250 bytes a track), and the WD1772 modelled at the level of its data separator and address-mark detection, not as a sector server. Copy protections that read weak bits, long tracks or fuzzy sectors require it. - **IPF has no official specification**: the IANA registration for `application/vnd.softpres-ipf-disk-image` says so and points to a third-party layout analysis (a KryoFlux-hosted PDF, v1.6; its author's terms not checked and not fetched in this phase). The SPS decoder library (capsimg, "SPS Decoder Library") is under a non-commercial licence ("based on the MAME licence ... for use in all non-commercial projects": the Gentoo copy titled Kryoflux-MAME): **excluded** from an MIT project. Two readable decoders exist: **Clock Signal's `IPF.cpp` (MIT, pinned here)** and MAME's `ipf_dsk.cpp` (BSD-3-Clause by its license line; run only tonight). Open decision 7. - Also needed later: ST (raw sectors) and MSA (Magic Shadow Archiver, run-length) for homebrew and test programs, and STX (the Pasti format, with timing): Clock Signal reads all three (MIT, pinned). The Pasti library itself is closed-source freeware: not used.