Fixed small PPU display bug introduced in previous build - need to return only if we set the sprite's pixel

This commit is contained in:
Souryo 2015-07-05 08:47:34 -04:00
parent 7cf5dafc40
commit f9060dc351

View file

@ -414,11 +414,6 @@ void PPU::DrawPixel()
if(spriteColor != 0) {
//First sprite without a 00 color, use it.
if(backgroundColor == 0 || !_spriteTiles[i].BackgroundPriority) {
//Check sprite priority
pixel = PPU_PALETTE_RGB[GetSpritePaletteEntry(_spriteTiles[i].PaletteOffset, spriteColor)];
}
if(i == 0 && backgroundColor != 0 && _sprite0Visible && _cycle != 256 && _flags.BackgroundEnabled) {
//"The hit condition is basically sprite zero is in range AND the first sprite output unit is outputting a non-zero pixel AND the background drawing unit is outputting a non-zero pixel."
//"Sprite zero hits do not register at x=255" (cycle 256)
@ -426,7 +421,14 @@ void PPU::DrawPixel()
//"Should always miss when Y >= 239"
_statusFlags.Sprite0Hit = true;
}
return;
if(backgroundColor == 0 || !_spriteTiles[i].BackgroundPriority) {
//Check sprite priority
pixel = PPU_PALETTE_RGB[GetSpritePaletteEntry(_spriteTiles[i].PaletteOffset, spriteColor)];
return;
}
break;
}
}
}