The bunny palette issue solved

View previous topic View next topic Go down

The bunny palette issue solved

Post by Puzzledude on Wed 1 Feb 2017 - 9:46

Solved the bunny palette problem.

When you construct a custom main sprite (ie Link), you will surely encounter a massive palette bug, when you draw the dark world equivalent (ie bunny) of the sprite, like seen here:



after pressing X for map, and returning:



And this is why:
at
1.) DD308, = green tunic pals for main sprite, 2 bytes for one colour, 1E bytes in hex

2.) at DD329, = same, but for blue tunic Link
3.) at DD344, = same, but for red tunic Link

new thing (not accebile in HM, but only in hex):
4.) at DD362, = same, but for bunny


main problem:
first apperance of bunny everytime you go to dark world with No Moonpearl= load 4.), but after pressing the map, the game load 1.) again.

This basically is a bug in the original ALTTP, since the game should be always loading 1.) and not 4.), or always 4.), but this is not the case with hacks.

You solve this by copy pasting the section DD308 (with data length 1E) into the scetion 4.), so to DD362 (with data length 1E). Then the game will always load 1.), the way it should be.

Doing so, you can also load pals for any custom main sprite, uppon you have changed all main pals. So you copy paste *after* the main pals change. Then you draw the bunny with the same colours as the green tunic variant of Link (this is logical though, as you can never be bunny if blue or red tunic; so you always draw for green tunic by default in YYchr).

This hex fix will ensure, that you can draw a brand new dark world variant of the main sprite if there is no Moonpearl (with correct pals loaded in all cases).

Puzzledude
   
   

Since : 2012-06-20

Back to top Go down

Re: The bunny palette issue solved

Post by ShadowOne333 on Sat 11 Feb 2017 - 12:47

Thank you so much for this info, puzzledude.
This will come in handy for sure.

To make it clear, the fix you provide (overwritting 1E bytes from DD308 into DD362) makes it so that the default palette loaded up for the bunny is always palette #1 right?

What change would be needed to fix the issue of the game loading palette 1 instead of 4 when going back from the Map screen for vanilla ALttP? So that the game the same palette it had before opening the Map. (i.e. Bunny palette retained no matter what if No moon pearl is aquired yet)

ShadowOne333
Rank: Rope
Rank: Rope

Since : 2016-04-06

Back to top Go down

Re: The bunny palette issue solved

Post by Puzzledude on Sat 11 Feb 2017 - 13:38

To make it clear, the fix you provide (overwritting 1E bytes from DD308 into DD362) makes it so that the default palette loaded up for the bunny is always palette #1 right?
Yes. This fix will load pal-1 (ie green tunic) when Link has tunic-1 (green clothes) and when you are a bunny. This is suitable for hacks, or gfx altered main sprite, since you always draw on pal-1 in YYchr. So now you only need to be careful when drawing clothes (colours) which will change when you get tunic-2 and 3.

However this fix is not recomended for original ALttP, since the actual correct bunny palette is palette-4. Or in other words, the original game has a paradox. It either loads bunny falsly (when both pals are 1) or would load Link falsly if both pals would be set to 4.



What change would be needed to fix the issue of the game loading palette 1 instead of 4 when going back from the Map screen for vanilla ALttP? So that the game the same palette it had before opening the Map. (i.e. Bunny palette retained no matter what if No moon pearl is aquired yet).
This will definitely require ASM, since Nintendo probably never noticed this. You see when returning from map and have Moonpearl you do return to pal-1 or any other current pal. There is no logic why game swaps the pal from 4 to 1 once you are a bunny (it should just keep the current pal).

This basically was never done, since when you are dealing with hacks, you always draw on pal-1. You actually don't even have access to pal-4 with HM, so obviously you don't draw on it.

Only the original game needs pal-4 for bunny. Basically you would need to trace the code when the game swaps pals and tell the game to not do this instead and keep the current pal-4 for the bunny even if pressing map.




Aside the ASM fix, you could also redraw the bunny in YYchr (ir GFX edit). So you would draw a bunny using the pal-1 colours, but you would be limited to the colours which are used for Link only, so you could never draw it the way it was meant.

It was long wondered why Link has pink hair. Finally they all said it has something to do with shared pals with bunny, who is pink. We now know this is not true, since they have separate pals.

Puzzledude
   
   

Since : 2012-06-20

Back to top Go down

Re: The bunny palette issue solved

Post by ShadowOne333 on Sat 11 Feb 2017 - 20:28

Puzzledude wrote:

However this fix is not recomended for original ALttP, since the actual correct bunny palette is palette-4. Or in other words, the original game has a paradox. It either loads bunny falsly (when both pals are 1) or would load Link falsly if both pals would be set to 4.

I did try to do it the other way around (Pal 4 into 1) and ended up with a bit too Pinky Link for my taste.Did so just to screw around with it a little bit.
It's rather odd though, since this issues doesn't seem to happen with neither palette 2 nor 3 (Blue and Red tunics), it only seems to switch the Pal 4 with Pal 1 for the bunny and no other pal.

Puzzledude wrote:

This will definitely require ASM, since Nintendo probably never noticed this. You see when returning from map and have Moonpearl you do return to pal-1 or any other current pal. There is no logic why game swaps the pal from 4 to 1 once you are a bunny (it should just keep the current pal).

This basically was never done, since when you are dealing with hacks, you always draw on pal-1. You actually don't even have access to pal-4 with HM, so obviously you don't draw on it.

I think I saw a palette similar to that of Link by using SnesPalEd quite some months ago, but didn't really pay attention to it.
So it means that basically the bunny has it's own palette, instead of the legendary assumption that Link's hair was pink because of the shared palette with the bunny.
Good to know it wasn't that way, as we now have 4 different palettes for 4 different sprites available.

Puzzledude wrote:
Aside the ASM fix, you could also redraw the bunny in YYchr (ir GFX edit). So you would draw a bunny using the pal-1 colours, but you would be limited to the colours which are used for Link only, so you could never draw it the way it was meant.

That's the problem I currently have.
I changed Link's default colour palette quite drastically, so redrawing the Bunny's GFX would only take those colours.
It'd surely be interesting to see the routine which causes the palette change. I'll see if I can find it with Snes9x Debugger.

EDIT:
Nope, I suck real bad xD
I always end up having issues with setting breakpoints and finding exactly what portion of it is the one I need.
:/

ShadowOne333
Rank: Rope
Rank: Rope

Since : 2016-04-06

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum