#22112 - SiN - Sun Jun 13, 2004 3:54 pm
hi guys,
right then, im a bit of a gba n00b, but not a coding n00b ... have a good 9 years of experience behind me. However, ive never been good with all the low-level stuff which is y im having a bit of trouble with the gba. heres the problem ...
... im in the lucky position to kno EXACTLY what colours i want in my palette, in what order i want them, and which colours are gonna be used in my image. the problem is that i dont seem to quite understand the image/palette format.
heres an image i got from the gbajunkie tutorial (obviously ive cut it down)
first off, i kno that all the numbers are in hex, and i can read&write hex no prob. however, i dont understand why the "x" is there ... what is it for? im guessing its an operator or something ... its not important, but it would be nice to kno.
the second array "junkiePalette", i figure holds the pallete :) ... and the numbers range from 0-32767, since each component has a 32 colour range. but im not quite sure HOW the # is generated ... any1 care to explain what the formula is? i figure its r*g*b, but im not sure.
finally and most importantly, i cant figure out what is stored in the first array ... naturally its the image itself, but i figured the numbers would be between 0-255 (so each represents a colour from the palette) ... its not ... the numbers are WAY out there ... i kno it stores the image, but i dont kno what format its in. could some1 explain?
any help is appreciated.
SiN
right then, im a bit of a gba n00b, but not a coding n00b ... have a good 9 years of experience behind me. However, ive never been good with all the low-level stuff which is y im having a bit of trouble with the gba. heres the problem ...
... im in the lucky position to kno EXACTLY what colours i want in my palette, in what order i want them, and which colours are gonna be used in my image. the problem is that i dont seem to quite understand the image/palette format.
heres an image i got from the gbajunkie tutorial (obviously ive cut it down)
Code: |
const u16 junkieData[] = { 0x81AC, 0x81AC, 0x81AC, 0xAC81, 0xAC81, 0xACAC, 0x8181, 0x8181, 0x8181, 0x81AC, 0x8181, 0x8181, 0x81AC, 0xACAC, 0xACAC, 0xACAC, 0x8181, 0x81AC, 0xAC81, 0x8181, 0x81AC, 0xAC81, 0x8181, 0x81AC, 0xAC81, 0xAC81, 0x81AC, 0x8181, 0x8181, 0xAC81, .................. 0xD7D7, 0xD7AC, 0xD7D7, 0xD7AC, 0xD7D7, 0xD7D7, 0xD7AC, 0xACD7, 0xD7D7, 0xD7D7, 0xACD7, 0xD7D7, 0xACD7, 0xD7D7, 0xD7AC, 0xD7D7, 0xD7AC, 0xACD7, 0xD7D7, 0xD7D7, 0xD7AC, 0xD7D7, 0xD7D7, 0xD7D7, 0xD7D7, 0xD7D7, 0xACD7, 0xD7D7, 0xACD7, 0xD7D7,}; const u16 junkiePalette[] = { 0x0000, 0x1800, 0x3000, 0x4C00, 0x6400, 0x7C00, 0x0006, 0x1806, 0x3006, 0x4C06, 0x6406, 0x7C06, 0x000C, 0x180C, 0x300C, 0x4C0C, 0x640C, 0x7C0C, 0x0013, 0x1813, 0x3013, 0x4C13, 0x6413, 0x7C13, 0x0019, 0x1819, 0x3019, 0x4C19, 0x6419, 0x7C19, 0x03FF, 0x1BFF, 0x33FF, 0x4FFF, 0x67FF, 0x7FFF, 0x0000, 0x0000, 0x0000, 0x0000, .................. 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,}; |
first off, i kno that all the numbers are in hex, and i can read&write hex no prob. however, i dont understand why the "x" is there ... what is it for? im guessing its an operator or something ... its not important, but it would be nice to kno.
the second array "junkiePalette", i figure holds the pallete :) ... and the numbers range from 0-32767, since each component has a 32 colour range. but im not quite sure HOW the # is generated ... any1 care to explain what the formula is? i figure its r*g*b, but im not sure.
finally and most importantly, i cant figure out what is stored in the first array ... naturally its the image itself, but i figured the numbers would be between 0-255 (so each represents a colour from the palette) ... its not ... the numbers are WAY out there ... i kno it stores the image, but i dont kno what format its in. could some1 explain?
any help is appreciated.
SiN