News:

Don't forget to visit the main site! There's lots of helpful docs, patches, and more!

Main Menu

Metroid Fusion - Suit Color Palette Explained?

Started by FlamingCobra, March 28, 2012, 07:32:17 PM

Previous topic - Next topic

FlamingCobra

THESE ARE CODEBREAKER CODES!

I figured this out last year. or last semester... well, last semester was last year. ANYWAY,

F O R M A T :
83004D28 4E73 - ?????
83004D2A 0000 - ?????
83004D2C XXXX - Shoulder, Kneecap, Elbow, part of feet
83004D2E XXXX - Front of Legs (shin), part of back and arm, part of feet
83004D30 XXXX - Back of legs, arms, and backside
83004D32 XXXX - Shadows -- OVERWRITES MAGENTA IN SCREW ATTACK
83004D34 XXXX - Two pixels, one on shoulder, one on leg
83004D36 XXXX - Part of armor layer 2 (yellow areas)
83004D38 XXXX - Part of helmet
83004D3A XXXX - Part of helmet
83004D3C XXXX - Most of helmet (maroon)
83004D3E XXXX - Visor
83004D40 XXXX - Dark Yellow areas on inside of leg
83004D42 XXXX - Backpack (gray), oxygen pipe on helmet, top of arm cannon while running
83004D44 XXXX - One pixel on back, middle of gun while running
83004D46 XXXX - Outline

I think each digit refers to a color value, but this pattern doesn't always seem to work.
X   X   X   X
BLU GRN ??? RED

For example, if you turn digit 1 all the way up, you get medium blue. and if you turn digit four all the way up, you get maroon. but for some reason if you have like 9XXD you can get a bright red or something. I think.  I was hoping I could get some insight into how the colors work.

interdpth

First, those are all memory addresses and not ROM.
Anyway to decode a palette you do this stuff
Windows calculator can do it all.

<< means left shift
palGBA[index + i]= your XXXX number
         R = ((palGBA[index + i] & 0x1F) << 3);
         g = ((palGBA[index + i] >> 5) & 0x1F) << 3;
         b = (((palGBA[index + i] >> 10) & 0x1f) << 3);


         palPC[index + i] = RGB(R, g, b);

Then to get back


clr = Your RGB color >> 3;
         palGBA[index + i] = (u16) ((clr & 0x1F) | (clr & 0x1F00) >> 3 | (clr & 0x1F0000) >> 6);

         // clr = (palPC[index + i]>>3);
         palGBA[index + i] = (u16) (((palPC[index + i] >> 3) & 0x1F) | ((palPC[index + i] >> 3) & 0x1F00) >> 3 | ((palPC[index + i] >> 3) & 0x1F0000) >> 6);

Awesome ain't it!

Yuki

Hmmm... I wonder if this should be moved to the fusion section

FlamingCobra

#3
Quote from: poke2mon3 on March 28, 2012, 07:41:24 PM
Hmmm... I wonder if this should be moved to the fusion section

Oops..........  :heheh:



interdpth, could you give an example of how you would go from an RGB color to the err........ XXXX number. all that code lingo is kind of confusing. If you could do it that way, I'd probably understand it easier and I might understand the codespeak better too.

P.JBoy

When I was making my Phazon suit cheat code, I made this image to shown which RAM address corresponds with which parts of her suit


Using GIMP, you can use the select by colour tool on either her suit or the palette on the right to change all of that colour.  For example, here's what I ended up with for the Phazon suit


The arm cannon uses a separate palette


As for the colour format: it's 15-bit BGR, so as a binary format it's 0bbbbbgggggrrrrr.  The bits 0..4 are red (0x00..0x1F), bits 4..9 are green (0x20..0x3E0), bits 10..14 are blue (0x400..7C00), bit 15 is ignored.

So to get a 15-bit BGR value from three separate blue, green and red intensities:
Find the intensities as a fraction of 0x1F, e.g. red=0x10, green=0x12, blue=0x04.  Now you can turn these into 5-bit binary values (10000, 10010 and 00100) and write them down as a single number: 00100 10010 10000 or 0x1250.  The more programmatic approach follows:
The red intensities can be left as is (0x10).  The green intensity needs to be shifted left 5 bits; you can either use you're binary to hex conversions, multiply by 2 five times, or use Windows' calculator (in hex, 12 Lsh 5) (0x12<<5 = 0x240).  The blue intensity needs to be shifted left 10 bits in much the same way (0x04<<10 = 0x1000).  Add or OR all these together and you have your colour.

To get the three separate intensities (out of 0x1F) from a 15-bit BGR colour:
E.g. 0x4321, in binary: 0 10000 11001 00001.  You could just convert the hex to binary and read the three sets of 5 bits separately, so red is 00001 or 0x01, green is 11001 or 0x19, blue is 10000 or 0x10.  A more programmatic way is with masks and shift rights:
So red is 0x4321 AND 0x1F, the AND 0x1F is the mask, it keeps only bits in both values, and 0x1F is the bottom five bits, giving you the red intensity (0x01); green will be 0x4321>>5 AND 0x1F, this is shifting 0x4321 right five bits to make green the lowest five bits, and applying the same mask, giving (0x4321>>5 = 0x219, 0x219 AND 0x1F = 0x19); blue should be obvious.  ANDs and right shifts can be done in Windows' calculator also, but they should be easy enough to do yourself

bot01

Quote from: FlamingCobra on March 28, 2012, 07:32:17 PM
THESE ARE CODEBREAKER CODES!


83004D28 4E73 - ?????
83004D2A 0000 - ?????
83004D2C XXXX - Shoulder, Kneecap, Elbow, part of feet
83004D2E XXXX - Front of Legs (shin), part of back and arm, part of feet
83004D30 XXXX - Back of legs, arms, and backside
83004D32 XXXX - Shadows -- OVERWRITES MAGENTA IN SCREW ATTACK
83004D34 XXXX - Two pixels, one on shoulder, one on leg
83004D36 XXXX - Part of armor layer 2 (yellow areas)
83004D38 XXXX - Part of helmet
83004D3A XXXX - Part of helmet
83004D3C XXXX - Most of helmet (maroon)
83004D3E XXXX - Visor
83004D40 XXXX - Dark Yellow areas on inside of leg
83004D42 XXXX - Backpack (gray), oxygen pipe on helmet, top of arm cannon while running
83004D44 XXXX - One pixel on back, middle of gun while running
83004D46 XXXX - Outline



someone knows the equivalent codes for the JAP version?