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

Author Topic: Zelda 1 pushable rock palette  (Read 1480 times)

gzip

  • RHDN Patreon Supporter!
  • Jr. Member
  • *****
  • Posts: 46
    • View Profile
Zelda 1 pushable rock palette
« on: September 19, 2020, 06:03:23 pm »
In Zelda 1 pushable rocks take on a different palette when they are being pushed. I'd like to remove that palette change altogether or at least use the same palette. The palette at 0x1A268 seems to be the right one but then black always remains transparent as the rock is being pushed. I was unable to locate the code that handles the move, that would probably help.

Cyneprepou4uk

  • Hero Member
  • *****
  • Posts: 504
  • I am the baldest romhacker
    • View Profile
Re: Zelda 1 pushable rock palette
« Reply #1 on: September 21, 2020, 03:45:15 am »
Maybe default rock is a part of background and using its palette, but it becomes a sprite when pushed
iromhacker.ru - NES ROM hacking tutorials for beginners. Please use Google Translate browser extension

ShadowOne333

  • Hero Member
  • *****
  • Posts: 1509
    • View Profile
Re: Zelda 1 pushable rock palette
« Reply #2 on: September 21, 2020, 07:59:18 pm »
I tried looking at this for a bit, but couldn't really find much.
I don't think the tiles themselves change from background to sprite to be moved, it should be something else, most likely handled by a routine somewhere, though I can't find it yet.
I'll see if I can find anything later.

gzip

  • RHDN Patreon Supporter!
  • Jr. Member
  • *****
  • Posts: 46
    • View Profile
Re: Zelda 1 pushable rock palette
« Reply #3 on: September 21, 2020, 09:50:32 pm »
Maybe default rock is a part of background and using its palette, but it becomes a sprite when pushed

This seems to hold true. If I open the Name Table Viewer the rock is there in the background. It disappears as it's pushed and then reappears in it's final location. That would explain the transparency since the sprite sets the first color, which is black, as transparent, right? I assume the background doesn't need transparency so it remains black there. Is there a way to disable a sprite's transparency, or maybe another workaround?

Btw, is there an easy way to find which code is moving/drawing any given sprite?

ShadowOne333

  • Hero Member
  • *****
  • Posts: 1509
    • View Profile
Re: Zelda 1 pushable rock palette
« Reply #4 on: September 21, 2020, 10:29:24 pm »
An easy way to do it would be to swap the black colour of both the sprite and background palettes for another colour not used by the sprite, and change the rest of the sprites and background tiles colours manually to adjust for the new palette.

abw

  • Hero Member
  • *****
  • Posts: 554
    • View Profile
Re: Zelda 1 pushable rock palette
« Reply #5 on: September 21, 2020, 11:20:40 pm »
Maybe default rock is a part of background and using its palette, but it becomes a sprite when pushed
+1 for Cyneprepou4uk. Using Mesen's sprite viewer, you can clearly see the rock become a sprite when it starts moving and stop being a sprite when it stops moving.

Btw, is there an easy way to find which code is moving/drawing any given sprite?
Breakpoints and/or trace logs will get you pretty much everything eventually, although backtracking Zelda 1's sprites is a little more annoying than usual since the game likes to rearrange its sprite layout every frame. If it helps any, Zelda 1 is like most other NES games in using $0200-$02FF as its sprite buffer.

Cyneprepou4uk

  • Hero Member
  • *****
  • Posts: 504
  • I am the baldest romhacker
    • View Profile
Re: Zelda 1 pushable rock palette
« Reply #6 on: September 22, 2020, 03:40:44 am »
Quote
the sprite sets the first color, which is black, as transparent, right?

Yes, the first of 4 colors for sprite is transparent, but it can be any color, not just black.

I need screenshots from ppu viewer and from the game with standing and moving rocks before I give any advice.
iromhacker.ru - NES ROM hacking tutorials for beginners. Please use Google Translate browser extension

ShadowOne333

  • Hero Member
  • *****
  • Posts: 1509
    • View Profile
Re: Zelda 1 pushable rock palette
« Reply #7 on: September 22, 2020, 12:23:07 pm »
Yes, the first of 4 colors for sprite is transparent, but it can be any color, not just black.

I need screenshots from ppu viewer and from the game with standing and moving rocks before I give any advice.

Nothing changes in PPU Viewer when moving the rocks.
All the sprites and backgrounds stay the same before and during the movement of the rock.

gzip

  • RHDN Patreon Supporter!
  • Jr. Member
  • *****
  • Posts: 46
    • View Profile
Re: Zelda 1 pushable rock palette
« Reply #8 on: October 07, 2020, 12:06:07 am »
Well, the easiest fix is to simply replace the black. It's only a subtle difference but I still prefer to keep the black and live with the strange looking pushed rock. :-\



Cyneprepou4uk

  • Hero Member
  • *****
  • Posts: 504
  • I am the baldest romhacker
    • View Profile
Re: Zelda 1 pushable rock palette
« Reply #9 on: October 07, 2020, 07:12:14 am »
Still waiting for the rest of the screenshots
iromhacker.ru - NES ROM hacking tutorials for beginners. Please use Google Translate browser extension