little update to shaolins

This commit is contained in:
dinkc64 2014-10-23 05:03:01 +00:00
parent 8e0769f100
commit e5a925d9b1
1 changed files with 19 additions and 4 deletions

View File

@ -360,10 +360,10 @@ static INT32 DrvInit()
M6809SetReadHandler(shaolins_read);
M6809Close();
SN76496Init(0, 1536000, 0);
SN76489Init(0, 1536000, 0);
SN76496SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH);
SN76496Init(1, 3072000, 1);
SN76489Init(1, 3072000, 1);
SN76496SetRoute(1, 1.00, BURN_SND_ROUTE_BOTH);
GenericTilesInit();
@ -486,6 +486,7 @@ static INT32 DrvFrame()
INT32 nInterleave = 256;
INT32 nCyclesTotal[1] = { 1536000 / 60 };
INT32 nCyclesDone[1] = { 0 };
INT32 nSoundBufferPos = 0;
M6809Open(0);
@ -497,11 +498,25 @@ static INT32 DrvFrame()
M6809SetIRQLine(0x20, M6809_IRQSTATUS_AUTO); // 480x/second (8x/frame)
if (i == 240) M6809SetIRQLine(0, M6809_IRQSTATUS_AUTO);
// Render Sound Segment
if (pBurnSoundOut) {
INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos;
INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1);
SN76496Update(0, pSoundBuf, nSegmentLength);
SN76496Update(1, pSoundBuf, nSegmentLength);
nSoundBufferPos += nSegmentLength;
}
}
// Make sure the buffer is entirely filled.
if (pBurnSoundOut) {
SN76496Update(0, pBurnSoundOut, nBurnSoundLen);
SN76496Update(1, pBurnSoundOut, nBurnSoundLen);
INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos;
INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1);
if (nSegmentLength) {
SN76496Update(0, pSoundBuf, nSegmentLength);
SN76496Update(1, pSoundBuf, nSegmentLength);
}
}
M6809Close();