More small pieces of ESS emulation

This commit is contained in:
Cacodemon345
2024-03-02 17:12:26 +06:00
committed by Kagamiin~
parent d5dad279c4
commit 97b239aed5
2 changed files with 12 additions and 0 deletions

View File

@@ -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;

View File

@@ -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);
}