Palette Hunting Guide
written by: squishy_ichigo

WHAT YOU NEED:
-ZSNES
-yy-chr
-Smile 2.3
-A hex-editor (I use HxD)

NOTE: This is a detailed guide that explains how squishy finds palettes.  If someone asks "Hey, I wonder were [insert palette] is?" This is how he finds it for them.  And now you can to!

A good rule of thumb ANY time your ROM-hacking is to make back-up copies of your ROM incase you accidentally mess something up.  Make sure to have a back-up before you read any further.

STEP ONE: ZSNES

Our first step is saving the palette in a ZNSES savestate.  Open up Zsnes, and load your ROM. (Game -> load -> ROM filename) 

You'll need to have onscreen what it is you want to find the palette of.  A good way to do this is using SMILE's quickmet feature.  Once you have it onscreen, make a savestate.  (Zsnes' default button for saving a savestate is F2).  Some palettes are hard to get, because they are only on screen for a few frames.  If that is the case, you might need to use slowdown.  

Zsnes savestates are .zst file extentions.  If you have more than one, its saves as .zs[insert # here]. Example: .zs4.  Zsnes saves these savestates in the directory that the ROM is in.

After you have the savestate, you may close Zsnes, we will not be using it after this.

STEP TWO: YY-CHR

Our next step is to convert that .zst into something we can actually use for a palette file.  With the Zsnes savestate in hand, open up YY-CHR.  Open your ROM, (File -> Open -> ROM file name)  And we need to load the savestate as a palette. (Palette -> Emulator State Load -> ROM Filename)

Now we make us a .pal file, which can be used with SMILE for palettes.  (Palette -> save palette file (*.pal) )

Its been pretty easy so far huh?  Now that that's done, you can close yy-chr as well.

STEP THREE: SMILE - PART 1

Third step is to save this palette somewhere in free space so we can find it later.  Open up SMILE, and select your ROM, and open up SABS. (Tools -> Beauty Salon) Under the picture of Samus, is a horizontal scroll bar, we'll be using this to take us to a different screen.Using the drop down menu on the left of the screen, select "I'm a genius", which is the last choice.

Now were are going to jump to free space.  Bank $B8 is unused. So we're gonna save the palette there.  In the text box underneath the drop down menu, put in: 1C0100-FF.  Now we load the .pal file with the "Import Palette" button at the bottom of the screen. (load the .pal file you saved earlier)

The right side of the screen will now be filled with 16 lines of palettes.  But we only need one of them. Click the dot next to the palette your were looking for then press the "copy" button at the bottom of the screen.  This will copy it to SMILE's clipboard.

We don't need ANY of those other colors, so lets get rid of those.  Use the horizontal scroll bar to leave this screen, then come back to it.  Those colors will be gone now.  Use the button "paste" at the bottom and your one line will be pasted in.  Now we "Save to Rom".

Awesome, so now we have this palette saved somewhere we can easily find it.  Now its time to find the palette you want to edit!  Keep SMILE open for now, you'll need it in a minute to edit the palette.

STEP FOUR: HEX EDITOR (HxD for my walkthorugh)

This is the hardest part, but even this is pretty easy.  Open up your Hex Editor, and open up your ROM. (HxD: File -> Open -> ROM Filename) Next we goto the offset we saved to: 1C0100.  (HxD: Search -> goto -> 1C0100)  Now we highlight two rows of bytes starting at the place were the cursor was placed from the goto.

With it highlighted, right click -> copy.  Now we search the ROM for another copy of this same palette. Before we do, make sure you goto the top of the file, so it scans the whole ROM.  (HxD: Search -> [paste string here] Data type: Hex values)

You should find more than 1 match. Discard the match at 1C0100, since thats the one we saved to.  But document all the other offsets in a .txt or similar file.

After documenting all the offsets, close your Hex Editor.

STEP FIVE: SMILE - PART 2

Now that we have these offsets, we can edit them! Finally the part we wanted to do!  Switch back over to SMILE, and have go back to the I'm a Genius page if your not still there.

insert the offset that you documented and you should see the palette right there.  If its part of a set of palettes, you should see those as well.

Before you edit it, make sure ONLY the palette is on the right screen, not anything else.  If you "Save to ROM" with other stuff on the screen, it can break your ROM! Be careful, and if you DO mess something up, grab a backup.

Now that your done editing the palette, "Save to ROM" and go a test to make sure it changed. Quickmet again is a useful tool to this.
--------------------------
Wasn't too hard I hope?  This is a long process, but is very useful for finding those hard to find palettes.

If you have any questions/comments you can reach me via irc.esper.net channel #metconst. Or send me a PM on the metconst forums. (http://www.metroidconstruction.com/Forum/index.php)