News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: [HELP] Changing Title Screen palette to finish my SNES MaternalBound hack!  (Read 3046 times)

ShadowOne333

  • Hero Member
  • *****
  • Posts: 1250
    • View Profile
Good day, RomHacking community.

So, I finally found a way to avoid the title screen from glitching out with the press of a button in my MaternalBound hack thanks to 'PK Hack' user TragicManner and his explanation on some ASM Pointer codes.

You can see the video showing the results here:
https://youtu.be/YWfN4YEULT8

And here is the IPS patch for that version:
http://local-static0.forum-files.fobby.net/forum_attachments/0038/6070/MaternalBound_Beta-Omega.ips

As you can see, the only problem right now is that the Static Title Screen that loads up with the press of a button has the wrong palette colours for some parts (only part not affected is the main text for MOTHER 2).
Since I haven't hacked any SNES ROM before (only NES ROMs), I am at loss here and don't know how to work around with palettes for SNES games, nor how can I debug and get where the palette for that particular screen is being stored within the ROM so I can change it to the correct HEX values.

I will post the information I got so far about the palette.
Here you have a link to a RAR:
http://local-static1.forum-files.fobby.net/forum_attachments/0038/6071/Palette_Data.rar

This .RAR contains two images.
Those two images show the palette that gets loaded up in BizHawk when the game reaches the title screen.
One image is for the correct title screen Red palette I want (desired) and the other shows up the Static Title Screen upon a button press, which is the purple-ish title screen that I want to change.

Along with the two images, you will find a TXT that details each info on each colour for both palettes that are being shown in the images. This contains the Raw Value, HEX value and the RGB value of the color.

Here's the text included in the .TXT (in case you don't want to download it XD):
Spoiler:
||||Mother 2 RED Title Screen
Desired Palette colours:

UPPER ROW PALETTE:
Left to right:

Colour - Raw Col. - Hex value - RGB Value

#1 - 0C34 - A00818 - 160,8,24
#2 - 0C76 - B01818 - 176,24,24
#3 - 0C78 - C01818 - 192,24,24
#4 - 18D9 - C83030 - 200,48,48
(End of red-ish colours in palette)

#5 - 0C63 - 181818 - 24,24,24
#6 - 739C - E0E0E0 - 224,224,224
#7 - 7C00 - 0000F8 - 0,0,248
#8 - 0841 - 081010 - 8,16,16
#9 - 0821 - 080810 - 8,8,16
#10 - 14A4 - 202828 - 32,40,40
(End of gray shades)

#11 up to #15 - 7C00 - 0000F8 - 0,0,248
(End of Blue shades)
(End of row)

ROW #2 PALETTE:

#1 - 14A6 - 302828 - 48,40,40
#2 up to #11 - 7C1F - F800F8 - 248,0,248
(End of pink line)
#13 - 6318 - C0C0C0 - 192,192,192
#14 - 5294 - A0A0A0 - 160,160,160
#15 - 39CE - 707070 - 112,112,112


||||Mother 2 Title Screen (Purple)
Incorrect palette, want to replace it with the palette above.

#1 & #2- 1C03 - 180038 - 24,0,56
#3 - 2866 - 301850 - 48,24,80
#4 - 2CA8 - 402858 - 64,40,88
#5 - 30E9 - 483860 - 72,56,96
#6 - 390B - 584070 - 88,64,112
#7 - 3D4D - 685078 - 104,80,120
#8 - 418E - 706080 - 112,96,128
#9 - 49B0 - 806890 - 128,104,144
#10 - 4DF1 - 887898 - 136,120,152
#11 - 5233 - 9888A0 - 152,136,160
#12 - 5A55 - A890B0 - 168,144,176
#13 - 5E96 - B0A0B8 - 176,160,184
#14 - 62D8 - C0B0C0 - 192,176,192
#15 - 6AF9 - C8B8D0 - 200,182,208
#16 - 6F3B - D8C8D8 - 216,200,216
(End of row)

With that said, I hope someone here could help me out to fix that palette so I can finally finish this hack and give it a proper full Omega release.

Thanks in advance for all of those who at least read this post!
« Last Edit: March 19, 2015, 11:59:49 am by ShadowOne333 »

drunken_honkey

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
This was a write up I had for TSB3 on the SNES.  Not sure if the RAM location is universal for all SNES roms.  So you may have to look for the RAM location in a different location.  But if its the same for all SNES roms then hopefully you'll be able to understand.  If not just let me know what doesn't make any sense and i'll try to explain better.

Download the following editing tools:
SNESpal - Use this to edit color pallets.

NOSSNS Emulator with debugger - (This is best for finding graphical things) Has VRAM Veiwer

SNES9X1.43 with Geiger debugger - (This is best for finding codes) *these emulators aren't very good for playing, but great for hacking. This emulator has a disassembler attached. Basically, you type in a location in your rom and the number of bytes that you want disassembled, and it'll break it down into assembly language. This is the best thing you can have when tracking down coding and adding coding. This emulator will allow you to dump ram, disassemble, see color pallet coding, graphic mapping, what's being used, locations codes use and open ram locations when you want to add things.

Cygnus Hex editor - My main hex veiwer/editor.

HxD Hex editor - I use this to compare files. Haven't tried using it to edit hex, but Cygnus is perfect so why bother.

Tile Molestor - This is THE TILE EDITING TOOL. Every bit of graphical editing I've done has been with this. This thing is massive at first but when you get the hang of it, it's the bomb.

