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

Author Topic: How do you change an object's assigned palette in Super Mario Bros?  (Read 755 times)

Mario4life

  • Newbie
  • *
  • Posts: 2
    • View Profile
First off, I'm pretty new to romhacking, and haven't used a hex editor much. But I'd like to know if someone has a list of or how to find the bytes that change which palette an object uses in Super Mario Bros. The only one I know is that changing 21 to 22 on byte 6878 changes a Piranha Plant's palette to the Red Koopa Palette. Specifically I need to change Hammer Bro's palette to a Red Koopa palette, but how to tell which byte is what object would be nice to know in case I have a similar problem later down the line. Any help is appreciated. Thanks!

Cyneprepou4uk

  • Hero Member
  • *****
  • Posts: 534
  • I am the baldest romhacker
    • View Profile
Re: How do you change an object's assigned palette in Super Mario Bros?
« Reply #1 on: April 23, 2020, 01:58:16 pm »
Palettes are most likely stick together in rom file in a single common table. So you already know the search area.

To find out which byte exactly to change, open ppu viewer in fceux emulator, hover cursor over 2nd line of colors (those are for sprites). To make sure it's the right color, open hex editor - ppu memory - go to $3F10 line and change bytes here manually (sometimes it will change back right away, try to slow down emulation to notice changes on the screen).

Then find the same byte in your table. There can be several same bytes nearby, try them all, one by one.

Then reload the level or load a proper savestate to update colors when code will read them.

For more precice search you can try to find 2-4th bytes of colors together from a set of colors for a sprite (there are 4 sets, each one has 4 colors). Also use code/data logger to see bytes which were read by the game code while it's working.
« Last Edit: April 23, 2020, 02:08:52 pm by Cyneprepou4uk »
iromhacker.ru - NES ROM hacking tutorials for beginners. Please use Google Translate browser extension

Mario4life

  • Newbie
  • *
  • Posts: 2
    • View Profile
Thanks for responding, I kind of understand what your talking about, but could you dumb it down just a little bit?

Cyneprepou4uk

  • Hero Member
  • *****
  • Posts: 534
  • I am the baldest romhacker
    • View Profile
No. First try it out in practice, then ask what you don't understand.
iromhacker.ru - NES ROM hacking tutorials for beginners. Please use Google Translate browser extension