# The GE (graphics engine) and the display Sources: YAPSPD 10-11 (196 commands listed, 2006), Copetti "Graphics", pspsdk `src/ge` (the sceGe library's NIDs and `PspGeListArgs`, `PspGeCallbackData`) and `src/gu` (a BSD display-list builder: which command words real code emits), pspautotests `tests/gpu/` (113 `.expected` outputs and 28 `.expected.bmp` frame captures recorded on a PSP), `tests/display/` (13). ## What the GE is - **Inside Tachyon**, on the system bus, with 2 MB of eDRAM ("local memory") behind its own controller and a 512-bit path to it (Copetti, "Architecture of the Graphics Engine": two unidirectional 256-bit buses). Frame buffer, depth buffer and textures may live in eDRAM or main memory; display lists, vertices, indices and CLUTs normally in main memory (Copetti). - **Command format:** 32-bit words, 8-bit command in the top byte, 24-bit argument; floats in commands are 24-bit (a 32-bit float shifted right by 8) (YAPSPD 11.1-11.2). Pointers take their top bits from BASE (YAPSPD 11.3). - **The list processor** (its own DMA, "not just a dumb memory copier": Copetti): NOP, VADDR, IADDR, PRIM, BEZIER, SPLINE, BBOX, JUMP, BJUMP (conditional on the last BBOX), CALL, RET (a call stack), END, SIGNAL, FINISH, BASE ... A list runs from its start address to a **stall address** that the CPU moves forward ("store controlled" lists: Copetti); SIGNAL and FINISH raise interrupts that the kernel turns into callbacks (pspsdk `PspGeCallbackData`: `signal_func`, `finish_func`). - **Surface engine:** world/view/projection/texture matrices (WORLD, VIEW, PROJ, TMA uploads), viewport and offset, up to 4 lights (ambient, directional, point, spot), 8 bone matrices for skinning (BONE), morph weights (MW0-MW7), Bézier and spline patches with subdivision (PSUB), clipping and culling (YAPSPD 11.5; Copetti). - **Rendering engine:** points, lines, line strips, triangles, strips, fans, sprites (rectangles); texture mapping with 8 KB texture cache (LRU: Copetti), CLUT formats, swizzled textures, mipmaps, filtering; fog; colour doubling; tests (scissor, depth range, alpha, stencil, depth), blending, logic ops, masks, dithering; through mode (2D, pre-transformed); block transfers (TRXSBP/TRXDBP/TRXPOS/TRXSIZE/TRXKICK). - **The depth buffer's layout** in VRAM is swizzled; reading through the +6 MB mirror linearises it (YAPSPD 10.2), and games read it (U7). ## What the specification models (proposal) - **The GE as hardware**, at register and command level: the list processor stepping words from memory, the matrix and state registers, the stall/signal/finish/end semantics with their interrupts, and a **software rasteriser that is the judge**, pixel by pixel, with the GE's own interpolation, depth, blending, dithering and texture sampling rules as data. - **The CPU/GE relationship** is the PlayStation GPU's and the N64 RDP's: the GE reads memory the CPU wrote (only after a D-cache writeback: allegrex cop0-and-caches.md), and writes VRAM the CPU or the display may read. The front-end/back-end split of psx-python and n64-python applies: the list processor and the timing on the CPU's thread; pixel shading as a producer (domains-and-speed.md). - **The judges:** `gpu/exact/*` (9 outputs of CRCs per rendering job, added recently: coverage, curves, lighting, lines, nearclip, pixel, planes, texture, transform), the 28 `.expected.bmp` frame captures, and the command-level tests (`commands`, `displaylist`, `signals`, `callbacks`, `callstack`, `bounding`, `clipping`, `clut`, `depth`, `dither`, `filtering`, `lighting`, `primitives`, `rendertarget`, `stencil`, `texcolors`, `texfunc`, `texmtx`, `textures`, `transfer`, `triangle`, `vertices`, `timing`). - **GE timing:** how many cycles a primitive costs is unknown to our sources (U8). pspautotests `gpu/timing` holds a `blittiming` program without an `.expected`; the model starts with a HYPOTHESIS cost per command and per pixel, marked as such, and games that race the GE (polling `sceGeListSync`, reading VRAM mid-list) are the cases that will show what matters. ## The display 480x272 visible in a frame buffer of stride 512, pixel formats 565, 5551, 4444, 8888 (pspsdk `pspdisplay.h`; YAPSPD 10.1). `sceDisplaySetFrameBuf` latches at the next hsync or vsync (`PSP_DISPLAY_SETBUF_NEXTHSYNC`/`NEXTVSYNC`). The panel's line and frame timing (about 59.94 Hz) is HYPOTHESIS until a display test's timing output is read (`display/*`, 13 outputs). Video out (PSP-2000/3000, 720x480/576: Copetti) is a later row. ## Chip rule The GE is in Tachyon and in no other family machine: it stays in this board (`psp_python.ge`).