fixed array out-of-bounds access in ppu2c0x_device::draw_sprites() (nw)

This commit is contained in:
Oliver Stöneberg 2013-07-20 10:03:53 +00:00
parent dbefcabe13
commit 4f0eee38c7

View File

@ -819,15 +819,16 @@ void ppu2c0x_device::draw_sprites( UINT8 *line_priority )
if (pixel_data)
{
/* has the background (or another sprite) already been drawn here? */
if (!line_priority[sprite_xpos + pixel])
{
/* no, draw */
if ((sprite_xpos + pixel) < VISIBLE_SCREEN_WIDTH)
bitmap.pix16(m_scanline, sprite_xpos + pixel) = paldata[pixel_data];
}
/* indicate that a sprite was drawn at this location, even if it's not seen */
if ((sprite_xpos + pixel) < VISIBLE_SCREEN_WIDTH)
{
if (!line_priority[sprite_xpos + pixel])
{
/* no, draw */
bitmap.pix16(m_scanline, sprite_xpos + pixel) = paldata[pixel_data];
}
/* indicate that a sprite was drawn at this location, even if it's not seen */
line_priority[sprite_xpos + pixel] |= 0x01;
}
}
/* set the "sprite 0 hit" flag if appropriate */