From 2e0c1878b54d0d5c90d5c47bb1dbda0d894399f3 Mon Sep 17 00:00:00 2001 From: iq_132 <1191709+iq132@users.noreply.github.com> Date: Sat, 14 Jun 2014 18:56:31 +0000 Subject: [PATCH] Sound cpu (mcu) has an internal clock divider of 4. This fixes the sound for Dragon Buster. --- src/burn/drv/pre90s/d_skykid.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/burn/drv/pre90s/d_skykid.cpp b/src/burn/drv/pre90s/d_skykid.cpp index 18db423ee..e4fdb5db7 100644 --- a/src/burn/drv/pre90s/d_skykid.cpp +++ b/src/burn/drv/pre90s/d_skykid.cpp @@ -261,13 +261,14 @@ STDDIPINFO(Drgnbstr) static inline void sync_HD63701(INT32 run) { - INT32 nNext = (INT32)((float)((102400.000 * nM6809CyclesTotal) / 25600)); + INT32 nNext = nM6809CyclesTotal - nCyclesDone[1]; - if (nNext > 0) { + if (nNext > 0) + { if (run) { - nCyclesDone[1] += HD63701Run(nNext - nCyclesDone[1]); + nCyclesDone[1] += HD63701Run(nNext); } else { - nCyclesDone[1] += nNext - nCyclesDone[1]; + nCyclesDone[1] += nNext; } } } @@ -809,9 +810,9 @@ static INT32 DrvFrame() M6809NewFrame(); HD63701NewFrame(); - INT32 nInterleave = 100; + INT32 nInterleave = 10; INT32 nSoundBufferPos = 0; - INT32 nCyclesTotal[2] = { 1536000 / 60, 6144000 / 60 }; + INT32 nCyclesTotal[2] = { 1536000 / 60, 1536000 / 60 }; nCyclesDone[0] = nCyclesDone[1] = 0; for (INT32 i = 0; i < nInterleave; i++)