+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  palette swapping
Pages: [1]
Author Topic: palette swapping  (Read 529 times)
Con
Guest
« on: March 05, 2007, 12:45:52 am »

Hi,

I edit tiles in a snes game and use snesedit and palette editor. It works quite good, but now I have a problem:

I want to give one tile a green color but this isn't in its specific 16 color palette available. I can't choose colors from another palette (won't be saved) and if I change one palette color to green with palette editor, more tiles are affected (and this looks quite ugly then).
 
The only possibility to solve this problem is, as far I think, to find somehow the code which says that this tile uses this palette, and change it to another palette where the wanted colors are available. Unfortunately I have no idea how to find this adress, since the tile specification like - palette, mirror flip and so on are at a different place than the pixels.
Can somebody help me please?
Nightcrawler
Guest
« Reply #1 on: March 05, 2007, 09:44:57 am »

You've got the right idea. That's what you'll need to do to get it to work. Changing the palette colors will affect any tiles that also use that palette. You'll need to make a new palette and load it into CGRAM(hopefully not all palettes are being actively used) and then change the tilemap for the tiles you're editing to reference that new palette.

VSNES is a good starting point. You can view the tilemap and CGRAM from a savestate right there. What you'll need to do though is make some trace logs and find the code that loads that tilemap to VRAM. You'll need to find where the source data comes from for that tilemap and edit that data to reference another palette.

Loading your new palette data will of course require a small assembly hack to load your new palette data. It might be tricky figuring out where to insert that routine depending on how your game code is structured. I'd probably recommend starting with the tilemap load and working backwards from there trying to see if any routines around there are unique only when the tiles in question are loaded.

You don't want to stick it in a common routine because it will load that palette data whenever that routine is run potentially screwing other tiles up later.
Con
Guest
« Reply #2 on: March 05, 2007, 05:08:05 pm »

Thanks a lot. I made my way through vsnes Smiley

I am very interested in ASM hacking but yet I have no clue how to make trace logs. I tried with Geiger SNES9x debugger but I found no good tutorial explaining how to find source codes with this program. Could you explain me a little bit how this works please?

KingMike
Guest
« Reply #3 on: March 05, 2007, 07:46:43 pm »

In Geiger's tracer, just push the '*' key when you want to start/stop code.
There's several options, such as filtering out repetitions of the same code ("Squelch"), and to split trace logs (which can grow to be several megabytes per second) across multiple files (good if your computer can't handle opening 100 MB text files)
(too bad he doesn't post old versions. The most recent version (Mark 9 release 8)'s trace logs have kinda messy formatting. Version 8 had the register data lined up nicely, making it easier to quickly glance for changes. But 9.8 has much better debugging options.
« Last Edit: March 06, 2007, 09:37:49 am by KingMike »
Nightcrawler
Guest
« Reply #4 on: March 06, 2007, 09:07:44 am »

Geiger should update his tool to work with the latest SNES9x since it's much improved as far as emulation goes.
Con
Guest
« Reply #5 on: March 09, 2007, 09:32:06 pm »

Jope, I solved the palette problem  Grin

But on an easier way - I just edited a color which was almost not used and gave the affected tiles another, similar color.

Thanks a lot for your help. Also I was able to get some trace logs Smiley

But, may I ask for another advice?
I want to make a time related item stable (it is only 10 minutes available)  but don't know how to get the correct address. It can be stabilized using a 7exxxx Par code but this afffects only ram and I need the rom address to create a patch. The log file is so huge and I don't know for which value I shall look in the cpu log. I know that I have to use somehow breakpoints (but also there I miss an address) or, as another possibility that I find game genie codes (but this isn't supported by zsnes cheat search...).

 
Aerdan
Guest
« Reply #6 on: March 09, 2007, 09:54:08 pm »

The ZSNES cheat search uses the CPU address, which GameGenie codes translate into in order to do stuff.
Pages: [1]  


Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC