# Nick: the video chip Nick is a display-list processor: instead of a whole-screen mode it walks a **line parameter table** (LPT) in video RAM, one 16-byte block per "mode line" of 1-256 scanlines, each block naming its own video mode, colour mode, margins, data pointers and eight palette colours. It also owns the horizontal timing and the video RAM: the Z80 reaches video RAM only through Nick, which stretches the Z80's clock to fit its own accesses. Nick stays inside the board (chip rule: no other family machine uses it). Keys: ETI20 (Intelligent Software's Enterprise Technical Information, EXOS 2.0, section 10 "The Nick Chip", 29-Nov-84, scanned; read by OCR), NICK-PG (David Bouman's HTML transcription of the same programmer's guide). Both are the manufacturer's text: DOC, tier 2. ## Video RAM - Nick addresses 64K, the four segments FC-FF of Dave's 4 MB space, **directly**, not through Dave's page registers: segment FD always starts at Nick address 4000h, wherever (or whether) the Z80 has it paged (NICK-PG section 1). - On the EP128 the second 64K is not video RAM and Nick cannot see it (NICK-PG: Nick "cannot address any additional RAM"); which segments it occupies (F8-FB by common report) is not in the pinned documents (U3). - Z80 accesses to video RAM are slowed by **clock stretching**, not by Dave's wait states: DAVE says Dave never waits video RAM accesses "as this would conflict with Z80 clock stretch". How many T-states a stretched access costs, and how it aligns to Nick's slots, is the board's main research risk (U1). ## The scanline - Every scanline is "64 us long" with Nick's own blanking, sync and colour burst (NICK-PG section 2; ETI20 Nick p3: "about 64 microseconds"). Vertical timing is the program's: the LPT must contain VSYNC-mode lines, and a frame is normally 312 scanlines. - A scanline is **57 slots**, two bytes of video RAM read per slot: slots 0-7 read the current line's LPB (16 bytes), the last 3 refresh the RAM, and 46 are available for display (NICK-PG section 5). The left and right margins (LPB bytes 2-3, 6 bits each) are slot numbers; a practical TV-visible width is 52 slots (margins 10 to 52). - Clocks: MAME runs Nick at 8.00 MHz (OBSERVED). 57 slots in 64 us is 1.123 us a slot, about 8.98 cycles of 8 MHz; nine cycles a slot would make a scanline 64.125 us (arithmetic only, HYPOTHESIS until a crystal and divider are confirmed, U2). MAME's screen runs at exactly 50.000 Hz (OBSERVED); 312 x 64 us gives 50.08 Hz (C1). ## The line parameter block (NICK-PG section 4; ETI20 Nick p3, p7-10) | Byte | Name | Meaning | | --- | --- | --- | | 0 | SC | two's complement of the scanline count (0 = 256) | | 1 | MB | b7 VINT (video interrupt during this mode line); b6-b5 colour mode (2, 4, 16, 256 colours); b4 VRES (full vertical resolution); b3-b1 video mode (000 VSYNC, 001 PIXEL, 010 ATTRIBUTE, 011 CH256, 100 CH128, 101 CH64, 110 unused, 111 LPIXEL); b0 RELOAD (last block: restart the table) | | 2 | LM | b0-b5 left margin; b6 LSBALT, b7 MSBALT (alternate colours in 2-colour graphics) | | 3 | RM | b0-b5 right margin; b6 ALTIND1, b7 ALTIND0 (alternate colours in 2-colour character modes) | | 4-5 | LD1 | primary data pointer | | 6-7 | LD2 | secondary pointer (font or bitmap, by mode) | | 8-15 | COL0-COL7 | palette colours 0-7 (not used in 256-colour mode) | Palette colours 8-15 are formed from the colour number's low three bits under the five bits of FIXBIAS (port 80h), the same for the whole screen. Pixel order (NICK-PG section 6): 2 colours: 8 pixels, MSB first; 4 colours: pairs (b3,b7), (b2,b6), (b1,b5), (b0,b4); 16 colours: (b1,b5,b3,b7) then (b0,b4,b2,b6). The colour byte drives RGB as `g0 r0 b0 g1 r1 b1 g2 r2` from bit 7, with red and green in eight levels and blue in four (NICK-PG section 12). **Modes and bus use** (ETI20 Nick p4-6): PIXEL reads two bytes from LD1 per slot; LPIXEL one (half the horizontal resolution); ATTRIBUTE reads an attribute byte from LD1 and a bitmap byte from LD2 per slot; CH256/CH128/CH64 read a character index through LD1 and its row from the font at LD2 (the font row-major: 256 bytes of each character's first row, then the next row). With VRES clear, LD1 restarts each scanline (repeated lines). VSYNC mode uses the margins to place the vertical sync pulse, which is how interlace is done. ## Ports (write-only; NICK-PG section 13; LGB-PORTS) | Port | Name | Bits | | --- | --- | --- | | 80h | FIXBIAS | b0-b4 bias for palette colours 8-15; b5-b6 external colour priority (EC0-EC3); b7 VC1 output: set to silence the internal speaker | | 81h | BORDER | the border colour byte | | 82h | LPL | LPT base A4-A11 | | 83h | LPH | b0-b3 LPT base A12-A15; b6 clear: stop clocking the line counter; b7 clear: force an immediate reload | 80h-83h echo through 84h-8Fh (LGB-PORTS; Dave decodes 80h-8Fh as the video I/O select: DAVE "Select outputs"). Reading them returns Nick's bus state, "some odd behaviour" (LGB-PORTS, not documented further: U4). A forced reload is: write LPL, then LPH with b6 and b7 clear, then b6 set, then both set (NICK-PG section 3). A plain base change takes effect at the next RELOAD block; writing it mid-reload can load half old, half new (NICK-PG). ## Video interrupt VINT holds Nick's VIRQ low for the whole mode line; Dave's input is edge-triggered, so two consecutive VINT lines give one interrupt, and a line with VINT clear must separate them (NICK-PG section 11). Which Dave input VIRQ drives (INT1 by common report) is not stated in the pinned text (U5). EXOS's frame interrupt comes from this, with the 50 Hz/1 kHz timer and the 1 Hz tick from Dave (dave.md). ## MAME's view (OBSERVED, a detector) ep128 boot (mame-oracle.md): BORDER 0 at 58 us; at 0.56 s LPL `90`, then LPH `0F`, `4F`, `CF` (the documented forced-reload sequence, LPT at Nick address F900h: segment FF, offset 3900h); from 4.84 s on, BORDER and FIXBIAS written 0 about every 19 ms (once per frame, by EXOS's interrupt routine: HYPOTHESIS).