gb_lcd.c: Fix another index out of bound access in the supergb driver (nw)

This commit is contained in:
Wilbert Pol 2014-07-28 08:34:04 +00:00
parent f9a8a749f4
commit 6b8acd5d5b

View File

@ -793,7 +793,8 @@ void sgb_lcd_device::update_sprites()
data = (vram[adr + 1] << 8) | vram[adr]; data = (vram[adr + 1] << 8) | vram[adr];
/* Find the palette to use */ /* Find the palette to use */
pal = m_sgb_pal_map[(xindex >> 3)][((yindex - SGB_YOFFSET) >> 3)] << 2; // If sprite started before the start of the line we may need to pick a different pal_map entry?
pal = m_sgb_pal_map[(xindex < 0) ? 0 : (xindex >> 3)][((yindex - SGB_YOFFSET) >> 3)] << 2;
/* Offset to center of screen */ /* Offset to center of screen */
xindex += SGB_XOFFSET; xindex += SGB_XOFFSET;