Skip to content

Commit

Permalink
More small pieces of ESS emulation
Browse files Browse the repository at this point in the history
  • Loading branch information
Cacodemon345 committed Mar 2, 2024
1 parent 8523a3e commit a338d46
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/include/86box/snd_sb_dsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
11 changes: 11 additions & 0 deletions src/sound/snd_sb_dsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit a338d46

Please sign in to comment.