SNES Mosaic Effects. More...
Go to the source code of this file.
Macros | |
| #define | MOSAIC_BG_ALL 0x0F |
| #define | MOSAIC_MAX 15 |
| #define | MOSAIC_MIN 0 |
Functions | |
| void | mosaicDisable (void) |
| Disable mosaic effect for all backgrounds. | |
| void | mosaicFadeIn (u8 speed) |
| Animate mosaic fade in (pixelated -> clear). | |
| void | mosaicFadeOut (u8 speed) |
| Animate mosaic fade out (clear -> pixelated). | |
| u8 | mosaicGetSize (void) |
| Get current mosaic size. | |
| void | mosaicInit (void) |
| Initialize mosaic system. | |
| void | mosaicSetLayers (u8 bgMask) |
| Set the backgrounds the mosaic applies to — REPLACES the previous set. | |
| void | mosaicSetSize (u8 size) |
| Set mosaic pixel block size. | |
SNES Mosaic Effects.
Mosaic is a PPU effect that pixelates backgrounds, commonly used for:
Hardware: Register $2106 (MOSAIC)
| #define MOSAIC_BG_ALL 0x0F |
Enable mosaic for all backgrounds
| #define MOSAIC_MAX 15 |
Maximum mosaic (16x16 pixel blocks)
| #define MOSAIC_MIN 0 |
Minimum mosaic (1x1, no visible effect)
| void mosaicDisable | ( | void | ) |
Disable mosaic effect for all backgrounds.
| void mosaicFadeIn | ( | u8 | speed | ) |
Animate mosaic fade in (pixelated -> clear).
Smoothly decreases mosaic from current level to 0. Blocks until animation completes.
| speed | Frames to wait between steps (1 = fast, higher = slower) |
Example:
| void mosaicFadeOut | ( | u8 | speed | ) |
Animate mosaic fade out (clear -> pixelated).
Smoothly increases mosaic from current level to maximum. Blocks until animation completes.
| speed | Frames to wait between steps (1 = fast, higher = slower) |
Example:
| u8 mosaicGetSize | ( | void | ) |
Get current mosaic size.
| void mosaicInit | ( | void | ) |
Initialize mosaic system.
Disables all mosaic effects. Call this once during setup.
| void mosaicSetLayers | ( | u8 | bgMask | ) |
Set the backgrounds the mosaic applies to — REPLACES the previous set.
mosaicSetLayers(LAYER_BG1) after mosaicSetLayers(LAYER_BG2) leaves only BG1 pixelated. This is the function the removed mosaicEnable() was (renamed 2026-09-22, removed 2026-10-05) because "Enable" reads as additive — windowEnable() IS additive — and the old name silently undid the previous call.
| bgMask | Bitmask of backgrounds (LAYER_BG1 | LAYER_BG2 | ...; 0 disables, like mosaicDisable()) |
Example:
| void mosaicSetSize | ( | u8 | size | ) |
Set mosaic pixel block size.
| size | Mosaic level (0-15) 0 = 1x1 pixels (no visible effect) 15 = 16x16 pixel blocks (maximum pixelation) |
Note: a background must be selected with mosaicSetLayers() to see the effect.