I recently completed a software disassembly of the 1980 coin-op arcade game Missile Command. I'm curious whether a feature of the hardware is unique or commonplace.
First, a bit of background: Missile Command uses a 256x231 indexed-color display. Most of the screen is 2 bits per pixel, packing 4 pixels per byte of memory. The bottom 32 lines use 3 bits per pixel, with the 3rd bit coming out of a separate area of RAM that packs 8 pixels per byte. The 2bpp RAM is linear, but the 3bpp RAM is creatively interleaved.
Most of Missile Command's animation code draws individual pixels. Even the planes and killer satellites that fly across the screen are drawn as a handful of pixels (leading edges drawn, trailing edges erased... very efficient). The 6502 only operates on whole bytes, so it would be helpful to have a way to access one pixel per byte.
The hardware designers implemented a scheme where a signal called MADSEL (Multiplexed Address Select) is asserted when a 6502 instruction with the bit pattern xxx00001
takes more than 5 cycles to execute. The signal causes the address space to function differently: a read or write to memory from $1900 to $ffff accesses a single 3bpp pixel value.
In practical terms, it means that LDA (zp,X)
and STA (zp,X)
instructions access memory in "MADSEL mode", one byte per pixel, while any other memory access instruction uses "normal mode".
My question: how common was this? Is this a standard trick, or something unique?
I nosed through a few MAME drivers. Most of the contemporary games for the 6502 were Atari vector or tile/sprite-based. (Missile Command is well suited to a plain framebuffer because it draws very little per frame, and it looks better with solid filled shapes.) I'm not sure if a scheme like this would be useful or possible on other CPUs.