Moved dd/sound into sound/sound
[reactos.git] / reactos / drivers / sound / sound / mixer.c
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * FILE: drivers/dd/sound/mixer.c
5 * PURPOSE: Wave Mixer?
6 * PROGRAMMER: ?
7 *
8 * UPDATE HISTORY:
9 * ??/??/??: Created
10 * 10/23/02: Steven Edwards (Steven_Ed4153@yahoo.com)
11 * Minor build fixes
12 */
13
14 #include "sb16.h"
15 #include "dsp.h"
16 #include "mixer.h"
17
18 unsigned char read_mixer(unsigned short base,unsigned char reg)
19 {
20
21 // outb(base+0x04,reg);
22 // return inb(base+0x05);
23 return 0;
24 }
25
26 unsigned char get_irq(SB16* sb16)
27 {
28 unsigned char irq;
29 irq=(read_mixer(sb16->base,MIXER_INTERRUPT_SETUP_REGISTER)&0x0f);
30
31 if(irq==1) sb16->irq=2;
32 if(irq==2) sb16->irq=5;
33 if(irq==4) sb16->irq=7;
34 if(irq==8) sb16->irq=10;
35 return 0;
36 }
37
38 void get_dma(SB16* sb16)
39 {
40 unsigned char hi,lo,result=read_mixer(sb16->base,MIXER_DMA_SETUP_REGISTER);
41 hi=result&0xE0;
42 lo=result&0x0B;
43 if(hi==0x80) sb16->dma16=7;
44 if(hi==0x40) sb16->dma16=6;
45 if(hi==0x20) sb16->dma16=5;
46
47 if(lo==0x08) sb16->dma8=3;
48 if(lo==0x02) sb16->dma8=1;
49 if(lo==0x01) sb16->dma8=0;
50 }