# The MC6847 VDG (and the MC6847T1) Sources: the MC6847/MC6847Y data sheet (Motorola DS9823-R1, 1984; pinned `MC6847.pdf`, OCR in `reference/ocr/`), the MC6847T1 Advance Information (`MC6847T1.pdf`), the TRM's "Video interface", CA's notes on the Dragon's wiring. DOC unless tagged. ## Chip rule Other machines with an MC6847 in MAME 0.285's device lists (OBSERVED, `-listdevices`): the Tandy MC-10, the Acorn Atom, the APF Imagination Machine, the VTech Laser 310 (clocked at 4.43 MHz there). None is a family board today (no `mc10-`, `atom-`, `vz200-` or `pc6001-python` among the sibling repositories, checked 2026-11-26). The chip rule keeps the VDG in this board until a second board needs it; its class should take its data through a fetch callback and its mode lines as inputs, not reach into the SAM or the PIA, so that extraction is a move. Open decision 4. ## Timing (non-interlaced MC6847, the CoCo/Dragon part) | Quantity | Value | Source | | --- | --- | --- | | clock | 3.579545 MHz from the SAM's VClk | VDG AC table; SAM | | line | 227.5 clocks (63.5 us); MC6847Y identical per line | figure 8 notes ("tPHST = 227.5 x 1/f") | | field | 262 lines (MC6847Y 262.5) | figure 8 notes | | field, by area | vertical blanking 13 lines, top border 25, active 192, bottom border 26, vertical retrace 6 | figure 13 | | FS | low for 32 lines; falls at the end of the active area, rises at the trailing edge of vertical sync | figure 8, "Field sync" | | HS | falls at the leading edge of horizontal sync, rises at its trailing edge | "Horizontal sync" | | line, by part | front porch 7 clocks, back porch 17.5 (colour burst 10.5 of it), left border 29.5, active 128, right border 28 | AC table; figure 10 (tAV = 128) | | smallest element | half a clock wide, one line high (256 per active line) | "Operation of the VDG" | | fetches | 32 bytes a line in the alphanumeric, semigraphic, CG2, CG3, CG6 and RG6 modes ("short cycle", DA0-DA4 toggle), 16 bytes in CG1, RG1, RG2, RG3 ("long cycle") | figures 4 and 5 notes | | RP | row preset for an external character generator, after the first 12 valid lines, alphanumeric and semigraphic modes only | "Row preset" | Contradiction C3: the text says the display window "is offset from the left-hand edge by 28.5 periods", the AC table says the left border is 29.5 x 1/f. The MC6847T1 sheet gives 29 and 29. ## Modes (Table 1 and Table 2) Mode lines: A/G, A/S, INT/EXT, INV, GM0-GM2, CSS. A/S, INT/EXT, INV and CSS may change per character; on the Dragon they are wired to the data bus (A/S = D7, INV = D6) and INT/EXT to GM0 (CA); the CoCo's GM0 & INT/EXT pairing is in the TRM's PIA1 table, and its D7/D6 use in text mode in LOM ("bit 7 = 1 -> graphic"), so each byte chooses for itself. | Major mode | Modes | Memory | Colours | | --- | --- | --- | --- | | 1 (A/G = 0), 32 x 16 cells of 8 half-clocks x 12 lines | internal alphanumerics (5x7 font in the cell, two columns in and three rows down), external alphanumerics (8x12 from an external ROM: none on the CoCo/Dragon), each with inverse; semigraphics 4 (2x2 blocks, eight colours from three data bits), semigraphics 6 (2x3 blocks, colour set by CSS) | 512 bytes | text green on dark green or orange on dark orange (CSS); border black | | 2 (A/G = 1) | CG1 64x64, RG1 128x64, CG2 128x64, RG2 128x96, CG3 128x96, RG3 128x192, CG6 128x192, RG6 256x192 | 1K, 1K, 2K, 1.5K, 3K, 3K, 6K, 6K | -C: four colours from one of two sets (CSS); -R: two; border green or buff | The colour sets, from LOM's FFC0 notes (community) and the VDG's figure 10 chroma levels: CSS=0 green, yellow, blue, red; CSS=1 buff, cyan, magenta, orange; -R modes black/green or black/buff. Semigraphics 4 colours by code 0-7: green, yellow, blue, red, buff, cyan, magenta, orange (LOM writes "000-cyan" for the first, against its own colour-set list: C4; the judge is the VDG sheet's Table 2 figure, to read as a picture at the build). The exact Y, R-Y, B-Y levels per colour are in the AC table (VWL, VWM, VWH, VBlack and the chroma levels); the RGB the host shows is a palette choice, not hardware. CoCo/Dragon wiring quirks (CA, Dragon; the same on the CoCo per TRM's PIA1 table): no external character ROM, so semigraphics 6 and external alphanumerics display whatever is on the data bus as a repeating pattern; and because D7 drives A/S, only two colours plus black are reachable in SG6 per colour set. ## MC6847T1 (the CoCo 2B's VDG) Enhanced, non-interlaced, works only with the SAM: all address lines but DA0 replaced by an 8-bit I/O port; lower case with true descenders (GM0 high makes D6 select lower case instead of inverse), GM1 inverts the whole alpha screen, GM2 enables coloured alpha borders (black, green or orange per CSS/GM1); only one semigraphic mode (SG4); borders 29 and 29 clocks. (VDG-T1 features list, "Graphic Mode (GM0 through GM2)", Table 3.) Its own row ([machines.md](machines.md)); its exact border and mode table must be read from the page images at the build (the OCR is partial). ## Artifact colours (NTSC) In RG6 (and the two-colour modes generally) one element is half a 3.58 MHz cycle, so alternate on/off dots put energy at the colour subcarrier and an NTSC set decodes them as colour: with black and white (CSS=1, buff), patterns 01 and 10 appear as two hues (red and blue in the familiar description), 11 as white. The VDG sheet confirms the mechanism only indirectly: "colour burst is also suppressed in the most dense two colour graphic modes. This leads to some interesting rainbow effects on the display which is frequency and pattern dependent" (page 15), and figure 10 removes the burst for A/G and CSS and GM0. LOM adds the CoCo fact (community, tier 3): which pair of hues a pattern gives "is somewhat random on RESET, so many games have the player press RESET until the colors are correct" (the VDG may start on either clock edge: "The VDG will power-up using either the rising or falling edge of the clock", VDG figure 4 note 1). CA: on PAL Dragons the colour comes from an LM1889 and there is no NTSC artifacting of the same kind (U7). What the board does: output the 256-element line as indices with the burst flag and the power-up clock phase (a machine option, chosen at reset, two values); a named host filter (off, "red/blue", "blue/red", composite simulation) turns indices into colours. Artifact colour is a display model, not part of the observable contract until a hardware capture of a CoCo's composite signal exists (U8: none found). ## PAL (the Dragon) The VDG is an NTSC part on every row. The Dragon 64 stretches the field to PAL by stopping the VDG clock twice a field (24 lines after FS falls, and at FS rising) for long enough to insert 25 lines each time, giving a 624-line (two-field) picture; HS interrupts are not passed to the CPU during the padding (CA, from the circuit). PAL Dragon 32s "seem to use a slightly different method", HS appearing for the whole frame "from software analysis" (CA, observation; U6). So PAL rows run 312 lines, with 50 lines in which the VDG and the SAM's address counter stand still. ## Unknowns here U6 the Dragon 32's PAL padding method and where HS interrupts occur in it; U7 PAL colour on the Dragon (LM1889); U8 artifact hues as captured from a real CoCo (and which of the two phases each power-up gives).