diff options
author | 2007-12-19 19:46:12 +0000 | |
---|---|---|
committer | 2007-12-19 19:46:12 +0000 | |
commit | cae7ef0587d74436e14519af2798911fcbce284c (patch) | |
tree | 539f45d0d26db0c4a68073dd3d42013ad6b83858 /src/emu/sound/c140.c | |
parent | 675246085eb0c9d61ff7a49ef33459bbb1a3df11 (diff) |
* Fixed C219 sample read order and implemented sign+magnitude format.
* Removed GAME_IMPERFECT_SOUND flag from all Namco NA-1 games.
Diffstat (limited to 'src/emu/sound/c140.c')
-rw-r--r-- | src/emu/sound/c140.c | 21 |
1 files changed, 17 insertions, 4 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 */ |