On the Master System and Game Gear using Mode 4, each tile graphic is 8x8 pixels in size, and uses 4 bits per pixel (4bpp).
As 4 bits can store 16 different values (0 to 15), a tile can have 16 different colours. The colour that each value equates to is taken from the Palettes. Sprites use a palette of 16 colours, and background tiles can either use the 16 colour background palette or the sprite palette.

Each tile is 32 bytes in size - which you can calculate by saying (8 pixels * 8 pixels * 4 bits per pixel) / 8 bits per byte = 32 bytes.

Tile graphics are not stored as might be expected with the 4 bits for each pixel stored together - they are stored as bitplanes.

Bitplanes

With bitplanes each bit of each pixel is taken separately, from lowest bit to highest bit, and stored with the bits from the same position from all of the other pixels in that row.

For example:

If the values of the first row of 8 pixels in a tile (before conversion) are
1537820112
We can look at the bits for each value
11110011011110000010000000011100
Then get bit 0 (the lowest/rightmost bit) of all of the values
11100010
Then put them all together into one byte
11100010

The bitplanes are stored so that the bitplanes for the first row are together, going from lowest to highest bit, followed by the bitplanes for the next row, i.e.

row 0 bitplane 0row 0 bitplane 1row 0 bitplane 2row 0 bitplane 3
row 1 bitplane 0row 1 bitplane 1row 1 bitplane 2row 1 bitplane 3
............
row 6 bitplane 0row 6 bitplane 1row 6 bitplane 2row 6 bitplane 3
row 7 bitplane 0row 7 bitplane 1row 7 bitplane 2row 7 bitplane 3



Return to top
0.19s