Display/Tile Data
Tile data
The tile data is stored at a fixed memory location:
- $2000 - $3FFF for 2 bit per pixel tiles in "mono" mode, for a total of 512 tiles.
- $2000 - $5FFF for 2 bit per pixel tiles in "color" mode, for a total of 1024 tiles.
- $4000 - $BFFF for 4 bit per pixel tiles in "color" mode, for a total of 1024 tiles.
Tile data formats
2 bits per pixel, planar
The tiles are stored in an interleaved planar format, with two bits total for every pixel. Odd bytes store the first plane (bit 0 of each pixel), while even bytes store the second plane (bit 1 of each pixel).
tile data (16 bytes) 01 7C 01 FC 00 C0 18 D8 18 D8 00 C0 00 00 C0 00 || \/ plane 0 plane 1 7 bit 0 7 bit 0 full tile ---- ---- ---- ---- .... ...1 = 01 .222 22.. = 7C .22222.1 .... ...1 = 01 2222 22.. = FC 222222.1 .... .... = 00 22.. .... = C0 22...... ...1 1... = 18 22.2 2... = D8 --\ 22.33... ...1 1... = 18 22.2 2... = D8 --/ 22.33... .... .... = 00 22.. .... = C0 22...... .... .... = 00 .... .... = 00 ........ 11.. .... = C0 .... .... = 00 11......
This matches the format used by the Game Boy.
4 bits per pixel, planar
This mode is stored in a manner similar to the 2 bits per pixel mode, but with an additional two planes for bit 2 and bit 3 of each pixel's palette index, expanding the tile data to 32 bytes.
tile data (32 bytes) 54 32 01 00 54 32 F1 00 54 32 01 F0 54 32 F1 F0 04 02 01 00 F8 04 02 01 00 F8 04 02 00 00 F8 04 || \/ plane 0 plane 1 plane 2 plane 3 7 bit 0 7 bit 0 7 bit 0 7 bit 0 full tile ---- ---- ---- ---- ---- ---- ---- ---- .1.1 .1.. = 54 ..22 ..2. = 32 .... ...4 = 01 .... .... = 00 .123.124 .1.1 .1.. = 54 ..22 ..2. = 32 4444 ...4 = F1 .... .... = 00 4567.124 .1.1 .1.. = 54 ..22 ..2. = 32 .... ...4 = 01 8888 .... = F0 89AB.124 .1.1 .1.. = 54 ..22 ..2. = 32 4444 ...4 = F1 8888 .... = F0 --\ CDEF.124 .... .1.. = 04 .... ..2. = 02 .... ...4 = 01 .... .... = 00 --/ .....124 1111 1... = F8 .... .2.. = 04 .... ..4. = 02 .... ...8 = 01 11111248 .... .... = 00 2222 2... = F8 .... .4.. = 04 .... ..8. = 02 2222248. .... .... = 00 .... .... = 00 4444 4... = F8 .... .8.. = 04 444448..
This format matches the one used by the Sega Master System and Game Gear family of consoles.
4 bits per pixel, packed
Unlike the previous two formats, in the packed format each byte stores the complete palette index of two pixels - the high four bits store the left pixel, while the low four bits store the right pixel. Four such bytes make up a row of eight pixels from left to right.
tile data (32 bytes) 01 23 01 24 45 67 01 24 89 AB 01 24 CD EF 01 24 00 00 01 24 11 11 12 48 22 22 24 80 44 44 48 00 || \/ byte 0 1 2 3 bits 7-4 3-0 7-4 3-0 7-4 3-0 7-4 3-0 pixel 0 1 2 3 4 5 6 7 full tile --- --- --- --- --- --- --- --- . 1 = 01 2 3 = 23 . 1 = 01 2 4 = 24 .123.124 = 01 23 01 24 4 5 = 45 6 7 = 67 . 1 = 01 2 4 = 24 4567.124 = 45 67 01 24 8 9 = 89 A B = AB . 1 = 01 2 4 = 24 89AB.124 = 89 AB 01 24 C D = CD E F = EF . 1 = 01 2 4 = 24 --\ CDEF.124 = CD EF 01 24 . . = 00 . . = 00 . 1 = 01 2 4 = 24 --/ .....124 = 00 00 01 24 1 1 = 11 1 1 = 11 1 2 = 12 4 8 = 48 11111248 = 11 11 12 48 2 2 = 22 2 2 = 22 2 4 = 24 8 . = 80 2222248. = 22 22 24 80 4 4 = 44 4 4 = 44 4 8 = 48 . . = 00 444448.. = 44 44 48 00
This format matches the one used by the Mega Drive console.