From 67e518b2711520d98018963be8be9d97f849411c Mon Sep 17 00:00:00 2001 From: dinkc64 <12570148+dinkc64@users.noreply.github.com> Date: Tue, 2 Dec 2014 18:17:23 +0000 Subject: [PATCH] Fix clipping/static in several NeoGeo games (Art of Fighting, Football Frenzy and more) with FM interpolation on --- src/burn/snd/burn_ym2610.cpp | 2 +- src/burn/snd/ym2151.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/burn/snd/burn_ym2610.cpp b/src/burn/snd/burn_ym2610.cpp index f9a40ddcc..55f89fabb 100644 --- a/src/burn/snd/burn_ym2610.cpp +++ b/src/burn/snd/burn_ym2610.cpp @@ -121,7 +121,7 @@ static void YM2610UpdateResample(INT16* pSoundBuf, INT32 nSegmentEnd) pYM2610Buffer[5] = pBuffer + 5 * 4096 + 4; for (INT32 i = (nFractionalPosition >> 16) - 4; i < nSamplesNeeded; i++) { - pYM2610Buffer[5][i] = pYM2610Buffer[2][i] + pYM2610Buffer[3][i] + pYM2610Buffer[4][i]; + pYM2610Buffer[5][i] = BURN_SND_CLIP(pYM2610Buffer[2][i] + pYM2610Buffer[3][i] + pYM2610Buffer[4][i]); } for (INT32 i = (nFractionalPosition & 0xFFFF0000) >> 15; i < nSegmentLength; i += 2, nFractionalPosition += nSampleSize) { diff --git a/src/burn/snd/ym2151.c b/src/burn/snd/ym2151.c index 90496353a..2b7666740 100644 --- a/src/burn/snd/ym2151.c +++ b/src/burn/snd/ym2151.c @@ -583,9 +583,9 @@ static void init_tables(void) /* we never reach zero here due to ((i*2)+1) */ if (m>0.0) - o = 8*log(1.0/m)/log(2); /* convert to 'decibels' */ + o = 8*log(1.0/m)/log(2.0); /* convert to 'decibels' */ else - o = 8*log(-1.0/m)/log(2); /* convert to 'decibels' */ + o = 8*log(-1.0/m)/log(2.0); /* convert to 'decibels' */ o = o / (ENV_STEP/4);