Sprite 0 Hit Question

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Sprite 0 Hit Question
by on (#217198)
I have a question with how sprite 0 hits work in. My emulator currently fails with error code #6 on blargg's test 05.left_clip. Looking at the readme, it says that the flag should not be set:
Code:
lda   #upper_left_tile
sta   sprite_tile
lda   #7
sta   sprite_x
lda   #6;) Should miss; sprite pixel covered by left-edge clip
ldx   #$18
jsr   sprite_should_miss

But looking at the code (and my emulator's logs), isn't the sprite x set to 7? And doesn't that mean that if there is an opaque pixel after the first pixel, the flag should be set?
Am I misunderstanding something?
Re: Sprite 0 Hit Question
by on (#217199)
The window function can disable sprites, background, or both at x=0 through 7. When background is disabled in this region, the pixel pipeline treats those background pixels as transparent. When sprites are disabled in this region, the pixel pipeline treats those sprite pixels as transparent. And transparent pixels never cause a sprite 0 hit.
Re: Sprite 0 Hit Question
by on (#217201)
Thanks, that clarified my doubt. My logic was correct but I got the color incorrectly, so that gave me false positives and negatives.