From 5d97fb886fb6ac8ea78b71e765a60eb193ebd93e Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Fri, 1 Mar 2024 16:10:31 +0600 Subject: [PATCH] Fix bad audio on ESFM emulation --- src/sound/snd_opl_esfm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sound/snd_opl_esfm.c b/src/sound/snd_opl_esfm.c index 16f728ab3..3720c8ada 100644 --- a/src/sound/snd_opl_esfm.c +++ b/src/sound/snd_opl_esfm.c @@ -112,14 +112,14 @@ esfm_drv_update(void *priv) { esfm_drv_t *dev = (esfm_drv_t *) priv; - if (dev->pos >= sound_pos_global) + if (dev->pos >= music_pos_global) return dev->buffer; esfm_drv_generate_stream(dev, &dev->buffer[dev->pos * 2], - sound_pos_global - dev->pos); + music_pos_global - dev->pos); - for (; dev->pos < sound_pos_global; dev->pos++) { + for (; dev->pos < music_pos_global; dev->pos++) { dev->buffer[dev->pos * 2] /= 2; dev->buffer[(dev->pos * 2) + 1] /= 2; }