# Video: the MCD212 VDSC (Mono boards), and the VSC/VSD family before it Source: Motorola **MCD212/D Rev. 0** (1995), "Video Decoder and System Controller (with JTAG)", 87 pages with a text layer (`reference/docs/mcd212rev0.pdf`, ICDIA; Motorola's document, facts only). Section numbers are its own. The Green Book chapter V (video) is the functional definition every CD-i player meets (facts only: all rights reserved). ## What it is (DOC 1.1-1.4) One chip that is both the **system controller** (reset sequencer with ROM shadowing, 1 MB ROM chip select, 1 KB I/O chip select, DTACK and bus-error generation, a watchdog, the DRAM controller for up to 4 MB) and the **video decoder** (two display channels with their display-file decoders, ICA/DCA control processors, a 256-entry CLUT, two DYUV decoders, RGB555, run-length and mosaic decoding, a cursor, four-plane overlay with transparency, mixing by weights and region control, an 8-bit-per-component digital RGB output, sync generation for 50 and 60 Hz). The MCD211 is the same part without JTAG and with slower processor-interface timing (1.4). ## The system controller (DOC chapter 3, 4) Address map seen through its 22 address lines (Table 3-1): | Range | What | | --- | --- | | `000000-3FFFFF` | DRAM (4 MB maximum; banks per Table 4-1) | | `400000-4FFBFF` | system ROM (1 MB; the chip select ignores R/W, so SRAM may sit there) | | `4FFC00-4FFFDF` | system I/O (CSIO; the addressed device acknowledges) | | `4FFFE0-4FFFEF` | channel 2 internal registers | | `4FFFF0-4FFFFF` | channel 1 internal registers | On the Mono-I board the CDIC (`300000`), slave (`310000`) and timekeeper NVRAM (`320000`) are decoded outside the MCD212 (OBSERVED: MAME's access census, mame-oracle.md; DOC: cdichips for the CDIC and slave bases). - **Memory swapping** (3.4): after reset the first four word accesses (SSP and PC) are sent to the ROM; the vectors are at `400000`/`400004`. The 68070 then runs from ROM at `400000`. - **Reset** (3.1): RSTOUT is released after eight video frames counted at the default configuration (8 x 312 x 112 x 16 CLK: "150 ms with a 30 MHz crystal"), HALT one line later. Registers reset as listed in 3.2. - **DTACK** (3.6, Table 3-2): DRAM is acknowledged when the access can complete (the slot arbitration below); ROM after a programmable delay (CSR1W DD/DD1/DD2: 11-12, 3-4, 5-6, 7-8, 9-10 CLK); system I/O is acknowledged by the device. - **Bus error** (3.7): when CSR1W.BE is set, an access unacknowledged for one whole video line (~64 us) raises BERR and sets CSR2R.BE (cleared by reading CSR2R). - **Interrupt** (3.8): `INT = not((not DI1 and IT1) or (not DI2 and IT2))`; IT1/IT2 are set by an ICA/DCA INTERRUPT instruction and cleared by reading CSR2R. - **DRAM arbitration** (4.2, Fig.4-1, Fig.4-2): display periods of **32 CLK**, each four slots: CH#1 (11 CLK, a fast-page burst of four words for channel 1's display or ICA/DCA), SYS (5 CLK, one random CPU or DMA access), CH#2, SYS. So during display **the CPU gets one DRAM access every 16 CLK** (8 CPU clocks at 15 MHz). Refresh takes the channel slots (eight rows a line). Outside display, ICA and DCA time, DRAM is "free-running" and a system access is taken at any time. Per line: refresh (1 period), display (horizontal resolution / 8 + 1 periods), refresh (1), DCA (0 to 8 periods), free-run. The CPU's DRAM wait states therefore depend on the dot position: **the CPU and the MCD212 cannot be separate domains** at cycle level (domains.md). ## Video timing (DOC 5.1-5.3) | Crystal | CF | ST | Pixels per line (normal / double) | Line | Active | Standard | | --- | --- | --- | --- | --- | --- | --- | | 28 MHz | 0 | x | 360 / 720 | 112 cycles = 64.0 us | 90 cycles = 51.43 us | NTSC monitor | | 30 MHz | 1 | 0 | 384 / 768 | 120 cycles = 64.0 us | 96 cycles = 51.2 us | PAL TV | | 30.2097 MHz | 1 | 0 | 384 / 768 | 120 cycles = 63.56 us | 96 = 50.84 us | NTSC TV | | 30 / 30.2097 MHz | 1 | 1 | 360 / 720 | 120 cycles | 90 cycles = 48.0 / 47.67 us | PAL/NTSC TV | One "cycle" is 16 CLK (Fig.5-4). Vertical (Table 5-6, non-interlaced): 50 Hz 312 lines (280 active with ST=0, 240 with ST=1), 60 Hz 262 lines (240 active); interlaced adds the half lines (Table 5-7: 312.5 / 262.5). Normal full screens: 384 x 280 PAL, 384 x 240 NTSC TV, 360 x 240 NTSC monitor (Table 5-1); high resolution doubles both axes (768 x 560). The Mono-I in MAME runs at 50 Hz with a 768 x 560 raster for `cdimono1` and 768 x 280 for `cdimono2`/`cdi910` (OBSERVED, `-listxml`: pixel clocks 28,416,000 and 14,976,000 Hz, htotal 960). Neither matches 30 MHz / 16 x 120 = the data sheet's line (C4: MAME's raster is its own presentation choice). ## Display control: ICA and DCA (DOC 5.4) - Each channel runs an **ICA** program (Image Control Area) in vertical retrace and a **DCA** program (Dynamic Control Area, up to 64 bytes a line) in horizontal retrace: long-word instructions read from DRAM by the chip itself. - ICA pointers: `000400` (channel 1) and `200400` (channel 2), `+4` for the even field when interlaced (Table 5-8). DCA: DCP points to the first line's 64 bytes, then DCP + 64 a line. - Control instructions (Tables 5-11/5-12): `0x` STOP, `1x` NOP, `2x` RELOAD DCP, `3x` RELOAD DCP and STOP, `4x` RELOAD VSR (in ICA a jump; in DCA a reload of the display pointer), `5x` RELOAD VSR and STOP, `6x` INTERRUPT, `78` RELOAD DISPLAY PARAMETERS (CM, MF1/MF2 mosaic, FT1/FT2 file type). Register-load instructions `80-BF` CLUT colours, `C0` image coding method, `C1` transparency control, `C2` plane order, `C3` CLUT bank, `C4-C6` transparent colour, `C7-C9` mask colour, `CA/CB` DYUV start values, `CD-CF` cursor position/control/pattern, `D0-D7` region control, `D8` backdrop, `D9/DA` mosaic pixel hold, `DB/DC` weights (Table 5-13). - Fetch budget (5.4.1's worked example): ~2,640 memory fetches in a 60 Hz vertical blank. Possible DCA fetches a line: 32 bytes (CF=0) or 64 bytes (CF=1), automatic STOP beyond (Table 5-10). ## Image codings (DOC 5.4.4.2, chapters 6-8) Coding methods (Table 5-17): plane A (channel 1) CLUT8, CLUT7, CLUT7+7, DYUV, CLUT4 (double resolution); plane B (channel 2) CLUT7, DYUV, CLUT4; **RGB555 uses both channels** (plane B only, 4 accesses = 4 pixels, 8 pixels a display period). File types (chapter 6): normal bitmap, run-length (RL7: one byte for a single pixel or two for a run of a 7-bit CLUT colour, 6.2.1; RL3: the same for **pairs** of 3-bit CLUT colours, 6.2.2; a run longer than the rest of the line is cut there), mosaic (pixel hold and line repeat factors). DYUV (7.1): pixel pairs with 4-bit deltas through a non-uniform 16-level table and an absolute start value per line (`CA`/`CB`); the data sheet prints the YUV-to-RGB integer formulas (R = lim[trunc((Y*256 + 351*(V-128))/256)] and the like) and says only the top 7 bits of each component reach the output. The CLUT holds RGB666 (2^18 colours), 7.2. Overlay (chapter 8): cursor in front, then A and B in the plane order register's order, backdrop/external video behind; transparency per plane (colour key, mask, region flags, always/never); mixing by weight factors 0-63; eight region control registers with two region flags. ## What to model, and at what level - **System controller**: cycle level: the slot arbitration decides every CPU DRAM access's wait, the ROM DTACK delay every ROM access's, the interrupt every frame's timing. - **ICA/DCA processors**: cycle level in their fetch timing (the MiSTer core's author measured on a 210/05: an INTERRUPT at the first DCA instruction fires at the end of the first line, "fits the datasheet, but not the green book"; CSR1R bit 7 "display active" falls when pixel output stops and rises when it starts: CDi_MiSTer `doc/mcd212.md`, OBSERVED on hardware, GPL-3.0 repository, facts only). - **Pixel pipeline** (decode, CLUT, DYUV, mixing, cursor): transaction level per line from the register state the ICA/DCA left: a **pure producer** (charter "Domains and channels") fed by a log of register writes with their dot positions. The picture is exact if the log is exact. - The output is a digital RGB888 stream: the specification produces RGB888 pixels; analogue effects (the DAC, composite encoding) are a host concern. ## The earlier chips (later rows) The Mini-/Maxi-MMC and JNMS boards use two **SCC66470 VSC** chips (each controls 512 KB and one plane: run-length and mosaic decoding) plus a back end: the **MN66460B VSR** (Matsushita) or the **GSC38TG307 VSD** (Motorola), which decode CLUT/DYUV/RGB555 and mix (cdichips README, facts only). Only the SCC66470 has a data sheet (`scc66470.pdf`, 61 scanned pages, not yet OCR'd); the back ends have none. That is the brief's "VSD/VSC2" row, and it is a later row because its back end is undocumented (U10). ## Chip rule The MCD212 is used by every Mono board, the Goldstar and I2M designs, all CD-i: one family of machines, one board repository with model rows. It stays in the board (chip rule: no second family board needs it).