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

Author Topic: [Technical] Changing color palette for a specific tile NES  (Read 950 times)

jackic

  • Jr. Member
  • **
  • Posts: 26
    • View Profile
[Technical] Changing color palette for a specific tile NES
« on: February 21, 2019, 05:47:14 am »
Greetings,

I have been playing this famicom game, Hokuto no Ken 3, and I find annoying that you need to walk AAAAAALL the way around the corner to do any shopping so I thought I would make an opening in the counter to make it more straightforward.

Anyways, I managed to do this:

https://imgur.com/a/TvCqpaK

Now I just need to change the palette of that particular tile in order to match the main floor.

How would I go about doing this?

Any help would be greatly apreciated.

Psyklax

  • Hero Member
  • *****
  • Posts: 1056
    • View Profile
    • Psyklax Translations
Re: [Technical] Changing color palette for a specific tile NES
« Reply #1 on: February 21, 2019, 08:32:01 am »
The palette information is stored in VRAM, and with a bit of experience it's usually a cinch to change, you just need to find where the instruction is located in the game code. I'll do it later, but it requires me being at that point of the game and using the debugger.

Can you provide an IPS file of what you've done, and an fceux save state if it's in a difficult location? If you only changed a few bytes then you can just write the changes you made and I can make them myself.

jackic

  • Jr. Member
  • **
  • Posts: 26
    • View Profile
Re: [Technical] Changing color palette for a specific tile NES
« Reply #2 on: February 21, 2019, 12:44:41 pm »
Thanks a lot Psyklax,

the changes I made are pretty straightforward:

Changed bytes 1a158 and 1a168 to 02
Changed bytes 19628 and 19638 to 02

That changes the tiles right in front of both merchants ro regular floor but it doesn't change the palette.

And this savestate leaves the player right in fron of both shops, goods shop on the left and armory on the right:

https://mega.nz/#!uLJTEIZL!wUfzM81CeZ11aCWr3DopNjnjNZxQTPWUlwgdGoumsSQ


All the shops in this game share the same layout and the changes apply to all of them.

Thanks a bunch, really.


Psyklax

  • Hero Member
  • *****
  • Posts: 1056
    • View Profile
    • Psyklax Translations
Re: [Technical] Changing color palette for a specific tile NES
« Reply #3 on: February 21, 2019, 05:12:37 pm »
Excellent, just what I needed. :)

Change $1B4D4 from 5F to 5D
Change $1B7D4 from 50 to 51
Change $1B7CC from 05 to 15

That should do the trick. ;)

All I had to do was find which part of VRAM held the palette for the tiles in question (between $27C0 and $27FF), breakpoint to when it's written to - which found me a temporary bit of work RAM. Breakpoint on that RAM, et voila, the part of the ROM that it came from opened itself up to me. Then I just had to change the number to the right one.

Happy to help! :D

jackic

  • Jr. Member
  • **
  • Posts: 26
    • View Profile
Re: [Technical] Changing color palette for a specific tile NES
« Reply #4 on: February 22, 2019, 05:30:47 am »
Thanks, now I see what you did. Is there any particular pattern you have to look for when searching the palette or just brute force your way through ppu memory?

In this particular case, the game is so "well done" that just looking for the hex code in the rom got me to where it stored the palette without needing to reverse engineering any more XP.

Now one can do as much lazy shopping as needed, big improvement:




Now I'll try to widen the stairs leading to this place. Thanks a lot for the tutorial Psyklax!
« Last Edit: February 25, 2019, 05:32:34 am by jackic »