PaMod: ROM Exploration.
This guide is intended for people that want to find or even modify regions of a game ROM that PalMod does not already know about. There are other arguably better ways to do this: this is just one way you can do it using PalMod.
Tools You Need For This
Getting Started With Extras Files
Each Extra definition is comprised of three lines. You specify one line with the title for a given palette, the next line being the starting position in the ROM for that palette, and the third line being the ending position in the ROM for that palette. For example:
- PalMod itself: a tool used to modify palettes in game ROMs or files. When exploring ROMs, it can be useful to have a second instance of PalMod open to a "known" game so that you can check what a given palette looks like. You can even paste the palette colors from your ROM exploration onto a sprite we have to see if it looks correct.
- The ROM for the game you're interested in.
- If you want your life to be simple, you're going to start with one of the game ROMs that PalMod already supports. If you're feeling frisky, you can load other ROMs into PalMod.
- An Extras file.
- This is a text-file extension to PalMod. This is a powerful and dangerous extension that lets you use PalMod to read and modify regions of the ROM that PalMod doesn't already know about. To do this you place an Extras file in the same directory that you launch PalMod from. Bad Extras files may crash PalMod: : to fix that just fix or remove that bogus Extras file.
Ryu's Pet Hamster
This would create a PalMod entry for the "Ryu's Pet Hamster" palette that reads the 0x20 (0n32) bytes (representing 16 colors at two bytes per color) between 0x2400e to 0x2402e. You can specify a lot of Extras entries if you need to: at one point Jojo's support was entirely being done via SFIII3's Extras file support.
All Extras loaded this way will be available at the bottom of the top listbox as "Extra Palettes". When that is selected your specific Extras will show up in the bottom listbox. Any palette larger than 128 colors will be shown across multiple pages. If you specify a gigantic palette we may show you a warning to be careful. We don't show any preview sprites for Extra Palettes.
Please note that any ROM locations/palettes present in both PalMod and in the Extras file is pure shenanigans: we will end up creating two copies of that palette and you would need to modify *both* to have anything good happen. Please don't duplicate palettes. PalMod will make a good faith effort to check for duplicates when it loads Extra files, and will try to warn you if it sees any dupes. For the purposes of ROM exploration, you might want/need to duplicate palettes: just ignore the warnings in that case.
The file names you can use are covered in the ReadMe included in PalMod.
If you want to try to experiment with a new ROM via Extras file hacking, remember that PalMod is going to read the ROM according to the game it thinks you are trying to use. So if you want to play around with a CPS2 ROM, be sure to use a CPS2 game / Extras file as your starting point. Likewise if it's a CPS3 game, use SFIII3 or Jojo's as your starting point. And if it's a NEO*GEO ROM (such as for King of Fighters games we don't support), we have the helpful "Unknown NEO*GEO" load option you can use.
ROM Exploration with PalMod
Create an Extras file identifying the ROM regions you want to explore. When I'm getting started I might read ridiculously long ROM regions. For example for COTA the first part of my exploratory COTAE.txt Extras file looked like this:
That of course is a huge range, and PalMod helpfully shows me a warning about that madness. PalMod disallows any native palette larger than 256 colors, but Extras file palettes can be gigantic and unwieldy. I now load the ROM and get some more (expected) warnings about dupes and reading unexpectedly low areas of the ROM.
Now we change the top listbox drop-down to be "Extra Palettes". We should see PalMod's interpretation of the ROM data as if everything was a color. (You can probably close the Preview window at this point, too: you can start loading in textures, if you have them, once you're getting to late-stage refinement of the ROM locations. )
Now for the boring part. Just keep walking ROM pages. You're looking for patterns in the data and chunks of colors that look related. Character palettes are usually 16 colors each. Everything in the COTA ROM is probably going to look like a jumbled mess until about when you hit 0x2611e. Things start getting interesting at this point.
Part of finding patterns is knowing what to look for. Helpfully, the CPS2/Vs series games reuse a lot of sprites, so we can try to check for palettes from this ROM that match palettes from another game in the series. And on "still early (103/256) 0x2671e" we hit our first bingo: we find an exact match for the main MvC2 Psylocke palette. You can copy the palette from 0x2673e over to MvC2's Psylocke and you'll see that it matches exactly. Additionally, most of the CPS2-era characters have their P1 main palette followed by three P1 "extra" palettes followed by their P2 palette palette (and three P2 extra palettes). And if you look at 0x267be - yep, that's Psylocke's P2 color. And the P1/P2 extra palettes generally match their MvC2 versions which makes things simpler.
So offhand if we're in a character region we would expect the next character palette set at
(start of character P1 palette + (0x20 * 4 palettes (1 main, 3 extra)) * 2 (P1 and P2 colors)). And indeed at 0x2683e we see a markedly different palette. If you try to match that against palettes for COTA characters present in MvC2, you'll realize that that's Colossus' palette. And to jump ahead: you'll realize the the COTA character sort order is Psylocke (0x2673e), Colossus (0x2683e), Cyclops (0x2693e), Storm (0x26a3e), Iceman (0x26b3e), Spiral (0x26c3e), Omega Red (0x26d3e), Sentinel (0x26e3e), Juggernaut (0x26f3e), Magneto (0x2703e), Wolverine (0x2713e), Silver Samurai (0x2727e), and finally ST Akuma/Gouki (0x2737e). (The sort order in a game is usually adhered to, but can differ for things like character select icons.)
So now as an experiment I would modify those palettes, save to ROM, and then test it in WinKawaks. We don't need fancy palmods for this: you can blast them redder or greener or alternating solid color pixels: just something that will indicate that these are the right palettes for what you care about. And indeed if you modify those you'll see that those characters change. BUT! Things like Silver Samurai's shine and other extra palettes are not changed yet.
We can check MvC2's palette sets to figure out which palettes we might be dealing with/looking for. But if we're just lost or want to experiment: blast pages of the ROM to specific colors. You'll want to keep track of this, but as you slowly modify a page of colors at a time to be all red or green or yellow or etc, you can figure out if those colors are used in the places in the game that you care about or not. That lets you start honing in on the exact regions and eventually individual palettes that you care about. For example, I now know that the Master Mold stage colors are stored around 0x36cfe: if I ever want to start working on stages, that's where I'd start.
Remember to keep updating your Extras file as you go along. If a section of a ROM isn't of interest, comment it out with a ";" in front of each line, or add comments or update the description string so you know what it is. I slowly keep slicing ROM sections in my Extras file until I know clearly what everything I care about is, and then I fold it into PalMod.
Good luck. :)