Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2014-04-12 20:19:14

Akwa
Member
Registered: 2012-06-14
Post 133/140

How do I read the palettes

I had a long break and I pretty much forgot how did we read the Pokemon palette data. If anyone remember, I made amongst others a palette randomizer to my project, but now all my knowledge has evaporated.

Could anyone write me a crash course on how did we read these palettes? Like, explain this Bulbasaur palette data (courtesy of pokecrystal):

link to normal
link to shiny

normal:
RGB 12, 31, 11
RGB 31, 10, 06

shiny:
RGB 20, 28, 11
RGB 31, 10, 06

Here it says the palette data starts at 0xAD86. So i went to hex editor and got:

FF 7D 67 69 12 7F 67 69

Umm, I'm not sure how I get these decimal numbers from this hex data. I know the colors were coded by 15 bits (5 bits per color) with 1 bit being always 0 but it still doesn't tell me anything.
The 31, 10, 06 must be the 67 69 in hex. But how do I get 31 when there are no 5 consecutive 1's in 110011101101001?

Halp.

Last edited by Akwa (2014-04-12 20:21:57)

Offline

#2 2014-04-12 20:42:18

comet
Member
Registered: 2012-04-09
Post 424/673

Re: How do I read the palettes

Akwa wrote:

Here it says the palette data starts at 0xAD86.

PokemonPalettes: ; a8d6

While we're here, monster palettes actually start at Palettes_a8ce. This is why PokemonPalettes appears to be unreferenced. This should be fixed soon.

Last edited by comet (2014-04-12 20:47:12)

Offline

#3 2014-04-12 20:44:37

Crystal_
Member
From: Spain
Registered: 2012-09-16
Post 178/417
Website

Re: How do I read the palettes

There is a little tool called colorpicker that converts RGB to GBC colors. I just don't remeber where I downloaded it, but I think it was here in Skeetendo.

The 15 bits are sorted: GGGRRRRR 0BBBBBGG (for green, the last two are the most significant, and the former three the least significant). It's eight times less precise than RGB (for example anything between 0x08 and 0x0F in RGB translates to 0x01 in GBC).

For example 80,38,10 in RGB becomes:
RRRRR=10000b=0x10, as 0x10 * 0x08 = 0x80
BBBBB=00010b=0x02, as 0x02 * 0x08 = 0x10
GGGGG=00111b=0x07, as 0x07 * 0x08 = 0x38

So if translated to GBC it becomes:
11110000 0001000
0xF0 0x08

Last edited by Crystal_ (2014-04-12 20:45:33)

Offline

#4 2014-04-12 21:45:09

Akwa
Member
Registered: 2012-06-14
Post 134/140

Re: How do I read the palettes

Wow damn I'm so blind.

Thanks for pointing out my mistake and for useful advice guys.

Offline

Board footer

Powered by FluxBB