From 447822e40dc401218f27af90341e434aeb82e097 Mon Sep 17 00:00:00 2001 From: "Alex W. Jackson" Date: Tue, 16 Dec 2014 17:13:52 -0500 Subject: k053936.c: fix potential out-of-bounds memory access; remove some dead code [Alex Jackson] --- src/mame/video/k053936.c | 34 ++++------------------------------ src/mame/video/konamigx.c | 9 ++------- 2 files changed, 6 insertions(+), 37 deletions(-) diff --git a/src/mame/video/k053936.c b/src/mame/video/k053936.c index b8d30b5145a..c36165795e1 100644 --- a/src/mame/video/k053936.c +++ b/src/mame/video/k053936.c @@ -496,7 +496,7 @@ INLINE void K053936GP_copyroz32clip( running_machine &machine, if (blend > 0) { - dst_base += dst_pitch; // draw blended + dst_ptr += dst_pitch; // draw blended starty += incyy; startx += incyx; @@ -539,35 +539,9 @@ INLINE void K053936GP_copyroz32clip( running_machine &machine, } else // draw solid { - if (blend == 0) - { - dst_ptr += dst_pitch; - starty += incyy; - startx += incyx; - } - else - { - if ((sy & 1) ^ (blend & 1)) - { - if (ty <= 1) return; - - dst_ptr += dst_pitch; - cy += incyy; - cx += incyx; - } - - if (ty > 1) - { - ty >>= 1; - dst_pitch <<= 1; - incyy <<= 1; - incyx <<= 1; - - dst_ptr += dst_pitch; - starty = cy + incyy; - startx = cx + incyx; - } - } + dst_ptr += dst_pitch; + starty += incyy; + startx += incyx; do { do { diff --git a/src/mame/video/konamigx.c b/src/mame/video/konamigx.c index fd158f55fa9..7ebc6b52831 100644 --- a/src/mame/video/konamigx.c +++ b/src/mame/video/konamigx.c @@ -695,8 +695,6 @@ void konamigx_state::gx_draw_basic_extended_tilemaps_1(screen_device &screen, bi int i = code<<1; int j = mixerflags>>i & 3; int k = 0; - static int parity = 0; - parity ^= 1; int disp = m_k055555->K055555_read_register(K55_INPUT_ENABLES); if ((disp & K55_INP_SUB1) || (rushingheroes_hack)) @@ -717,7 +715,7 @@ void konamigx_state::gx_draw_basic_extended_tilemaps_1(screen_device &screen, bi alpha = temp4 = m_k054338->set_alpha_level(temp2); if (temp4 <= 0) return; - if (temp4 < 255) k = (j == GXMIX_BLEND_FAST) ? ~parity : 1; + if (temp4 < 255) k = 1; } int l = sub1flags & 0xf; @@ -745,9 +743,6 @@ void konamigx_state::gx_draw_basic_extended_tilemaps_2(screen_device &screen, bi int temp1,temp2,temp3,temp4; int i = code<<1; int j = mixerflags>>i & 3; -// int k = 0; -// static int parity = 0; -// parity ^= 1; int disp = m_k055555->K055555_read_register(K55_INPUT_ENABLES); if (disp & K55_INP_SUB2) @@ -768,7 +763,7 @@ void konamigx_state::gx_draw_basic_extended_tilemaps_2(screen_device &screen, bi temp4 = m_k054338->set_alpha_level(temp2); if (temp4 <= 0) return; - //if (temp4 < 255) k = (j == GXMIX_BLEND_FAST) ? ~parity : 1; + //if (temp4 < 255) k = 1; } int l = sub2flags & 0xf; -- cgit v1.2.3