# The RDP (Reality Display Processor) Sources: n64brew: Reality Display Processor and its Commands, Pipeline, Interface and Hazards subpages; Coverage Unit (CC BY-SA 4.0, facts only, tier 3); Nintendo's "Ultra64 RDP Command Summary" and programming manual (leaked SGI/Nintendo documents listed on ultra64.ca, tier 2, facts only, **not fetched tonight**: the site hides its links behind scripts). Comparators: parallel-rdp (MIT, tier 5, readable), ares (uses parallel-rdp), MAME (closed box); angrylion-rdp-plus is under MAME's old non-commercial licence: closed box only, and under the 2026-11-25 rule it is built, if ever, in emu-tools-gpl2, never here. **Chip rule.** The RDP is a non-CPU chip used by one machine (the N64; the iQue Player and the Aleck64 arcade board are the same RCP). It stays inside the board as a package (`n64_python.rdp`), behind a pin-shaped interface (command words in, RDRAM transactions out, the DP interrupt), so it could be extracted if a second user appeared. None is known. ## What it does A fixed-function pipeline at the RCP clock (62.5 MHz), fed by 64-bit command words from RDRAM or from the RSP's DMEM over the XBUS (DPC_STATUS bit 0), between DPC_START and DPC_END; one pending transfer is double-buffered behind the active one. Logical stages (n64brew: RDP Pipeline, which warns they overlap): rasterise (edge walking of a triangle given as three edges with slopes; rectangles are left-major triangles with zero slopes) with attribute interpolation and 4x4 subpixel coverage; perspective divide of S,T by W; texture coordinate shift, tile offset, clamp/mirror/mask; **4 texels sampled from TMEM** and expanded to RGBA32; texture filter (point, bilinear, the 3-point "median"); colour combiner ((A-B)*C+D per RGB and alpha, two cycles in 2-cycle mode); chroma key; alpha fixups; dither; memory colour read; Z compare; alpha compare; coverage reject; **blender** (p*a + m*b, divided by a+b on antialiased edges); RGB dither to 5:5:5 for 16-bit targets; the span buffers and the RDRAM write; Z write. Cycle modes: 1-cycle (one pixel per clock), 2-cycle (one per two clocks, two texture / combiner / blender passes), COPY (64 bits of texels per step, no filtering, a TLUT allowed), FILL (64 bits of the fill colour per step, straight to RDRAM). TMEM is 4 KB addressed in 64-bit words; TLUTs live in the high half, each entry stored four times; loads past the end wrap; LOAD_BLOCK is limited to 2048 texels and swaps the 32-bit words of odd lines by a u1.11 counter (too little precision misses swaps). TMEM's bank organisation is not on the wiki (U). ## Commands (n64brew: RDP Commands) Opcode in bits 61-56 of the first word; lengths in 64-bit words: | Opcodes | Command | Words | | --- | --- | --- | | 0x08-0x0F | triangles: fill, +Z, +texture, +texture+Z, +shade, +shade+Z, +shade+texture, +all | 4 + shade 8 + texture 8 + Z 2 (4, 6, 12, 14, 12, 14, 20, 22) | | 0x24, 0x25 | texture rectangle, flipped | 2 | | 0x26-0x29 | SYNC_LOAD, SYNC_PIPE, SYNC_TILE, SYNC_FULL | 1 | | 0x2A-0x2F | set key GB, key R, convert (YUV), scissor, primitive depth, other modes | 1 | | 0x30, 0x32-0x37 | load TLUT, set tile size, load block, load tile, set tile, fill rectangle, set fill colour | 1 | | 0x38-0x3F | set fog, blend, primitive, environment colour; set combine; set texture, depth, colour image | 1 | | 0x00-0x07, 0x10-0x23, 0x31 | no-op ("TOVERIFY") | 1 | Fixed-point formats: Y edges s11.2, X and slopes s.16, shade and texture s15.16, Z 16.16; texture rectangle S,T s10.5 and steps s5.10; scissor u10.2 (and it cannot be disabled). ## Syncs and hazards (where the specification must be exact about wrong programs) - SYNC_LOAD, SYNC_PIPE, SYNC_TILE stall a fixed 25, 50 and 33 GCLK cycles (the wiki states these as exact counts, method not given); SYNC_FULL waits for all work and raises the DP interrupt; nothing may be sent until busy clears "or the RDP can crash". - Without a sync the tail pixels of the previous primitive see the new state; the wiki tabulates how many cycles are corrupted per attribute (combiner 24/22, blender 26/24, tile 13/10, and so on; several TBC). - Hazards RH#001-004 (libdragon's validator detects them; "not emulated by ares"): TEX1 in 1-cycle mode gives the next pixel's value; 2-cycle TEX0/TEX1 cross-talk (Monster Truck Madness shows it); COMBINED in the first cycle gives the previous pixel; SHADE on unshaded primitives is garbage. - 2-cycle bugs listed on the Commands page: first-cycle memory colour and coverage from the previous pixel; second-cycle shade alpha from the next pixel. A software RDP that is "correct" for correct programs and undefined for wrong ones does not match the hardware on games that break the rules (the hazards are seen in shipped games). The specification models the pipeline's timing in pixels and cycles so that these effects fall out of it, where the evidence says how; where it does not (TBC rows), the choice is a marked HYPOTHESIS. This is a modelling-level decision (handoff-brief Open decision 4). ## Coverage, Z and formats - Coverage: a 4x4 subpixel mask counted through the checkerboard 0xA5A5, so 0-8; memory coverage is 3 bits ("full" is 7) in the hidden 9th bits of a 16-bit colour buffer (and the low alpha bits of a 32-bit one) (C11: the 0-8 range against 3 bits). - Z: 18 bits per pixel, a compressed floating format with a dz; the depth image uses the colour image's width; 64-byte alignment. - Colour images: RGBA16 (5:5:5:1), RGBA32, I8; 4-bit targets write zeros and FILL to them crashes. ## Judges for the RDP There is **no tier-1 RDP judge we hold**, and no die model. In order: 1. **Hardware-run test ROMs with pictures**: krom's `RDPTest` (Unlicense, PNG photos beside many tests), `tex_sampling_rom` (MIT), libdragon's `tests/` rdpq tests (Unlicense, run on hardware by its developers; self-checking against expected framebuffers in some cases), nemu64-test `rdp` (7 tests). 2. **parallel-rdp** (MIT, tier 5): bit-exact against angrylion by its authors' account; a detector of differences, readable, and the source of facts with its notice if used. 3. MAME (closed box), ares (ISC, uses parallel-rdp, so not independent of 2). Rung exit tests are pixel-exact against (1), and differences against (2) are listed as detector findings, never as failures.