# Video: two uPD7220 GDCs, the character generator and the kanji ROM Sources: **GDCDM** NEC, *uPD7220 GDC Design Manual*, version 3 (1982, text layer); **GDCUM** NEC, *uPD7220/uPD7220A User's Manual* (December 1985; a scan **without** a text layer: read by page image, U3 lists what still needs it); **GDC81** NEC's 1981 paper; UND `io_disp`; TDB86. Tags as the charter's. ## The chip The uPD7220 GDC is NEC's graphics display controller: a microprogrammed chip that generates raster timing, refreshes and serves up to **256K 16-bit words** of display memory, and **draws** (lines, arcs, rectangles, graphics characters) by read-modify-write cycles into that memory (GDCDM 1.1 Features). Its points of contact: - **Host interface:** two addresses: status read / parameter write, and data read / command write (UND `io_disp` 0060h, 0062h; GDCDM 3). Commands and parameters pass through a FIFO; the host may transfer **a byte no more often than once every four 2xWCLK cycles** (GDCDM 5.1.1); writing to a full FIFO overwrites the oldest entry (GDCDM 5.1.1). The FIFO's depth (16 entries is the common figure) is stated in GDCUM, still to be read from its page images (U3). - **Status bits** (UND `io_disp` 0060h, matching GDCDM 5.1.2): 7 light pen detect, 6 horizontal blank, 5 vertical sync, 4 DMA execute, 3 drawing in progress, 2 FIFO empty, 1 FIFO full, 0 data ready. On the graphics GDC bit 7 always reads 1 (UND `io_disp` 00A0h). - **Clock:** one input, 2xWCLK, at twice the display-memory cycle rate: at 5 MHz a display cycle is 400 ns (GDCDM 2.2.1). The PC-98 runs its GDCs at **2.5 MHz, or 5 MHz by DIP switch SW2-8** (TDB86 chapter 6 switch table; normal setting OFF = 2.5 MHz). - **Drawing speed:** "800 ns per pixel" at 5 MHz (GDCDM 1.1); a figure's drawing time is counted in clocks (GDCDM 2363: a figure "drawn in 400 clock cycles"). - **Master and slave:** the SYNC command's parameters choose master or slave video operation; slaves synchronise to the master's sync (GDCDM 4582, 5219, 5232). - **DMA:** with 8257- or 8237-type controllers (GDCDM 1.1): on the PC-98 the 8237A. Command set used by PC-98 software (UND `io_disp` 0062h, matching GDCDM's command chapter): RESET1/2/3 (00h, 01h, 09h), SYNC (0Eh/0Fh), START (0Dh/6Bh), STOP1/STOP2 (0Ch/05h), ZOOM (46h), PITCH (47h), CSRW (49h), CSRFORM (4Bh), MASK (4Ah), VECTW (4Ch), VECTE (6Ch), TEXTE (68h), SCROLL and TEXTW (70h-7Fh), WRITE and DMAW (20h-3Fh), READ and DMAR (A0h-BFh), LPEN (C0h), CSRR (E0h), SLAVE (6Eh), MASTER (6Fh). "Not every command is usable" on the PC-98 (UND). **Parts by model** (UND `io_disp` head): uPD7220 on the PC-9801 original, E, F, M, U, VF and VM2; uPD7220A on the other PC-9801s of the era (the VX among them); uPD72020 on the PC-H98, PC-9821, PC-98GS and the late PC-9801s. "The basic commands are common." The 7220/7220A differences are recorded in GDCUM (U4); this board models the uPD7220 first and keeps a part field. ## Two GDCs on the PC-98 | | Text GDC (master) | Graphics GDC (slave) | | --- | --- | --- | | Ports | 60h status/param, 62h data/command | A0h, A2h | | Role | generates the CRT sync; character mode over text VRAM | follows the master's sync; graphics mode over the bit planes | | Memory | A0000-A3FFF: codes (A0000-A1FFF) and attributes (A2000-A3FFF) | three planes A8000/B0000/B8000 (32 KB each); a fourth at E0000 on 16-colour models; two banks on every model but the original and the U | | Source | UND `io_disp` テキストGDC制御 | UND `io_disp` グラフィックGDC | The text GDC supplies addresses only; the **character generator** turns each code into dots line by line, using the line counter that external logic keeps (UND `io_disp` テキスト表示ライン カウンタ制御回路, ports 70h-7Ah: PL, BL, CL, SSL, SUR, SDR). The attribute plane gives colour, reverse, blink, underline, vertical line and the semigraphics switch (TDB86; detail to the board's video document at M2). **Interrupt:** a write of any value to **64h** arms one INT 0Ah (IR2) at the next VSYNC (UND `io_disp` 0064h). The BIOS re-arms it each frame; some INT 18h functions stop it. **Mode flip-flops** at 68h and 6Ah (UND `io_disp` 0068h, 006Ah): 40/80 columns, colour or monochrome, the kanji access mode (code or dot access), the 200-line mode, display on/off, the 16-colour and EGC enables on later models. **GRCG** at 7Ch/7Eh (TDW, TCR, RMW modes over four planes at once: UND `io_disp` グラフィックチャージャ) is absent on the original (U6: which early models have it). **EGC** (UND `io_egc`) is a VX-and-later block: recorded only. **Palette:** 8-colour mode, digital (A8h-AEh hold pairs of 3-bit entries: UND `io_disp` パレットレジスタ(8色モード)); 16-colour mode from a 4096-colour palette exists from the U on, on the U, VF and VM only with the 16-colour board (UND `io_disp` パレットレジスタ(16色モード)). **Timing:** normal mode 640x400 at 24.83 kHz and 56.42 Hz (UND `memsys` CRT mode table); the GDC's SYNC parameters are what produce it. The board will compute the frame from the SYNC parameters the BIOS writes, not from a table (MAME's runs record the writes: mame-oracle.md), and check the result against these figures. ## The character generator and the kanji ROM - **ANK font:** the 8x8 and 8x16 ROMs (MAME region `chargen`: on the original `sfz4w 00.bin` 8 KB with two smaller parts, `d23128c-17.bin` and `hn613128pac8.bin`, both marked bad dumps by MAME; on the VM `main_board_12f_d2364ec.bin`, the same SHA-1 as the original's `sfz4w 00.bin`: [census.md](census.md)). - **Kanji ROM:** JIS level 1 (and later level 2) 16x16 glyphs. The original and E have **no kanji ROM as standard** and the odd bytes of text VRAM are absent (UND `io_disp` head); the kanji ROM board was an option. MAME's 8086 sets carry `24256c-x01..x04.bin` (256 KB, marked bad dumps) and a 1 MB `kanji.bin` (bad dump); the VM carries its own `main_board_12h/10h_231000.bin` and `main_board_8h_d23256ac.bin` (good dumps). **MAME's VX and UX sets borrow the 8086 sets' kanji ROMs and the UX's font**, so no VX kanji dump of its own is recorded there (U7). - **Access:** ports A1h (code, second byte), A3h (code, first byte), A5h (line counter), A9h (pattern data, read and for user-defined characters write) (UND `io_disp` 00A1h-00A9h). The original has **no user-defined characters**; E, F, M, U have 63; later models 188 (UND `io_disp` キャラクタジェネレータ). Code access is fast but may disturb the picture outside VSYNC; dot access is slow and safe at any time (same entry). The **CG window** (A4000h) projects part of the generator into memory on models that have it. ## The chip rule | Chip | Users in the family | Users elsewhere (MAME 0.285 device lists, checked 2026-11-26) | Proposal | | --- | --- | --- | --- | | uPD7220 / 7220A | none built or in Phase 0 (grep of every `docs/handoff-brief.md`; the PC-88VA uses its own controller, not a 7220: MAME `pc88va2` has none) | Epson QX-10, NEC APC, Compis, Sharp MZ-6500, A5105, NCR DMV, DEC VT240 and the Rainbow's graphics option, Oki IF-800, Sanyo MBC-55x, Wang PC | **stays in the board** as one class instantiated twice (text and graphics), pin-shaped (`Upd7220(part, memory_port, clock)`), so that a future QX-10, APC or VT240 board can trigger an extraction with history (open decision 4) | | Character generator, kanji ROM logic, line counter, GRCG | PC-98 only | | board |