diff options
Diffstat (limited to 'src/mame/video/namco_c355spr.cpp')
-rw-r--r-- | src/mame/video/namco_c355spr.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/mame/video/namco_c355spr.cpp b/src/mame/video/namco_c355spr.cpp index bb0a217a41a..43cd4cfb1f4 100644 --- a/src/mame/video/namco_c355spr.cpp +++ b/src/mame/video/namco_c355spr.cpp @@ -398,13 +398,13 @@ void namco_c355spr_device::get_single_sprite(const u16 *pSource, c355_sprite *sp int tile_index = spriteformat16[linkno * 4 + 0]; const u16 format = spriteformat16[linkno * 4 + 1]; - int dx = spriteformat16[linkno * 4 + 2]; - int dy = spriteformat16[linkno * 4 + 3]; + int dx = spriteformat16[linkno * 4 + 2]; // should this also be masked and have a sign bit like dy? + const int dy = spriteformat16[linkno * 4 + 3] & 0x1ff; int num_cols = (format >> 4) & 0xf; int num_rows = (format) & 0xf; if (num_cols == 0) num_cols = 0x10; - bool flipx = (hsize & 0x8000); + const bool flipx = (hsize & 0x8000); hsize &= 0x3ff;//0x1ff; if (hsize == 0) { @@ -423,7 +423,7 @@ void namco_c355spr_device::get_single_sprite(const u16 *pSource, c355_sprite *sp } if (num_rows == 0) num_rows = 0x10; - bool flipy = (vsize & 0x8000); + const bool flipy = (vsize & 0x8000); vsize &= 0x3ff; if (vsize == 0) { @@ -431,11 +431,16 @@ void namco_c355spr_device::get_single_sprite(const u16 *pSource, c355_sprite *sp return; } u32 zoomy = (vsize << 16) / (num_rows * 16); - dy = (dy * zoomy + 0x8000) >> 16; + s32 dy_zoomed = ((dy & 0xff) * zoomy + 0x8000) >> 16; + if (dy & 0x100) dy_zoomed = -dy_zoomed; if (!flipy) { - vpos -= dy; + vpos -= dy_zoomed; + } + else + { + vpos += dy_zoomed; } sprite_ptr->flipx = flipx; @@ -520,6 +525,7 @@ void namco_c355spr_device::get_sprites(const rectangle cliprect) // if (offs == 0) // boot // TODO: solvalou service mode wants 0x14000/2 & 0x00000/2 + // drawing this is what causes the bad tile in vshoot, do any games need 2 lists at the same time or should 1 list be configurable? get_list(0, &m_spriteram[buffer][0x02000/2], &m_spriteram[buffer][0x00000/2]); // else get_list(1, &m_spriteram[buffer][0x14000/2], &m_spriteram[buffer][0x10000/2]); |