OpenSNES
Modern Open-Source SNES Development SDK
Loading...
Searching...
No Matches
Colour

Colour & effects — squeezing more colour out of the PPU. The SNES shows 256 colours at once from a 15-bit (32768-colour) palette — unless you cheat. This family is the colour-math blend, the palette-bypass mode, and the tricks that push past 256 by reloading the palette mid-frame.

The ladder

Example Developer question
palette_cycle How do I animate (waterfall/fire/lights) by rotating CGRAM, no pixels moved?
transparency How do I blend two layers — with colour math, or 50 % without it (pseudo-hires)?
shadow_tint How do I darken (night) or colour-cast (underwater/sunset) a whole scene?
direct_color How do I use direct-colour mode (the pixel byte is the RGB)?
hicolor_1792 How do I show 1792 colours via H-IRQ CGRAM streaming?

The idea in one screen

The PPU reads pixel colours from CGRAM (256 slots). Colour math ($2130– $2132) adds or subtracts one layer's colour over another — transparency, shadows, tints. Direct colour spends the 8bpp pixel byte as a BGR value, skipping CGRAM entirely. And to beat the 256-at-once limit, you reload CGRAM mid-frame under an H-IRQ so different scanlines see different palettes (hicolor_1792; its README also describes the channel-split blend that reaches 3840 colours).

direct_color — the pixel byte IS the color HiColor — 1792 colors from a 4bpp background palette_cycle — animate by rotating CGRAM shadow_tint — recolour a whole scene at once Color Addition Transparency — and Pseudo-Hires