Windows XP’s glossy chrome cost a GPU with acceleration. We wanted it on a Pentium II with VESA and 4 MB of VRAM, drawn entirely in software. The solution is three counterintuitive decisions, all born from the same question: what can this machine actually afford?
Decision 1: always compose in 32 bits
Everything draws into ONE 32-bit XRGB back buffer in system RAM. It sounds ruinously expensive for the era and it is the opposite: the drawing code is format-independent and there is no dithering anywhere. Gradients, bevels and shadows are computed once, clean. Only the present() step converts to the hardware’s real format.
Decision 2: a palette you never search
At 8bpp we use a 3-3-2 palette: three bits of red, three of green, two of blue. Converting a 32-bit pixel is a shift and a mask — zero table lookups, zero “nearest color”: it is the three lines of gfx_pack_index_332(). At 16bpp, straight RGB565. And only dirty rectangles get converted: a click repaints a window, not a screen.
There is no per-pixel alpha in the whole system. Icons use a magenta color key; shadows are a cheap read-modify-write on the edge strips.
Decision 3: ban alpha
Per-pixel transparency is the luxury a period machine cannot afford. So it does not exist: icons and cursors use a 1-bit magenta color key, and window shadows are a cheap darkening of the edge strips. The eye is fooled exactly the same, and it fits the budget. The host checks — 457 when we wrote this, 7,609 today — run under both gcc and clang on every push, make sure no commit breaks the conversion.

D. ABELLÁN · FOUNDER · PRINCETON, IL · 2026.04.22
About CastaliaOS 98 PE →