Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4973 | right-hear | 1 | /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
2 | #include |
||
3 | #include |
||
4 | |||
5 | void sound(int freq) |
||
6 | { |
||
7 | int scale; |
||
8 | if (freq == 0) |
||
9 | { |
||
10 | outportb(0x61, inportb(0x61) & ~3); |
||
11 | return; |
||
12 | } |
||
13 | scale = 1193046 / freq; |
||
14 | outportb(0x43, 0xb6); |
||
15 | outportb(0x42, scale & 0xff); |
||
16 | outportb(0x42, scale >> 8); |
||
17 | outportb(0x61, inportb(0x61) | 3); |
||
18 | } |