PPU pattern tables: Difference between revisions

From NESdev Wiki
Jump to navigationJump to search
(Origin of "left" and "right" nicknames)
Line 1: Line 1:
There are two pattern tables, one at $0000 and one at $1000. Each tile in the pattern table is 16 bytes, made of two planes. The first plane controls bit 0 of the color; the second plane controls bit 1. Any pixel whose color is 0 is background/transparent (represented by '.' in the following diagram):
Backgrounds and sprites are drawn with tiles.
The pattern table, at $0000-$1FFF in PPU address space, defines the shapes of these tiles.
Each tile in the pattern table is 16 bytes, made of two planes.
The first plane controls bit 0 of the color; the second plane controls bit 1. Any pixel whose color is 0 is background/transparent (represented by '.' in the following diagram):


  Bit Planes            Pixel Pattern
  Bit Planes            Pixel Pattern
Line 19: Line 22:
  $0xxE=$42  01000010
  $0xxE=$42  01000010
  $0xxF=$87  10000111
  $0xxF=$87  10000111
The pattern table is divided into two 256-tile sections: $0000-$0FFF, nicknamed "left", and $1000-$1FFF, nicknamed "right".
(The nicknames come from how emulators with a debugger display the pattern table, as 128x128 pixel square and laid them out side by side.)

Revision as of 13:09, 28 March 2010

Backgrounds and sprites are drawn with tiles. The pattern table, at $0000-$1FFF in PPU address space, defines the shapes of these tiles. Each tile in the pattern table is 16 bytes, made of two planes. The first plane controls bit 0 of the color; the second plane controls bit 1. Any pixel whose color is 0 is background/transparent (represented by '.' in the following diagram):

Bit Planes            Pixel Pattern
$0xx0=$41  01000001
$0xx1=$C2  11000010
$0xx2=$44  01000100
$0xx3=$48  01001000
$0xx4=$10  00010000
$0xx5=$20  00100000         .1.....3
$0xx6=$40  01000000         11....3.
$0xx7=$80  10000000  =====  .1...3..
                            .1..3...
$0xx8=$01  00000001  =====  ...3.22.
$0xx9=$02  00000010         ..3....2
$0xxA=$04  00000100         .3....2.
$0xxB=$08  00001000         3....222
$0xxC=$16  00010110
$0xxD=$21  00100001
$0xxE=$42  01000010
$0xxF=$87  10000111

The pattern table is divided into two 256-tile sections: $0000-$0FFF, nicknamed "left", and $1000-$1FFF, nicknamed "right". (The nicknames come from how emulators with a debugger display the pattern table, as 128x128 pixel square and laid them out side by side.)