summaryrefslogtreecommitdiff
path: root/games/xbreaky/patches/patch-ac
blob: 799411c0659b90f149bdcf9d174d6ffa0705463c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
$NetBSD: patch-ac,v 1.2 2007/07/31 10:17:38 joerg Exp $

--- xbreaky.snd.c.orig	2000-05-11 08:13:45.000000000 +0000
+++ xbreaky.snd.c
@@ -20,7 +20,7 @@
  */
 
 #include <stdio.h>
-#include <malloc.h>
+#include <stdlib.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <getopt.h>
@@ -28,11 +28,19 @@
 #include <string.h>
 #include <strings.h>
 #include <signal.h>
+#ifdef __NetBSD__
+#include <soundcard.h>
+#else
 #include <sys/soundcard.h>
+#endif
 #include <sys/ioctl.h>
 
 #define DEFAULT_DSP_SPEED 8000
+#ifdef __NetBSD__
+#define AUDIO "/dev/audio"
+#else
 #define AUDIO "/dev/dsp"
+#endif
 #define RAWFILESDIR PREFIX"/share/games/xbreaky"
 
 int timelimit = 0, dsp_speed = DEFAULT_DSP_SPEED, dsp_stereo = 0;
@@ -53,7 +61,6 @@ int main (int argc, char *argv[])
   char k;
 
   signal(SIGTERM, quit);   
-  fcntl(STDIN_FILENO,F_SETFL,O_NONBLOCK);
   audio = open (AUDIO, O_WRONLY, 0);
   if (audio == -1)
   {
@@ -101,7 +108,7 @@ int main (int argc, char *argv[])
    }
    if(i!=-1)  
    { 
-    play(names[(int)k]);
+    play(names[(int)k & 1]);
    }
   }