# Start here: the Atari ST in one page Phase 0 notes for `atarist-python`, the Atari ST board. No emulator code exists yet. Every fact names its source with a key from [sources.md](sources.md) and an evidence tag (methodology: DOC, DIE, TEST ROM, MEASURED, OBSERVED, FITTED, HYPOTHESIS). "DOC: HWSPEC 8" is section 8 of Atari's *Engineering Hardware Specification of the Atari ST Computer System* (1986-01-07). Atari's documents are unlicensed company documents: we cite them and copy nothing from them. ## The machine (520ST/1040ST first) | Part | Chip | Clock | Notes | Docs | | --- | --- | --- | --- | --- | | CPU | Motorola MC68000 | 8 MHz (DOC: HWSPEC 2.1); MAME's ST rows run it at 8,021,247 Hz (OBSERVED, `-listxml st`), a quarter of the PAL video crystal (below) | 16-bit data, 24-bit address | [cpu-cores.md](cpu-cores.md); core: m68000-python | | Control logic | **GLUE** (Atari custom) | 8 MHz | address decode and chip selects, bus errors, the 2 MHz and 500 kHz clocks, video sync and DE, interrupt priority on IPL1/IPL2 (DOC: SVC 2.x "Glue") | [bus-and-memory.md](bus-and-memory.md), [video.md](video.md) | | Memory controller | **MMU** (Atari custom) | 8 MHz bus side; its own clock input is to read from the schematics (U2) | RAM banks 128 KB/512 KB/2 MB, RAS/CAS, refresh, the video address counter, DMA addresses, interleaving CPU and video cycles (DOC: HWSPEC 2.2; SVC "Memory Controller") | [bus-and-memory.md](bus-and-memory.md) | | Video | **Shifter** (Atari custom) | 32 MHz | 320x200x16, 640x200x4, 640x400x1; 16 palette registers of 9 bits (STE: 12) (DOC: HWSPEC 3.2; STEADD) | [video.md](video.md) | | DMA | **DMA chip** (Atari custom) | | one channel, a 32-byte FIFO, the floppy and the ACSI hard-disk port (DOC: HWSPEC 2.3, 5.6) | [dma-and-floppy.md](dma-and-floppy.md) | | Interrupts, timers, serial | **MK68901 MFP** | bus 4 MHz (MAME: 4.01 MHz, OBSERVED); timers from a 2.4576 MHz crystal (DOC: SVC "RS232C Interface"; TTHRM, MFP serial section) | 16 interrupt sources, 4 timers, 8 GPIP, a USART for RS-232 (DOC: HWSPEC 10; MK68901) | [mfp.md](mfp.md) | | Keyboard and MIDI links | 2 x **MC6850 ACIA** | 500 kHz from GLUE (DOC: HWSPEC 5.1; SVC "Glue") | keyboard at 7812.5 baud (divide by 64), MIDI at 31.25 kbaud (DOC: HWSPEC 4.2, 5.1) | [acia-and-ikbd.md](acia-and-ikbd.md) | | Keyboard MCU | **HD6301V1** in the keyboard, with its own mask ROM | 1 MHz E clock (DOC: HWSPEC 5.1); MAME: 4 MHz input (OBSERVED) | key scan, mouse, joysticks, time of day; its firmware is Atari's (census: SHA-1 `1102f20d...`) | [acia-and-ikbd.md](acia-and-ikbd.md); core: m6800-python + an HD6301 variant | | Sound | **YM2149** PSG | 2 MHz (DOC: HWSPEC 4.1) | port A drives floppy side/drive select, RTS/DTR, Centronics strobe, GPO; port B the printer data (DOC: HWSPEC 9) | [sound.md](sound.md); core: ay8910-python | | Floppy | **WD1772** | 8 MHz (MAME, OBSERVED; the data sheet's 8 MHz CLK) | behind the DMA chip; two drives (DOC: HWSPEC 5.6) | [dma-and-floppy.md](dma-and-floppy.md) | | ROM | TOS | | 192 KB at FC0000 (TOS 1.0-1.04); early machines a 16 KB boot ROM that loads TOS from disk (DOC: SVC "Main Memory"); STE 256 KB at E00000 (OBSERVED: MAME's STE starts at E00040) | [tos.md](tos.md) | | Cartridge | ROM port | | 128 KB at FA0000, ROM3/ROM4 selects (DOC: HWSPEC 7) | [bus-and-memory.md](bus-and-memory.md) | The STE adds (DOC: STEADD): a 4096-colour palette, hardware fine scroll (HSCROLL, LINEWID, VBASELO), a read/write video counter, 8-bit stereo DMA sound with a Microwire interface to an LMC1992 volume/tone chip, extended joystick ports with paddles and a light gun, and the Blitter as standard. GLUE and MMU become one chip, the GSTMCU, whose design files (ST4081, three revisions) survive in Atari's recovered ASIC archive (ASIC README). The Mega ST adds the Blitter socket and an RP5C15 clock; the Mega STE adds a 16 MHz mode with a cache, a Z8530 SCC and VME (OBSERVED: MAME `-listdevices` megast, megaste). Rows: [machines.md](machines.md). ## The family pieces it uses - **m68000-python** (public, `55d3d60`): the CPU. The ST's bus needs from it: per-access timing inside an instruction (`step_clocks`, have), E-clock synchronous cycles for the ACIAs (request), correct bus-error frames (TOS and programs rely on bus errors: request), MFP vectored acknowledge and GLUE autovectors (have). [cpu-cores.md](cpu-cores.md). - **ay8910-python** (`76cace3`): the YM2149, with its two ports. Nothing new expected. - **m6800-python** (`96302c2`): the IKBD's HD6301V1 needs the Hitachi superset as a variant, the same request the Namco System 1 Phase 0 makes for its HD63701V0 (one variant serves both). Its on-chip ports, timer and SCI belong in one shared place. - New shared chip cores proposed by the chip rule: the MFP (the X68000 is the second family user), the WD177x/279x family (BBC Micro's WD1770, MSX's WD2793), the MC6850 (BBC Micro). [cpu-cores.md](cpu-cores.md), handoff-brief.md "The chip rule". ## Modelling level (charter axis B), proposed | Component | Level | Why | | --- | --- | --- | | 68000 | cycle (m68000-python), with the board placing each access in GLUE/MMU's 4-cycle slots | demos and games depend on exact cycle counts per line (the border and sync tricks below) | | GLUE + MMU + Shifter | cycle, per 8 MHz cycle (per 2 MHz "slot" for the bus, per pixel for the Shifter) | the ST's famous effects (opening borders, sync scrolling) are races between CPU writes to the sync and mode registers and GLUE's per-cycle comparisons | | MFP | cycle on its own 2.4576 MHz timer clock, bus side at the CPU's | timer interrupts drive raster and digi-sound code | | ACIAs | bit level at their 500 kHz clock | cheap, and the IKBD link's byte timing is visible to software | | IKBD | cycle (HD6301 core running Atari's ROM), with a functional model as an option | the real firmware is the specification of the protocol's corners | | YM2149 | ay8910-python's per-clock model | existing core | | WD1772 + drive | bit cell (MFM at 250 kbit/s) against a track model | the No-Intro set is all IPF flux-level dumps with copy protection ([census.md](census.md)) | | DMA chip | per transfer (FIFO of 16-byte bursts) | [dma-and-floppy.md](dma-and-floppy.md) | | STE DMA sound, Microwire, LMC1992 | sample (DMA side cycle level; LMC1992 functional) | the family's sound rule | | Blitter | per bus cycle | it shares the bus in 64-cycle turns (DOC: BLIT "HOG") | ## Clocks and frames - Video crystal: the STE addendum gives the system clock as **32.215905 MHz (NTSC) and 32.084988 MHz (PAL)** (DOC: STEADD "Genlock and the STE"). The CPU runs at a quarter (8.0539763 or 8.021247 MHz); MAME's US ST and STE rows use the PAL figure (OBSERVED, `-listxml`: CPU 8,021,247 Hz, YM2149 2,005,311 Hz): conflict C2 in the brief. - Lines and frames are not in Atari's documents. MAME's ST screen: 1024 half-pixel clocks (512 CPU cycles) a line, 313 lines, 50.05 Hz (OBSERVED, `-listxml st`). Clock Signal's ST (MIT, tier 5): 512 cycles x 313 lines at 50 Hz, 508 x 263 at 60 Hz, 224 x 500 at 71 Hz with its author's note that the 71 Hz vertical numbers are guesswork (OBSERVED, `CLK Machines/Atari/ST/Video.cpp` at `cc085c4`). Atari's own GSTMCU design files (ASIC) hold the STE's counters: the first job of milestone 2 is to read them there (U3). - The MFP's timers run from their own 2.4576 MHz crystal (DOC: SVC; TTHRM), unrelated to the video crystal: the board's timeline holds two crystals (three with the IKBD's 4 MHz). ## The order to read 1. [machines.md](machines.md), [bus-and-memory.md](bus-and-memory.md), [video.md](video.md). 2. The chips: [mfp.md](mfp.md), [acia-and-ikbd.md](acia-and-ikbd.md), [dma-and-floppy.md](dma-and-floppy.md), [sound.md](sound.md), [ste-and-mega.md](ste-and-mega.md), [tos.md](tos.md). 3. [cpu-cores.md](cpu-cores.md), [domains-and-speed.md](domains-and-speed.md). 4. [sources.md](sources.md), [validation.md](validation.md), [mame-oracle.md](mame-oracle.md), [census.md](census.md), [provenance.md](provenance.md). 5. [handoff-brief.md](handoff-brief.md): scope, names, unknowns, milestones, open decisions.