Difference between revisions of "Palettes"

From Data Crystal
Jump to navigation Jump to search
Line 4: Line 4:
 
The SNES uses a 15-bit format to describe a single color entry. 5 bits are allocated to each of the three red, green, and blue color components. Therefore, a single color is stored in two bytes, as such:
 
The SNES uses a 15-bit format to describe a single color entry. 5 bits are allocated to each of the three red, green, and blue color components. Therefore, a single color is stored in two bytes, as such:
  
0BBBBBGG GGGRRRRR
+
0BBBBBGG GGGRRRRR
  
Note that colors are stored in little-endian format, exactly as shown. In other words, when read as a 16-bit [[Binary#Word|word]], the most significant bit of the least significant byte is 0. For example, full intensity blue would be stored as 01111100 00000000 [78 00], but would be read as 00000000 01111100 or simply [78].
+
Note that colors are stored in little-endian format, exactly as shown. In other words, when read as a 16-bit [[Binary#Word|word]], the most significant bit of the least significant byte is 0. For example, full intensity blue would be stored in-ROM as [7C 00]:
 +
 
 +
01111100 00000000
 +
 
 +
but would be read as $007C, or simply $7C:
 +
 
 +
00000000 01111100
  
 
{{stub}}
 
{{stub}}

Revision as of 13:22, 5 August 2008

A palette is a limited index of colors defined as a subset of the total range of displayable colors. Any given game will generally contain many such palettes.

SNES Palettes

The SNES uses a 15-bit format to describe a single color entry. 5 bits are allocated to each of the three red, green, and blue color components. Therefore, a single color is stored in two bytes, as such:

0BBBBBGG GGGRRRRR

Note that colors are stored in little-endian format, exactly as shown. In other words, when read as a 16-bit word, the most significant bit of the least significant byte is 0. For example, full intensity blue would be stored in-ROM as [7C 00]:

01111100 00000000

but would be read as $007C, or simply $7C:

00000000 01111100