Raster interrupt

Raster interrupt

A raster interrupt is a computer interrupt signal that is used for display timing purposes. It is usually, though not always, generated by the system's graphics chip.

Often, the graphics chips used in home computers and video game consoles during the 8-bit era were somewhat limited in their capabilities. For instance, the MOS Technology VIC-II chip used in the Commodore 64 could only handle eight sprites simultaneously. Raster interrupts were sometimes incorporated into these video chips in order to allow skilled programmers to transcend these limitations. An interrupt would be set to trigger when a given screen line was refreshed, and the interrupt routine could then reload the chip's registers. In doing so, multiple graphics modes could be mixed on one screen, the number of sprites could be greatly multiplied, and a portion of the screen could be scrolled while another part remained stationary.

Most, though not all, popular graphics chips of the 8-bit era supported raster interrupts in some form. The C64's VIC-II had a powerful and flexible raster interrupt system, which was used extensively by the demoscene. The ANTIC chip used by the Atari 8-bit family included display list interrupts, which performed much the same function. Some systems did not include native support for raster interrupts, and had to compensate in other ways. The Nintendo Entertainment System's PPU graphics chip did not support true raster interrupts - an interrupt could be set to trigger during the vertical blank interval, but not at any arbitrary scan line - and instead required polling of a "hit flag" that indicated when the first sprite was being drawn. Although early games like Super Mario Bros., Castlevania, and The Legend of Zelda managed to produce effective split-screen scrolling with this method, it was quite CPU-intensive, and some later cartridges incorporated MMC circuitry (most prominently Nintendo's MMC3 chip) that kept track of the PPU's address and data lines and generated raster interrupts.