Skip to content

Commit

Permalink
Fix bad audio on ESFM emulation
Browse files Browse the repository at this point in the history
  • Loading branch information
Cacodemon345 committed Mar 1, 2024
1 parent a8622e3 commit 3e685d4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/sound/snd_opl_esfm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 3e685d4

Please sign in to comment.