From e5a925d9b18f34985540daef3955b82b62864648 Mon Sep 17 00:00:00 2001 From: dinkc64 <12570148+dinkc64@users.noreply.github.com> Date: Thu, 23 Oct 2014 05:03:01 +0000 Subject: [PATCH] little update to shaolins --- src/burn/drv/konami/d_shaolins.cpp | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/burn/drv/konami/d_shaolins.cpp b/src/burn/drv/konami/d_shaolins.cpp index ba72ef057..218b281c8 100644 --- a/src/burn/drv/konami/d_shaolins.cpp +++ b/src/burn/drv/konami/d_shaolins.cpp @@ -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();