ReactOS 0.4.15-dev-7906-g1b85a5f
dsp.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SB_TRUE   0
 
#define SB_FALSE   1
 
#define DSP_MIXER_ADDRESS_PORT   0x04
 
#define DSP_MIXER_DATA_PORT   0x05
 
#define DSP_RESET_PORT   0x06
 
#define DSP_READ_DATA_PORT   0x0A
 
#define DSP_WRITE_PORT   0x0C
 
#define DSP_READ_STATUS_PORT   0x0E
 

Typedefs

typedef unsigned char sb_status
 

Functions

unsigned char read_dsp (unsigned short base)
 
void write_dsp (unsigned short base, unsigned char data)
 
sb_status detect_dsp (SB16 *sb16)
 
sb_status reset_dsp (unsigned short base_address)
 

Variables

unsigned short base
 
unsigned char irq
 
unsigned char dma8
 
unsigned char dma16
 

Macro Definition Documentation

◆ DSP_MIXER_ADDRESS_PORT

#define DSP_MIXER_ADDRESS_PORT   0x04

Definition at line 4 of file dsp.h.

◆ DSP_MIXER_DATA_PORT

#define DSP_MIXER_DATA_PORT   0x05

Definition at line 5 of file dsp.h.

◆ DSP_READ_DATA_PORT

#define DSP_READ_DATA_PORT   0x0A

Definition at line 7 of file dsp.h.

◆ DSP_READ_STATUS_PORT

#define DSP_READ_STATUS_PORT   0x0E

Definition at line 9 of file dsp.h.

◆ DSP_RESET_PORT

#define DSP_RESET_PORT   0x06

Definition at line 6 of file dsp.h.

◆ DSP_WRITE_PORT

#define DSP_WRITE_PORT   0x0C

Definition at line 8 of file dsp.h.

◆ SB_FALSE

#define SB_FALSE   1

Definition at line 2 of file dsp.h.

◆ SB_TRUE

#define SB_TRUE   0

Definition at line 1 of file dsp.h.

Typedef Documentation

◆ sb_status

Definition at line 11 of file dsp.h.

Function Documentation

◆ detect_dsp()

sb_status detect_dsp ( SB16 sb16)

Definition at line 38 of file dsp.c.

39{
40 for(base=0x200;base<0x280;base+=0x10) //Tries to reset all DSP addresses there is
42 {
43 sb16->base=base;
44 return SB_TRUE;
45 }
46 return SB_FALSE;
47}
SB16 sb16
Definition: sound.c:26
sb_status reset_dsp(unsigned short base_address)
Definition: dsp.c:56
#define SB_FALSE
Definition: dsp.h:2
#define SB_TRUE
Definition: dsp.h:1
unsigned short base
Definition: sb16.h:3

Referenced by sb16_getenvironment().

◆ read_dsp()

unsigned char read_dsp ( unsigned short  base)

Definition at line 24 of file dsp.c.

25{
26// while((inb(base+0x0e)&0x80)==0); //Wait until there is something to read
27// return inb(base+0x0a);
28 return 0;
29}

◆ reset_dsp()

sb_status reset_dsp ( unsigned short  base_address)

Definition at line 56 of file dsp.c.

57{
58// int delay;
59
60// outb(base_address+DSP_RESET_PORT,1);
61// for(delay=0;delay<0xffff;delay++);
62
63// outb(base_address+DSP_RESET_PORT,0);
64// for(delay=0;delay<0xffff;delay++);
65
66// if((inb(base_address+DSP_READ_STATUS_PORT)&0x80)==0) return SB_FALSE;
67
68// if(inb(base_address+DSP_READ_DATA_PORT)!=0xAA) return SB_FALSE;
69
70 return SB_TRUE;
71}

Referenced by detect_dsp().

◆ write_dsp()

void write_dsp ( unsigned short  base,
unsigned char  data 
)

Definition at line 73 of file dsp.c.

74{
75// while ((inb(base+DSP_WRITE_PORT) & 0x80) != 0);
76// outb(base+DSP_WRITE_PORT, data);
77}

Referenced by sb16_play().

Variable Documentation

◆ base

Definition at line 12 of file dsp.h.

◆ dma16

unsigned char dma16

Definition at line 13 of file dsp.h.

◆ dma8

unsigned char dma8

Definition at line 13 of file dsp.h.

◆ irq