ReactOS 0.4.16-dev-297-gc569aee
dsp.c File Reference
#include "sb16.h"
#include "dsp.h"
Include dependency graph for dsp.c:

Go to the source code of this file.

Functions

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

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().