More dependency reduction.
[super-star-trek.git] / sstlinux.c
1 #include <sys/types.h>
2 #include <fcntl.h>
3 #include <sys/ioctl.h>
4 #include <linux/kd.h>
5
6 #include "sstlinux.h"
7
8 static int fd = 0;
9
10 void sound(unsigned int freq)
11 {
12     if(fd==0) fd=open("/dev/console", O_RDONLY);
13     if(fd>0) ioctl(fd, KDMKTONE, 1193180/freq + (0xFFFF<<16));
14 }
15
16 void nosound(void)
17 {
18     if(fd>0) ioctl(fd, KDMKTONE, 0);
19 }