Wrong palette on a few Donkey Kong squares (SOLVED)
Moderator: Moderators
Wrong palette on a few Donkey Kong squares (SOLVED)
For the DK glitch at least, my attribute lookup, $22, is the same as Mesen except Mesen picks palette 2 for all four tiles instead of only the left tiles. That doesn't seem right.
BIG CAVEAT: I'm not doing real scanline emulation and instead I'm directly reading the nametable. Is the choice of palette 2 some timing thing that happens once you do the real PPU rendering?
Thanks!
Last edited by radicant on Wed Aug 03, 2022 4:03 pm, edited 1 time in total.
- rainwarrior
- Posts: 8732
- Joined: Sun Jan 22, 2012 12:03 pm
- Location: Canada
- Contact:
Re: Wrong palette on a few Donkey Kong squares
The nametable should have sufficient/correct data for this case. There is no mid-screen trickery going on in this game.
Maybe put a breakpoint in Mesen where that particular attribute byte is written, and try finding the corresponding thing happening in your emulator?
Edit: Actually... no, something is wrong here. Your "wrong" colours are splitting attribute regions in half already. Each 2 bits of attribute data should colour a 16x16 pixel region, not 8x8. Is this something you are doing correctly?
The score under the BONUS indicator is in the wrong colour too, and once again, it's in the same 16x16 region as the BONUS line above it, so it should be impossible for them to have different colours.
I suspect the rest of the screen below would have errors too, except for the fact that the entire rest of the screen is attribute 00.
Re: Wrong palette on a few Donkey Kong squares
Yes, thank you! I wasn't applying the bits to four tiles. I failed at fancy bitwise math so I resorted to a lut