mirror of
https://github.com/holub/mame
synced 2025-05-22 13:48:55 +03:00
snes.c: Fixed OAM overflow [jbo_85, Fabio Priuli]
This commit is contained in:
parent
ad194976cb
commit
2de8c84647
@ -548,7 +548,9 @@ INLINE void snes_draw_tile_object( UINT16 tileaddr, INT16 x, UINT8 priority, UIN
|
||||
mask >>= 1;
|
||||
}
|
||||
|
||||
if (scanlines[SNES_MAINSCREEN].enable)
|
||||
if (ii >= 0 && ii < SNES_SCR_WIDTH && scanlines[SNES_MAINSCREEN].enable)
|
||||
{
|
||||
if (scanlines[SNES_MAINSCREEN].priority[ii] <= priority)
|
||||
{
|
||||
UINT8 clr = colour;
|
||||
|
||||
@ -561,8 +563,6 @@ INLINE void snes_draw_tile_object( UINT16 tileaddr, INT16 x, UINT8 priority, UIN
|
||||
|
||||
/* Only draw if we have a colour (0 == transparent) */
|
||||
if (clr)
|
||||
{
|
||||
if ((scanlines[SNES_MAINSCREEN].priority[ii] <= priority) && (ii >= 0))
|
||||
{
|
||||
c = snes_cgram[(pal + clr) % FIXED_COLOUR];
|
||||
|
||||
@ -574,7 +574,9 @@ INLINE void snes_draw_tile_object( UINT16 tileaddr, INT16 x, UINT8 priority, UIN
|
||||
}
|
||||
}
|
||||
|
||||
if (scanlines[SNES_SUBSCREEN].enable)
|
||||
if (ii >= 0 && ii < SNES_SCR_WIDTH && scanlines[SNES_SUBSCREEN].enable)
|
||||
{
|
||||
if (scanlines[SNES_SUBSCREEN].priority[ii] <= priority)
|
||||
{
|
||||
UINT8 clr = colour;
|
||||
|
||||
@ -587,8 +589,6 @@ INLINE void snes_draw_tile_object( UINT16 tileaddr, INT16 x, UINT8 priority, UIN
|
||||
|
||||
/* Only draw if we have a colour (0 == transparent) */
|
||||
if (clr)
|
||||
{
|
||||
if ((scanlines[SNES_SUBSCREEN].priority[ii] <= priority) && (ii >= 0))
|
||||
{
|
||||
c = snes_cgram[(pal + clr) % FIXED_COLOUR];
|
||||
|
||||
@ -1083,7 +1083,7 @@ static void snes_update_objects( UINT8 priority_tbl, UINT16 curline )
|
||||
UINT8 count = 0;
|
||||
for (xs = (snes_ppu.oam.size[size] - 1); xs >= 0; xs--)
|
||||
{
|
||||
if ((x + (count << 3) < SNES_SCR_WIDTH + 8))
|
||||
if ((x + (count << 3) < SNES_SCR_WIDTH))
|
||||
{
|
||||
snes_draw_tile_object(charaddr + name_sel + tile + table_obj_offset[ys][xs] + line, x + (count++ << 3), priority, hflip, pal, blend);
|
||||
}
|
||||
@ -1094,7 +1094,7 @@ static void snes_update_objects( UINT8 priority_tbl, UINT16 curline )
|
||||
{
|
||||
for (xs = 0; xs < snes_ppu.oam.size[size]; xs++)
|
||||
{
|
||||
if ((x + (xs << 3) < SNES_SCR_WIDTH + 8))
|
||||
if ((x + (xs << 3) < SNES_SCR_WIDTH))
|
||||
{
|
||||
snes_draw_tile_object(charaddr + name_sel + tile + table_obj_offset[ys][xs] + line, x + (xs << 3), priority, hflip, pal, blend);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user