summaryrefslogtreecommitdiff
path: root/games/nighthawk/patches/patch-bb
blob: 72506a4927c9ea2e81d001d9fd20021a944d0e43 (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
51
52
53
54
55
$NetBSD: patch-bb,v 1.3 2005/06/07 05:33:20 minskim Exp $

--- src_sound/dsp_mixxer.c.orig	1998-06-22 05:41:31.000000000 -0500
+++ src_sound/dsp_mixxer.c
@@ -23,6 +23,8 @@
  #include <sys/soundcard.h>
 #elif FreeBSD
  #include <machine/soundcard.h>
+#elif defined(__NetBSD__)
+ #include <soundcard.h>
 #endif
 #include "funktracker_defs.h"
 #include "funktracker.h"
@@ -91,7 +93,7 @@ void init_dsp_buffers(void)
   register int x;
 
   calc_mix_buffer(funk_info.bpm_rate);
-  ioctl(dsp_fp,SNDCTL_DSP_RESET);
+  ioctl(dsp_fp,SNDCTL_DSP_RESET, 0);
   for(x = 0;x < mix_buffer_size;x++)
   {
     *(left_mix_buffer + x) = 0;
@@ -187,7 +189,7 @@ void close_dsp(void)
 {
   if(dsp_fp != -1)
   {
-    ioctl(dsp_fp,SNDCTL_DSP_RESET);
+    ioctl(dsp_fp,SNDCTL_DSP_RESET, 0);
     close(dsp_fp);
   }
 }
@@ -247,12 +249,12 @@ int open_dsp(int srate,int prec,int st)
   if(dsp_alloc_bufs())
   {
     printf("Allocated dsp buffers..\n");
-    dsp_fp = open("/dev/dsp",O_WRONLY,0);
+    dsp_fp = open(DEVOSSAUDIO,O_WRONLY,0);
     if(dsp_fp != -1)
     {
       int frag;
 
-      printf("Opened /dev/dsp: %d bit %s, %d Hz (%d frames @ %d bytes)\n",
+      printf("Opened " DEVOSSAUDIO ": %d bit %s, %d Hz (%d frames @ %d bytes)\n",
         funk_info.precision,
         funk_info.stereo == 8 ? "mono" : "stereo",
         funk_info.sampling_rate,
@@ -265,7 +267,7 @@ int open_dsp(int srate,int prec,int st)
       return 1;
     }
     else
-      printf("Error: Couldn't open /dev/dsp. Program aborted.\n");
+      printf("Error: Couldn't open " DEVOSSAUDIO". Program aborted.\n");
     dsp_dealloc_bufs();
   }
   else