Skip to content

About this page

On this page

Graphics Synthesizer ​

This section is in beta. See the note on the cheat sheet.

The Graphics Synthesizer (GS) is the PS2's graphics chip. It is a separate chip with its own local video memory.

Local memory ​

The GS has 4MB of eDRAM on-die, used for the frame buffer, the z-buffer and the textures currently in use. The EE cannot read or write this memory directly. Everything in GS memory (a texture upload, a cleared frame buffer, a triangle) arrives as a command that the GS executes.

GIF packets ​

Commands are packaged as GIF packets (GIF = Graphics Interface): tagged data that the GS front end unpacks into register writes and primitive draws. A packet is normally sent to the GS over its own DMA channel (DMA_CHANNEL_GIF, channel 2; see DMA).

Privileged registers ​

A few GS registers are memory-mapped into the EE's address space (not through DMA) for things the CPU must access synchronously: display timing, the current display buffer and interrupt status. The addresses, from ee_regs.h:

RegisterAddressPurpose
GS_PMODE0x12000000Output circuit config (which read circuits are active, alpha blending between them)
GS_SMODE1/GS_SMODE20x12000010/0x12000020Video timing and sync mode
GS_BGCOLOR0x120000e0Background color when nothing else is drawn
GS_CSR0x12001000Control and status: VSync interrupt flag, current field, reset

Everything else, including primitive type, vertex color, texture parameters, alpha blend mode and the frame and z-buffer pointers, goes through GIF packets.

Drawing libraries ​

This SDK has two libraries for drawing. Do not use them together in one project:

  • gsKit - an immediate-mode-style API: build a primitive, then call a draw function. gskit-toolkit adds texture loading from freetype and libpng.
  • ps2gl - an API similar to a small subset of OpenGL.

Both build GIF packets and DMA them to the GS. Higher-level libraries built on one generally do not work with the other.

Frame buffer and z-buffer placement ​

Frame buffers, z-buffers and textures must be placed at chosen offsets within the 4MB and sized to fit. You manage this budget yourself (gsKit and ps2gl each have an allocator for it).

See also ​

  • DMA - how packets reach the GS
  • Vector Units - VU1 usually builds the GIF packets