Page 1 of 1

Help to find the color palettes of fighters and stages in sf2ce

Posted: Mon Jul 27, 2020 8:10 pm
by supneo
Hello, I would like to know if anyone has or knows the color palette codes of the fighters and scenarios of the street fighter 2 champion edition for the GeckoGrabber.

I have these that I have found but I can't find any more, can anyone help me? Thanks.

chunli = A4328
ryu = A4288
ken = A4308
E.honda = A47A8
Guile : A42E8
Dhalsim = A4368
zangief = A4348
blanka = A42C8 ; A5448
vega = 30dc4 ; A5A68
Balrog = 0A5868
Sagat = A5668
M.bison = 0A5468

Re: Help to find the color palettes of fighters and stages in sf2ce

Posted: Wed Jul 29, 2020 7:58 pm
by Gnawtor
$0A5868 = Balrog Sprite
$0A5468 = M.Bison Sprite

Those are the only ones I have in my notes other than Vega. Here's how you can track the rest of them down, though.

In MAME press F4 to bring up the graphics viewer. By default it should bring up the palette screen which displays palettes that are currently loaded into VRAM. Use Page Up and Page Down to view all the palettes. Each screen layer has 32 palettes available (MAME only displays 16 at a time) and they are displayed in this order: OBJ (sprites), SCROLL1, SCROLL2, SCROLL3, and Starfield (rarely used). So, the first 32 palettes MAME displays will be for sprites. It will only display which palettes are currently loaded into memory, but in most cases you should be able to search for them in the ROM with a hex editor.

It works like this: Each CPS1 color is 2 bytes in length (so a full palette is 32 bytes in length) Each nybble controls something different:

XRGB
X = Brightness (0 - F, darkest - brightest)
R = Red
G = Green
B = Blue

MAME converts each CPS1 color up to 24 bit color by multiplying each color channel value by 0x11. This might sound complicated, but it really isn't. For example, a CPS1 color with RGB of FB8 would become #FFBB88 when converted to 24 bit.

Hovering over the first several colors of Ryu's palette in MAME's graphics viewer, it gives us the values:
R:11 G:11 B:11
R:FF G:DD B:99
R:FF G:BB B:88

The math is straightforward enough that all we need to do is turn each of those values into a single digit and write them in the XRGB format I explained earlier. So to find Ryu's palette, load up the program ROM in a hex editor and search for the hex values: 0111 0FD9 0FB8. There are actually several palettes that contain this sequence of colors, so you might want to narrow your search a bit further than this example. It helps to include some distinct colors like clothing details. Your mileage may vary. Note that the brightness nybble in our search values is zero. All the palettes I've found in SFII:CE have their brightness at zero by default, but this isn't true across all CPS1 games. Other games (like Final Fight) have full brightness set by default in their palettes, so with other games if your searches are coming up dry, try searching with a brightness value of F instead of 0

Hope that makes sense, let me know if it doesn't

Re: Help to find the color palettes of fighters and stages in sf2ce

Posted: Sat Aug 01, 2020 12:39 pm
by supneo
Gnawtor wrote:
Wed Jul 29, 2020 7:58 pm
$0A5868 = Balrog Sprite
$0A5468 = M.Bison Sprite

Those are the only ones I have in my notes other than Vega. Here's how you can track the rest of them down, though.

In MAME press F4 to bring up the graphics viewer. By default it should bring up the palette screen which displays palettes that are currently loaded into VRAM. Use Page Up and Page Down to view all the palettes. Each screen layer has 32 palettes available (MAME only displays 16 at a time) and they are displayed in this order: OBJ (sprites), SCROLL1, SCROLL2, SCROLL3, and Starfield (rarely used). So, the first 32 palettes MAME displays will be for sprites. It will only display which palettes are currently loaded into memory, but in most cases you should be able to search for them in the ROM with a hex editor.

It works like this: Each CPS1 color is 2 bytes in length (so a full palette is 32 bytes in length) Each nybble controls something different:

XRGB
X = Brightness (0 - F, darkest - brightest)
R = Red
G = Green
B = Blue

MAME converts each CPS1 color up to 24 bit color by multiplying each color channel value by 0x11. This might sound complicated, but it really isn't. For example, a CPS1 color with RGB of FB8 would become #FFBB88 when converted to 24 bit.

Hovering over the first several colors of Ryu's palette in MAME's graphics viewer, it gives us the values:
R:11 G:11 B:11
R:FF G:DD B:99
R:FF G:BB B:88

The math is straightforward enough that all we need to do is turn each of those values into a single digit and write them in the XRGB format I explained earlier. So to find Ryu's palette, load up the program ROM in a hex editor and search for the hex values: 0111 0FD9 0FB8. There are actually several palettes that contain this sequence of colors, so you might want to narrow your search a bit further than this example. It helps to include some distinct colors like clothing details. Your mileage may vary. Note that the brightness nybble in our search values is zero. All the palettes I've found in SFII:CE have their brightness at zero by default, but this isn't true across all CPS1 games. Other games (like Final Fight) have full brightness set by default in their palettes, so with other games if your searches are coming up dry, try searching with a brightness value of F instead of 0

Hope that makes sense, let me know if it doesn't
Hi, thanks for the explanation Gnawtor, as you told me I found the palettes, some repeated that have the same colors but are used for other things, I edit my first post putting the palette codes in case someone needs them, greetings.