From 1dc09b862d668721e084edaee541a9ca5745c025 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Banaan=20Ananas?= Date: Fri, 28 Oct 2011 23:03:17 +0000 Subject: [PATCH] found out where dirtdash stores num_sprites --- src/mame/drivers/namcos22.c | 2 +- src/mame/video/namcos22.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/mame/drivers/namcos22.c b/src/mame/drivers/namcos22.c index 931cb0d354a..f3bec03f414 100644 --- a/src/mame/drivers/namcos22.c +++ b/src/mame/drivers/namcos22.c @@ -5772,7 +5772,7 @@ GAME( 1994, alpinerd, 0, namcos22s, alpiner, alpiner, ROT0, "Namco", " GAME( 1994, alpinerc, alpinerd, namcos22s, alpiner, alpiner, ROT0, "Namco", "Alpine Racer (Rev. AR2 Ver.C)" , GAME_IMPERFECT_SOUND|GAME_IMPERFECT_GRAPHICS ) GAME( 1995, airco22b, 0, namcos22s, airco22, airco22, ROT0, "Namco", "Air Combat 22 (Rev. ACS1 Ver.B, Japan)" , GAME_IMPERFECT_SOUND|GAME_IMPERFECT_GRAPHICS|GAME_NOT_WORKING ) // boots but missing sprite clear DMA? GAME( 1995, cybrcycc, 0, namcos22s, cybrcycc, cybrcyc, ROT0, "Namco", "Cyber Cycles (Rev. CB2 Ver.C)" , GAME_IMPERFECT_SOUND|GAME_IMPERFECT_GRAPHICS ) // 95/04/04 -GAME( 1995, dirtdash, 0, namcos22s, dirtdash, dirtdash, ROT0, "Namco", "Dirt Dash (Rev. DT2)" , GAME_IMPERFECT_SOUND|GAME_IMPERFECT_GRAPHICS|GAME_NOT_WORKING ) // 95/12/20 20:01:56. many issues: slowdown, missing sprites, text layer transparency, spot ram +GAME( 1995, dirtdash, 0, namcos22s, dirtdash, dirtdash, ROT0, "Namco", "Dirt Dash (Rev. DT2)" , GAME_IMPERFECT_SOUND|GAME_IMPERFECT_GRAPHICS|GAME_NOT_WORKING ) // 95/12/20 20:01:56. many issues: slowdown, text layer transparency, spot ram GAME( 1995, timecris, 0, namcos22s, timecris, timecris, ROT0, "Namco", "Time Crisis (Rev. TS2 Ver.B)" , GAME_IMPERFECT_SOUND|GAME_IMPERFECT_GRAPHICS ) // 96/04/02 18:48:00 GAME( 1995, timecrisa,timecris, namcos22s, timecris, timecris, ROT0, "Namco", "Time Crisis (Rev. TS2 Ver.A)" , GAME_IMPERFECT_SOUND|GAME_IMPERFECT_GRAPHICS ) // 96/01/08 18:56:09 GAME( 1996, propcycl, 0, namcos22s, propcycl, propcycl, ROT0, "Namco", "Prop Cycle (Rev. PR2 Ver.A)" , GAME_IMPERFECT_SOUND|GAME_IMPERFECT_GRAPHICS ) // 96/06/18 21:22:13 diff --git a/src/mame/video/namcos22.c b/src/mame/video/namcos22.c index de7bda437e9..61a9367f403 100644 --- a/src/mame/video/namcos22.c +++ b/src/mame/video/namcos22.c @@ -8,8 +8,8 @@ * - texture u/v mapping is often 1 pixel off, resulting in many glitch lines/gaps between textures * - tokyowar tanks are not shootable, same for timecris helicopter, there's still a very small hitbox but almost impossible to hit * (is this related to dsp? or cpu?) - * - no sprites shown in dirtdash: looks like the same issue as airco22b: find out how/where vics num_sprites is determined exactly - * - eliminate sprite garbage in airco22b: find out how/where vics num_sprites is determined exactly, or is it linktable related? + * - find out how/where vics num_sprites is determined exactly, it causes major sprite problems in airco22b + * dirtdash would have this issue too, if not for the current workaround * - window clipping (acedrvrw, victlapw) * - using rgbint to set brightness may cause problems if a color channel is 00 (eg. victlapw attract) * (probably a bug in rgbint, not here?) @@ -1714,7 +1714,13 @@ DrawSprites( running_machine &machine, bitmap_t *bitmap, const rectangle *clipre 0x940060..0x94007c set#2 */ + // where do the games store the number of sprites to be processed by vics??? + // the current default implementation (using spritelist size) is clearly wrong and causes problems in dirtdash and airco22b num_sprites = state->m_vics_control[0x40/4] >> 4 & 0x1ff; // no +1 + + // dirtdash sprite list starts at xxx4, number of sprites is stored in xxx0, it doesn't use set#2 + if (state->m_gametype == NAMCOS22_DIRT_DASH) num_sprites = (state->m_vics_data[(state->m_vics_control[0x48/4]&0x4000)/4] & 0xff) + 1; + if( num_sprites > 0 ) { pSource = &state->m_vics_data[(state->m_vics_control[0x48/4]&0xffff)/4];