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:
parent
7cf5dafc40
commit
f9060dc351
1 changed files with 8 additions and 6 deletions
14
Core/PPU.cpp
14
Core/PPU.cpp
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue