Merge pull request #846 from arcadez2003/patch-8

Fix various graphical niggles for the video system games
This commit is contained in:
markwkidd 2020-08-04 19:03:58 -04:00 committed by GitHub
commit d5103b67f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -369,7 +369,7 @@ static void aerofgt_drawsprites(struct mame_bitmap *bitmap,const struct rectangl
} }
} }
static void turbofrc_drawsprites(struct mame_bitmap *bitmap,const struct rectangle *cliprect,int chip) static void turbofrc_drawsprites(struct mame_bitmap *bitmap,const struct rectangle *cliprect,int chip, int chip_disabled_pri)
{ {
int attr_start,base,first; int attr_start,base,first;
@ -385,7 +385,9 @@ static void turbofrc_drawsprites(struct mame_bitmap *bitmap,const struct rectang
/* int zoomtable[16] = { 0,7,14,20,25,30,34,38,42,46,49,52,54,57,59,61 };*/ /* int zoomtable[16] = { 0,7,14,20,25,30,34,38,42,46,49,52,54,57,59,61 };*/
if (!(aerofgt_spriteram3[attr_start + 2] & 0x0080)) continue; if (!(aerofgt_spriteram3[attr_start + 2] & 0x0080)) continue;
pri = aerofgt_spriteram3[attr_start + 2] & 0x0010;
if ( chip_disabled_pri & !pri) continue;
if (!chip_disabled_pri & (pri>>4)) continue;
ox = aerofgt_spriteram3[attr_start + 1] & 0x01ff; ox = aerofgt_spriteram3[attr_start + 1] & 0x01ff;
xsize = (aerofgt_spriteram3[attr_start + 2] & 0x0700) >> 8; xsize = (aerofgt_spriteram3[attr_start + 2] & 0x0700) >> 8;
zoomx = (aerofgt_spriteram3[attr_start + 1] & 0xf000) >> 12; zoomx = (aerofgt_spriteram3[attr_start + 1] & 0xf000) >> 12;
@ -395,7 +397,7 @@ static void turbofrc_drawsprites(struct mame_bitmap *bitmap,const struct rectang
flipx = aerofgt_spriteram3[attr_start + 2] & 0x0800; flipx = aerofgt_spriteram3[attr_start + 2] & 0x0800;
flipy = aerofgt_spriteram3[attr_start + 2] & 0x8000; flipy = aerofgt_spriteram3[attr_start + 2] & 0x8000;
color = (aerofgt_spriteram3[attr_start + 2] & 0x000f) + 16 * spritepalettebank; color = (aerofgt_spriteram3[attr_start + 2] & 0x000f) + 16 * spritepalettebank;
pri = aerofgt_spriteram3[attr_start + 2] & 0x0010;
map_start = aerofgt_spriteram3[attr_start + 3]; map_start = aerofgt_spriteram3[attr_start + 3];
/* aerofgt has this adjustment, but doing it here would break turbo force title screen*/ /* aerofgt has this adjustment, but doing it here would break turbo force title screen*/
@ -431,7 +433,7 @@ static void turbofrc_drawsprites(struct mame_bitmap *bitmap,const struct rectang
sx,sy, sx,sy,
cliprect,TRANSPARENCY_PEN,15, cliprect,TRANSPARENCY_PEN,15,
zoomx << 11,zoomy << 11, zoomx << 11,zoomy << 11,
pri ? 0 : 0x2); pri ? 0 : 2);
map_start++; map_start++;
} }
@ -443,6 +445,81 @@ static void turbofrc_drawsprites(struct mame_bitmap *bitmap,const struct rectang
} }
} }
static void spinlbrk_draw_sprites(struct mame_bitmap *bitmap,const struct rectangle *cliprect,int chip, int chip_disabled_pri)
{
int attr_start,base,first;
base = chip * 0x0200;
first = 4 * aerofgt_spriteram3[0x1fe + base];
for (attr_start = base + 0x0200-8;attr_start >= first + base;attr_start -= 4)
{
int map_start;
int ox,oy,x,y,xsize,ysize,zoomx,zoomy,flipx,flipy,color,pri;
/* some other drivers still use this wrong table, they have to be upgraded*/
/* int zoomtable[16] = { 0,7,14,20,25,30,34,38,42,46,49,52,54,57,59,61 };*/
if (!(aerofgt_spriteram3[attr_start + 2] & 0x0080)) continue;
pri = aerofgt_spriteram3[attr_start + 2] & 0x0010;
if ( chip_disabled_pri & !pri) continue;
if (!chip_disabled_pri & (pri>>4)) continue;
ox = aerofgt_spriteram3[attr_start + 1] & 0x01ff;
xsize = (aerofgt_spriteram3[attr_start + 2] & 0x0700) >> 8;
zoomx = (aerofgt_spriteram3[attr_start + 1] & 0xf000) >> 12;
oy = aerofgt_spriteram3[attr_start + 0] & 0x01ff;
ysize = (aerofgt_spriteram3[attr_start + 2] & 0x7000) >> 12;
zoomy = (aerofgt_spriteram3[attr_start + 0] & 0xf000) >> 12;
flipx = aerofgt_spriteram3[attr_start + 2] & 0x0800;
flipy = aerofgt_spriteram3[attr_start + 2] & 0x8000;
color = (aerofgt_spriteram3[attr_start + 2] & 0x000f) + 16 * spritepalettebank;
map_start = aerofgt_spriteram3[attr_start + 3];
/* aerofgt has this adjustment, but doing it here would break turbo force title screen*/
/* ox += (xsize*zoomx+2)/4;*/
/* oy += (ysize*zoomy+2)/4;*/
zoomx = 32 - zoomx;
zoomy = 32 - zoomy;
for (y = 0;y <= ysize;y++)
{
int sx,sy;
if (flipy) sy = ((oy + zoomy * (ysize - y)/2 + 16) & 0x1ff) - 16;
else sy = ((oy + zoomy * y / 2 + 16) & 0x1ff) - 16;
for (x = 0;x <= xsize;x++)
{
int code;
if (flipx) sx = ((ox + zoomx * (xsize - x) / 2 + 16) & 0x1ff) - 16;
else sx = ((ox + zoomx * x / 2 + 16) & 0x1ff) - 16;
if (chip == 0)
code = aerofgt_spriteram1[map_start % (aerofgt_spriteram1_size/2)];
else
code = aerofgt_spriteram2[map_start % (aerofgt_spriteram2_size/2)];
pdrawgfxzoom(bitmap,Machine->gfx[sprite_gfx + chip],
code,
color,
flipx,flipy,
sx,sy,
cliprect,TRANSPARENCY_PEN,15,
zoomx << 11,zoomy << 11,
pri ? 2 : 0);
map_start++;
}
if (xsize == 2) map_start += 1;
if (xsize == 4) map_start += 3;
if (xsize == 5) map_start += 2;
if (xsize == 6) map_start += 1;
}
}
}
VIDEO_UPDATE( pspikes ) VIDEO_UPDATE( pspikes )
{ {
@ -457,7 +534,8 @@ VIDEO_UPDATE( pspikes )
fillbitmap(priority_bitmap,0,cliprect); fillbitmap(priority_bitmap,0,cliprect);
tilemap_draw(bitmap,cliprect,bg1_tilemap,0,0); tilemap_draw(bitmap,cliprect,bg1_tilemap,0,0);
turbofrc_drawsprites(bitmap,cliprect,0); turbofrc_drawsprites(bitmap,cliprect,0,-1);
turbofrc_drawsprites(bitmap,cliprect,0, 0);
} }
VIDEO_UPDATE( karatblz ) VIDEO_UPDATE( karatblz )
@ -473,8 +551,10 @@ VIDEO_UPDATE( karatblz )
tilemap_draw(bitmap,cliprect,bg2_tilemap,0,0); tilemap_draw(bitmap,cliprect,bg2_tilemap,0,0);
/* we use the priority buffer so sprites are drawn front to back */ /* we use the priority buffer so sprites are drawn front to back */
turbofrc_drawsprites(bitmap,cliprect,1); turbofrc_drawsprites(bitmap,cliprect,1,-1);
turbofrc_drawsprites(bitmap,cliprect,0); turbofrc_drawsprites(bitmap,cliprect,1, 0);
turbofrc_drawsprites(bitmap,cliprect,0,-1);
turbofrc_drawsprites(bitmap,cliprect,0, 0);
} }
VIDEO_UPDATE( spinlbrk ) VIDEO_UPDATE( spinlbrk )
@ -492,11 +572,13 @@ VIDEO_UPDATE( spinlbrk )
fillbitmap(priority_bitmap,0,cliprect); fillbitmap(priority_bitmap,0,cliprect);
tilemap_draw(bitmap,cliprect,bg1_tilemap,0,0); tilemap_draw(bitmap,cliprect,bg1_tilemap,0,0);
tilemap_draw(bitmap,cliprect,bg2_tilemap,0,0); tilemap_draw(bitmap,cliprect,bg2_tilemap,0,1);
/* we use the priority buffer so sprites are drawn front to back */ /* we use the priority buffer so sprites are drawn front to back */
turbofrc_drawsprites(bitmap,cliprect,0); spinlbrk_draw_sprites(bitmap,cliprect,0, 0);
turbofrc_drawsprites(bitmap,cliprect,1); spinlbrk_draw_sprites(bitmap,cliprect,0,-1);
spinlbrk_draw_sprites(bitmap,cliprect,1, 0);
spinlbrk_draw_sprites(bitmap,cliprect,1,-1);
} }
VIDEO_UPDATE( turbofrc ) VIDEO_UPDATE( turbofrc )
@ -518,8 +600,10 @@ VIDEO_UPDATE( turbofrc )
tilemap_draw(bitmap,cliprect,bg2_tilemap,0,1); tilemap_draw(bitmap,cliprect,bg2_tilemap,0,1);
/* we use the priority buffer so sprites are drawn front to back */ /* we use the priority buffer so sprites are drawn front to back */
turbofrc_drawsprites(bitmap,cliprect,1); turbofrc_drawsprites(bitmap,cliprect,1,-1); /*ship*/
turbofrc_drawsprites(bitmap,cliprect,0); turbofrc_drawsprites(bitmap,cliprect,1, 0); /*intro*/
turbofrc_drawsprites(bitmap,cliprect,0,-1); /*enemy*/
turbofrc_drawsprites(bitmap,cliprect,0, 0); /*enemy*/
} }
VIDEO_UPDATE( aerofgt ) VIDEO_UPDATE( aerofgt )