Spectrum Attribute Clash Calculator
Computes how many 8x8 attribute clash regions exist on a 256x192 pixel ZX Spectrum screen used by the famous color hardware issue.
โ
ZX Spectrum attribute clash
The Sinclair ZX Spectrum (1982) draws a 256ร192 pixel bitmap, but its color lives in a much coarser place: a 32ร24 grid of 8ร8 attribute blocks. Every one of those blocks gets just 2 colors (INK + PAPER), along with a BRIGHT and a FLASH bit, picked from a fixed 15-color palette (8 normal plus 7 bright, with black shared between them). Put two different objects in the same 8ร8 cell and one of them gets recolored whether you like it or not. That's the infamous "attribute clash". Attribute RAM comes to 32ร24 = 768 bytes, mapped at $5800, and the bitmap takes 6144 bytes at $4000. The better developers (Ultimate Play the Game, Tim Follin's brother Mike) drew sprites that lined up with the attribute grid so the clash never showed.
Applications
Retrogaming work for the ZX Spectrum on modern toolchains (z88dk, sjasmplus), demoscene productions aimed at the Spectrum 48K/128K, emulator authors (Fuse, ZEsarUX, Spectaculator), converting pixel art from PNG into SCREEN$ format, and homebrew releases on places like itch.io and the World of Spectrum archive.
FAQ
Why only 2 colors per block? Memory was tight in 1982. Color stored per pixel would have eaten 8ร more RAM (โ48 KB just for the screen), whereas the 32ร24 attribute grid keeps the whole framebuffer under 7 KB.
How do games avoid the clash? A few standard tricks. Monochrome sprites over a black background, sprite hitboxes that snap to the 8ร8 cells, the BRIGHT bit pressed into service as a fake third color, or just leaning into the clash and treating it as the look (see Knight Lore).
What's SCREEN$? It's the 6912-byte snapshot of video RAM (6144 bitmap + 768 attributes), usually dumped to .SCR files when people want to share pixel art.
Related Tools
Rent Adjustment Calculator
Compute annual rent adjustment by IGP-M or IPCA accumulated in the last 12 months (manually configurable).
Pregnancy Calculator
Compute estimated due date (EDD), gestational age and trimester from the last menstrual period (LMP).
Fertile Period Calculator
Compute fertile window and ovulation day from the first day of the last cycle and the average cycle length.