From e43c9e3d4b57e76a7a84dad2ba9a4d61667f2106 Mon Sep 17 00:00:00 2001 From: cam900 Date: Wed, 5 Jun 2019 19:43:23 +0900 Subject: decmxc06.cpp : Fix bandit regression, Fix notes, Remove outdated comments --- src/mame/video/decmxc06.cpp | 80 ++++++++++++++++++++++++--------------------- 1 file changed, 43 insertions(+), 37 deletions(-) diff --git a/src/mame/video/decmxc06.cpp b/src/mame/video/decmxc06.cpp index 0788f926467..d78adb50a79 100644 --- a/src/mame/video/decmxc06.cpp +++ b/src/mame/video/decmxc06.cpp @@ -4,9 +4,15 @@ Deco MXC06 sprite generator: used by: - madmotor.c + madmotor.cpp + dec0.cpp + stadhero.cpp + thedeep.cpp + actfancr.cpp + vaportra.cpp + dec8.cpp -Notes (dec0.c) +Notes (dec0.cpp) Sprite data: The unknown bits seem to be unused. @@ -29,11 +35,6 @@ Notes (dec0.c) Bit 4,5,6,7: - Colour Byte 5: X-coords - -todo: - Implement sprite/tilemap orthogonality (not strictly needed as no - games make deliberate use of it). (pdrawgfx, or rendering to bitmap for manual mixing) - */ @@ -73,8 +74,8 @@ void deco_mxc06_device::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap int flipx = data0 & 0x2000; parentFlipY = flipy = data0 & 0x4000; - const u16 h = (1 << ((data0 & 0x1800) >> 11)); /* 1x, 2x, 4x, 8x height */ - const u16 w = (1 << ((data0 & 0x0600) >> 9)); /* 1x, 2x, 4x, 8x width */ + const int h = (1 << ((data0 & 0x1800) >> 11)); /* 1x, 2x, 4x, 8x height */ + const int w = (1 << ((data0 & 0x0600) >> 9)); /* 1x, 2x, 4x, 8x width */ int sx = data2 & 0x01ff; int sy = data0 & 0x01ff; @@ -101,44 +102,49 @@ void deco_mxc06_device::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap continue; } + int chainoffs = priority ? offs - ((w - 1) * 4) : offs; // or bandit breaks for (int x = 0; x < w; x++) { - // maybe, birdie try appears to specify the base code for each part.. - u16 code = spriteram[offs + 1] & 0x1fff; + if (chainoffs < size) + { + // maybe, birdie try appears to specify the base code for each part.. + u16 code = spriteram[chainoffs + 1] & 0x1fff; - code &= ~(h - 1); + code &= ~(h - 1); - // not affected by flipscreen - if (parentFlipY) // in the case of multi-width sprites the y flip bit is set by the parent - incy = -1; - else - { - code += h - 1; - incy = 1; - } + // not affected by flipscreen + if (parentFlipY) // in the case of multi-width sprites the y flip bit is set by the parent + incy = -1; + else + { + code += h - 1; + incy = 1; + } - for (int y = 0; y < h; y++) - { - if (!flash || (screen.frame_number() & 1)) + for (int y = 0; y < h; y++) { - if (priority) - { - gfx->prio_transpen(bitmap, cliprect, - code - y * incy, - colour, - flipx, flipy, - sx + (mult * x), sy + (mult * y), screen.priority(), pri_mask, 0); - } - else + if (!flash || (screen.frame_number() & 1)) { - gfx->transpen(bitmap, cliprect, - code - y * incy, - colour, - flipx, flipy, - sx + (mult * x), sy + (mult * y), 0); + if (priority) + { + gfx->prio_transpen(bitmap, cliprect, + code - y * incy, + colour, + flipx, flipy, + sx + (mult * x), sy + (mult * y), screen.priority(), pri_mask, 0); + } + else + { + gfx->transpen(bitmap, cliprect, + code - y * incy, + colour, + flipx, flipy, + sx + (mult * x), sy + (mult * y), 0); + } } } } + chainoffs += 4; offs += inc; if (offs == end) return; -- cgit v1.2.3