NES PPU Bitplane Decomposer

SPK-101 interactive · step through a 16-byte sprite tile one pixel at a time · see the two-plane combination resolve into the displayed 8x8 color tile · return to SPK-101

How an NES tile is stored in memory

An NES sprite tile is an 8 by 8 grid of pixels. Each pixel can be one of four colors (indices 0, 1, 2, 3). Two bits per pixel times 64 pixels equals 128 bits, which is 16 bytes.

The 16 bytes are split into two separate 8-byte planes. Plane A holds bytes 0 through 7 (one bit per pixel for the low bit of the color index). Plane B holds bytes 8 through 15 (the high bit). For each pixel at row r and column c, take bit (7 minus c) of Plane A row r and bit (7 minus c) of Plane B row r. Combine them with this formula:

Color index = (PlaneB << 1) | PlaneA

Pick one of the built-in tiles below and click Start. The decomposer walks each of the 64 pixels in order (row 0 left to right, then row 1, and so on), highlights the two source bits, and writes the color index into the output grid. The math for each cell appears in the callout below the controls.

Anchor: SPK-101 Weeks 4-6 (palette swap, sprite editing, ROM hacking) ask you to recognize and edit these byte patterns. This decomposer is the live version of the paper Bitplane Decomposer cognitive tool in the SPK-101 younger-learner supplement.

Idle (no cell selected)

Tile bytes (editable)

Row Plane A (low bit) Plane B (high bit)

Decomposition

Plane A (low bit of color)

Bit b of row r contributes to pixel (r, 7 minus b).

Plane B (high bit of color)

Same bit-position rule. Combined with Plane A in the output below.

Output 8x8 tile

Color = (PlaneB shifted left 1) OR PlaneA. Step to fill cell by cell.

0 = transparent/black 1 = red 2 = green 3 = blue
Press Start, then Step (or Step all) to walk through the 64 pixels. The cell currently being decomposed appears highlighted in all three grids; the math appears here.