summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Roberto Zandona <robertoz@mamedev.org>2009-04-14 15:44:59 +0000
committer Roberto Zandona <robertoz@mamedev.org>2009-04-14 15:44:59 +0000
commitd588a9fe873fb6d2aa3fdfdf3a4e0a7785ceda07 (patch)
treed9c845af0a28dfc847705d41ab87df963c63579b
parent7357089fc8517217b972f7962314584a2b7b8771 (diff)
no bugs fixed; only a different and cleaner implementation
-rw-r--r--src/mame/video/munchmo.c36
1 files changed, 6 insertions, 30 deletions
diff --git a/src/mame/video/munchmo.c b/src/mame/video/munchmo.c
index 0d1367d6f14..091f3fb993e 100644
--- a/src/mame/video/munchmo.c
+++ b/src/mame/video/munchmo.c
@@ -129,15 +129,15 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int color_base = mnchmobl_palette_bank * 4 + 3;
int i, j;
int firstsprite = mnchmobl_vreg[4] & 0x3f;
- for( i = firstsprite; i < 0x40; i++ )
+ for( i = firstsprite; i < firstsprite + 0x40; i++ )
{
for( j = 0; j < 8; j++ )
{
- int ii = (j << 6) | i;
- int tile_number = mnchmobl_sprite_tile[ii]; /* ETTTTTTT */
- int attributes = mnchmobl_sprite_attr[ii]; /* XYYYYYCC */
- int sx = mnchmobl_sprite_xpos[ii]; /* XXXXXXX? */
- int sy = (ii >> 6) << 5; /* Y YY------ */
+ int offs = (j << 6) | ( i & 0x3f );
+ int tile_number = mnchmobl_sprite_tile[offs]; /* ETTTTTTT */
+ int attributes = mnchmobl_sprite_attr[offs]; /* XYYYYYCC */
+ int sx = mnchmobl_sprite_xpos[offs]; /* XXXXXXX? */
+ int sy = (offs >> 6) << 5; /* Y YY------ */
sy += (attributes >> 2) & 0x1f;
if( attributes & 0x80 )
{
@@ -152,30 +152,6 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
}
}
}
- if (firstsprite != 0)
- for( i = 0; i < firstsprite; i++ )
- {
- for( j = 0; j < 8; j++ )
- {
- int ii = (j << 6) | i;
- int tile_number = mnchmobl_sprite_tile[ii]; /* ETTTTTTT */
- int attributes = mnchmobl_sprite_attr[ii]; /* XYYYYYCC */
- int sx = mnchmobl_sprite_xpos[ii]; /* XXXXXXX? */
- int sy = (ii >> 6) << 5; /* Y YY------ */
- sy += (attributes >> 2) & 0x1f;
- if( attributes & 0x80 )
- {
- sx = (sx >> 1) | (tile_number & 0x80);
- sx = 2 * ((- 32 - scroll - sx) & 0xff) + xadjust;
- drawgfx( bitmap, gfx,
- 0x7f - (tile_number & 0x7f),
- color_base - (attributes & 0x03),
- 0,0, /* no flip */
- sx,sy,
- cliprect, TRANSPARENCY_PEN, 7 );
- }
- }
- }
}
VIDEO_UPDATE( mnchmobl )