# VDP2: scroll screens, rotation, priority, display Sources: the VDP2 User's Manual version 1.1 (ST-058-R2, 440 pages, cited VDP2) and MacDonald's notes, which test several VDP2 corners on two consoles (CMH "VDP2 Color RAM", "VDP2 Display", "VDP2 Registers", "Miscellaneous"). ## What it is (DOC: VDP2 ch. 1-3, OVW 3.4) - Up to four normal scroll screens NBG0-NBG3 and two rotation screens RBG0-RBG1, with cell (tile) or bitmap formats, line and vertical-cell scroll, mosaic, windows (two rectangles or line windows plus the sprite window), colour calculation (ratio and additive), colour offset, shadow, the line-colour and back screens, special priority and special colour calculation, and the sprite layer taken from VDP1's frame buffer. - Memory: 4 Mbit VRAM as banks A0, A1, B0, B1 (the chip also supports 8 Mbit; the Saturn has 512 KB: VDP2 3.2; CMH: bit 15 of VRSIZE set to 1 MB mirrors odd 64 KB pages); colour RAM 4 KB in three modes (CMH: mode 3, undocumented, behaves as mode 2; write mirroring in mode 0; address bits shuffled in modes 2-3). - **The VRAM cycle patterns.** Each bank gives eight access slots T0-T7 per unit of time in normal resolution, assigned by the cycle-pattern registers to pattern-name reads, character-pattern reads, vertical-scroll reads, CPU access and so on (DOC: VDP2 ch. 3, "VRAM Cycle Pattern Register", p. 37-39). What the screen shows depends on that assignment, and on assignments the manual forbids (how many commercial games make them is not known: the board should log every forbidden pattern it meets, HYPOTHESIS that some do). This is the VDP2 behaviour most worth modelling exactly: the table is documented, and the effects of rule-breaking settings are not (U7). - Rotation: per-line parameter tables read from VRAM (coefficient tables), two parameter sets A/B with a window or coefficient switch (DOC: VDP2 ch. 6); the arithmetic's precision (fixed-point widths, rounding) is given as register formats, not as a datapath (U8). ## Display timing (DOC: CMH, measured on real units) - NTSC 263 lines, PAL 313; the active/border/blanking/sync split per mode is in CMH, e.g. NTSC 224 lines = 224 active + 8 bottom border + 5 bottom blanking + 3 sync + 15 top blanking + 8 top border. - VBLANK in TVSTAT is clear for (active lines + 1) and set for the rest of the frame (CMH). HBLANK runs even with DISP clear. - HRES 352/704 needs the 352-mode PLL (SMPC CKCHG352); the exclusive-monitor modes give 480 lines in 525 (31 kHz) or 479 in 561 (Hi-Vision) (CMH). - Clearing DISP mid-frame blanks to the end of the frame (CMH); changing VRESO at the end of a frame moves the borders (CMH). - The H/V counter latch (HCNT/VCNT, EXLTFG) is driven by the light gun through the SMPC's EXLE (CMH, untested by him). ## Modelling proposal The specification draws per dot inside each line, with the cycle-pattern fetch schedule modelled, because mid-line register writes are rare but the fetch schedule decides what is drawn at all. A line-at-a-time drawing path that reproduces the per-dot result is a `-fast` or turbo concern (charter: pure producers from a register-write log), not a specification concern. ## What the board owns All of it (used by Saturn and ST-V only). It stays in `saturn-python`.