# The memory schedule, derived from TI's 1978 drawing Source: **TI, "9918 Address Select / RAM Data Load Timing"**, hand-drawn, 1978, from Karl Guttag's documents as archived by Joe Zbiciak (`reference/docs/guttag-vdp-99xx/1978_9918_Master_Timing_by_Serigio_Maggi.jpg`, 3288 x 2148, tier 2, the plain TMS9918 before the "A"). First read by eye on 2026-11-12 (open decision 8 of the brief), by an agent that also had openMSX's tables in hand. **Provenance wave 2 (2026-11-19).** Because that first table equalled openMSX's (GPL-2.0) at every slot, it was moved aside unread and the schedule was derived again from TI's drawing, TI's 1982 manual and VATT's hardware results alone, with no other emulator's tables or source in view. The code is `src/tms9918_python/_schedule.py` (each rule names its drawing row and counts, with an evidence tag); `tables.py` re-exports it; the tests are `tests/test_rung0_tables.py`. Compared afterwards by equality only (a script that printed the number of differing slots, never the old values): **0 differing slots in every schedule** (Graphics, Multicolor, one-in-four, Text, refresh, both early-check variants). The readings below are the wave-2 readings. ## Coordinates The drawing's horizontal count (HCNT) runs 0-295, then jumps to 466 and runs to 511: 342 states. The core's **dot** is HCNT for 0-295 and HCNT - 170 for 466-511, so dot 0 is the first name fetch of a line and dot 341 the last state before it. A memory cycle is two pixel clocks; **slot** s starts at dot 2s (171 slots). The grid on the paper is one square per memory cycle (two pixel clocks); pulse positions were read against the HCNT labels (0, 8, 16, 24, 32 on the left sheet; 256, 264, ..., 504, 0 on the right sheet). Readings are to the nearest memory cycle. ## Pattern modes (Graphics I and II): "PATTERN PLANE", repeat 8 times Per 8-pixel group g (dot 8g, g = 0-31): | Dot | Fetch | Drawing row | | ---: | --- | --- | | 8g + 0 | name | NAME ADDRESS SELECT (S1YY) | | 8g + 2 | CPU window if g is a multiple of 4, else a sprite vertical check | CPU (HCPB) at count 2 of each 32; VERT ATT. ADDRESS SELECT (CCYY) at 10, 18, 26 | | 8g + 4 | colour | COLOR ADDRESS SELECT (T2YY) | | 8g + 6 | pattern | PATTERN ADDRESS SELECT (VVYY) | So 8 CPU windows and 24 vertical checks (sprites 8-31) in dots 0-255. [TI 2.1.5]: "CPU windows occur once every 16 memory cycles" (checked by a test). Horizontal blank, dots 256-340 (HCNT 256-295, 466-510). Every pulse of the right sheet's sprite rows is labelled in the drawing (V, H, N, T; P1, P2) and falls on an even count; the CPU row (HCPB) has 2 + 5 + 4 pulses. The AAYY row also has three faint pulses at HCNT 490-494 that were rubbed out on the paper: not taken. | Dot (HCNT) | Slot | What | | --- | --- | --- | | 256, 258 | 128, 129 | CPU | | 260-270 | 130-135 | sprite 0: V, H, N, T, then P1, P2 (rows DDYY, EEYY, NNYY) | | 272-282 | 136-141 | sprite 1: V, H, N, T, P1, P2 (FFYY, PPYY) | | 284, 286 | 142, 143 | sprite 2: V, H (GGYY) | | 288-294, 296 (466) | 144-148 | CPU (five windows) | | 298-304 (468-474) | 149-152 | sprite 2: N, T (HHYY), P1, P2 (QQYY) | | 306-316 (476-486) | 153-158 | sprite 3: V, H (LLYY), N, T (XXYY), P1, P2 (RRYY) | | 318-324 (488-494) | 159-162 | CPU | | 326-340 (496-510) | 163-170 | vertical checks of sprites 0-7 (AAYY), for the line after next | Line total: 19 CPU windows. ## Multicolor The drawing has no Multicolor row. [TI 2.1.5] says windows come "at least once out of every four memory cycles" in Multicolor, which fits if the four colour slots of each 32 pixels become CPU windows (51 a line, `MULTICOLOR_ONE_IN_FOUR`, kept aside). **The core does not.** VATT's raw results (tier 3, hardware-run, 21 TI-part machine and owner entries) land the same fraction of fast writes in Multicolor as in Graphics I and II at every period from 12 to 31 T, on 60 Hz and 50 Hz machines (for example 64-78 % at 12 T, 98-100 % at 26 T). A Multicolor line with 51 windows lands 92 % at 12 T in the emulated VATT ([results.md](results.md), rung 4); the Graphics schedule lands 69 %. So Multicolor runs the Graphics schedule: the colour slots are still taken (the fetch is made and ignored), 19 windows a line. Clock Signal (tier 5) drives Multicolor with its Graphics sequencer too. This is C9 decided by the drawing's structure and VATT over TI's table 2-2. ## Text: "TEXT MODE" The drawing counts characters in a sub-counter that skips two states every eight (labels 0, 2, 4, 5, 8, 10, 12, 13, 16; CHAR 0 ... CHAR 39). Per 6-pixel character: name at +0, CPU at +2, pattern at +4. The first name fetch is at dot 6, the last pattern fetch at dot 244. The drawing does not tie the text sub-counter to HCNT unambiguously (its end labels, 325, 328, 329, 338 and, on the right sheet near HCNT 262-264, 350 and 351, do not agree with 40 characters at 8 counts each), so the start comes from [TI table 3-3]: the text area sits 6 pixels to the right of the pattern modes', and with the pattern modes' fetch-to-picture delay (name fetch at dot 0, ACTIVE SCREEN rising at 10) character 0's name fetch is at dot 6. Provisional to one memory cycle. Every other slot of the line (dots 0-4 and 246-340) is a CPU window: 91 in all. [TI 2.1.5]: "at least once out of every three memory cycles" (checked). ## Refresh mode: the vertical border and BLANK = 0 "REFRESH MODE": refresh address select and CPU alternate ("REPEAT 56 TIMES"), then a run of CPU-only cycles in the horizontal blank ("REPEAT 34 TIMES"). Four refresh/CPU pairs are drawn before the 56 and four after (64 pairs, 128 cycles); five CPU cycles are drawn before the 34 and four after (43 cycles); 128 + 43 = 171. So refresh in even slots 0-126 (64 refreshes), CPU in odd slots 1-127 and in every slot 128-170: 107 windows. Vermaelen's prose page (cite-only, read under the old rule) writes 32 refreshes per border line; the drawing's "56" plus the drawn pairs gives 64 here. Nothing the CPU sees depends on the difference. ## Which lines use which schedule (core's reading) - **Active lines 0-191 and the line before line 0** run the mode's schedule while BLANK = 1. The line before line 0 fetches no pattern bytes for display, but its sprite checks and sprite fetches serve line 0. (openMSX, read under the old rule, does the same; no TI statement.) - **Every other line, and every line while BLANK = 0**, runs refresh mode [TI 2.1.5: "the entire screen will show only border color and the VDP does not have to wait for a CPU access window"]. - **Slots 163-170** (the first eight vertical checks) belong to the evaluation two lines on, so they follow the *next* line: vertical checks if the next line runs a sprite schedule, CPU windows otherwise. This makes the evaluation for line 192 happen during lines 190-191, which is TI's "lines 0 to 192" for 5S (C5). - The schedule is chosen when a line begins (dot 0); a mode change takes effect at the next line (U11, provisional). Table bases are read at each fetch. ## Cross-checks (history) Under the old rule (before 2026-11-19) openMSX's MSX1 slot tables (GPL-2.0, tier 5) were read as a detector, after the first transcription, and a test parsed them at run time; its CPU windows equalled the first transcription's at every slot in all four tables (19, 51, 91, 107 a line), its Multicolor table being the one-in-four reading set aside above. That test is deleted and openMSX is **run, never read, from 2026-11-19**. Two readings of one drawing agreeing says the reading is consistent; it does not make the drawing right for the 9918A, which it predates. Clock Signal's `Components/9918/Implementation/Fetch.hpp` (MIT, tier 5) was read, not run, during the first transcription; it was not consulted for the wave-2 derivation. Its `CharacterSequencer` (Graphics and Multicolor alike) gave the same 19 windows with the eight early vertical checks at slot 163, its `TextSequencer` the same 91, and its `RefreshSequencer` the 64 refresh cycles one memory cycle later than this reading (CPU on the even slots 0-126, refresh on the odd ones and slot 170): a named one-cycle difference with the same 107 windows; nothing decides it. ## Display position The drawing's "ACTIVE SCREEN" row rises at HCNT 10 and falls at 266 (+-1): pixel x of the 256-pixel modes is shown at dot x + 10. With [TI table 3-3]'s widths that puts the left border at dots 339-9 (13), the right border at 266-280 (15), right blanking 281-288, sync 289-314. The drawing's own BLANKING and SYNC rows rise near 284 and 292, within a few pixel clocks of that. Provisional (`DISPLAY_START_DOT`).