summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author R. Belmont <rb6502@users.noreply.github.com>2019-06-05 09:31:08 -0400
committer GitHub <noreply@github.com>2019-06-05 09:31:08 -0400
commitcfc6dd2944672ddd06d2c0a4eb44de926ce7c5ca (patch)
tree350219beb2560d0f1dd67433cddf6bc43bcdabf5
parent444f79cabb5a3efbc92b4b45e6051da405526340 (diff)
parentf6375f506502b75e7263a850763dcc1f3b3e6c5a (diff)
Merge pull request #5160 from cam900/bandit
decmxc06.cpp : Fix bandit regression, Fix notes, Remove outdated comm…
-rw-r--r--src/mame/video/decmxc06.cpp85
1 files changed, 47 insertions, 38 deletions
diff --git a/src/mame/video/decmxc06.cpp b/src/mame/video/decmxc06.cpp
index 0788f926467..4ee3e9e868c 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 */
+ int w = (1 << ((data0 & 0x0600) >> 9)); /* 1x, 2x, 4x, 8x width */
int sx = data2 & 0x01ff;
int sy = data0 & 0x01ff;
@@ -101,48 +102,56 @@ 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;
+ }
+ while (w)
+ {
+ w--;
offs += inc;
if (offs == end)
return;
-
}
}
}