IT lexicon › Programming › Compiled sprite

Compiled sprite

Programming På svenska → Updated: 2026-10-26

A sprite stored not as pixels but as machine code that writes exactly those pixels — the fastest blit possible, paid for with everything else.

An ordinary blit reads every source pixel, checks whether it's transparent and maybe writes it. A compiled sprite is converted ahead of time into a straight run of mov instructions with fixed address offsets. Transparent pixels don't appear in the code at all; they're simply skipped. No loop, no branches, no reading of source data. On DOS machines driving VGA in Mode 13h or Mode X that could mean several times the speed.

The bill came as code size — a 32×32 sprite easily ran to kilobytes of instructions — and rigidity. Clipping at the screen edge, mirroring or palette swaps needed separate variants or on-the-fly generation. Once graphics cards shipped their own blitters, the trick stopped being worth it.

← Back to the lexicon