From cae7ef0587d74436e14519af2798911fcbce284c Mon Sep 17 00:00:00 2001 From: Phil Bennett Date: Wed, 19 Dec 2007 19:46:12 +0000 Subject: [PATCH] * Fixed C219 sample read order and implemented sign+magnitude format. * Removed GAME_IMPERFECT_SOUND flag from all Namco NA-1 games. --- src/emu/sound/c140.c | 21 +++++++++++++++++---- src/mame/drivers/namcona1.c | 22 +++++++++++----------- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/src/emu/sound/c140.c b/src/emu/sound/c140.c index 9cc4922a1e2..60203a17f61 100644 --- a/src/emu/sound/c140.c +++ b/src/emu/sound/c140.c @@ -401,12 +401,25 @@ static void update_stereo(void *param, stream_sample_t **inputs, stream_sample_t if( cnt ) { prevdt=lastdt; - lastdt=pSampleData[pos]; - if ((v->mode & 0x40) && (info->banking_type == C140_TYPE_ASIC219)) + + if (info->banking_type == C140_TYPE_ASIC219) { - lastdt ^= 0x80; // flip signedness + lastdt = pSampleData[BYTE_XOR_BE(pos)]; + + // Sign + magnitude format + if ((v->mode & 0x01) && (lastdt & 0x80)) + lastdt = -(lastdt & 0x7f); + + // Sign flip + if (v->mode & 0x40) + lastdt = -lastdt; } - dltdt=(lastdt - prevdt); + else + { + lastdt=pSampleData[pos]; + } + + dltdt = (lastdt - prevdt); } /* Caclulate the sample value */ diff --git a/src/mame/drivers/namcona1.c b/src/mame/drivers/namcona1.c index 54abd7d49e9..0838b11325e 100644 --- a/src/mame/drivers/namcona1.c +++ b/src/mame/drivers/namcona1.c @@ -1820,17 +1820,17 @@ ROM_START( xday2 ) ROM_END // NA-1 (C69 MCU) -GAME( 1992,bkrtmaq, 0, namcona1w, namcona1_quiz,bkrtmaq, ROT0, "Namco", "Bakuretsu Quiz Ma-Q Dai Bouken (Japan)", GAME_IMPERFECT_SOUND ) -GAME( 1992,cgangpzl, 0, namcona1w, namcona1_joy, cgangpzl, ROT0, "Namco", "Cosmo Gang the Puzzle (US)", GAME_IMPERFECT_SOUND ) -GAME( 1992,cgangpzj, cgangpzl, namcona1w, namcona1_joy, cgangpzl, ROT0, "Namco", "Cosmo Gang the Puzzle (Japan)", GAME_IMPERFECT_SOUND ) -GAME( 1992,exvania, 0, namcona1, namcona1_joy, exbania, ROT0, "Namco", "Exvania (Japan)", GAME_IMPERFECT_SOUND ) -GAME( 1992,fghtatck, 0, namcona1, namcona1_joy, fa, ROT90,"Namco", "Fighter & Attacker (US)", GAME_IMPERFECT_SOUND ) -GAME( 1992,fa, fghtatck, namcona1, namcona1_joy, fa, ROT90,"Namco", "F/A (Japan)", GAME_IMPERFECT_SOUND ) -GAME( 1992,swcourt, 0, namcona1w, namcona1_joy, swcourt, ROT0, "Namco", "Super World Court (World)", GAME_IMPERFECT_SOUND ) -GAME( 1992,swcourtj, swcourt, namcona1w, namcona1_joy, swcourt, ROT0, "Namco", "Super World Court (Japan)", GAME_IMPERFECT_SOUND ) -GAME( 1993,emeraldj, emeralda, namcona1w, namcona1_joy, emeraldj, ROT0, "Namco", "Emeraldia (Japan Version B)", GAME_IMPERFECT_SOUND ) /* Parent is below on NA-2 Hardware */ -GAME( 1993,emerldja, emeralda, namcona1w, namcona1_joy, emeraldj, ROT0, "Namco", "Emeraldia (Japan)", GAME_IMPERFECT_SOUND ) /* Parent is below on NA-2 Hardware */ -GAME( 1993,tinklpit, 0, namcona1w, namcona1_joy, tinklpit, ROT0, "Namco", "Tinkle Pit (Japan)", GAME_IMPERFECT_SOUND ) +GAME( 1992,bkrtmaq, 0, namcona1w, namcona1_quiz,bkrtmaq, ROT0, "Namco", "Bakuretsu Quiz Ma-Q Dai Bouken (Japan)", 0 ) +GAME( 1992,cgangpzl, 0, namcona1w, namcona1_joy, cgangpzl, ROT0, "Namco", "Cosmo Gang the Puzzle (US)", 0 ) +GAME( 1992,cgangpzj, cgangpzl, namcona1w, namcona1_joy, cgangpzl, ROT0, "Namco", "Cosmo Gang the Puzzle (Japan)", 0 ) +GAME( 1992,exvania, 0, namcona1, namcona1_joy, exbania, ROT0, "Namco", "Exvania (Japan)", 0 ) +GAME( 1992,fghtatck, 0, namcona1, namcona1_joy, fa, ROT90,"Namco", "Fighter & Attacker (US)", 0 ) +GAME( 1992,fa, fghtatck, namcona1, namcona1_joy, fa, ROT90,"Namco", "F/A (Japan)", 0 ) +GAME( 1992,swcourt, 0, namcona1w, namcona1_joy, swcourt, ROT0, "Namco", "Super World Court (World)", 0 ) +GAME( 1992,swcourtj, swcourt, namcona1w, namcona1_joy, swcourt, ROT0, "Namco", "Super World Court (Japan)", 0 ) +GAME( 1993,emeraldj, emeralda, namcona1w, namcona1_joy, emeraldj, ROT0, "Namco", "Emeraldia (Japan Version B)", 0 ) /* Parent is below on NA-2 Hardware */ +GAME( 1993,emerldja, emeralda, namcona1w, namcona1_joy, emeraldj, ROT0, "Namco", "Emeraldia (Japan)", 0 ) /* Parent is below on NA-2 Hardware */ +GAME( 1993,tinklpit, 0, namcona1w, namcona1_joy, tinklpit, ROT0, "Namco", "Tinkle Pit (Japan)", 0 ) // NA-2 (C70 MCU) GAME( 1992,knckhead, 0, namcona2, namcona2_joy, knckhead, ROT0, "Namco", "Knuckle Heads (World)", GAME_IMPERFECT_SOUND )