2.2 Palettes and colours
Although the GBA and DS capable of 16 bit (well 15 bit) colours you usually do not have the ability to define any number of 16 bit colours to use in a given image (remember tiles are like paint by numbers and you might only have 4 bits aka 16 colours at once or 8 bits aka 256 colours at once).
2.2.1 GBA colours (15 bit)
There is an undocumented feature on the GBA (and GBA mode of the DS) that swaps the green and blue but that is not that commonly used.
The GBA is said to be a 16 bit screen but as there are three colours used to make others each 16 bit value is in fact 15 with the 16th bit wasted.
Bits 0 to 4 deal with Red
Bits 5 to 9 deal with Green
Bits 10 to 14 deal with Blue
This allows 32 intensities (consider it a 5 bit number and higher numbers are more intense with lower ones being closer to black4 ).
This also means that depending upon how you look at it the GBA/DS (and SNES) use BGR video instead of the standard RGB notation used almost everywhere else (naturally with printing using different primary colours to light it uses a different colour setup which is usually Cyan Magenta Yellow blacK hence your colour printer usually having four cartridges or ink level displays). The other method of note comes into play usually when video is involved and is known as yuv (which also leads to YV12) but that will be mentioned later and has no effect on any of the standard 2d and 2d imagery used on the GBA or DS.
In most operations the DS and GBA make a palette of various colours using the above method and the imagery refers to this to generate the colours. If you need to turn it into a 32 bit colour value, say for HTML colour notation, most of the time it is directly interpolated (multiply by 7.96875 which is 255 divided by 32) without correction, save maybe for a rounding (this can vary between implementations), and as most screens are not calibrated properly and the GBA/DS screens are not stellar to begin with it works well enough.
It should also be noted the DS has a master brightness section just before the image is displayed and optional capture hardware that change how an image ends up being displayed and this is in addition to some of the extra features afforded to the GBA and DS that will be covered later.
The lower range until at least 10 decimal on the first GBA screens, and in some cases the later ones, are not so good so developers would often manually up the contrast or brightness for their games. This did not do well when the GBA SP arrived and which featured a frontlight, and later a backlight, as standard. To this end several people have hacked and continue to hack GBA games to improve the colours or, in the case of games with originals on the SNES (it also uses a BGR colour model) and such, port colours from the “originals”. It should be noted Donkey Kong Country actually changed far more and downsized some sprites meaning it is not a simple hack to restore it.↩︎