Amiga Sprites
The Amiga has eight true hardware sprites, drawn by Denise straight from chip RAM under DMA control, with the copper free to reposition and reuse them line by line. Each is 16 pixels wide and any height. For everything else there are BOBs, blitter objects the blitter draws into the bitplanes, giving unlimited software sprites with full masking.
Overview
Two kinds of moving object exist on the Amiga. Hardware sprites are overlaid on the display by Denise as the beam scans, cost no bitplane memory and leave the background untouched, but there are only eight and each is a narrow 16 pixels wide. BOBs are bitmaps the blitter copies into the playfield bitplanes, so they can be any size and any colour, at the cost of drawing and restoring them each frame. Most games mix the two.
| Property | Hardware sprite | BOB |
|---|---|---|
| Count | 8 | Unlimited |
| Width | 16 pixels | Any |
| Height | Any | Any |
| Colours | 3 + transparent (15 attached) | Full playfield palette |
| Drawn by | Denise, DMA | Blitter |
| Costs bitplane RAM | No | Yes |
The hardware sprites
Denise supports eight sprites, numbered 0 to 7. Each is 16 pixels wide and can be any number of scanlines tall. A sprite pixel is two bits, so it shows one of four values: value 0 is transparent and lets the playfield show through, and values 1, 2 and 3 pick three visible colours. Those three colours come from a fixed group of palette registers reserved for that sprite pair, not from the general playfield palette.
The sprites are fetched by DMA one 16-pixel line at a time, so they cost no CPU. Because fetching is per line, the copper can rewrite a sprite's position and data pointer partway down the screen, letting a single sprite channel be reused several times on different scanlines. This multiplexing is how games show far more than eight moving objects using the sprite hardware.
| Sprite pair | Colour registers |
|---|---|
| Sprites 0 and 1 | 17, 18, 19 |
| Sprites 2 and 3 | 21, 22, 23 |
| Sprites 4 and 5 | 25, 26, 27 |
| Sprites 6 and 7 | 29, 30, 31 |
Sprite data structure
A sprite lives in chip RAM as a small structure the DMA reads through the sprite pointer register. It opens with two control words that set the vertical start line, the horizontal position and the vertical stop line. Then come the image lines, two 16-bit words each: the first word supplies the low bit of every pixel, the second word the high bit, so the two words together give each of the 16 pixels its 2-bit value. A final pair of zero control words ends the sprite.
| Words | Contents |
|---|---|
| 0–1 | Control words: vertical start, horizontal start, vertical stop, attach flag |
| 2–3 | First image line: low-bit word, then high-bit word |
| … | One low/high word pair per scanline |
| last | Two zero words, ending the sprite |
Two bitplanes' worth of data are interleaved here per line, which is why a plain 3-colour sprite needs two words per row. The position words let a sprite be placed anywhere and, by writing new control words further down, reused lower on the screen.
Attached sprites
Three colours is often too few, so two adjacent sprites can be attached to act as one. Setting the attach bit in the odd-numbered sprite of a pair merges it with its even partner: the two 2-bit pixels combine into a single 4-bit value, giving 15 visible colours plus transparent for that 16-pixel column. The combined colour is looked up in the pair's block of sprite palette registers.
| Mode | Bits per pixel | Visible colours |
|---|---|---|
| Single sprite | 2 | 3 + transparent |
| Attached pair | 4 | 15 + transparent |
Attaching a pair uses up two of the eight sprite channels for one object, so a screen can hold four independent 15-colour sprites, or eight 3-colour ones, or any mix.
BOBs and the blitter
A BOB, or Blitter OBject, is a software sprite drawn into the playfield bitplanes by the blitter rather than overlaid by Denise. The blitter copies the object's bitmap into the screen through a mask, so the shape can be any outline and can use any of the playfield colours. Because it writes into the bitplanes, a BOB overwrites what was there, so the program first saves the background, draws the BOB, then restores the background before drawing it in its new place.
The blitter draws through its logic unit, combining the source bitmap, a mask and the destination in one pass, which is what makes masked, any-size sprites cheap on the Amiga. There is no fixed limit on the number of BOBs, only the blitter time and memory available, so parallax fields of hundreds of objects are possible where eight hardware sprites would not be enough.