Hi all. I've been working on a side project the last week or so and have run into a bit of roadblock.
I figured this would be very simple to figure out since I've done it before on other games.
My goal is to change this:
The issue I'm having accomplishing this is that the bridges, floor, and green boxes all share the same palette.
Changing the palette itself is no problem.
Normally, the first 3 background palettes have color 3 set to the same color so you can see the floor underneath certain blocks and inside the doorway.
I changed the green block to not use color 3 at all.
But the next step is to change the 2 types of floor blocks to use either palette 0 or palette 3 so that it doesn't use the new "wood" color I want for the bridges.
So I fired up MESEN's debugging tools and got to work.
The PPU viewer says the attribute data is at $23c9 in PPU RAM.
I set the break point there to see when it gets written to.
This is where I ran into my first issue.
MESEN says: "Breakpoint: PPU Write ($23C9:$00)"
However the line that is stopped at says:
D4AE | STA PpuData_2007 = $D7
I was expecting to see an instruction directly writing to $23C9.
Then I decided to try waiting for it to say it was writing the value that ends up in that byte in PPU memory.
Then I noticed the line above it was writing the expected value to a different address right before the break.
D4AC | LDA ($13),Y @ $0104 = $95
Then I naturally set a break point for $0104 to see when it's being read from.
But that doesn't help because it's constantly being read from and written to.
Next I added a condition to the breakpoint so that it breaks when the accumulator is holding the value of $95.
The last time that $95 is loaded into the accumulator before writing to $0104, the value was read from $016B.
Great, another address in CPU RAM.
This time it lead me to an instance of code that had loaded $94 into the accumulator and performed an ORA to raise it to $95 before writing it to the relevant address.
So I guess I have to switch over to finding a write with this new value.
This is just leading to a long series of instances of AND and ORA that is ultimately coming up with the value of $95.
DD9F | STA $16
DDA1 | LDX $15
DDA3 | LDY #$00
DDA5 | LDA ($0F),Y
DDA7 | AND $DDC3,X
DDAA | ORA $16
DDAC | STA ($0F),Y
At this point I'm not sure exactly what is happening and I'm no closer to figuring out how to universally set the floor blocks to use a different palette.
Am I even heading in the right direction here?