Fix invisible sprite when Y + Height >= 256 and Y < _vblankStartScanline

This commit is contained in:
Marcus Rowe 2021-10-26 19:52:09 +10:00
parent dd9e689880
commit bf961dc559

View file

@ -42,8 +42,9 @@ struct SpriteInfo
return false;
}
uint8_t endY = (Y + (interlace ? (Height >> 1) : Height)) & 0xFF;
return (scanline >= Y && scanline < endY) || (endY < Y && scanline < endY);
uint16_t endY = (Y + (interlace ? (Height >> 1) : Height));
uint8_t endY_8 = endY & 0xFF;
return (scanline >= Y && scanline < endY) || (endY_8 < Y && scanline < endY_8);
}
};