summaryrefslogtreecommitdiff
path: root/games/quake/patches/patch-aj
diff options
context:
space:
mode:
Diffstat (limited to 'games/quake/patches/patch-aj')
-rw-r--r--games/quake/patches/patch-aj41
1 files changed, 25 insertions, 16 deletions
diff --git a/games/quake/patches/patch-aj b/games/quake/patches/patch-aj
index 50be61af72e..28d92b4e732 100644
--- a/games/quake/patches/patch-aj
+++ b/games/quake/patches/patch-aj
@@ -1,8 +1,8 @@
-$NetBSD: patch-aj,v 1.2 2002/01/02 10:01:36 hubertf Exp $
+$NetBSD: patch-aj,v 1.3 2006/05/12 12:40:10 joerg Exp $
---- winquake/snd_linux.c Tue Dec 21 18:40:36 1999
-+++ ../work/winquake/snd_linux.c Thu Jan 20 21:52:45 2000
-@@ -25,15 +6,33 @@
+--- winquake/snd_linux.c.orig 1999-12-21 18:40:36.000000000 +0000
++++ winquake/snd_linux.c
+@@ -25,15 +25,42 @@ Foundation, Inc., 59 Temple Place - Suit
#include <sys/mman.h>
#include <sys/shm.h>
#include <sys/wait.h>
@@ -11,6 +11,10 @@ $NetBSD: patch-aj,v 1.2 2002/01/02 10:01:36 hubertf Exp $
+#include <soundcard.h>
+#endif
+
++#if defined(__DragonFly__)
++#include <sys/soundcard.h>
++#endif
++
+#ifdef __linux__
#include <linux/soundcard.h>
+#endif
@@ -25,19 +29,24 @@ $NetBSD: patch-aj,v 1.2 2002/01/02 10:01:36 hubertf Exp $
static int tryrates[] = { 11025, 22051, 44100, 8000 };
+#ifdef __linux__
-+char *audio_device="/dev/dsp";
++const char *audio_device="/dev/dsp";
+#define MMAP_PROTECTION PROT_WRITE
+#endif
+
+#ifdef __NetBSD__
-+char *audio_device="/dev/audio";
++const char *audio_device="/dev/audio";
++#define MMAP_PROTECTION PROT_WRITE|PROT_READ
++#endif
++
++#if defined(__DragonFly__)
++const char *audio_device="/dev/dsp";
+#define MMAP_PROTECTION PROT_WRITE|PROT_READ
+#endif
+
qboolean SNDDMA_Init(void)
{
-@@ -47,28 +46,29 @@
+@@ -47,28 +74,29 @@ qboolean SNDDMA_Init(void)
snd_inited = 0;
@@ -74,7 +83,7 @@ $NetBSD: patch-aj,v 1.2 2002/01/02 10:01:36 hubertf Exp $
Con_Printf("Sound driver too old\n");
close(audio_fd);
return 0;
-@@ -130,11 +130,11 @@
+@@ -130,11 +158,11 @@ qboolean SNDDMA_Init(void)
// memory map the dma buffer
shm->buffer = (unsigned char *) mmap(NULL, info.fragstotal
@@ -89,7 +98,7 @@ $NetBSD: patch-aj,v 1.2 2002/01/02 10:01:36 hubertf Exp $
close(audio_fd);
return 0;
}
-@@ -145,8 +145,8 @@
+@@ -145,8 +173,8 @@ qboolean SNDDMA_Init(void)
rc = ioctl(audio_fd, SNDCTL_DSP_STEREO, &tmp);
if (rc < 0)
{
@@ -100,7 +109,7 @@ $NetBSD: patch-aj,v 1.2 2002/01/02 10:01:36 hubertf Exp $
close(audio_fd);
return 0;
}
-@@ -158,8 +158,8 @@
+@@ -158,8 +186,8 @@ qboolean SNDDMA_Init(void)
rc = ioctl(audio_fd, SNDCTL_DSP_SPEED, &shm->speed);
if (rc < 0)
{
@@ -111,7 +120,7 @@ $NetBSD: patch-aj,v 1.2 2002/01/02 10:01:36 hubertf Exp $
close(audio_fd);
return 0;
}
-@@ -170,7 +170,7 @@
+@@ -170,7 +198,7 @@ qboolean SNDDMA_Init(void)
rc = ioctl(audio_fd, SNDCTL_DSP_SETFMT, &rc);
if (rc < 0)
{
@@ -120,7 +129,7 @@ $NetBSD: patch-aj,v 1.2 2002/01/02 10:01:36 hubertf Exp $
Con_Printf("Could not support 16-bit data. Try 8-bit.\n");
close(audio_fd);
return 0;
-@@ -182,7 +182,7 @@
+@@ -182,7 +210,7 @@ qboolean SNDDMA_Init(void)
rc = ioctl(audio_fd, SNDCTL_DSP_SETFMT, &rc);
if (rc < 0)
{
@@ -129,7 +138,7 @@ $NetBSD: patch-aj,v 1.2 2002/01/02 10:01:36 hubertf Exp $
Con_Printf("Could not support 8-bit data.\n");
close(audio_fd);
return 0;
-@@ -190,7 +190,7 @@
+@@ -190,7 +218,7 @@ qboolean SNDDMA_Init(void)
}
else
{
@@ -138,7 +147,7 @@ $NetBSD: patch-aj,v 1.2 2002/01/02 10:01:36 hubertf Exp $
Con_Printf("%d-bit sound not supported.", shm->samplebits);
close(audio_fd);
return 0;
-@@ -202,7 +202,7 @@
+@@ -202,7 +230,7 @@ qboolean SNDDMA_Init(void)
rc = ioctl(audio_fd, SNDCTL_DSP_SETTRIGGER, &tmp);
if (rc < 0)
{
@@ -147,7 +156,7 @@ $NetBSD: patch-aj,v 1.2 2002/01/02 10:01:36 hubertf Exp $
Con_Printf("Could not toggle.\n");
close(audio_fd);
return 0;
-@@ -211,7 +211,7 @@
+@@ -211,7 +239,7 @@ qboolean SNDDMA_Init(void)
rc = ioctl(audio_fd, SNDCTL_DSP_SETTRIGGER, &tmp);
if (rc < 0)
{
@@ -156,7 +165,7 @@ $NetBSD: patch-aj,v 1.2 2002/01/02 10:01:36 hubertf Exp $
Con_Printf("Could not toggle.\n");
close(audio_fd);
return 0;
-@@ -233,7 +233,7 @@
+@@ -233,7 +261,7 @@ int SNDDMA_GetDMAPos(void)
if (ioctl(audio_fd, SNDCTL_DSP_GETOPTR, &count)==-1)
{