Sound Blaster / ESS: DSP reset now properly disables DMA, fixes the OS/2 ESS ES688 driver.
This commit is contained in:
@@ -814,8 +814,6 @@ dma16_read(uint16_t addr, UNUSED(void *priv))
|
|||||||
case 7: /*Count registers*/
|
case 7: /*Count registers*/
|
||||||
dma_wp[1] ^= 1;
|
dma_wp[1] ^= 1;
|
||||||
count = dma[channel].cc/* + 1*/;
|
count = dma[channel].cc/* + 1*/;
|
||||||
// if (count > dma[channel].cb)
|
|
||||||
// count = 0x0000;
|
|
||||||
if (dma_wp[1])
|
if (dma_wp[1])
|
||||||
ret = count & 0xff;
|
ret = count & 0xff;
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -446,11 +446,47 @@ sb_dsp_set_mpu(sb_dsp_t *dsp, mpu_t *mpu)
|
|||||||
mpu401_irq_attach(mpu, sb_dsp_irq_update, sb_dsp_irq_pending, dsp);
|
mpu401_irq_attach(mpu, sb_dsp_irq_update, sb_dsp_irq_pending, dsp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
sb_stop_dma(const sb_dsp_t *dsp)
|
||||||
|
{
|
||||||
|
dma_set_drq(dsp->sb_8_dmanum, 0);
|
||||||
|
|
||||||
|
if (dsp->sb_16_dmanum != 0xff) {
|
||||||
|
if (dsp->sb_16_dmanum == 4)
|
||||||
|
dma_set_drq(dsp->sb_8_dmanum, 0);
|
||||||
|
else
|
||||||
|
dma_set_drq(dsp->sb_16_dmanum, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dsp->sb_16_8_dmanum != 0xff)
|
||||||
|
dma_set_drq(dsp->sb_16_8_dmanum, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
sb_finish_dma(sb_dsp_t *dsp)
|
||||||
|
{
|
||||||
|
if (dsp->ess_playback_mode) {
|
||||||
|
ESSreg(0xB8) &= ~0x01;
|
||||||
|
dma_set_drq(dsp->sb_8_dmanum, 0);
|
||||||
|
} else
|
||||||
|
sb_stop_dma(dsp);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
sb_dsp_reset(sb_dsp_t *dsp)
|
sb_dsp_reset(sb_dsp_t *dsp)
|
||||||
{
|
{
|
||||||
midi_clear_buffer();
|
midi_clear_buffer();
|
||||||
|
|
||||||
|
if (dsp->sb_8_enable) {
|
||||||
|
dsp->sb_8_enable = 0;
|
||||||
|
sb_finish_dma(dsp);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dsp->sb_16_enable) {
|
||||||
|
dsp->sb_16_enable = 0;
|
||||||
|
sb_finish_dma(dsp);
|
||||||
|
}
|
||||||
|
|
||||||
timer_disable(&dsp->output_timer);
|
timer_disable(&dsp->output_timer);
|
||||||
timer_disable(&dsp->input_timer);
|
timer_disable(&dsp->input_timer);
|
||||||
|
|
||||||
@@ -565,22 +601,6 @@ sb_resume_dma(const sb_dsp_t *dsp, const int is_8)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
sb_stop_dma(const sb_dsp_t *dsp)
|
|
||||||
{
|
|
||||||
dma_set_drq(dsp->sb_8_dmanum, 0);
|
|
||||||
|
|
||||||
if (dsp->sb_16_dmanum != 0xff) {
|
|
||||||
if (dsp->sb_16_dmanum == 4)
|
|
||||||
dma_set_drq(dsp->sb_8_dmanum, 0);
|
|
||||||
else
|
|
||||||
dma_set_drq(dsp->sb_16_dmanum, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dsp->sb_16_8_dmanum != 0xff)
|
|
||||||
dma_set_drq(dsp->sb_16_8_dmanum, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
sb_start_dma(sb_dsp_t *dsp, int dma8, int autoinit, uint8_t format, int len)
|
sb_start_dma(sb_dsp_t *dsp, int dma8, int autoinit, uint8_t format, int len)
|
||||||
{
|
{
|
||||||
@@ -2206,16 +2226,6 @@ sb_dsp_dma_attach(sb_dsp_t *dsp,
|
|||||||
dsp->dma_priv = priv;
|
dsp->dma_priv = priv;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
sb_finish_dma(sb_dsp_t *dsp)
|
|
||||||
{
|
|
||||||
if (dsp->ess_playback_mode) {
|
|
||||||
ESSreg(0xB8) &= ~0x01;
|
|
||||||
dma_set_drq(dsp->sb_8_dmanum, 0);
|
|
||||||
} else
|
|
||||||
sb_stop_dma(dsp);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
sb_espcm_fifoctl_run(sb_dsp_t *dsp)
|
sb_espcm_fifoctl_run(sb_dsp_t *dsp)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user