From 299a85bfad6d1ffb3848312cada968f54797e28c Mon Sep 17 00:00:00 2001 From: Zachary Hall Date: Wed, 16 Oct 2024 10:34:33 -0700 Subject: [PATCH] Update --- backends/playback/zsm/zsm_backend.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/backends/playback/zsm/zsm_backend.cpp b/backends/playback/zsm/zsm_backend.cpp index e41807b..394ac77 100644 --- a/backends/playback/zsm/zsm_backend.cpp +++ b/backends/playback/zsm/zsm_backend.cpp @@ -132,7 +132,6 @@ void ZsmBackend::tick(bool step) { while (YM_read_status()) { size_t clocksToAddForYm = 64; ticks_remaining -= clocksToAddForYm; - prevCpuClocks += clocksToAddForYm; if (ticks_remaining < 0) { delayTicks -= 1; nextCpuClocks += ClocksPerTick; @@ -211,7 +210,7 @@ void ZsmBackend::tick(bool step) { size_t nextCpuClocksInt = std::floor(nextCpuClocks); size_t prevCpuClocksInt = std::floor(prevCpuClocks); size_t cpuClocksIntDelta = nextCpuClocksInt - prevCpuClocksInt; - audio_step(cpuClocksIntDelta); + audio_step(ticks_remaining); cpuClocks = std::fmod(nextCpuClocks, ClocksPerTick); } size_t ZsmBackend::render(void *buf, size_t maxlen) {