# The board family, its clocks and its frame Tags as in the charter: DOC (a document; for MacDonald's notes, facts he tested on a board), MEASURED (an instrument on real hardware, by whoever is named), OBSERVED (MAME, a detector), HYPOTHESIS. Source short names are [sources.md](sources.md)'s. ## The boards | Board | Years | Main CPU | Sound | Video | MAME file | | --- | --- | --- | --- | --- | --- | | **Pre-System 16** (unofficial name) | 1985-1987 | 68000 @ 10 MHz (MC68000P10) | Z80 (uPD780C-1) @ 4 MHz, YM2151 @ 4 MHz, uPD7751 @ 6 MHz into an 8-bit signed DAC | 16 KB work RAM, 32 KB tile RAM, 4 KB text RAM, 4 KB colour RAM, 2 KB sprite RAM, two 512 x 12-bit line buffers | `segas16a.cpp` | | **System 16A** | 1986-1988 | 68000 @ 10 MHz; FD1089A/FD1089B/FD1094 in some sets | as Pre-16 | as Pre-16 (CMP16 asks whether 16A has a zoom ROM; unanswered: U4) | `segas16a.cpp` | | **System 16B** | 1987-1991 (later Korean and Japanese boards to 1996) | 68000 @ 10 MHz behind the **315-5195** mapper; FD1089/FD1094 in some sets; 8751 socket | Z80-B, YM2151 @ 4 MHz, **uPD7759** @ 640 kHz | **315-5196** sprites, **315-5197** tiles, 315-5213/5214 PALs; three ROM board types | `segas16b.cpp` | | **System 18** (later row) | 1989-1992 | 68000 @ 10 MHz (most sets FD1094) | Z80-B @ 8 MHz, two YM3438 @ 8 MHz, RF5C68 @ 10 MHz | 315-5361 sprites, 315-5362 tiles, **315-5313** (the Mega Drive VDP) mixed in | `segas18.cpp` | | **Out Run** (separate board, later) | 1986-1989 | two 68000 @ 10 MHz | Z80 @ 4 MHz, YM2151, Sega PCM | its own sprite chip and the **road generator** | `segaorun.cpp` | Sources: CMP16 ("Timing", "Overview"), CM16B §1, CM18 "Overview", "Timing"; MAME `-listdevices` ([mame-oracle.md](mame-oracle.md)) for the Out Run row. Pre-System 16 and 16A are one machine family in MAME and nearly one to software: the same fixed memory map (CMP16 "68000 memory map", and the Shinobi 16A writes logged in mame-oracle.md land on it), an 8255 PPI for the sound command and outputs, the uPD7751 sample CPU; 16B replaced the fixed decode with the 315-5195 and the 7751 with the uPD7759. ## Crystals and clocks | Clock | Value | Evidence | | --- | --- | --- | | 68000 | 10.000 MHz (20 MHz crystal at B1 / 2) | DOC CM16B §1 ("I confirmed that the 68000 runs at 10MHz"); DOC JT16 crystal table | | Video pixel clock | 6.2937 MHz (25.1748 MHz crystal at G1 / 4) | DOC JT16; CMP16 gives 6.293700 MHz for the line buffer scan and pixel clock and 12.587400 MHz for the sprite render clock | | YM2151 | 4.000 MHz (8.000 MHz at E12 / 2) | DOC CMSND "Timing", JT16 | | Z80, 16B | **unknown on hardware**: CMSND says its clock "comes from elsewhere on the board, which I have not determined yet"; MAME runs it at 5 MHz | U1 | | Z80, Pre-16/16A | 4.000 MHz (a uPD780C-1, rated 4 MHz) | DOC CMP16; OBSERVED MAME 4 MHz | | uPD7751 | 6.000 MHz | DOC CMP16; OBSERVED MAME | | uPD7759 | 640 kHz ceramic resonator | DOC CMSND; DS7759 (630-650 kHz range, 640 typical) | | 8751, Pre-16 | 8 MHz input, "Has a clock divider (runs at 4.000 MHz)" | DOC CMP16; MAME runs every 8751 at 8 MHz: C1 | | 8751, 18 | 8 MHz | DOC CM18 | ## The frame | Fact | Value | Evidence | | --- | --- | --- | | Lines | 262 a frame, 224 active | DOC CM16B §4 | | Dots | 400 a line at 6.2937 MHz = 63.555 us, 15.734 kHz | DOC JT16 ("Estimated geometry"); MEASURED JT16 HSync 15.73 kHz (OSSC) | | Frame rate | 6,293,700 / (400 x 262) = **60.054 Hz** by the clocks; **60.042 Hz MEASURED** (JT16, an Analog Discovery) | C2 | | Vertical blank | 2.427 ms, 38 lines (262 - 224 = 38) | MEASURED JT16 | | CPU clocks | 10 MHz / 60.054 = 166,517 a frame, 636 a line (400 dots x 10 / 6.2937) | arithmetic | | Sprite render budget | about 800.75 ticks of 12.5874 MHz a line (CMP16) | DOC | | The vblank interrupt | **level 4 at the start of line 223** (the last active line, so palette changes there still show); "automatically acknowledged by the video hardware"; if SR masks it, it is taken as soon as SR allows, "even on a different scanline or frame" | DOC CM16B §4 | On the Pre-16 boards the 8751 drives the 68000's /IPL lines itself (P1.0-P1.2, level 4 autovector for vblank, with the vblank timing on its /INT0): DOC CMP16 "8751 MCU". Without an MCU the board's own timing logic raises the level 4 interrupt (16B, CM16B §4). ## What the board needs from a host, per frame A 60.05 Hz frame of 320 x 224 pixels (CM16B §3: sprite X 0x0B6-0x1F5 is the visible range; the text layer shows 40 of its 64 columns), stereo-less mono sound (16B: one speaker pair on the harness, CM16B §10), 4 input bytes and 2 DIP bytes (CM16B §2 "I/O information").