2bpp Graphics Format
Palette
The Game Boy palette consists of 4 slots for color data at memory address 0xFF47. The slots are as follows
The four possible colors that can fit in each slot are:
- 0 (0b00) - White
- 1 (0b01) - Light Gray
- 2 (0b10) - Dark Gray
- 3 (0b11) - Black
Any of the 4 colors can go into any of the 4 palette slots. As an example, a palette with the order slot index 0 = White, slot index 1 = Light Gray, slot index 2 = Dark Gray, and slot index 4 = Black would require writing the following byte to memory address 0xFF47:
Inverting the previous example, so having the order be slot index 0 = Black, slot index 1 = Dark Gray, slot index 2 = Light Gray, and slot index 3 = White, would require the following byte to be written to memory address 0xFF47:
A monochrome version, which converts anything that isn't black to white, of the first palette example, so having the order be slot index 0 = white, slot index 1 = white, slot index 2 = white, slot index 3 = black, would require the following byte to be written to memory address 0xFF47:
Tiles
Each Game Boy tile is an 8x8 pixel graphic with only 2 bits of palette slot index data per pixel. Because there are 2 bits per pixel, there are 8 rows each of 16 bits of palette slot index data per tile, totalling 128 bits (16 bytes) of palette slot index data per tile.
A Game Boy tile is represented below as palette slot index numbers in an 8 by 8 grid:
Each row of indexes is represented by first taking the 8 least significant bits of the row, then taking the 8 most significant bytes of the row, this is shown below for the previous tile example:
The tile example would be represented in graphical memory on the Game Boy as the following: