# Video Almost everything here is MAME's driver `[mame]`: its register table (by David Haywood, with notes from ElSemi) and its renderer. No Capcom document exists. The board measurements `[board]` cover timing and the pipeline, not pixels. Every "??" in MAME's table is copied into the brief's unknowns list. ## The picture in one paragraph The CPU builds a **sprite list** in sprite RAM. Entries are either zoomable sprites made of 16×16 tiles or "draw these lines of tilemap N". At VBlank the game asks the hardware to latch the list (the sprite-list DMA). The PPU draws the latched list from **character RAM** (8 MiB of 8-bit pixels, filled by a decompressing DMA from the graphics SIMMs), looks colours up in **colour RAM** (0x20000 15-bit entries, written directly or by a palette DMA that can fade), and shows the result through a **full-screen zoom**, one frame after the latch (whether through a frame buffer is C1, below). A separate 8×8 text layer, the **score screen** (SS), is generated by the sound chip and laid on top. There are no fixed background planes: tilemaps are drawn only where the sprite list says, in list order. Priority is list order. ## Screen modes and timing | | 384 mode | wide mode | | --- | --- | --- | | Pixel clock | 42.954545 MHz / 5 = 8.59 MHz | / 4 = 10.74 MHz | | H sync end, blank end, screen end, total (registers `60`-`66`) | 42, 111, 495, 454 | 35, 118, 613, 454 | | Visible width = screen end − blank end | 384 | **495** (C2: 496 everywhere else) | | V sync end, blank end, screen end, total (`70`-`76`) | 3, 21, 245, 262 | the same | | Visible lines | 224 | 224 | Register values are the last count of each area: real totals are value + 1 horizontally and value + 2 vertically. H total counts a fixed 42.954545 MHz / 6 clock in every 15 kHz mode, not the pixel clock: 455 counts per line, 264 lines, 15,734.26 Hz, 59.5995 Hz `[mame]`. An unused 24 kHz 512×384 mode exists in the code (H total 293, V total 424, 57.16 Hz) `[mame]`. Measured: line rate 15.73315 kHz, 59.59 Hz, DAC clock 8.602 and 10.73 MHz (MAME's comment, source unstated); 59.604 ± 0.011 Hz and 419,512 ± 40 CPU clocks per frame `[board]`. 3rd Strike programs H total 454 and V total 262 from a table at `0613E380` `[board, rom]`. Which games offer the wide mode was not checked here (common knowledge: the SFIII games' configuration menu) (U17). ## PPU registers, `040C0000-040C00AF` (write only; words) | Offset | Bits | Meaning | | --- | --- | --- | | `00`-`1F` | 10 bits each | eight global scroll pairs (X at +0, Y at +2), selected per sprite-list entry | | `20`, `22` | 16 | tilemap 0 scroll X, Y | | `24` | `4-0` | tilemap 0 width in tiles; bits `a-6` "?? always 0" | | `26` | `f` enable, `e` line scroll enable, `d` line zoom enable (unused by games?), `c` "?? set together with zoom", `b` flip X, `a` flip Y | | | `28` | `e-8` line scroll/zoom table base, `6-0` tile base (both × 1 KiB of longwords in sprite RAM) | | | `30`-`5F` | | tilemaps 1 to 3, same layout | | `60`-`66` | | H sync end, blank end, screen end, total | | `68` | 10 bits | "H ?? zoom master?"; +128 on flip screen; may be a global H scroll | | `6A`, `6C` | | "H ?? zoom offset?", "H ?? zoom size?" (1023; 511 at BIOS init) | | `6E` | 8 bits used | **H zoom scale**: `40` = 1:1 | | `70`-`76` | | V sync end, blank end, screen end, total | | `78`, `7A`, `7C` | | V "zoom master/offset/size?" (size 1023; 261 at BIOS init) | | `7E` | | **V zoom scale**: `40` = 1:1 | | `80` | `2-0` pixel clock (3 = /5, 5 = /4), `4-3` flip screen, `5` "?? always 1", `6` "?? 0 at init then 1", `f` "?? always 0, but code may set it" | | | `82` | bits 3 and 0 | sprite-list DMA: games write 8, 9, 8, 9, wait for status bit 0 to clear, write 0 | | `84` | | "?? always `0800`" | | `86` | `3-0` | character RAM bank for the `04100000` window (MAME uses 3 bits) | | `88` | `5-0` (high word) | graphics flash bank ([flash.md](flash.md)) | | `8A` | | "?? set to 0 by BIOS init" | | `8E` | | "?? set to `00A0` by BIOS init" (DMA interrupt enables?) | | `96`, `98` | | character DMA list address (low 16, high 6 bits); bit 6 of `98` starts it | | `A0`, `A2` | 11 + 16 bits | palette DMA source | | `A4`, `A6` | 1 + 16 bits | palette DMA destination (colour index) | | `A8`, `AA` | | palette DMA fade | | `AC`, `AE` | 16 + bit 0 | palette DMA length; bit 1 of `AE` starts it | Read: `040C000C` DMA status, bit 2 palette DMA active, bit 1 character DMA active, bit 0 sprite-list DMA active. "Several parts of game code assume only one of these might be active at the same time" `[mame]`. Red Earth reads `040C0000-07` and ignores the values. ## The sprite list In sprite RAM from offset 0, four longwords per main entry, at most 0x800 entries scanned (`0x2000` bytes); the list ends at an entry with bit 31 of its first word set. Main entry: | Word | Bits | Meaning | | --- | --- | --- | | 0 | `31` end; `30-28` which global scroll pair; `24-16` number of sub-entries; `14-4` sub-list address (× 0x100 bytes... MAME: `(value × 0x100) >> 2` longwords) | | | 1 | `25-16` X, `9-0` Y | | | 2 | `30` use global bpp, `29` use global palette, `28` flip X, `27` flip Y, `26` alpha, `25` bpp (1 = 6 bpp), `24-16` palette | applies to every sub-entry | | 3 | unused by MAME | | Sub-entry (four longwords, three used): | Word | Bits | Meaning | | --- | --- | --- | | 0 | `31-17` tile number (16×16 tile = 256 bytes of character RAM), `13` "?" (bonus-stage score digits, staff roll), `12` flip X, `11` flip Y, `10` alpha, `9` bpp, `8-0` palette | | | 1 | `25-16` X offset, `9-0` Y offset | | | 2 | `30-24` drawn height − 1 in pixels... see zoom, `22-16` drawn width − 1, `9-8` "? 3 for sprites, 0 for tilemaps", `5-4` tilemap number, `3-2` height in tiles, `1-0` width in tiles | | Sizes in tiles decode as 0 → 8, 1 → 1, 2 → 2, 3 → 4. **Width code 0 is not a sprite**: it means "draw `drawn height` lines of tilemap `5-4`". Height code 0 is skipped as invalid by MAME. Tiles in a sprite are numbered column by column: tile + 0 at the top of the first column. ### Zoom (per sprite) The drawn width and height fields (1 to 128) give the size in screen units of the whole sprite of `w × h` tiles. MAME computes a step per tile, `(drawn size << 16) / tiles`, and a 16.16 scale of that step over 16, **rounded up to the next 1/16 to avoid gaps between tiles**. That rounding is a guess: "Warzard is confirmed to have gaps during some cut-scenes on real hardware" `[mame]`. Position: the entry's X plus the sub-entry's offset plus the selected global scroll, centred by half the drawn size, with flips mirroring about the sprite's own origin; +1 in X, and Y inverted (`0x3FF − y − 17`). MAME lists as known issues: "placement of zooming sprites is imperfect" (Red Earth's intro leaves the leftmost 16 pixels uncovered) and whole-screen flip not emulated. ### Colour depth and palette A tile is always 8 bits per pixel in character RAM. The bpp bit selects how many index bits are used: 8 bpp uses a 256-colour palette granule, 6 bpp a 64-colour one (so the palette number counts in units of 64 colours). Pen 0 is transparent. The palette and bpp come from the sub-entry or, when the main entry says so, from the main entry. "Alpha" is not blending `[mame]`. MAME's render buffer holds 17-bit colour indices (`palette base + pixel`), looked up in colour RAM only at scan-out. An ordinary pixel replaces the index (`PEN_INDEX`); an "alpha" pixel (`PEN_INDEX_BLEND`, chosen by the sub-entry's bit 10 or the main entry's bit 26) is ORed into the index already in the buffer (`cps3_drawgfxzoom`, read 2026-11-12): - 6 bpp tile (granularity 64): `index |= (pixel & 0xF) << 13`; - 8 bpp tile (granularity 256): `index |= (pixel & 1) << 15 | (palette & 1) << 16`. So the alpha pixel selects one of the upper banks of colour RAM above the colour already drawn: a shadow or tint table the game has loaded there. Pen 0 stays transparent. MAME's comments: "blending isn't 100% understood"; "is it really ORed or bits should be replaced ... both produce same results in games"; the 6 bpp rule is "OK for sfiii world map spotlight", the 8 bpp rule "OK for jojo intro, and warzard swords, and various shadows in sf games". Tilemap cells use the same rule through their bit 10. OR versus replace is U13. ## Tilemaps Four, each 64×64 cells of 16×16 pixels in sprite RAM at the tile base. A cell is one longword: bits `31-17` tile, `15` bit 16 of the tile number for boards with more character RAM (ignored), `12` flip X, `11` flip Y, `10` alpha, `9` bpp, `8-0` palette. With line scroll enabled, the table at the line base supplies one longword per line: scroll in the high word (10 bits), zoom in the low word (line zoom is "seems unused in games"; it may be enabled in the JoJo games' developer menu, U14). MAME adds 4 to scroll Y and offsets the tile row by one; those constants are fitted. Whole-map flip X is used by Red Earth's special moves, flip Y by 2nd Impact's loading screens. A tilemap appears on screen only through a width-0 sprite sub-entry, line by line, at the Y the entry gives (MAME: `~(y + scroll − line) − 18`). ## Character RAM and the decompressing DMA Character RAM is 8 MiB, seen by the CPU through a 1 MiB window at `04100000` selected by `86`. The CPU writes a **command list** into character RAM itself and starts the engine with `96`/`98`. Each command is three longwords (stored little-endian relative to the CPU's view): | Word | Meaning | | --- | --- | | 0 | bit 24 end of list; bits `23-21` command; bits `20-0` length: output bytes = (n + 1) × 8 | | 1 | destination in character RAM, in units of 8 bytes | | 2 | source in graphics flash: linear address = value × 2 − `400000` | | Command | Meaning | | --- | --- | | 4 | set the 128-entry, two-bytes-per-entry **dictionary table** address used by 2 and 3 | | 2 | the **6 bpp mode**: used for nearly all sprites and backgrounds | | 3 | the **8 bpp mode**: used only on Sean's stage in New Generation | | 0 | uncompressed copy (Red Earth, at stage start) | **Mode 2** (6-bit pixels with run length). Read a source byte. If bit 7 is set, it indexes the dictionary: emit the pair of bytes stored there, each processed as below. Otherwise process the byte itself. Processing a byte: if bit 6 is set it is a run, "repeat the last literal's low 6 bits (count = low 6 bits + 1) times"; otherwise it is a literal pixel, written and remembered. **Mode 3** (8-bit pixels). A control byte, then eight items; a 1 bit in the control (most significant first) means the item indexes the dictionary (two bytes), a 0 bit a raw byte. Each resulting byte is a pixel, except that after two equal consecutive pixels the next byte is a repeat count (count + 1 more copies), after which the history is reset. MAME's code has loose ends: an abort on overrun that is commented "not working", and the dictionary is read through a pointer rather than copied. JTCPS3 implements both modes, with its own test bench `[jt]` (HYPOTHESIS); the second FPGA core found that the game does not wait for the DMA, so a slow engine shows half-written tiles `[fpga2, board]`. **Speed.** Unknown in MAME ("needs to be measured"). `[board]`: at least 8.5 decompressed bytes per microsecond; the largest live batch (22,784 bytes) finished inside the VBlank handler; the attract sequence issues single batches of 1,949,696 bytes, which would take about 14 frames at that bound. Completion raises IRQ10 once. ## Palette, the palette DMA and fade Colour RAM: 0x20000 words, `0BBBBBGGGGGRRRRR` (red in the low bits), bit 15 kept. The DAC's low three bits are grounded: 5 bits per gun, no extension `[mame]`. The palette DMA copies `length` words from graphics flash (source × 2 − `400000`) to colour RAM at `destination`, applying the fade to each word. Fade register: one 7-bit field per gun (blue in bits `6-0`, green `22-16`, red `30-24` of the 32-bit value at `A8`): bit 6 enable, bit 5 mode, bits `4-0` level `f`. Mode 0: `c × f >> 5`. Mode 1: the same applied to the inverted component and inverted back (a fade toward white). Direct CPU writes to colour RAM are not faded. "Is this 100% correct?" is MAME's own comment (U15). `[board]`: a palette DMA started when the engine is idle begins at once (routine `06137DF0`); its completion is the likely source of an IRQ10 about 12,000 ticks after VBlank at the start of a fight. MAME and FinalBurn Neo both finish it 100 µs (2,500 clocks) after the request. ## The sprite-list latch Writing the 8/9 pattern to `82` copies the list (main entries, the sub-lists they point at, and the eight global scrolls) to where the renderer reads it. MAME copies at once and clears status bit 0 after 4 µs; `[board]` the wait is under one timer tick (2.6 µs). "Actual DMA probably combines coordinates and control fields from main/sub list records and gscroll registers" `[mame]`. ## Frame buffer or line renderer (C1): not decided What each source does, and what it rests on (re-checked 2026-11-12): - **MAME** draws the whole latched list into a 1024×448 buffer of colour indices (`m_renderbuffer_bitmap`, sized "twice the size of the screen, this allows us to handle framebuffer zoom values") in `screen_update`, then copies it out through the full-screen zoom (`40` = 1:1, `20` = see half as much, clamped at `80` = twice as much; "I don't know if this is accurate"; U16). That buffer is how MAME implements the zoom in one pass per frame. It is not a statement about the board's RAM, and MAME's board notes name no frame-buffer RAM. - **JTCPS3** renders each line into a frame buffer in the FPGA's SDRAM (JTFRAME's line-to-frame interface; HYPOTHESIS, source-read). A design choice of the core (tier 4). - **The second FPGA core** renders through a line buffer (DP 13.1). Written from MAME. - **JTCPS3's schematics** put four 1M×16 DRAMs (HM5118160) on the PPU's own bus in a sheet titled "MEMORIES FRAME BUFFER" (`memories_fb.kicad_sch`, nets `FB_D0-31`, `FB_A0-9`); an unused draft of the same sheet (`memories_main.kicad_sch`) is titled "MEMORIES FRAME BUFFER?" with the question mark. **MAME's board notes give the board exactly four 1M×16 DRAMs (TC5118160) and call them "Character RAM", from the name the test mode's memory check prints** (8 MiB, the size MAME allocates for character RAM). The same four chips cannot be all of both (C15). - **DP section 11** is an inference, not a measurement: WydD's camera measurement of a real cabinet gives 2.58 frames from button to light, with inputs read during blanking. 3rd Strike samples inputs at VBlank N, its pass N writes the sprite list, and the VBlank N+1 handler latches that list (`0613696C`) `[rom]`. A picture of pass N first seen in frame N+2 gives 0.5 + 2 + s frames, which fits; one drawn on the fly during frame N+1 gives 1.5 + s, which does not. So **pass N's picture reaches the screen two VBlanks after its inputs were sampled**. That excludes "a renderer that draws the list latched at N+1 while scanning frame N+1". It does not distinguish a frame buffer from a line renderer that reads a list latched one stage later, and DP's own list of next measurements says a display-layer test "settles Table 14" (DP 14, item 6): the authors do not consider it settled either. The measurement is second-hand (inputlag.science refused the fetch). **What the board does with this.** Model the observable: the list latched at VBlank N+1 is drawn into a buffer of 17-bit indices during frame N+1 and scanned out (palette lookup, full-screen zoom) during frame N+2. MAME's pipeline gives the same frame numbering (DP table 14), so lockstep pictures line up. Whether colour RAM is read when drawing or when scanning out (it matters for mid-frame palette changes) is open: MAME looks it up at scan-out (U12). ## The score-screen layer (SS) Generated by the SSU. RAM at `05040000`, **odd bytes only** `[board]`: the CPU's 64 KiB window `05040000-0504FFFF` reaches a 32 KiB byte-wide SRAM, so RAM offset = CPU offset / 2. MAME maps it with lane mask `00FF00FF`. MAME's comment block above `ssram_r` gives the same layout in CPU offsets (tilemap `0000-3FFF`, row scroll `4000-7FFF`, tiles `8000-FFFF`); the table below and MAME's code count RAM bytes. The two agree (checked 2026-11-12). The same comment says "only even bytes", which is wrong by DP's measurement and by MAME's own lane mask (bytes 1 and 3 of each longword on this big-endian bus). | RAM offset (of 32 KiB) | Content | | --- | --- | | `0000-1FFF` | tilemap, 64 columns × 64 rows of 8×8 cells, two bytes a cell (low byte first, so the low byte is in the CPU's first 16-bit half and the high byte in the second): bits `8-0` tile, `13-9` palette, `14` flip Y, `15` flip X. Tile bit 8 is bit 0 of the attribute byte, as DP found the game writing it | | `2000-3FFF` | row scroll: one byte per line at even RAM offsets, `2000 + 2 × line`, 9-bit line index (the JoJo combo meter uses it) | | `4000-7FFF` | 512 tile definitions, 8×8, 4 bits per pixel | Registers at `05050000` (odd bytes): `00`-`06` H sync, start, blank, total; `07`/`08` H scroll (−101 in 384 mode, −107 wide, +128 flipped); `09`-`0F` V sync, start, blank, total; `10`/`11` V scroll (−24; +288 flipped); `12` palette base (× 32 palettes of 16); `13` pixel clock ("not clear how it works"); `14` flip. MAME uses only the scrolls and the palette base, and handles V scroll with a `TODO`. The layer is drawn after the zoomed buffer, so the full-screen zoom does not touch it. ## What MAME says is still wrong or unknown (copied) Whole-screen flip not emulated; DMA speeds unknown; "alpha" effects unverified; tilemap line zoom unused or untested; palette DMA effects unverified; full-screen zoom range unverified; CRT registers ("it is not known which is base pixel clock and how it is affected by register 40C0080 bits"); sprite positioning glitches when zooming; gaps in sprite zooming exist on hardware too.