summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Michaël Banaan Ananas <happppp@users.noreply.github.com>2013-07-22 21:07:35 +0000
committer Michaël Banaan Ananas <happppp@users.noreply.github.com>2013-07-22 21:07:35 +0000
commit9130356683ce9f7de496af05664fc4350a299dfd (patch)
tree0d14de757a83bd0e82bef45db33f104b815ed924
parent94070bdfd44022ac58f6557a60159aaf4dfdcbaa (diff)
fix array out of bounds access in ejsakura
-rw-r--r--src/mame/video/seibuspi.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mame/video/seibuspi.c b/src/mame/video/seibuspi.c
index 5656323453e..2808456be0e 100644
--- a/src/mame/video/seibuspi.c
+++ b/src/mame/video/seibuspi.c
@@ -338,6 +338,7 @@ void seibuspi_state::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprec
int x1, y1;
gfx_element *gfx = machine().gfx[2];
const int has_tile_high = (gfx->elements() > 0x10000) ? 1 : 0;
+ const int colormask = (m_sprite_bpp == 6) ? 0x3f : 0x1f;
static const int sprite_xtable[2][8] =
{
@@ -363,7 +364,7 @@ void seibuspi_state::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprec
-------- -------- ----x--- -------- flip_x
-------- -------- -----xxx -------- width
-------- -------- -------- xx------ priority
- -------- -------- -------- --xxxxxx color
+ -------- -------- -------- --xxxxxx color (highest bit not used on SYS386F)
Word 1, unmarked bits have no function
-------x xxxxxxxx -------- -------- ypos
@@ -387,8 +388,8 @@ void seibuspi_state::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprec
ypos = m_sprite_ram[a + 1] >> 16 & 0x1ff;
if (ypos & 0x100)
ypos |= 0xfe00;
- color = m_sprite_ram[a + 0] & 0x3f;
-
+ color = m_sprite_ram[a + 0] & colormask;
+
width = (m_sprite_ram[a + 0] >> 8 & 0x7) + 1;
height = (m_sprite_ram[a + 0] >> 12 & 0x7) + 1;
flip_x = m_sprite_ram[a + 0] >> 11 & 0x1;