Bitplane (Pico-8)

Bitplanes! An overview

0x5f5e / 24414

Allows PICO-8 to mask out certain bits of the input source color of drawing operations, and to write to specific bitplanes in the screen (there’s 4 of them since PICO-8 uses a 4BPP display). Bits 0..3 indicate which bitplanes should be set to the new color value, while bits 4..7 indicate which input color bits to keep.

For example, poke(0x5f5e, 0b00110111) will cause drawing operations to write to bitplanes 0, 1, and 2 only, with 0 and 1 receiving the color value bits, 2 being cleared, and 3 being unaltered. This formula is applied for every pixel written:

dst_color = (dst_color & ~write_mask) | (src_color & write_mask & read_mask)

caption

Written on October 25, 2023, Last update on October 27, 2023
pico8