From bf52804eae803b2400a151b4ac27c64794560e4f Mon Sep 17 00:00:00 2001 From: Barry Harris <44396066+barry65536@users.noreply.github.com> Date: Fri, 16 Mar 2012 15:54:22 +0000 Subject: [PATCH] Changed d_route16.cpp to use DACSync --- src/burn/drv/pre90s/d_route16.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/burn/drv/pre90s/d_route16.cpp b/src/burn/drv/pre90s/d_route16.cpp index be1ca5de3..c77d947e2 100644 --- a/src/burn/drv/pre90s/d_route16.cpp +++ b/src/burn/drv/pre90s/d_route16.cpp @@ -410,6 +410,11 @@ void stratvox_sn76477_write(UINT32, UINT32) } +static INT32 DrvSyncDAC() +{ + return (INT32)(float)(nBurnSoundLen * (ZetTotalCyclesPrecise() / (2500000.000 / (nBurnFPS / 100.000)))); +} + static INT32 DrvInit() { Mem = (UINT8*)BurnMalloc(0x10000 + 0x10000 + 0x200); @@ -459,7 +464,7 @@ static INT32 DrvInit() AY8910Init(0, 1250000, nBurnSoundRate, NULL, NULL, &stratvox_sn76477_write, NULL); - DACInit(0, 0, 1); + DACInit(0, 0, 1, DrvSyncDAC); DACSetVolShift(0, 2); DrvDoReset(); @@ -628,7 +633,7 @@ static INT32 DrvFrame() pSoundBuf[(n << 1) + 0] = nSample; pSoundBuf[(n << 1) + 1] = nSample; } - + DACUpdate(pSoundBuf, nSegmentLength); nSoundBufferPos += nSegmentLength; @@ -654,9 +659,9 @@ static INT32 DrvFrame() pSoundBuf[(n << 1) + 0] = nSample; pSoundBuf[(n << 1) + 1] = nSample; } + + DACUpdate(pSoundBuf, nSegmentLength); } - - DACUpdate(pSoundBuf, nSegmentLength); } if (pBurnDraw) {