Back

Graphics

this page is unfinished and needs to be totally written basic theory of operation:

For every screen-pixel, the fdp outputs two half-pixels (each consisting of a color id and an alpha value).  These are then converted to rgb colors, and blended into a single output by the fda.

(say something like: the fdp is controlled by writing to its external RAM, as well as a few write-only internal registers

Graphics Layers

The fdp has eight different graphics layers which can be used as the source for each half-pixel:

line registers / lineram page

pixel pipeline order:
- [per-layer rendering] ← (common and layer-specific data)
×8 ↓ color, alpha select, blend mode, priority, clip settings, mosaic enable
- Mosaic ← mosaic strength
×8 ↓ color, alpha select, blend mode, priority, clip settings
- Clipping ← clip window values
×8 ↓ color, alpha select, blend mode, priority
- Priority Sorting
×2 ↓ color, alpha select, shadow?
- Shadow Effect ← shadow mode
×2 ↓ color, alpha select
- Alpha Lookup ← alpha values
×2 ↓ color, alpha value
- Color Lookup (RAM) ← color ram
×2 ↓ rgb color, alpha value
- Blending (FDA) ← fda mode, blur enable
×1 ↓ rgb color (blended)
- (Output to screen)

Graphics settings are stored in lineram.  Effectively, each setting is an array of 256 values, one for each scanline.

Most layers have these settings:

Enable
whether the layer is visible
Clip Plane enables (4)
which of the four clip windows to enable
clip window modes (4)
0
outside visible
1
inside visible
clip invert
inverts the final clip mask
priority
which of the 16 priority levels to use (higher number = above other things)
blend mode
which half-pixel(s) to contribute to (neither/A/B/both)
alpha select
which set of alpha values to use (0/1)
idea: each layer can be described as: - description of the fixed data (e.g. tilemap data or the sprite framebuffer) - the lineram settings (

Clipping

there are four clip windows, each of which has a left and right value (ranging 0-511).  selecting multiple of these will union their visible areas together (todo explain all this better. but i think it goes here because it's a like top-level feature that applies across layers)

Background Color Layer

a solid color, used if nothing else is present in that half-pixel, or if a priority conflict occurs.  this is a pseudo-layer which lacks most of the common settings.

Pivot Layer

(we're not sure what the name means). the pivot layer is a 64×64 grid of 8×8 tiles, with textures defined in ram. it can be used for displaying text or pixel graphics.

Sprite Layer

the fdp renders up to ~900 16×16 sprites per frame to a single bitmap framebuffer.

Tilemap Layers

each tilemap is a 32×32 (or 64×32) grid of 16×16 tiles.

"extend mode" (global)
select between 32×32 or 64×32 size (no tradeoffs)
scroll (global)
scroll (lineram)
(layers 2 and 3 only)
background color
a solid color, used if nothing else is found for that half-pixel, or if a priority conflict occurs.
pivot layer
a 64×64 grid of 8×8 tiles, with textures defined in ram.  can be used for displaying text or bitmap graphics.
sprite groups (4)
playfields (4)
32×32 (or 64×32) grid of 16×16 tiles. can be scaled vertically from 50% to infinity, and horizontally from 100% to 25600%.