X-Git-Url: https://jxself.org/git/?p=super-star-trek.git;a=blobdiff_plain;f=src%2Fsstlinux.c;fp=src%2Fsstlinux.c;h=3c2ebbeb78fd5f48cb1d5d63933c481d8e8fc13b;hp=0000000000000000000000000000000000000000;hb=e535e2ef833a03ec84d0f002d684c07ddde893f1;hpb=6faaa79dff2fa3ceec44ef46b79e651f1bd9e0aa diff --git a/src/sstlinux.c b/src/sstlinux.c new file mode 100644 index 0000000..3c2ebbe --- /dev/null +++ b/src/sstlinux.c @@ -0,0 +1,27 @@ +#include "config.h" +#include "sstlinux.h" + +#ifdef HAVE_LINUX_KD_H + +#include +#include +#include +#include + +static int fd = 0; +#endif + +void sound(unsigned int freq) +{ +#ifdef HAVE_LINUX_KD_H + if(fd==0) fd=open("/dev/console", O_RDONLY); + if(fd>0) ioctl(fd, KDMKTONE, 1193180/freq + (0xFFFF<<16)); +#endif +} + +void nosound(void) +{ +#ifdef HAVE_LINUX_KD_H + if(fd>0) ioctl(fd, KDMKTONE, 0); +#endif +}