Fix crackles when interpolation=0 in ym 3812, 2610, 2203 & clear the savestate registers @ init and on reset in ym2151

This commit is contained in:
dinkc64 2014-05-10 14:08:38 +00:00
parent f162c2362e
commit ee67e268a2
4 changed files with 14 additions and 6 deletions

View File

@ -147,6 +147,7 @@ void BurnYM2151Reset()
if (!DebugSnd_YM2151Initted) bprintf(PRINT_ERROR, _T("BurnYM2151Reset called without init\n"));
#endif
memset(&BurnYM2151Registers, 0, sizeof(BurnYM2151Registers));
YM2151ResetChip(0);
}
@ -201,6 +202,7 @@ INT32 BurnYM2151Init(INT32 nClockFrequency)
nFractionalPosition = 4 << 16;
nSamplesRendered = 0;
nBurnPosition = 0;
memset(&BurnYM2151Registers, 0, sizeof(BurnYM2151Registers));
// default routes
YM2151Volumes[BURN_SND_YM2151_YM2151_ROUTE_1] = 1.00;

View File

@ -384,8 +384,10 @@ static void YM2203UpdateNormal(INT16* pSoundBuf, INT32 nSegmentEnd)
nRightSample = BURN_SND_CLIP(nRightSample);
if (bYM2203AddSignal) {
pSoundBuf[(n << 1) + 0] += nLeftSample;
pSoundBuf[(n << 1) + 1] += nRightSample;
//pSoundBuf[(n << 1) + 0] += nLeftSample;
//pSoundBuf[(n << 1) + 1] += nRightSample;
pSoundBuf[(n << 1) + 0] = BURN_SND_CLIP(pSoundBuf[(n << 1) + 0] + nLeftSample);
pSoundBuf[(n << 1) + 1] = BURN_SND_CLIP(pSoundBuf[(n << 1) + 1] + nRightSample);
} else {
pSoundBuf[(n << 1) + 0] = nLeftSample;
pSoundBuf[(n << 1) + 1] = nRightSample;

View File

@ -307,8 +307,10 @@ static void YM2610UpdateNormal(INT16* pSoundBuf, INT32 nSegmentEnd)
nRightSample = BURN_SND_CLIP(nRightSample);
if (bYM2610AddSignal) {
pSoundBuf[(n << 1) + 0] += nLeftSample;
pSoundBuf[(n << 1) + 1] += nRightSample;
//pSoundBuf[(n << 1) + 0] += nLeftSample;
//pSoundBuf[(n << 1) + 1] += nRightSample;
pSoundBuf[(n << 1) + 0] = BURN_SND_CLIP(pSoundBuf[(n << 1) + 0] + nLeftSample);
pSoundBuf[(n << 1) + 1] = BURN_SND_CLIP(pSoundBuf[(n << 1) + 1] + nRightSample);
} else {
pSoundBuf[(n << 1) + 0] = nLeftSample;
pSoundBuf[(n << 1) + 1] = nRightSample;

View File

@ -452,8 +452,10 @@ static void YM3812UpdateNormal(INT16* pSoundBuf, INT32 nSegmentEnd)
nRightSample = BURN_SND_CLIP(nRightSample);
if (bYM3812AddSignal) {
pSoundBuf[(n << 1) + 0] += nLeftSample;
pSoundBuf[(n << 1) + 1] += nRightSample;
//pSoundBuf[(n << 1) + 0] += nLeftSample;
//pSoundBuf[(n << 1) + 1] += nRightSample;
pSoundBuf[(n << 1) + 0] = BURN_SND_CLIP(pSoundBuf[(n << 1) + 0] + nLeftSample);
pSoundBuf[(n << 1) + 1] = BURN_SND_CLIP(pSoundBuf[(n << 1) + 1] + nRightSample);
} else {
pSoundBuf[(n << 1) + 0] = nLeftSample;
pSoundBuf[(n << 1) + 1] = nRightSample;