The second main component of the Nintendo system is the Picture Processing Unit (PPU). This is responsible for drawing the graphical output to the screen 50 times a second (NTSC refresh rate). The graphics pipeline is defined fairly specifically by the emulator authors since this is critical to getting the game code to work with the graphics system to draw the correct output.
Nintendo Graphics is a tile based rendering system. The graphical unit which composes all the objects on the screen consists of an 8x8 pixel tile called a Pattern. The screen resolution is 256x240 which corresponds to 32x30 tiles to construct the background. The background is also capable of scrolling across two screens. A screen is constructed using a Name Table which maps each 8x8 region on the screen to a pattern inside of a Pattern Table, a table of all the patterns available.
Also, Sprites, characters which are free to move about anywhere on the screen, are also composed from either one or two 8x8 tiles from the pattern tables. Each sprite has an x and y location where it is placed on the screen.
Figure 2: This diagram gives a graphical breakdown the of
the Nintendo graphics. The screen is divided up in to 32x30 grid
where each tile is mapped to a pattern through the Name table.
Dedicated sprite memory also uses the pattern table to place the
sprites.
Furthermore, the Nintendo is capable of displaying 16 colors at a time on the screen. The pattern tables contain 2 of the four bits of color. The remaining two bits come from a separate Attribute Table which defines the remaining two bits for each 32x32 pixel area on the screen. Finally these four bits are looked up into a two separate palettes, one for the background, another for the sprites. With only 16 colors to work with, having these different levels of indirection allow for minimizing memory usage inside of the pattern tables but still allow for plenty of graphical functionality and sharing of pattern tiles.
The CPU code needs to setup each of these tables and palettes for the graphics to work correctly. Once set up, the PPU unit will construct a graphics frame, however its up to the CPU to perform all the necessary setup.
The functionality of PPU is quite different than the CPU since it is not an instruction set driven device. Its behavior is predetermined and there are no instructions to indicate what register are required.