In a character-cell display system, a "nametable" is a table of tile indexes and their on-screen attributes. For example, to write a string to the screen, copy the string to the nametable and set the attributes to display the proper color.

NES nametable format

Bytes $000 to $3bf of an NES nametable are raw tile indexes. Bytes $3c0 to $3ff each control the palette of a 4x4 square of tiles; each 2-bit field controls a 2x2 tile area.

||||||++- Palette for top left
||||++--- Palette for top right
||++----- Palette for bottom left
++------- Palette for bottom right

CGA/EGA/VGA nametable format

fedcba98 76543210
|||||||| ||||||||
|||||||| ++++++++- Tile index
||||++++---------- Foreground color
|+++-------------- Background color
+----------------- Blink, or bit 3 of bg color

SNES nametable format

fedcba98 76543210
vhpcccnn nnnnnnnn
|||||||| ||||||||
||||||++-++++++++- Tile index
|||+++------------ Color palette index
||+--------------- Priority (in front of or behind sprites?)
|+---------------- Horizontal flip
+----------------- Vertical flip

Sega Genesis nametable format

pccvhnnn nnnnnnnn
|||||||| ||||||||
|||||+++-++++++++- Tile index
||||+------------- Horizontal flip
|||+-------------- Vertical flip
|++--------------- Color palette index
+----------------- Priority

DISCLAIMER: Specific systems' nametable formats are probably very inaccurate.

Log in or registerto write something here or to contact authors.