zSNES emulator - Might be better ones out there but I haven't looked. This is just the emulator I use to play the game.

Open Office Free - I use this instead of excel cause I'm not paying for excel.

Heres the quick how-to:
SNES Color Pallets (Need Geiger, Hex editor, and SNES Pal)
Color pallets - Pretty simple concept here.
You have to find the color pallets location to use SNESpal, but that's fairly easy.


Open Geiger, run your rom. Click show hex (this will pause the game automatically) You'll see a button marked ROM.  Click to reveal the drop down list and change it to RAM. Scroll down and look at RAM location x7E2000. This beginning of the RAM location that the game  loads colors into.

It loads in Tecmo Super Bowl 3 like so:
x7E2000 - x7E203F for small pallets (Like the ones used in NES games). These are in 4bit format. These only have 3 colors available (4 total but the first color is always clear.)

x7E2040 - x7E20FF are background colors. These are in 16bit format. Thats 15 colors with first clear.

x7E2100 - x7E210FF are sprite colors. 16 bit format like backgrounds.

Go back to the game and get to the screen of the pallet you're looking for.  Go back to the Ram Window and go to these locations. When you get to the screen, just click on show hex and the game will pause. Geiger allows you to edit on the fly with certain things, and colors is one of them. You can 00 out locations in Ram and click back on the game window. This will unpause the game and black out colors. (00 00 = black in hex). Once you find the right RAM location with the right pallet, open your hex editor and your rom. Do a Find command. Type in the remaining hex numbers (about 3 - 4 more color codes, 1D20 1DE5 1E00 ect) from the RAM location you found. Make sure you do Find Next as there are some pallets that use the same Color sequences. Use the hex editor to change the coding and save. Now go back in the game and check to make sure it's the right location. If you found the right location, make note of the ROM location and open up SNESpal. File open your rom, and in the address window type in the location you found. About 99% of the time, the first color will be black. (This doesn't always hold true, but most times it does). Use the little arrows to scroll forward and back in the rom to get to the colors. The color you change it to in SNESpal will be the color the Rom will use. When your done changing the colors, save your rom.

Hope this helps!! Honkey Vanish!!

ShadowOne333

  • Hero Member
  • *****
  • Posts: 1250
    • View Profile
Thanks for the info!

Although, I am having some problems.

I already got the address in which the palette gets loaded in RAM.

It's 7E0200 for Earthbound.
I can clearly see the raw color values in there in Big Endian format.

The dark purple of the title screen is 1C 03, then 28 66 as I wrote them down in the.txt
I see them all pilled up as 03 1C 03 1C 66 28 ... and so on.

Thing is that when I try to black out the colors writting 00 instead of those values in RAM, the game doesn't respond to such thing.
No matter where I put the 00 values, the palette still retains its color. :/

I also tried looking up those values in the ROM data in HEX and I couldn't find 03 1C 03 1C, etc, only the colors for the red title screen, which are 34 0C 76 0C 78 0C, etc, which starts at 0x314205.

I don't know what I'm doing wrong, since that is the only address in RAM that gives the palette values. :/

drunken_honkey

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
What are you using to view RAM?  Id actually have to look at in real time to get a better understanding of whats happening.  Sorry.  Wish I could have been more help.

ShadowOne333

  • Hero Member
  • *****
  • Posts: 1250
    • View Profile
Exactly as you said, I am using Snes9x Debugger tool, Show HEX and then switched to RAM in real time.

drunken_honkey

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
You don't have to flip them when searching in the ROM.  So if RAM is showing 1C03 1C03 6628 then when searching the ROM you'd type it exactly how it shows in RAM.

ShadowOne333

  • Hero Member
  • *****
  • Posts: 1250
    • View Profile
That's the problem

The RAM viewer shows this:
03 1C 03 1C 66 28 A8 2C E9 30 0B 39 4D 3D 8E 41
B0 49 F1 4D 33 52 55 5A 96 5E D8 62 F9 6A 3B 6F

But I can't find those HEX values in the ROM together.
For example, if I try to find 03 1C 03 1C 66 28 in the HEX editor, it can't find anything close to it. :/

March 19, 2015, 09:52:31 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
Wait up...
I found it.

I don't know why, the palette has an HEX value between 03 1C and 66 28 that doesn't correspond to the palette at all.

03 1C 1B 66 28 A8 2C E9 30 0B

It is at 0x21CFE1 in the original ROM.
« Last Edit: March 19, 2015, 09:52:31 pm by ShadowOne333 »

drunken_honkey

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
I tried looking for it myself.  Cant figure out how Earthbound loads its pallets.  At location xAF1F changing the 09 changes the static effect.  But can't seem to locate the coding thats handling the alternating colors. 

March 19, 2015, 09:55:12 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
Good deal.  Yeah as I've come to notice about SNES roms is the odd ways the original programmers did things at times.  Glad you figured it out!!

ShadowOne333

  • Hero Member
  • *****
  • Posts: 1250
    • View Profile
I tried looking for it myself.  Cant figure out how Earthbound loads its pallets.  At location xAF1F changing the 09 changes the static effect.  But can't seem to locate the coding thats handling the alternating colors. 

March 19, 2015, 09:55:12 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
Good deal.  Yeah as I've come to notice about SNES roms is the odd ways the original programmers did things at times.  Glad you figured it out!!

I really appreciate your help, though!
It will come in handy if I ever do any more SNES hacks. :)

Thanks!