In my emu, I was noticing a weird artifact along the right column in Ice Climber:
http://i46.tinypic.com/acpglc.png
I traced the root of it back to how I'm emulating sprites. I'm trying to stay as close to the weird oam fetch pattern as possible... so I'm actually emulating the secondary oam buffer and all that.
The reason I get junk on the right column is because I don't determine whether a Y coordinate is "in range" after it's been moved to secondary OAM. I figure the PPU had already done the in range check when filling oam2, that it wouldn't do those same checks again when reading oam2.
So basically, oam2 has this in it:
Where ## is sprite 63's Y coordinate (the last value written to oam2) Since I don't do an in range check, when rendering from oam2, this results in me drawing tile FF, with attributes FF, at X coord FF, on every scanline. Hence the column of garbage.
Then that made me think of the sprite 0 quirk... how sprite 0 doesn't hit when x=255.
And it begs the question... does the PPU even render sprites at X=255? Does it filter them out to prevent this garbage column? Or does it have some other filtering to prevent the garbage some other way?
Thoughts and/or feedback appreciated.
http://i46.tinypic.com/acpglc.png
I traced the root of it back to how I'm emulating sprites. I'm trying to stay as close to the weird oam fetch pattern as possible... so I'm actually emulating the secondary oam buffer and all that.
The reason I get junk on the right column is because I don't determine whether a Y coordinate is "in range" after it's been moved to secondary OAM. I figure the PPU had already done the in range check when filling oam2, that it wouldn't do those same checks again when reading oam2.
So basically, oam2 has this in it:
Code:
## FF FF FF FF FF FF FF ...
Where ## is sprite 63's Y coordinate (the last value written to oam2) Since I don't do an in range check, when rendering from oam2, this results in me drawing tile FF, with attributes FF, at X coord FF, on every scanline. Hence the column of garbage.
Then that made me think of the sprite 0 quirk... how sprite 0 doesn't hit when x=255.
And it begs the question... does the PPU even render sprites at X=255? Does it filter them out to prevent this garbage column? Or does it have some other filtering to prevent the garbage some other way?
Thoughts and/or feedback appreciated.