Picture Processing Unit
Encyclopedia
The PPU, more specifically known as Ricoh
RP2C02 (NTSC
version) / RP2C07 (PAL
version), is the microprocessor
in the Nintendo Entertainment System
responsible for generating video signals from graphic data stored in memory.
The chip is known for its effective use of memory, using very little memory to store graphical data. It was rather advanced for its time when the Famicom
(Japanese version of the Nintendo Entertainment System) was released, sporting full sprite
support, movable backgrounds, and many colors on screen at the same time. To compete with other video game systems, like the graphically superior Sega Master System
, Nintendo
also extended the PPU's technical capabilities through the use of mappers
, which were placed on the game cartridge. The mappers added more memory or could bank switch data into the PPU's address space
, making it possible to create more advanced graphics, using more colors and bigger tile sets.
visible in the CPU's address space in the addresses $2000 through $2007. All data and information is passed to the PPU through these, except the raw tile data (there are exceptions, as some games had RAM instead of ROM to store the tile data, and the tiles had to be written each time), which is hardwired to the PPU's address space. The PPU uses the tile graphics data together with information stored by the program in the PPU's RAM, such as color and position, to render the final graphical output to the screen.
The lowest graphical components the PPU operates with are tile
s, which are blocks of 8×8 or 8×16 pixels. The tiles are stored in a ROM
chip on the game cartridge. The tiles are the basic building blocks, used to create larger moving objects, or large static backgrounds.
Essentially, the PPU supports two different kinds of objects: movable (sprites) and non-movable (background). Both kind of objects are basically a tile, and moreover a sprite and background object can use the same tile. The difference is that a tile used as a sprite can move around, whereas a tile used as a background cannot.
Sprite data is stored in a special memory called the "Sprite-RAM" or "SPR-RAM" for short, which is a 256-byte memory built into the PPU core. The data stored here is 4 bytes; the position, color and tile, for each of the 64 sprites. This data is used by the PPU to place the sprite when it renders
the frame. Background objects, however, are stored in a much less exclusive way, which is more like the way characters are stored in text mode
on PCs
. A background is defined by a simple data structure called a nametable, which is essentially a two dimensional array. The integer value in each array slot corresponds to a tile number, and the index values of this slot correspond to the tile's intended x/y position on screen. The PPU has, without the use of memory mappers, two nametables, so smooth scrolling between backgrounds is possible.
A color palette must be defined in order to show graphics on the screen. It is stored in a separate 32 byte location in RAM, known as "palette-RAM". Each entry here picks a color from the hardware color palette, which are the predefined colors to choose between. 16 colors can be chosen for sprites, and 16 colors for backgrounds. However, bytes 4, 8 and 12 of the sprite palette, and bytes 0, 4, 8, and 12 of the background palette, are not in use by the PPU. Therefore, the number of actually usable colors is reduced to 25 instead of 32. The first byte of the sprite palette also defines the global background color for both sprites and the background.
Ricoh
or Ricoh, is a Japanese company that was established in 1936 on February 6th, as , a company in the RIKEN zaibatsu. Its headquarters is located in Ricoh Building in Chūō, Tokyo....
RP2C02 (NTSC
NTSC
NTSC, named for the National Television System Committee, is the analog television system that is used in most of North America, most of South America , Burma, South Korea, Taiwan, Japan, the Philippines, and some Pacific island nations and territories .Most countries using the NTSC standard, as...
version) / RP2C07 (PAL
PAL
PAL, short for Phase Alternating Line, is an analogue television colour encoding system used in broadcast television systems in many countries. Other common analogue television systems are NTSC and SECAM. This page primarily discusses the PAL colour encoding system...
version), is the microprocessor
Microprocessor
A microprocessor incorporates the functions of a computer's central processing unit on a single integrated circuit, or at most a few integrated circuits. It is a multipurpose, programmable device that accepts digital data as input, processes it according to instructions stored in its memory, and...
in the Nintendo Entertainment System
Nintendo Entertainment System
The Nintendo Entertainment System is an 8-bit video game console that was released by Nintendo in North America during 1985, in Europe during 1986 and Australia in 1987...
responsible for generating video signals from graphic data stored in memory.
The chip is known for its effective use of memory, using very little memory to store graphical data. It was rather advanced for its time when the Famicom
Nintendo Entertainment System
The Nintendo Entertainment System is an 8-bit video game console that was released by Nintendo in North America during 1985, in Europe during 1986 and Australia in 1987...
(Japanese version of the Nintendo Entertainment System) was released, sporting full sprite
Sprite (computer graphics)
In computer graphics, a sprite is a two-dimensional image or animation that is integrated into a larger scene...
support, movable backgrounds, and many colors on screen at the same time. To compete with other video game systems, like the graphically superior Sega Master System
Sega Master System
The is a third-generation video game console that was manufactured and released by Sega in 1985 in Japan , 1986 in North America and 1987 in Europe....
, Nintendo
Nintendo
is a multinational corporation located in Kyoto, Japan. Founded on September 23, 1889 by Fusajiro Yamauchi, it produced handmade hanafuda cards. By 1963, the company had tried several small niche businesses, such as a cab company and a love hotel....
also extended the PPU's technical capabilities through the use of mappers
Multi-Memory Controller
Multi-Memory Controllers or Memory Management Controllers are different kinds of special chips designed by various video game developers for use in Nintendo Entertainment System cartridges...
, which were placed on the game cartridge. The mappers added more memory or could bank switch data into the PPU's address space
Address space
In computing, an address space defines a range of discrete addresses, each of which may correspond to a network host, peripheral device, disk sector, a memory cell or other logical or physical entity.- Overview :...
, making it possible to create more advanced graphics, using more colors and bigger tile sets.
Key features
- 2KB external RAMRam-Animals:*Ram, an uncastrated male sheep*Ram cichlid, a species of freshwater fish endemic to Colombia and Venezuela-Military:*Battering ram*Ramming, a military tactic in which one vehicle runs into another...
for graphics information storage - 256 bytes for spriteSprite (computer graphics)In computer graphics, a sprite is a two-dimensional image or animation that is integrated into a larger scene...
data storage - 32 bytes for palette storage
- 8 × 8 or 8 × 16 (selectable) sized tileTileA tile is a manufactured piece of hard-wearing material such as ceramic, stone, metal, or even glass. Tiles are generally used for covering roofs, floors, walls, showers, or other objects such as tabletops...
s - Two 4KB tile sets with space for 256 tiles each
- Up to 64 sprites (movable objects) on screen simultaneously (only 8 visible per scan lineScan lineA scan line or scanline is one line, or row, in a raster scanning pattern, such as a line of video on a cathode ray tube display of a television set or computer monitor....
) - 25 colors simultaneously (although more colors are possible using programming tricks) from a hardware color palettePalette (computing)In computer graphics, a palette is either a given, finite set of colors for the management of digital images , or a small on-screen graphical element for choosing from a limited set of choices, not necessarily colors .Depending on the context In computer graphics, a palette is either a given,...
of 64 colors - Picture resolution of 256 × 240 pixels (fully visible on PAL, but cropped to 256 × 224 on most NTSCNTSCNTSC, named for the National Television System Committee, is the analog television system that is used in most of North America, most of South America , Burma, South Korea, Taiwan, Japan, the Philippines, and some Pacific island nations and territories .Most countries using the NTSC standard, as...
television sets)
Technical information
The PPU is controlled via eight registersProcessor register
In computer architecture, a processor register is a small amount of storage available as part of a CPU or other digital processor. Such registers are addressed by mechanisms other than main memory and can be accessed more quickly...
visible in the CPU's address space in the addresses $2000 through $2007. All data and information is passed to the PPU through these, except the raw tile data (there are exceptions, as some games had RAM instead of ROM to store the tile data, and the tiles had to be written each time), which is hardwired to the PPU's address space. The PPU uses the tile graphics data together with information stored by the program in the PPU's RAM, such as color and position, to render the final graphical output to the screen.
The lowest graphical components the PPU operates with are tile
Tile
A tile is a manufactured piece of hard-wearing material such as ceramic, stone, metal, or even glass. Tiles are generally used for covering roofs, floors, walls, showers, or other objects such as tabletops...
s, which are blocks of 8×8 or 8×16 pixels. The tiles are stored in a ROM
Read-only memory
Read-only memory is a class of storage medium used in computers and other electronic devices. Data stored in ROM cannot be modified, or can be modified only slowly or with difficulty, so it is mainly used to distribute firmware .In its strictest sense, ROM refers only...
chip on the game cartridge. The tiles are the basic building blocks, used to create larger moving objects, or large static backgrounds.
Essentially, the PPU supports two different kinds of objects: movable (sprites) and non-movable (background). Both kind of objects are basically a tile, and moreover a sprite and background object can use the same tile. The difference is that a tile used as a sprite can move around, whereas a tile used as a background cannot.
Sprite data is stored in a special memory called the "Sprite-RAM" or "SPR-RAM" for short, which is a 256-byte memory built into the PPU core. The data stored here is 4 bytes; the position, color and tile, for each of the 64 sprites. This data is used by the PPU to place the sprite when it renders
Rendering (computer graphics)
Rendering is the process of generating an image from a model , by means of computer programs. A scene file contains objects in a strictly defined language or data structure; it would contain geometry, viewpoint, texture, lighting, and shading information as a description of the virtual scene...
the frame. Background objects, however, are stored in a much less exclusive way, which is more like the way characters are stored in text mode
Text mode
Text mode is a kind of computer display mode in which the content of the screen is internally represented in terms of characters rather than individual pixels. Typically, the screen consists of a uniform rectangular grid of character cells, each of which contains one of the characters of a...
on PCs
Personal computer
A personal computer is any general-purpose computer whose size, capabilities, and original sales price make it useful for individuals, and which is intended to be operated directly by an end-user with no intervening computer operator...
. A background is defined by a simple data structure called a nametable, which is essentially a two dimensional array. The integer value in each array slot corresponds to a tile number, and the index values of this slot correspond to the tile's intended x/y position on screen. The PPU has, without the use of memory mappers, two nametables, so smooth scrolling between backgrounds is possible.
A color palette must be defined in order to show graphics on the screen. It is stored in a separate 32 byte location in RAM, known as "palette-RAM". Each entry here picks a color from the hardware color palette, which are the predefined colors to choose between. 16 colors can be chosen for sprites, and 16 colors for backgrounds. However, bytes 4, 8 and 12 of the sprite palette, and bytes 0, 4, 8, and 12 of the background palette, are not in use by the PPU. Therefore, the number of actually usable colors is reduced to 25 instead of 32. The first byte of the sprite palette also defines the global background color for both sprites and the background.