News: 11 March 2016 - Forum Rules

Author Topic: [GBA] Super Puzzle Fighter II change to Color-blind friendly  (Read 3650 times)

theColorsGuy

  • Jr. Member
  • **
  • Posts: 4
    • View Profile
[GBA] Super Puzzle Fighter II change to Color-blind friendly
« on: November 24, 2016, 11:50:01 am »
Hi,

I'm trying to change some colors in Super Puzzle Fighter II but it is more complicated than expected.

I did the same with Super Bust-A-Move without problems. Apparently, the "Advance Palette Editor" doesn't work with Super Puzzle Fighter II.

I've tried find the colors using a Hex editor but was impossible. The main idea is making these games accessible for color-blind people.

I did it already with the arcade version but the Game Boy Advance is giving me troubles.






Thanks!
« Last Edit: November 24, 2016, 12:02:15 pm by theColorsGuy »

Asaki

  • Full Member
  • ***
  • Posts: 210
    • View Profile
Re: [GBA] Super Puzzle Fighter II change to Color-blind friendly
« Reply #1 on: December 03, 2016, 05:35:59 am »
The palette is probably stored differently, possibly compressed.

x0_000

  • Jr. Member
  • **
  • Posts: 35
    • View Profile
Re: [GBA] Super Puzzle Fighter II change to Color-blind friendly
« Reply #2 on: December 05, 2016, 03:41:55 pm »
I had a look at the game, the colours are stored at 7D3A3C, except all the values are offset by 0x1084. For example the first few halfwords in RAM are

2A84 290C 318E 3A12 ...

while at 7D3A3C, the halfwords are

1A00 1888 210A 298E ...

A strange way to store it, but it should be simple to edit.

(The reason for this weirdness is that the game only uses 27 possible values for RGB instead of 31, so they drop the 4 darkest values for each. 0x1084 is exactly 4||4<<5||4<<10.)

FAST6191

  • Hero Member
  • *****
  • Posts: 3237
    • View Profile
Re: [GBA] Super Puzzle Fighter II change to Color-blind friendly
« Reply #3 on: December 06, 2016, 03:26:11 am »
Interesting setup. Seen plenty of dynamic palettes, palette animations and game with brightness control somewhere/brightness selections but this sort of thing is new.

I wonder if it was just port weirdness or if someone looked at it on an original GBA screen (not the best thing thanks to no light on it) and rather than redo everything had some fun with maths. Possibly related reading http://problemkaputt.de/gbatek.htm#lcdcolorpalettes

theColorsGuy

  • Jr. Member
  • **
  • Posts: 4
    • View Profile
Re: [GBA] Super Puzzle Fighter II change to Color-blind friendly
« Reply #4 on: December 06, 2016, 12:02:00 pm »
I had a look at the game, the colours are stored at 7D3A3C, except all the values are offset by 0x1084. For example the first few halfwords in RAM are

2A84 290C 318E 3A12 ...

while at 7D3A3C, the halfwords are

1A00 1888 210A 298E ...

A strange way to store it, but it should be simple to edit.

(The reason for this weirdness is that the game only uses 27 possible values for RGB instead of 31, so they drop the 4 darkest values for each. 0x1084 is exactly 4||4<<5||4<<10.)


I've changed the colors and is working without problems.



I'm gonna start to upload the ips files to the site and color-blind people will be able to play these games.

I'm working on others games for Arcade but I have to admit that sometimes this hacking stuff is too complicated.

The arcade game Pnickies is another mystery, I've changed the colors in Capcom games like Super Puzzle Fighter II thanks to the information available on Internet and sadly this game apparently is an exception. You can't find the colors, maybe the colors inside the ROM are differents like happened here with GBA.

Do you know any website with information about CP System I and II and palette of colors?


Thanks for help me to understand this mystery.
« Last Edit: December 07, 2016, 06:59:49 am by theColorsGuy »

FAST6191

  • Hero Member
  • *****
  • Posts: 3237
    • View Profile
Re: [GBA] Super Puzzle Fighter II change to Color-blind friendly
« Reply #5 on: December 06, 2016, 02:37:44 pm »
If it is any kind of arcade system then the MAME source code is where we tend to point people. Not a lot is as nicely laid out as the GBA/DS doc I linked above but this is better than most and has loads and loads of comments and niceties sprinkled within it.
https://github.com/mamedev/mame/blob/master/src/mame/drivers/cps1.cpp
https://github.com/mamedev/mame/blob/master/src/mame/drivers/cps2.cpp
Warning, quite large pages so may take a while to load.

