Skip to main content

bgr555_to_rgba8

Function bgr555_to_rgba8 

Source
pub const fn bgr555_to_rgba8(bgr555: u16) -> u32
Expand description

Expand a 15-bit SNES BGR555 color word (0bbbbbgggggrrrrr) to a packed little-endian RGBA8 (0xAABBGGRR) value suitable for an RGBA8 framebuffer / texture upload.

The 5-bit channels are left-justified to 8 bits (c << 3 | c >> 2), matching how Mesen2 / bsnes expand CGRAM. Alpha is forced opaque.