SMS - Mix YM & SN Sound

This commit is contained in:
Barry Harris 2015-03-12 23:11:01 +00:00
parent 6c81946d46
commit 691a550618
2 changed files with 12 additions and 5 deletions

View File

@ -23,7 +23,7 @@ INT32 sound_init(void)
return 0;
// Init sound emulation
SN76489Init(0, snd.psg_clock, 0);
SN76489Init(0, snd.psg_clock, 1);
SN76496SetRoute(0, 0.70, BURN_SND_ROUTE_BOTH);
FM_Init();

View File

@ -106,9 +106,13 @@ void system_frame(INT32 skip_render)
if (pBurnSoundOut) {
INT32 nSegmentLength = nBurnSoundLen / lpf;
INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1);
SN76496Update(0, pSoundBuf, nSegmentLength);
if (sms.use_fm)
if (sms.use_fm) {
BurnYM2413Render(pSoundBuf, nSegmentLength);
} else {
memset(pSoundBuf, 0, nSegmentLength * 2 * sizeof(INT16));
}
SN76496Update(0, pSoundBuf, nSegmentLength);
nSoundBufferPos += nSegmentLength;
}
@ -123,9 +127,12 @@ void system_frame(INT32 skip_render)
INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos;
INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1);
if (nSegmentLength) {
SN76496Update(0, pSoundBuf, nSegmentLength);
if (sms.use_fm)
if (sms.use_fm) {
BurnYM2413Render(pSoundBuf, nSegmentLength);
} else {
memset(pSoundBuf, 0, nSegmentLength * 2 * sizeof(INT16));
}
SN76496Update(0, pSoundBuf, nSegmentLength);
}
}
}