diff --git a/src/include/86box/snd_sb_dsp.h b/src/include/86box/snd_sb_dsp.h index bf9ceab53..6f94a9801 100644 --- a/src/include/86box/snd_sb_dsp.h +++ b/src/include/86box/snd_sb_dsp.h @@ -141,6 +141,7 @@ typedef struct sb_dsp_t { uint8_t azt_eeprom[AZTECH_EEPROM_SIZE]; /* the eeprom in the Aztech cards is attached to the DSP */ uint8_t ess_regs[256]; /* ESS registers. */ + uint8_t ess_playback_mode; mpu_t *mpu; } sb_dsp_t; diff --git a/src/sound/snd_sb_dsp.c b/src/sound/snd_sb_dsp.c index 79415ac5b..1e2d469a2 100644 --- a/src/sound/snd_sb_dsp.c +++ b/src/sound/snd_sb_dsp.c @@ -1332,6 +1332,15 @@ sb_dsp_dma_attach(sb_dsp_t *dsp, dsp->dma_priv = priv; } +void +sb_ess_finish_dma(sb_dsp_t *dsp) +{ + if (!dsp->ess_playback_mode) + return; + ESSreg(0xB8) &= ~0x01; + dma_set_drq(dsp->sb_8_dmanum, 0); +} + void pollsb(void *priv) { @@ -1530,6 +1539,7 @@ pollsb(void *priv) else { dsp->sb_8_enable = 0; timer_disable(&dsp->output_timer); + sb_ess_finish_dma(dsp); } sb_irq(dsp, 1); } @@ -1582,6 +1592,7 @@ pollsb(void *priv) else { dsp->sb_16_enable = 0; timer_disable(&dsp->output_timer); + sb_ess_finish_dma(dsp); } sb_irq(dsp, 0); }