Fix game type parsing.
[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 #include "sstlinux.h"
6
7 static int fd = 0;
8
9 void sound(unsigned int freq)
10 {
11     if(fd==0) fd=open("/dev/console", O_RDONLY);
12     if(fd>0) ioctl(fd, KDMKTONE, 1193180/freq + (0xFFFF<<16));
13 }
14
15 void nosound(void)
16 {
17     if(fd>0) ioctl(fd, KDMKTONE, 0);
18 }