In my first attempt at rom hacking, I’m trying to get a better understanding of how palettes are assigned to player sprites in Super Mario Bros. My understanding is that because of limitations in the game, only three palettes can be used for the player sprites, which are assigned like this:
Small/big Mario – Palette #1
Small/big Luigi – Palette #2
Fire Mario/Luigi – Palette #3
What I’d like to know is, how does the game check the state of the player and assign the sprite? For example, is there one check that checks if the player has fire regardless of which player it is (like above), and then assigns it palette #3, or are there separate checks that also check whether it’s player 1 or player 2 and then checks if the player has fire, and in either case assigns it palette #3. Or in other words, does the game check which player is being used, as well as the state of the player, and then assigns a palette, like so:
Small Mario – Palette #1
Big Mario – Palette #1
Fire Mario – Palette #3
Small Luigi – Palette #2
Big Luigi – Palette #2
Fire Luigi – Palette #3
The reason I’m asking is because I want to know if it’s possible to make player 1 and player 2 look the same as each other for each of the three states they can be in (small, big , fire) but have three separate palettes for each state. So ideally, it would be something like this:
Small Mario/Luigi – Palette #1
Big Mario/Luigi – Palette #2
Fire Mario/Luigi – Palette #3
Since this would require having separate palette assignments for small Mario and big Mario, is something like this even possible within the game or do they HAVE to be the same. Similarly, can fire Mario and fire Luigi have different palette assignments or do they also HAVE to be the same.
If this is possible, could someone tell me where in the hex code these six palette assignments are stored (if there are in fact six distinct assignments) and how they are changed to assign a different palette? I appreciate any help anyone can offer. I've been reading other discussions on the idea of changing which palette is assigned to a sprite, but I can't seem to understand how to do what I'm trying to do. Thanks in advance.