Graphics & Sprites

VRAM layout, spritesheets, backgrounds, tiles, metasprites, shadow OAM, and CGB attribute maps. The graphics system is implemented in C.

VRAM Layout

Sprite Mode

Spritesheet Structure

typedef struct spritesheet_t {
    UINT8 num_frames;
    UINT8 num_tiles;        // tiles per frame
    // followed by metasprite data and tile data
} spritesheet_t;

Background System

Background Loading

Tile Replacement

Shadow OAM (Double Buffering)

Metasprite Rendering

CGB Attributes

Each background tile has an attribute byte:

Each sprite has similar attributes in OAM entry byte 3.

Common Graphics Operations

Examples of common graphics tasks in plugin and engine code:

Submap System