Skip to content

Commit

Permalink
fix SB16 IRQ/DMA mixer registers init.
Browse files Browse the repository at this point in the history
  • Loading branch information
crazii committed Apr 27, 2024
1 parent ae94687 commit 70db5c4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions sbemu/sbemu.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ void SBEMU_Mixer_Write(uint16_t port, uint8_t value)
SBEMU_MixerRegs[SBEMU_MixerRegIndex] = value;
if(SBEMU_MixerRegIndex == SBEMU_MIXERREG_RESET)
{
//special IRQ&DMA regs
SBEMU_MixerRegs[SBEMU_MIXERREG_INT_SETUP] = 1<<SBEMU_Indexof(SBEMU_IRQMap,countof(SBEMU_IRQMap),SBEMU_IRQ);
SBEMU_MixerRegs[SBEMU_MIXERREG_DMA_SETUP] = ((1<<SBEMU_DMA)|(SBEMU_HDMA?(1<<SBEMU_HDMA):0))&0xEB;
SBEMU_MixerRegs[SBEMU_MIXERREG_MODEFILTER] = 0xFD; //mask out stereo

// Mixer Registers are documented here:
// https://pdos.csail.mit.edu/6.828/2018/readings/hardware/SoundBlaster.pdf

Expand Down Expand Up @@ -196,8 +201,6 @@ void SBEMU_DSP_Reset(uint16_t port, uint8_t value)
if(value == 1)
{
SBEMU_ResetState = SBEMU_RESET_START;
SBEMU_MixerRegs[SBEMU_MIXERREG_INT_SETUP] = 1<<SBEMU_Indexof(SBEMU_IRQMap,countof(SBEMU_IRQMap),SBEMU_IRQ);
SBEMU_MixerRegs[SBEMU_MIXERREG_DMA_SETUP] = ((1<<SBEMU_DMA)|(SBEMU_HDMA?(1<<SBEMU_HDMA):0))&0xEB;
SBEMU_MixerRegs[SBEMU_MIXERREG_MODEFILTER] = 0xFD; //mask out stereo
SBEMU_MixerRegIndex = 0;
SBEMU_DSPCMD = SBEMU_DSPCMD_INVALID;
Expand Down

0 comments on commit 70db5c4

Please sign in to comment.