They are also in a fairly unique position for emulation and tend to take a more game focused approach in their layout -- if you only ever had 7 games that ran on a given board... so some are even quite good for ROM hacking where something like the DS with 7000 games + years of very active homebrew scene at the time and since can not reasonably afford that.

The CPS family is mightily popular though so there may be some more... useful to the would be hacker/homebrew author type wikis or documents out there somewhere. You will probably get it done with the MAME source but it might take learning the ropes of programming in some instances.

theColorsGuy

  • Jr. Member
  • **
  • Posts: 4
    • View Profile
Re: [GBA] Super Puzzle Fighter II change to Color-blind friendly
« Reply #6 on: December 07, 2016, 07:09:44 am »
If it is any kind of arcade system then the MAME source code is where we tend to point people. Not a lot is as nicely laid out as the GBA/DS doc I linked above but this is better than most and has loads and loads of comments and niceties sprinkled within it.
https://github.com/mamedev/mame/blob/master/src/mame/drivers/cps1.cpp
https://github.com/mamedev/mame/blob/master/src/mame/drivers/cps2.cpp
Warning, quite large pages so may take a while to load.

They are also in a fairly unique position for emulation and tend to take a more game focused approach in their layout -- if you only ever had 7 games that ran on a given board... so some are even quite good for ROM hacking where something like the DS with 7000 games + years of very active homebrew scene at the time and since can not reasonably afford that.

The CPS family is mightily popular though so there may be some more... useful to the would be hacker/homebrew author type wikis or documents out there somewhere. You will probably get it done with the MAME source but it might take learning the ropes of programming in some instances.


The CP Systems are quite popular, find information is not a problem. I just need more experience.

I've been changing colors in Street Fighter II and Alpha 3 just for practice and I'm creating a tool that makes everything easier.

Like I said, I just need more experience  :)

Asaki

  • Full Member
  • ***
  • Posts: 210
    • View Profile
Re: [GBA] Super Puzzle Fighter II change to Color-blind friendly
« Reply #7 on: December 08, 2016, 10:45:36 am »
I had a look at the game, the colours are stored at 7D3A3C, except all the values are offset by 0x1084.

How the heck do you even find something like that?? o_O

FAST6191

  • Hero Member
  • *****
  • Posts: 3237
    • View Profile
Re: [GBA] Super Puzzle Fighter II change to Color-blind friendly
« Reply #8 on: December 08, 2016, 08:03:39 pm »
How the heck do you even find something like that?? o_O

If right next to the image in question/image set does not work, and searching recursively does not work (you have the whole palette there in memory, dump it and search the ROM for it) then you have a few options, assuming you need the palette at all (for various things you might not need it if you have one from an emulator or know what should be what and can work accordingly, for the OP it is necessary unless they want to redo a whole bunch of spritework and hope there is a yellow colour in the palette somewhere to replace the red or green and dodge the colour blind issue).

For basic palette animation (on the GBA I usually point people at the rainbow block of mr driller 2) then search for a partial fragment that remains unchanged. Quite often a basic one will be used and then changed from there, this means if you search using the palette as extracted from memory like most people hacking palettes start with then you will fall short but this will hopefully find something. Same deal for a more complex palette animation but the more animation there is the smaller fragment you have to search with.

For a dynamic palette, like brightness settings, then you can try relative search if you want. The palette you dump with the various brightness settings will still be the same in many cases, just be shifted up or down so much across the board.

I should also say the GBA and SNES share a palette format, some find this useful for the various ports and remakes the GBA has.

For something like this I imagine a quick tracing session was done. You can hopefully find a point in the game before the palette in question is loaded (and with menus and such you might even be able to shuffle it in and out very quickly and reliably compared to some other things people search for). From there do a break on write (bpw) for the given area of palette memory ( http://problemkaputt.de/gbatek.htm#lcdcolorpalettes ) and trigger the palette to be written, hopefully it is a CPU copy or a DMA or something directly from the ROM but otherwise you follow the chain back up to where it comes from the ROM. By mere virtue of following it through you will also know exactly what was done to the palette, if anything, on its way from the ROM to the palette section.

Basic overview of tracing with VBA-sdl-h http://www.romhacking.net/documents/361/ , no$gba is better and the steps you take will probably be launched from a GUI but still be the same concepts underneath.

Asaki

  • Full Member
  • ***
  • Posts: 210
    • View Profile
Re: [GBA] Super Puzzle Fighter II change to Color-blind friendly
« Reply #9 on: December 10, 2016, 11:28:03 pm »
Thanks. I was specifically talking about -this- crazy scenario, but I do need to learn to use the debugger.

Wish I had more time for projects these days...