repo.or.cz
/
mascara-docs.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
* added compilers lcc and bcc (linux86)
[mascara-docs.git]
/
compilers
/
linux86-0.16.17
/
libc
/
msdos
/
sound.c
blob
90c474c8a6e29d59fecd91157480b65c62d20bcc
1
2
#include <bios.h>
3
4
static int
port_val
= -
1
;
5
6
sound
(
freq
)
7
unsigned
freq
;
/* freq is in hertz */
8
{
9
if
(
port_val
== -
1
)
10
port_val
=
inp
(
0x61
);
11
12
freq
=
1193180L
/
freq
;
13
14
outp
(
0x61
,
port_val
|
3
);
15
outp
(
0x43
,
0xb6
);
16
outp
(
0x42
,
freq
&
0xFF
);
17
outp
(
0x42
, (
freq
>>
8
)&
0xFF
);
18
}
19
20
nosound
()
21
{
22
if
(
port_val
)
23
outp
(
0x61
,
port_val
);
24
else
25
outp
(
0x61
,
inp
(
0x61
)&~
3
);
26
}
27