Texas Instruments TMS9918 - Sprites

Sprites

In modes 1, 2, and 3, the VDC can render sprites. There can be 32 monochrome sprites of either 8×8 or 16×16 pixels on screen, each sprite can have its own one color. There can be no more than 4 sprites on a single scanline; any additional sprites' horizontal pixels are dropped. Sprites with a higher priority are drawn first. The VDP reports in a status register the number of the first dropped sprite. The CPU can get around this limitation by rotating sprite priorities so that a different set of sprites is drawn on every frame. Instead of disappearing entirely, the sprites will flicker. This technique is known as sprite multiplexing.

Automatic sprite movement is not handled by the VDC. What is done, in practice, is that the CPU will pick up on the VDC's 'vertical interrupt' - a standard VDC output, which is triggered automatically once every 50th or 60th of a second (depending on chip variant), at the start of the VBI (vertical blanking interval). The CPU then jumps to some sprite-handling routine in software, which in turn tells the VDC where to reposition the sprites.

When two non-transparent pixels in any pair of sprites collide, the sprite collision flag is set. This is useful for triggering more advanced collision detection routines inside the software which can then determine the exact location and act upon it. Note that unlike the Atari 2600's Television Interface Adapter and the Commodore 64's VIC-II, the VDC cannot tell the program which two sprites have collided, just that individual sprites have been involved in a collision.

Read more about this topic:  Texas Instruments TMS9918