I'm trying to understand why I get random splotches of black in SMB: image
I tried debugging it for a particular pixel (152,52). The relevant info for that was:
nametableAddr=0x20D3
mem[nametableAddr]=0x24 (i.e. tile 0x24)
attributeAddr=0x23CC
mem[attributeAddr]=0x55 (i.e. 1-1-1-1 for 2-bit attribute sections - I choose the bottom-right one, but they're all the same in this case.)
bgPaletteIndexWithoutAttribute=0 (blue)
bgPaletteIndexWithAttribute=4 (0 +(1 << 2)) (black)
When I compare with Nintendulator, I get all the same answers, except that I can't verify that it's using 0x23CC as the attribute. I double-checked that by hand, and it seems to be the right address given the pixel coordinate. My palette's also line up with Nintendulator's, so that shouldn't be the problem.
Any clues what I might be doing wrong? The cute thing about this is invisible blocks always seem to get rendered as black, so they're easy to find.
I tried debugging it for a particular pixel (152,52). The relevant info for that was:
nametableAddr=0x20D3
mem[nametableAddr]=0x24 (i.e. tile 0x24)
attributeAddr=0x23CC
mem[attributeAddr]=0x55 (i.e. 1-1-1-1 for 2-bit attribute sections - I choose the bottom-right one, but they're all the same in this case.)
bgPaletteIndexWithoutAttribute=0 (blue)
bgPaletteIndexWithAttribute=4 (0 +(1 << 2)) (black)
When I compare with Nintendulator, I get all the same answers, except that I can't verify that it's using 0x23CC as the attribute. I double-checked that by hand, and it seems to be the right address given the pixel coordinate. My palette's also line up with Nintendulator's, so that shouldn't be the problem.
Any clues what I might be doing wrong? The cute thing about this is invisible blocks always seem to get rendered as black, so they're easy to find.