summaryrefslogtreecommitdiff
path: root/games/quake2forge/files/patch-aa
diff options
context:
space:
mode:
authorAlexander Leidinger <netchild@FreeBSD.org>2003-01-31 09:55:59 +0000
committerAlexander Leidinger <netchild@FreeBSD.org>2003-01-31 09:55:59 +0000
commitbe651d79ad9418f76bcca0107773740a4cdc51fd (patch)
tree336bb23585439aa7ca6808806edf9d960cb8c09b /games/quake2forge/files/patch-aa
parent- Unbreak by updating to the 2002-08-23 "minor release" of 1.2.5 (diff)
This is the quakeforge version of quake2. To play it you need the official
quake2 CD for the data files. Submitted by: Ulrich Spoerlein <q@uni.de>
Notes
Notes: svn path=/head/; revision=74343
Diffstat (limited to 'games/quake2forge/files/patch-aa')
-rw-r--r--games/quake2forge/files/patch-aa69
1 files changed, 69 insertions, 0 deletions
diff --git a/games/quake2forge/files/patch-aa b/games/quake2forge/files/patch-aa
new file mode 100644
index 000000000000..bac7f8e2ced4
--- /dev/null
+++ b/games/quake2forge/files/patch-aa
@@ -0,0 +1,69 @@
+--- src/snd.c.orig Fri Oct 18 16:08:56 2002
++++ src/snd.c Tue Oct 15 17:56:17 2002
+@@ -211,12 +211,7 @@
+ sndbits = Cvar_Get("sndbits", "16", CVAR_ARCHIVE);
+ sndspeed = Cvar_Get("sndspeed", "0", CVAR_ARCHIVE);
+ sndchannels = Cvar_Get("sndchannels", "2", CVAR_ARCHIVE);
+-/* merged in from snd_bsd.c -- jaq */
+-#ifdef __linux__
+ snddevice = Cvar_Get("snddevice", "/dev/dsp", CVAR_ARCHIVE);
+-#else /* bsd */
+- snddevice = Cvar_Get("snddevice", "/dev/audio", CVAR_ARCHIVE);
+-#endif
+ }
+
+ // open /dev/dsp, check capability to mmap, and get size of dma buffer
+@@ -321,24 +316,6 @@
+ if (dma.channels < 1 || dma.channels > 2)
+ dma.channels = 2;
+
+- if (mmapped) {
+- dma.samples = info.fragstotal * info.fragsize / (dma.samplebits/8);
+- dma.submission_chunk = 1;
+-
+- // memory map the dma buffer
+-
+- if (!dma.buffer)
+- dma.buffer = (unsigned char *) mmap(NULL, info.fragstotal
+- * info.fragsize, PROT_WRITE, MAP_FILE|MAP_SHARED, audio_fd, 0);
+- if (!dma.buffer || dma.buffer == MAP_FAILED) {
+- perror(snddevice->string);
+- Com_Printf("SNDDMA_Init: Could not mmap %s.\n", snddevice->string);
+- close(audio_fd);
+- audio_fd = -1;
+- return 0;
+- }
+- }
+-
+ tmp = 0;
+ if (dma.channels == 2)
+ tmp = 1;
+@@ -432,6 +409,28 @@
+ } else {
+ tmp = 0;
+ rc = ioctl(audio_fd, SNDCTL_DSP_SETTRIGGER, &tmp);
++ dma.samples = info.fragstotal * info.fragsize / (dma.samplebits/8);
++ dma.submission_chunk = 1;
++
++ // memory map the dma buffer
++
++ if (!dma.buffer) {
++ dma.buffer = (unsigned char *) mmap(NULL, info.fragstotal * info.fragsize,
++#if (defined(__FreeBSD__) && (__FreeBSD_version < 500000))
++ PROT_READ|PROT_WRITE,
++#else
++ PROT_WRITE,
++#endif
++ MAP_FILE|MAP_SHARED, audio_fd, 0);
++ }
++ if (!dma.buffer || dma.buffer == MAP_FAILED) {
++ perror(snddevice->string);
++ Com_Printf("SNDDMA_Init: Could not mmap %s.\n", snddevice->string);
++ close(audio_fd);
++ audio_fd = -1;
++ return 0;
++ }
++
+ if (rc < 0) {
+ perror(snddevice->string);
+ Com_Printf("SNDDMA_Init: Could not toggle. (1)\n");