From e77e77d51c818fc011c17a02c4c831f9e7012bf4 Mon Sep 17 00:00:00 2001 From: hap Date: Fri, 4 Nov 2022 20:12:27 +0100 Subject: calorie: fix spriteram oob access --- src/mame/sega/calorie.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/mame/sega/calorie.cpp b/src/mame/sega/calorie.cpp index 734defb6bce..43876f0cfde 100644 --- a/src/mame/sega/calorie.cpp +++ b/src/mame/sega/calorie.cpp @@ -174,8 +174,6 @@ void calorie_state::video_start() uint32_t calorie_state::screen_update_calorie(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - int x; - if (m_bg_bank & 0x10) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); @@ -186,7 +184,7 @@ uint32_t calorie_state::screen_update_calorie(screen_device &screen, bitmap_ind1 m_fg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); } - for (x = 0x400; x >= 0; x -= 4) + for (int x = m_sprites.bytes() - 4; x >= 0; x -= 4) { int xpos, ypos, tileno, color, flipx, flipy; @@ -211,7 +209,7 @@ uint32_t calorie_state::screen_update_calorie(screen_device &screen, bitmap_ind1 if (m_sprites[x + 1] & 0x10) { - /* 32x32 sprites */ + /* 32x32 sprites */ m_gfxdecode->gfx(3)->transpen(bitmap,cliprect, tileno | 0x40, color, flipx, flipy, xpos, ypos - 31, 0); } else -- cgit v1.2.3