summaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
authornia <nia@pkgsrc.org>2021-01-14 13:23:25 +0000
committernia <nia@pkgsrc.org>2021-01-14 13:23:25 +0000
commit66554c709e14ea2da42fd44214e5d6c7e2178542 (patch)
tree55a1a4b2fad316a87720f62fb3331c5fa8b18c6e /games
parentb10256a922ff2bb6c2c7c434a42a9684fbcdf06d (diff)
downloadpkgsrc-66554c709e14ea2da42fd44214e5d6c7e2178542.tar.gz
Remove games/quake
This has bitrotted with time and no longer works on its target platforms, having been surpassed by newer "faithful ports" like games/tyrquake PR pkg/29439
Diffstat (limited to 'games')
-rw-r--r--games/Makefile3
-rw-r--r--games/quake/DESCR1
-rw-r--r--games/quake/MESSAGE10
-rw-r--r--games/quake/Makefile61
-rw-r--r--games/quake/PLIST6
-rw-r--r--games/quake/distinfo22
-rw-r--r--games/quake/patches/patch-aa549
-rw-r--r--games/quake/patches/patch-ab13
-rw-r--r--games/quake/patches/patch-ac43
-rw-r--r--games/quake/patches/patch-ad176
-rw-r--r--games/quake/patches/patch-ae115
-rw-r--r--games/quake/patches/patch-af13
-rw-r--r--games/quake/patches/patch-ag547
-rw-r--r--games/quake/patches/patch-ah14
-rw-r--r--games/quake/patches/patch-ai84
-rw-r--r--games/quake/patches/patch-aj176
-rw-r--r--games/quake/patches/patch-ak14
-rw-r--r--games/quake/patches/patch-al13
-rw-r--r--games/quake/patches/patch-am13
-rw-r--r--games/quake/patches/patch-an13
-rw-r--r--games/quake/patches/patch-ao27
-rw-r--r--games/quake/patches/patch-ap13
22 files changed, 1 insertions, 1925 deletions
diff --git a/games/Makefile b/games/Makefile
index 23b85d858cf..5f52b11c2c6 100644
--- a/games/Makefile
+++ b/games/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.494 2020/09/30 08:07:56 nia Exp $
+# $NetBSD: Makefile,v 1.495 2021/01/14 13:23:25 nia Exp $
#
COMMENT= Games
@@ -339,7 +339,6 @@ SUBDIR+= qonk
SUBDIR+= qqwing
SUBDIR+= qstat
SUBDIR+= quadrupleback
-SUBDIR+= quake
SUBDIR+= quake2forge
SUBDIR+= quake6
SUBDIR+= quakedata
diff --git a/games/quake/DESCR b/games/quake/DESCR
deleted file mode 100644
index 49e1d182769..00000000000
--- a/games/quake/DESCR
+++ /dev/null
@@ -1 +0,0 @@
-legendary first person shoot'em up game
diff --git a/games/quake/MESSAGE b/games/quake/MESSAGE
deleted file mode 100644
index e4b54ee7d0e..00000000000
--- a/games/quake/MESSAGE
+++ /dev/null
@@ -1,10 +0,0 @@
-===========================================================================
-$NetBSD: MESSAGE,v 1.1 2003/11/18 14:13:47 xtraeme Exp $
-
-To run quake you need data files. The quakedata package, which contains
-the shareware data, has been installed.
-
-To start a game, run quake.x11 from a directory that contains
-id1/pak0.pak, for example, ${PREFIX}/share/quake/.
-
-===========================================================================
diff --git a/games/quake/Makefile b/games/quake/Makefile
deleted file mode 100644
index b0c812a8938..00000000000
--- a/games/quake/Makefile
+++ /dev/null
@@ -1,61 +0,0 @@
-# $NetBSD: Makefile,v 1.53 2018/03/07 11:57:30 wiz Exp $
-
-DISTNAME= q1source
-PKGNAME= quake-2.30
-PKGREVISION= 7
-CATEGORIES= games x11
-MASTER_SITES= ftp://ftp.fu-berlin.de/pc/msdos/games/idgames/idstuff/source/
-MASTER_SITES+= ftp://ftp.idsoftware.com/idstuff/source/
-EXTRACT_SUFX= .zip
-
-MAINTAINER= pkgsrc-users@NetBSD.org
-HOMEPAGE= https://www.idsoftware.com/
-COMMENT= Legendary first person shoot'em up game
-
-DEPENDS+= quakedata-[0-9]*:../../games/quakedata
-
-ONLY_FOR_PLATFORM= *-*-i386
-
-WRKSRC= ${WRKDIR}
-USE_TOOLS+= gmake
-MAKE_ENV+= MAINDIR=${WRKSRC}
-
-
-MAKE_ENV+= MESA_DIR=${BUILDLINK_PREFIX.Mesa}
-MAKE_ENV+= X11BASE=${X11BASE}
-
-LDFLAGS+= ${LIBOSSAUDIO}
-
-INSTALLATION_DIRS= bin
-
-do-configure:
- cd ${WRKSRC}/QW && ${LN} -fs Makefile.Linux ${MAKE_FILE}
- cd ${WRKSRC}/WinQuake && ${LN} -fs Makefile.linuxi386 ${MAKE_FILE}
-
-do-build:
- ( cd ${WRKSRC}/QW ; ${SETENV} ${MAKE_ENV} \
- ${GMAKE} MAINDIR=`pwd` CFLAGS="${CFLAGS}" all)
- ( cd ${WRKSRC}/WinQuake ; ${SETENV} ${MAKE_ENV} \
- ${GMAKE} MAINDIR=`pwd` CFLAGS="${CFLAGS}" \
- WRKSRC="${WRKSRC}" all)
-
-do-install:
- ${INSTALL_PROGRAM} ${WRKSRC}/QW/release_version/qwsv \
- ${DESTDIR}${PREFIX}/bin
- ${INSTALL_PROGRAM} ${WRKSRC}/QW/release_version/qwcl.x11 \
- ${DESTDIR}${PREFIX}/bin
- ${INSTALL_PROGRAM} ${WRKSRC}/QW/release_version/glqwcl.glx \
- ${DESTDIR}${PREFIX}/bin
- ${INSTALL_PROGRAM} ${WRKSRC}/WinQuake/release_version/bin/glquake.glx \
- ${DESTDIR}${PREFIX}/bin
- ${INSTALL_PROGRAM} ${WRKSRC}/WinQuake/release_version/bin/quake.x11 \
- ${DESTDIR}${PREFIX}/bin
-
-.include "../../graphics/MesaLib/buildlink3.mk"
-.include "../../graphics/glu/buildlink3.mk"
-.include "../../x11/libXext/buildlink3.mk"
-.include "../../x11/libXxf86dga/buildlink3.mk"
-.include "../../x11/libXxf86vm/buildlink3.mk"
-.include "../../x11/xorgproto/buildlink3.mk"
-.include "../../mk/oss.buildlink3.mk"
-.include "../../mk/bsd.pkg.mk"
diff --git a/games/quake/PLIST b/games/quake/PLIST
deleted file mode 100644
index 832b88622a8..00000000000
--- a/games/quake/PLIST
+++ /dev/null
@@ -1,6 +0,0 @@
-@comment $NetBSD: PLIST,v 1.2 2018/01/01 22:29:34 rillig Exp $
-bin/glquake.glx
-bin/glqwcl.glx
-bin/quake.x11
-bin/qwcl.x11
-bin/qwsv
diff --git a/games/quake/distinfo b/games/quake/distinfo
deleted file mode 100644
index 4d3c0c5d1d5..00000000000
--- a/games/quake/distinfo
+++ /dev/null
@@ -1,22 +0,0 @@
-$NetBSD: distinfo,v 1.12 2015/11/03 20:57:02 agc Exp $
-
-SHA1 (q1source.zip) = 1f607e549c6aa3921797e51b7d2038e95116c989
-RMD160 (q1source.zip) = 57a750e8644116d0d07a273ea6ad0b6d3071c89f
-SHA512 (q1source.zip) = c8c52cfd3ebd4e852f31cb9a5e6c4781986662a44528f012680713150e7daabe5eb698fc5e43b452d162caa493e604b21907eff48b92f9c7e6372c3a7cb88a87
-Size (q1source.zip) = 3211531 bytes
-SHA1 (patch-aa) = 7b4f06a9650a83c221a9c16b69fdaf107ea025c4
-SHA1 (patch-ab) = 164aa9d8fbaf19b16aec17ce99cd632ee1986c8b
-SHA1 (patch-ac) = f7dc2284fd997a0cc75644d0a19a4747eb138b53
-SHA1 (patch-ad) = 187ba247c14324419383624b3dec054a098f0055
-SHA1 (patch-ae) = 6164ee9bfaf748f241e5b1c763a0ffa681d45dc9
-SHA1 (patch-af) = 57d5d0d88dcd745517b24bd4bdc9ceef494ef3a6
-SHA1 (patch-ag) = c56b1704416427a2ef733ca0cbf2436ff22b4b09
-SHA1 (patch-ah) = d7ab5fd7f7f834b254a068514ae473c35a43fef4
-SHA1 (patch-ai) = 81e9fd2537c1cf1c73be9790f2f6dcf6445d09c3
-SHA1 (patch-aj) = 5509d63f7856bc4760244a3d25c1984d16473e96
-SHA1 (patch-ak) = 44e5305375e41277e902980f7fd398fb1fcbeba8
-SHA1 (patch-al) = 1e40eb69839753348e023bc31f01331b6d4f51ef
-SHA1 (patch-am) = 0aed65d5a82c99b79630c3955359829857289337
-SHA1 (patch-an) = b769e61777a9f83b8a9c4479e3d70964755ff3d8
-SHA1 (patch-ao) = 4cd94997797c56653d4b80dd2fb11d175ee5d700
-SHA1 (patch-ap) = f65e0b73f26ff9a82be2c8c2c80c4f654e9ada18
diff --git a/games/quake/patches/patch-aa b/games/quake/patches/patch-aa
deleted file mode 100644
index a23a08634ef..00000000000
--- a/games/quake/patches/patch-aa
+++ /dev/null
@@ -1,549 +0,0 @@
-$NetBSD: patch-aa,v 1.6 2009/08/29 19:26:01 wiz Exp $
-
---- QW/client/cd_linux.c.orig 1999-12-21 18:58:58.000000000 +0000
-+++ QW/client/cd_linux.c
-@@ -31,7 +31,23 @@ Foundation, Inc., 59 Temple Place - Suit
- #include <time.h>
- #include <errno.h>
-
-+#ifdef __linux__
- #include <linux/cdrom.h>
-+#endif
-+
-+#if defined(__DragonFly__)
-+#include <sys/cdio.h>
-+#endif
-+
-+#if defined(__NetBSD__)
-+#include <sys/cdio.h>
-+
-+/* resume seems to have some trouble right now. xcdplayer also can not resume
-+ the drive correctly. It appears to play, but no audio is heard */
-+
-+#define PAUSE_BY_STOPPING 1
-+
-+#endif
-
- #include "quakedef.h"
-
-@@ -46,165 +62,296 @@ static byte remap[100];
- static byte playTrack;
- static byte maxTrack;
-
-+#ifdef PAUSE_BY_STOPPING
-+static qboolean t_playLooping;
-+static byte t_playTrack;
-+#endif
-+
- static int cdfile = -1;
-+#ifdef __linux__
- static char cd_dev[64] = "/dev/cdrom";
-+#endif
-+
-+#ifdef __DragonFly__
-+static char cd_dev[64] = "/dev/cd0d";
-+#endif
-+
-+#ifdef __NetBSD__
-+static char cd_dev[64] = "/dev/rcd0d";
-+#endif
-
- static void CDAudio_Eject(void)
- {
-- if (cdfile == -1 || !enabled)
-- return; // no cd init'd
-+#if defined(__DragonFly__) || defined(__NetBSD__)
-+ int arg=0;
-+#endif
-
-- if ( ioctl(cdfile, CDROMEJECT) == -1 )
-- Con_DPrintf("ioctl cdromeject failed\n");
-+ if (cdfile == -1 || !enabled)
-+ return; // no cd init'd
-+
-+#ifdef __linux__
-+ if ( ioctl(cdfile, CDROMEJECT) == -1 )
-+ Con_DPrintf("ioctl cdromeject failed\n");
-+#elif defined(__DragonFly__)
-+ ioctl(cdfile, CDIOCALLOW);
-+ if ( ioctl(cdfile, CDIOCEJECT) == -1 )
-+ Con_DPrintf("ioctl cdromeject failed\n");
-+#elif defined(__NetBSD__)
-+ if(ioctl(cdfile, DIOCLOCK, &arg) == -1)
-+ Con_DPrintf("ioctl cdromunlock failed\n");
-+ arg = 1;
-+ if ( ioctl(cdfile, DIOCEJECT, &arg) == -1 )
-+ Con_DPrintf("ioctl cdromeject failed\n");
-+#endif
- }
-
-
- static void CDAudio_CloseDoor(void)
- {
-- if (cdfile == -1 || !enabled)
-- return; // no cd init'd
-+if (cdfile == -1 || !enabled)
-+ return; // no cd init'd
-
-- if ( ioctl(cdfile, CDROMCLOSETRAY) == -1 )
-- Con_DPrintf("ioctl cdromclosetray failed\n");
-+#ifdef __linux__
-+ if ( ioctl(cdfile, CDROMCLOSETRAY) == -1 )
-+ Con_DPrintf("ioctl cdromclosetray failed\n");
-+#endif
-+#if defined(__DragonFly__) || defined(__NetBSD__)
-+ if(ioctl(cdfile, CDIOCCLOSE, NULL) == -1) {
-+ Con_DPrintf("ioctl cdromclosetray failed\n");
-+ }
-+#endif
- }
-
- static int CDAudio_GetAudioDiskInfo(void)
- {
-- struct cdrom_tochdr tochdr;
-+#ifdef __linux__
-+struct cdrom_tochdr tochdr;
-+#endif
-+#if defined(__DragonFly__) || defined(__NetBSD__)
-+struct ioc_toc_header tochdr;
-+#endif
-
-- cdValid = false;
-+cdValid = false;
-
-- if ( ioctl(cdfile, CDROMREADTOCHDR, &tochdr) == -1 )
-- {
-- Con_DPrintf("ioctl cdromreadtochdr failed\n");
-- return -1;
-- }
-+#ifdef __linux
-+if ( ioctl(cdfile, CDROMREADTOCHDR, &tochdr) == -1 )
-+{
-+ Con_DPrintf("ioctl cdromreadtochdr failed\n");
-+ return -1;
-+}
-+#endif
-
-- if (tochdr.cdth_trk0 < 1)
-- {
-- Con_DPrintf("CDAudio: no music tracks\n");
-- return -1;
-- }
-+#if defined(__DragonFly__) || defined(__NetBSD__)
-+if ( ioctl(cdfile, CDIOREADTOCHEADER, &tochdr) == -1 )
-+{
-+ Con_DPrintf("ioctl cdromreadtochdr failed\n");
-+ return -1;
-+}
-+#endif
-+
-+#ifdef __linux__
-+if (tochdr.cdth_trk0 < 1)
-+ {
-+ Con_DPrintf("CDAudio: no music tracks\n");
-+ return -1;
-+ }
-+#endif
-+#if defined(__DragonFly__) || defined(__NetBSD__)
-+if (tochdr.starting_track < 1)
-+ {
-+ Con_DPrintf("CDAudio: no music tracks\n");
-+ return -1;
-+ }
-+#endif
-
-- cdValid = true;
-- maxTrack = tochdr.cdth_trk1;
-+cdValid = true;
-+#ifdef __linux__
-+maxTrack = tochdr.cdth_trk1;
-+#endif
-+#if defined(__DragonFly__) || defined(__NetBSD__)
-+maxTrack = tochdr.ending_track;
-+#endif
-
-- return 0;
-+return 0;
- }
-
-
- void CDAudio_Play(byte track, qboolean looping)
- {
-- struct cdrom_tocentry entry;
-- struct cdrom_ti ti;
-+#ifdef __linux__
-+ struct cdrom_tocentry entry;
-+ struct cdrom_ti ti;
-+#endif
-
-- if (cdfile == -1 || !enabled)
-- return;
-+#if defined(__DragonFly__) || defined(__NetBSD__)
-+ struct ioc_read_toc_entry entry;
-+ struct ioc_play_track ti;
-+ int arg=1;
-+#endif
-+
-+ if (cdfile == -1 || !enabled)
-+ return;
-
-- if (!cdValid)
-- {
-- CDAudio_GetAudioDiskInfo();
-- if (!cdValid)
-- return;
-- }
-+ if (!cdValid)
-+ {
-+ CDAudio_GetAudioDiskInfo();
-+ if (!cdValid)
-+ return;
-+ }
-
-- track = remap[track];
-+ track = remap[track];
-
-- if (track < 1 || track > maxTrack)
-- {
-- Con_DPrintf("CDAudio: Bad track number %u.\n", track);
-- return;
-- }
-+ if (track < 1 || track > maxTrack)
-+ {
-+ Con_DPrintf("CDAudio: Bad track number %u.\n", track);
-+ return;
-+ }
-
-- // don't try to play a non-audio track
-- entry.cdte_track = track;
-- entry.cdte_format = CDROM_MSF;
-- if ( ioctl(cdfile, CDROMREADTOCENTRY, &entry) == -1 )
-- {
-- Con_DPrintf("ioctl cdromreadtocentry failed\n");
-- return;
-- }
-- if (entry.cdte_ctrl == CDROM_DATA_TRACK)
-- {
-- Con_Printf("CDAudio: track %i is not audio\n", track);
-- return;
-- }
-+#ifdef __linux__ /* Not sure what the equiv is for NetBSD */
-+ /* don't try to play a non-audio track */
-+ entry.cdte_track = track;
-+ entry.cdte_format = CDROM_MSF;
-+ if ( ioctl(cdfile, CDROMREADTOCENTRY, &entry) == -1 )
-+ {
-+ Con_DPrintf("ioctl cdromreadtocentry failed\n");
-+ return;
-+ }
-+ if (entry.cdte_ctrl == CDROM_DATA_TRACK)
-+ {
-+ Con_Printf("CDAudio: track %i is not audio\n", track);
-+ return;
-+ }
-
-- if (playing)
-- {
-- if (playTrack == track)
-- return;
-- CDAudio_Stop();
-- }
-+#endif
-
-- ti.cdti_trk0 = track;
-- ti.cdti_trk1 = track;
-- ti.cdti_ind0 = 1;
-- ti.cdti_ind1 = 99;
-+ if (playing)
-+ {
-+ if (playTrack == track)
-+ return;
-+ CDAudio_Stop();
-+ }
-
-- if ( ioctl(cdfile, CDROMPLAYTRKIND, &ti) == -1 )
-+#ifdef __linux__
-+ ti.cdti_trk0 = track;
-+ ti.cdti_trk1 = track;
-+ ti.cdti_ind0 = 1;
-+ ti.cdti_ind1 = 99;
-+ if ( ioctl(cdfile, CDROMPLAYTRKIND, &ti) == -1 )
- {
-- Con_DPrintf("ioctl cdromplaytrkind failed\n");
-- return;
-+ Con_DPrintf("ioctl cdromplaytrkind failed\n");
-+ return;
-+ }
-+
-+ if ( ioctl(cdfile, CDROMRESUME) == -1 )
-+ Con_DPrintf("ioctl cdromresume failed\n");
-+#endif
-+
-+#if defined(__DragonFly__) || defined(__NetBSD__)
-+ ti.start_track = track;
-+ ti.end_track = track;
-+ ti.start_index = 1;
-+ ti.end_index = 99;
-+ if ( ioctl(cdfile, CDIOCPLAYTRACKS, &ti) == -1 )
-+ {
-+ Con_DPrintf("ioctl cdromplaytrkind failed\n");
-+ return;
- }
-
-- if ( ioctl(cdfile, CDROMRESUME) == -1 )
-- Con_DPrintf("ioctl cdromresume failed\n");
-+ if ( ioctl(cdfile, CDIOCRESUME, &arg) == -1 )
-+ Con_DPrintf("ioctl cdromresume failed\n");
-+#endif
-
-- playLooping = looping;
-- playTrack = track;
-- playing = true;
-+ playLooping = looping;
-+ playTrack = track;
-+ playing = true;
-
-- if (cdvolume == 0.0)
-- CDAudio_Pause ();
-+ if (cdvolume == 0.0)
-+ CDAudio_Pause ();
- }
-
-
- void CDAudio_Stop(void)
- {
-- if (cdfile == -1 || !enabled)
-- return;
-+ if (cdfile == -1 || !enabled)
-+ return;
-
-- if (!playing)
-- return;
-+ if (!playing)
-+ return;
-
-- if ( ioctl(cdfile, CDROMSTOP) == -1 )
-- Con_DPrintf("ioctl cdromstop failed (%d)\n", errno);
-+#ifdef __linux__
-+ if ( ioctl(cdfile, CDROMSTOP) == -1 )
-+ Con_DPrintf("ioctl cdromstop failed (%d)\n", errno);
-+#endif
-+#if defined(__DragonFly__) || defined(__NetBSD__)
-+ if ( ioctl(cdfile, CDIOCSTOP) == -1 )
-+ Con_DPrintf("ioctl cdromstop failed (%d)\n", errno);
-+#endif
-
-- wasPlaying = false;
-- playing = false;
-+ wasPlaying = false;
-+ playing = false;
- }
-
- void CDAudio_Pause(void)
- {
-- if (cdfile == -1 || !enabled)
-- return;
-+#ifdef PAUSE_BY_STOPPING
-+ qboolean t;
-+#endif
-
-- if (!playing)
-- return;
-+ if (cdfile == -1 || !enabled)
-+ return;
-
-- if ( ioctl(cdfile, CDROMPAUSE) == -1 )
-- Con_DPrintf("ioctl cdrompause failed\n");
-+ if (!playing)
-+ return;
-
-- wasPlaying = playing;
-- playing = false;
-+#ifndef PAUSE_BY_STOPPING
-+#ifdef __linux__
-+ if ( ioctl(cdfile, CDROMPAUSE) == -1 )
-+ Con_DPrintf("ioctl cdrompause failed\n");
-+#endif
-+
-+#if defined(__DragonFly__) || defined(__NetBSD__)
-+ if ( ioctl(cdfile, CDIOCPAUSE) == -1 )
-+ Con_DPrintf("ioctl cdrompause failed\n");
-+#endif
-+#else
-+ t_playLooping = playLooping;
-+ t_playTrack=playTrack;
-+ t=playing;
-+ CDAudio_Stop();
-+ playing=t;
-+#endif
-+
-+ wasPlaying = playing;
-+ playing = false;
- }
-
-
- void CDAudio_Resume(void)
- {
-- if (cdfile == -1 || !enabled)
-- return;
-+ if (cdfile == -1 || !enabled)
-+ return;
-
-- if (!cdValid)
-- return;
-+ if (!cdValid)
-+ return;
-
-- if (!wasPlaying)
-- return;
-+ if (!wasPlaying)
-+ return;
-
-- if ( ioctl(cdfile, CDROMRESUME) == -1 )
-- Con_DPrintf("ioctl cdromresume failed\n");
-- playing = true;
-+#ifndef PAUSE_BY_STOPPING
-+#ifdef __linux__
-+ if ( ioctl(cdfile, CDROMRESUME) == -1 )
-+ Con_DPrintf("ioctl cdromresume failed\n");
-+#endif
-+
-+#if defined(__DragonFly__) || defined(__NetBSD__)
-+ if ( ioctl(cdfile, CDIOCRESUME) == -1 )
-+ Con_DPrintf("ioctl cdromresume failed\n");
-+#endif
-+#else
-+ CDAudio_Play(t_playTrack, t_playLooping);
-+#endif
-+
-+ playing = true;
- }
-
- static void CD_f (void)
-@@ -327,43 +474,72 @@ static void CD_f (void)
-
- void CDAudio_Update(void)
- {
-- struct cdrom_subchnl subchnl;
-- static time_t lastchk;
-+#ifdef __linux__
-+ struct cdrom_subchnl subchnl;
-+#endif
-+#if defined(__DragonFly__) || defined(__NetBSD__)
-+ struct ioc_read_subchannel subchnl;
-+ struct cd_sub_channel_info data;
-+#endif
-+ static time_t lastchk;
-
-- if (!enabled)
-- return;
-+ if (!enabled)
-+ return;
-
-- if (bgmvolume.value != cdvolume)
-+ if (bgmvolume.value != cdvolume)
-+ {
-+ if (cdvolume)
- {
-- if (cdvolume)
-- {
-- Cvar_SetValue ("bgmvolume", 0.0);
-- cdvolume = bgmvolume.value;
-- CDAudio_Pause ();
-- }
-- else
-- {
-- Cvar_SetValue ("bgmvolume", 1.0);
-- cdvolume = bgmvolume.value;
-- CDAudio_Resume ();
-- }
-+ Cvar_SetValue ("bgmvolume", 0.0);
-+ cdvolume = bgmvolume.value;
-+ CDAudio_Pause ();
- }
--
-- if (playing && lastchk < time(NULL)) {
-- lastchk = time(NULL) + 2; //two seconds between chks
-- subchnl.cdsc_format = CDROM_MSF;
-- if (ioctl(cdfile, CDROMSUBCHNL, &subchnl) == -1 ) {
-- Con_DPrintf("ioctl cdromsubchnl failed\n");
-- playing = false;
-- return;
-- }
-- if (subchnl.cdsc_audiostatus != CDROM_AUDIO_PLAY &&
-- subchnl.cdsc_audiostatus != CDROM_AUDIO_PAUSED) {
-- playing = false;
-- if (playLooping)
-- CDAudio_Play(playTrack, true);
-- }
-+ else
-+ {
-+ Cvar_SetValue ("bgmvolume", 1.0);
-+ cdvolume = bgmvolume.value;
-+ CDAudio_Resume ();
- }
-+ }
-+
-+
-+ if (playing && lastchk < time(NULL)) {
-+ lastchk = time(NULL) + 2; /* two seconds between chks */
-+#ifdef __linux
-+ subchnl.cdsc_format = CDROM_MSF;
-+ if (ioctl(cdfile, CDROMSUBCHNL, &subchnl) == -1 ) {
-+ Con_DPrintf("ioctl cdromsubchnl failed\n");
-+ playing = false;
-+ return;
-+ }
-+ if (subchnl.cdsc_audiostatus != CDROM_AUDIO_PLAY &&
-+ subchnl.cdsc_audiostatus != CDROM_AUDIO_PAUSED) {
-+ playing = false;
-+ if (playLooping)
-+ CDAudio_Play(playTrack, true);
-+ }
-+#endif
-+#if defined(__DragonFly__) || defined(__NetBSD__)
-+ subchnl.address_format = CD_MSF_FORMAT;
-+ subchnl.data_format = CD_CURRENT_POSITION;
-+ subchnl.data_len = sizeof(data);
-+ subchnl.track = playTrack;
-+ subchnl.data = &data;
-+
-+ if (ioctl(cdfile, CDIOCREADSUBCHANNEL, &subchnl) == -1 ) {
-+ Con_DPrintf("ioctl cdromsubchnl failed\n");
-+ playing = false;
-+ return;
-+ }
-+ if (subchnl.data->header.audio_status != CD_AS_PLAY_IN_PROGRESS &&
-+ subchnl.data->header.audio_status != CD_AS_PLAY_PAUSED) {
-+ playing = false;
-+ if (playLooping)
-+ CDAudio_Play(playTrack, true);
-+ }
-+#endif
-+ }
-+
- }
-
- int CDAudio_Init(void)
-@@ -375,6 +551,8 @@ int CDAudio_Init(void)
- return -1;
- #endif
-
-+ fprintf(stderr,"...... cdaudio_init .......\n");
-+
- if (COM_CheckParm("-nocdaudio"))
- return -1;
-
-@@ -384,9 +562,9 @@ int CDAudio_Init(void)
- }
-
- if ((cdfile = open(cd_dev, O_RDONLY)) == -1) {
-- Con_Printf("CDAudio_Init: open of \"%s\" failed (%i)\n", cd_dev, errno);
-- cdfile = -1;
-- return -1;
-+ Con_Printf("CDAudio_Init: open of \"%s\" failed (%i)\n", cd_dev, errno);
-+ cdfile = -1;
-+ return -1;
- }
-
- for (i = 0; i < 100; i++)
diff --git a/games/quake/patches/patch-ab b/games/quake/patches/patch-ab
deleted file mode 100644
index af5e17d6c17..00000000000
--- a/games/quake/patches/patch-ab
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-ab,v 1.5 2009/08/29 19:26:01 wiz Exp $
-
---- QW/client/gl_draw.c.orig 1999-12-21 15:46:06.000000000 +0000
-+++ QW/client/gl_draw.c
-@@ -1367,7 +1367,7 @@ void GL_SelectTexture (GLenum target)
- {
- if (!gl_mtexable)
- return;
--#ifndef __linux__ // no multitexture under Linux yet
-+#if !defined(__linux__) && !defined(__NetBSD__) && !defined(__DragonFly__) // no multitexture under Linux yet
- qglSelectTextureSGIS(target);
- #endif
- if (target == oldtarget)
diff --git a/games/quake/patches/patch-ac b/games/quake/patches/patch-ac
deleted file mode 100644
index e687ab19532..00000000000
--- a/games/quake/patches/patch-ac
+++ /dev/null
@@ -1,43 +0,0 @@
-$NetBSD: patch-ac,v 1.5 2009/08/29 19:26:01 wiz Exp $
-
---- QW/client/gl_vidlinuxglx.c.orig 1999-12-21 18:45:54.000000000 +0000
-+++ QW/client/gl_vidlinuxglx.c
-@@ -20,7 +20,6 @@ Foundation, Inc., 59 Temple Place - Suit
- #include <termios.h>
- #include <sys/ioctl.h>
- #include <sys/stat.h>
--#include <sys/vt.h>
- #include <stdarg.h>
- #include <stdio.h>
- #include <signal.h>
-@@ -560,6 +559,9 @@ extern void gl3DfxSetPaletteEXT(GLuint *
-
- void VID_Init8bitPalette(void)
- {
-+#if defined(__NetBSD__) || defined(__DragonFly__)
-+ return;
-+#else
- // Check for 8bit Extensions and initialize them.
- int i;
- GLubyte table[256][4];
-@@ -580,6 +582,7 @@ void VID_Init8bitPalette(void)
- }
- gl3DfxSetPaletteEXT((GLuint *)table);
- is8bit = true;
-+#endif
- }
- #endif
-
-@@ -603,7 +606,12 @@ void VID_Init(unsigned char *palette)
- Window root;
- XVisualInfo *visinfo;
-
-+ /* For some reason this is called. It causes trouble for NetBSD
-+ and sound won't work */
-+
-+#if !defined(__NetBSD__) && !defined(__DragonFly__)
- S_Init();
-+#endif
-
- Cvar_RegisterVariable (&vid_mode);
- Cvar_RegisterVariable (&gl_ztrick);
diff --git a/games/quake/patches/patch-ad b/games/quake/patches/patch-ad
deleted file mode 100644
index d4e47053d81..00000000000
--- a/games/quake/patches/patch-ad
+++ /dev/null
@@ -1,176 +0,0 @@
-$NetBSD: patch-ad,v 1.5 2009/08/29 19:26:01 wiz Exp $
-
---- QW/client/snd_linux.c.orig 1997-07-07 20:08:00.000000000 +0000
-+++ QW/client/snd_linux.c
-@@ -6,15 +6,42 @@
- #include <sys/mman.h>
- #include <sys/shm.h>
- #include <sys/wait.h>
-+
-+#ifdef __NetBSD__
-+#include <soundcard.h>
-+#endif
-+
-+#if defined(__DragonFly__)
-+#include <sys/soundcard.h>
-+#endif
-+
-+#ifdef __linux__
- #include <linux/soundcard.h>
-+#endif
-+
- #include <stdio.h>
- #include "quakedef.h"
-
--int audio_fd;
-+int audio_fd = -1;
- int snd_inited;
-
- static int tryrates[] = { 11025, 22051, 44100, 8000 };
-
-+#ifdef __linux__
-+const char *audio_device="/dev/dsp";
-+#define MMAP_PROTECTION PROT_WRITE
-+#endif
-+
-+#ifdef __NetBSD__
-+const char *audio_device="/dev/audio";
-+#define MMAP_PROTECTION PROT_WRITE|PROT_READ
-+#endif
-+
-+#if defined(__DragonFly__)
-+const char *audio_device="/dev/audio";
-+#define MMAP_PROTECTION PROT_WRITE|PROT_READ
-+#endif
-+
- qboolean SNDDMA_Init(void)
- {
-
-@@ -28,28 +55,29 @@ qboolean SNDDMA_Init(void)
-
- snd_inited = 0;
-
--// open /dev/dsp, confirm capability to mmap, and get size of dma buffer
-+// open /dev/dsp or whatever, confirm capability to mmap, and get size of
-+// dma buffer
-
-- audio_fd = open("/dev/dsp", O_RDWR);
-+ audio_fd = open(audio_device, O_RDWR);
- if (audio_fd < 0)
- {
-- perror("/dev/dsp");
-- Con_Printf("Could not open /dev/dsp\n");
-+ perror(audio_device);
-+ Con_Printf("Could not open %s\n",audio_device);
- return 0;
- }
-
- rc = ioctl(audio_fd, SNDCTL_DSP_RESET, 0);
- if (rc < 0)
- {
-- perror("/dev/dsp");
-- Con_Printf("Could not reset /dev/dsp\n");
-+ perror(audio_device);
-+ Con_Printf("Could not reset %s\n",audio_device);
- close(audio_fd);
- return 0;
- }
-
- if (ioctl(audio_fd, SNDCTL_DSP_GETCAPS, &caps)==-1)
- {
-- perror("/dev/dsp");
-+ perror(audio_device);
- Con_Printf("Sound driver too old\n");
- close(audio_fd);
- return 0;
-@@ -111,11 +139,11 @@ qboolean SNDDMA_Init(void)
- // memory map the dma buffer
-
- shm->buffer = (unsigned char *) mmap(NULL, info.fragstotal
-- * info.fragsize, PROT_WRITE, MAP_FILE|MAP_SHARED, audio_fd, 0);
-+ * info.fragsize, MMAP_PROTECTION, MAP_FILE|MAP_SHARED, audio_fd, 0);
- if (!shm->buffer)
- {
-- perror("/dev/dsp");
-- Con_Printf("Could not mmap /dev/dsp\n");
-+ perror(audio_device);
-+ Con_Printf("Could not mmap %s\n",audio_device);
- close(audio_fd);
- return 0;
- }
-@@ -126,8 +154,8 @@ qboolean SNDDMA_Init(void)
- rc = ioctl(audio_fd, SNDCTL_DSP_STEREO, &tmp);
- if (rc < 0)
- {
-- perror("/dev/dsp");
-- Con_Printf("Could not set /dev/dsp to stereo=%d", shm->channels);
-+ perror(audio_device);
-+ Con_Printf("Could not set %s to stereo=%d", audio_device, shm->channels);
- close(audio_fd);
- return 0;
- }
-@@ -139,8 +167,8 @@ qboolean SNDDMA_Init(void)
- rc = ioctl(audio_fd, SNDCTL_DSP_SPEED, &shm->speed);
- if (rc < 0)
- {
-- perror("/dev/dsp");
-- Con_Printf("Could not set /dev/dsp speed to %d", shm->speed);
-+ perror(audio_device);
-+ Con_Printf("Could not set %s speed to %d", audio_device, shm->speed);
- close(audio_fd);
- return 0;
- }
-@@ -151,7 +179,7 @@ qboolean SNDDMA_Init(void)
- rc = ioctl(audio_fd, SNDCTL_DSP_SETFMT, &rc);
- if (rc < 0)
- {
-- perror("/dev/dsp");
-+ perror(audio_device);
- Con_Printf("Could not support 16-bit data. Try 8-bit.\n");
- close(audio_fd);
- return 0;
-@@ -163,7 +191,7 @@ qboolean SNDDMA_Init(void)
- rc = ioctl(audio_fd, SNDCTL_DSP_SETFMT, &rc);
- if (rc < 0)
- {
-- perror("/dev/dsp");
-+ perror(audio_device);
- Con_Printf("Could not support 8-bit data.\n");
- close(audio_fd);
- return 0;
-@@ -171,7 +199,7 @@ qboolean SNDDMA_Init(void)
- }
- else
- {
-- perror("/dev/dsp");
-+ perror(audio_device);
- Con_Printf("%d-bit sound not supported.", shm->samplebits);
- close(audio_fd);
- return 0;
-@@ -183,7 +211,7 @@ qboolean SNDDMA_Init(void)
- rc = ioctl(audio_fd, SNDCTL_DSP_SETTRIGGER, &tmp);
- if (rc < 0)
- {
-- perror("/dev/dsp");
-+ perror(audio_device);
- Con_Printf("Could not toggle.\n");
- close(audio_fd);
- return 0;
-@@ -192,7 +220,7 @@ qboolean SNDDMA_Init(void)
- rc = ioctl(audio_fd, SNDCTL_DSP_SETTRIGGER, &tmp);
- if (rc < 0)
- {
-- perror("/dev/dsp");
-+ perror(audio_device);
- Con_Printf("Could not toggle.\n");
- close(audio_fd);
- return 0;
-@@ -214,7 +242,7 @@ int SNDDMA_GetDMAPos(void)
-
- if (ioctl(audio_fd, SNDCTL_DSP_GETOPTR, &count)==-1)
- {
-- perror("/dev/dsp");
-+ perror(audio_device);
- Con_Printf("Uh, sound dead.\n");
- close(audio_fd);
- snd_inited = 0;
diff --git a/games/quake/patches/patch-ae b/games/quake/patches/patch-ae
deleted file mode 100644
index a842874df18..00000000000
--- a/games/quake/patches/patch-ae
+++ /dev/null
@@ -1,115 +0,0 @@
-$NetBSD: patch-ae,v 1.10 2011/09/14 19:19:37 marino Exp $
-
---- QW/Makefile.Linux.orig 1999-04-21 18:16:24.000000000 +0000
-+++ QW/Makefile.Linux
-@@ -27,41 +27,57 @@ ARCH=i386
- RPMARCH=i386
- endif
-
--MAINDIR=/grog/Projects/QW
--
--BUILD_DEBUG_DIR=debug$(ARCH)$(GLIBC)
--BUILD_RELEASE_DIR=release$(ARCH)$(GLIBC)
-+#BUILD_DEBUG_DIR=debug$(ARCH)$(GLIBC)
-+#BUILD_RELEASE_DIR=release$(ARCH)$(GLIBC)
-+BUILD_DEBUG_DIR=debug_version
-+BUILD_RELEASE_DIR=release_version
- CLIENT_DIR=$(MAINDIR)/client
- SERVER_DIR=$(MAINDIR)/server
-
--MESA_DIR=/usr/local/src/Mesa-3.0
-+#MESA_DIR=/usr/local/src/Mesa-3.0
-
- CC=gcc
--BASE_CFLAGS=-Wall -Dstricmp=strcasecmp -I$(CLIENT_DIR) -I$(SERVER_DIR)
-+BASE_CFLAGS=-Wall -Dstricmp=strcasecmp -I$(CLIENT_DIR) -I$(SERVER_DIR) \
-+ ${CFLAGS} -I${X11BASE}/include -O0
- DEBUG_CFLAGS=$(BASE_CFLAGS) -g
- ifeq ($(ARCH),axp)
- RELEASE_CFLAGS=$(BASE_CFLAGS) -ffast-math -funroll-loops \
- -fomit-frame-pointer -fexpensive-optimizations
- else
--RELEASE_CFLAGS=$(BASE_CFLAGS) -m486 -O6 -ffast-math -funroll-loops \
-- -fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \
-- -malign-jumps=2 -malign-functions=2
-+# Optimizer bug?!?!?
-+#RELEASE_CFLAGS=$(BASE_CFLAGS) -m486 -O6 -ffast-math -funroll-loops \
-+# -fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \
-+# -malign-jumps=2 -malign-functions=2
-+RELEASE_CFLAGS=$(BASE_CFLAGS) \
-+ -mtune=i486 \
-+ -ffast-math \
-+ -funroll-loops \
-+ -fomit-frame-pointer \
-+ -fexpensive-optimizations \
-+ -falign-loops=2 \
-+ -falign-jumps=2 \
-+ -falign-functions=2
- endif
--GLCFLAGS=-DGLQUAKE -I/usr/local/src/Mesa-3.0/include -I/usr/include/glide
-+GLCFLAGS=-DGLQUAKE -I${MESA_DIR}/include -I/usr/include/glide
-
--LDFLAGS=-lm
-+LDFLAGS+=-lm
- SVGALDFLAGS=-lvga
--XLDFLAGS=-L/usr/X11R6/lib -lX11 -lXext
--GL_SVGA_LDFLAGS=-L/usr/X11/lib -L/usr/local/src/Mesa-3.0/lib -lm -lMesaGL -lglide2x -lX11 -lXext -lvga
--GL_X11_LDFLAGS=-L/usr/X11/lib -L/usr/local/src/Mesa-3.0/lib -lm -lGL -lX11 -lXext
-+XLDFLAGS=-L${X11BASE}/lib ${LDFLAGS} -lX11 -lXext
-+GL_SVGA_LDFLAGS=-L${X11BASE}/lib ${LDFLAGS} -L${MESA_DIR}/lib -lm -lMesaGL -lglide2x -lX11 -lXext -lvga
-+GL_X11_LDFLAGS=-L${X11BASE}/lib ${LDFLAGS} -L${MESA_DIR}/lib -lm -lGL -lX11 -lXext
-
- DO_CC=$(CC) $(CFLAGS) -o $@ -c $<
--DO_O_CC=$(CC) -O $(CFLAGS) -o $@ -c $<
-+#DO_O_CC=$(CC) -O $(CFLAGS) -o $@ -c $<
-+DO_O_CC=$(CC) $(CFLAGS) -o $@ -c $<
- DO_GL_CC=$(CC) $(CFLAGS) $(GLCFLAGS) -o $@ -c $<
- DO_SERVER_CC=$(CC) -DSERVERONLY $(CFLAGS) -o $@ -c $<
-
--DO_AS=$(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
--DO_GL_AS=$(CC) $(CFLAGS) $(GLCFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
-+DO_AS=$(CC) $(CFLAGS) -x assembler-with-cpp -o $@ -c $<
-+#DO_AS=$(CC) $(CFLAGS) -DAOUT -x assembler-with-cpp -o $@ -c $<
-+#DO_AS=$(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
-+DO_GL_AS=$(CC) $(CFLAGS) $(GLCFLAGS) -x assembler-with-cpp -o $@ -c $<
-+#DO_GL_AS=$(CC) $(CFLAGS) $(GLCFLAGS) -DAOUT -x assembler-with-cpp -o $@ -c $<
-+#DO_GL_AS=$(CC) $(CFLAGS) $(GLCFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
-
- #############################################################################
- # SETUP AND BUILD
-@@ -71,7 +87,7 @@ ifeq ($(ARCH),axp)
- TARGETS=$(BUILDDIR)/qwsv
- #$(BUILDDIR)/qwcl.x11
- else
--TARGETS=$(BUILDDIR)/qwsv $(BUILDDIR)/qwcl $(BUILDDIR)/qwcl.x11 $(BUILDDIR)/glqwcl $(BUILDDIR)/glqwcl.glx
-+TARGETS=$(BUILDDIR)/qwsv $(BUILDDIR)/qwcl.x11 $(BUILDDIR)/glqwcl.glx
- endif
-
- build_debug:
-@@ -485,7 +501,7 @@ $(BUILDDIR)/client/wad.o : $(
- $(BUILDDIR)/client/zone.o : $(CLIENT_DIR)/zone.c
- $(DO_CC)
-
--$(BUILDDIR)/client/cd_linux.o : $(CLIENT_DIR)/cd_linux.c
-+$(BUILDDIR)/client/cd_linux.o : $(CLIENT_DIR)/cd_linux.c
- $(DO_CC)
-
- $(BUILDDIR)/client/sys_linux.o : $(CLIENT_DIR)/sys_linux.c
-@@ -609,7 +625,7 @@ GLQWCL_OBJS = \
- $(BUILDDIR)/glclient/math.o \
- $(BUILDDIR)/glclient/snd_mixa.o \
- $(BUILDDIR)/glclient/sys_dosa.o
--
-+
- GLQWCL_SVGA_OBJS = $(BUILDDIR)/glclient/gl_vidlinux.o
- GLQWCL_X11_OBJS = $(BUILDDIR)/glclient/gl_vidlinuxglx.o
-
-@@ -715,7 +731,7 @@ $(BUILDDIR)/glclient/wad.o : $
- $(BUILDDIR)/glclient/zone.o : $(CLIENT_DIR)/zone.c
- $(DO_GL_CC)
-
--$(BUILDDIR)/glclient/cd_linux.o : $(CLIENT_DIR)/cd_linux.c
-+$(BUILDDIR)/glclient/cd_linux.o : $(CLIENT_DIR)/cd_linux.c
- $(DO_GL_CC)
-
- $(BUILDDIR)/glclient/sys_linux.o : $(CLIENT_DIR)/sys_linux.c
diff --git a/games/quake/patches/patch-af b/games/quake/patches/patch-af
deleted file mode 100644
index 88fe039e0a5..00000000000
--- a/games/quake/patches/patch-af
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-af,v 1.4 2009/08/29 19:26:01 wiz Exp $
-
---- QW/server/sys_unix.c.orig 1999-12-21 18:45:14.000000000 +0000
-+++ QW/server/sys_unix.c
-@@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suit
- #include <libc.h>
- #endif
-
--#if defined(__linux__) || defined(sun)
-+#if defined(__linux__) || defined(sun) || defined(__NetBSD__) || defined(__DragonFly__)
- #include <sys/stat.h>
- #include <unistd.h>
- #include <sys/time.h>
diff --git a/games/quake/patches/patch-ag b/games/quake/patches/patch-ag
deleted file mode 100644
index eacdd5cae99..00000000000
--- a/games/quake/patches/patch-ag
+++ /dev/null
@@ -1,547 +0,0 @@
-$NetBSD: patch-ag,v 1.4 2009/08/29 19:26:01 wiz Exp $
-
---- WinQuake/cd_linux.c.orig 1999-12-21 18:40:50.000000000 +0000
-+++ WinQuake/cd_linux.c
-@@ -31,7 +31,23 @@ Foundation, Inc., 59 Temple Place - Suit
- #include <time.h>
- #include <errno.h>
-
-+#ifdef __linux__
- #include <linux/cdrom.h>
-+#endif
-+
-+#if defined(__DragonFly__)
-+#include <sys/cdio.h>
-+#endif
-+
-+#ifdef __NetBSD__
-+#include <sys/cdio.h>
-+
-+/* resume seems to have some trouble right now. xcdplayer also can not resume
-+ the drive correctly. It appears to play, but no audio is heard */
-+
-+#define PAUSE_BY_STOPPING 1
-+
-+#endif
-
- #include "quakedef.h"
-
-@@ -46,165 +62,296 @@ static byte remap[100];
- static byte playTrack;
- static byte maxTrack;
-
-+#ifdef PAUSE_BY_STOPPING
-+static qboolean t_playLooping;
-+static byte t_playTrack;
-+#endif
-+
- static int cdfile = -1;
-+#ifdef __linux__
- static char cd_dev[64] = "/dev/cdrom";
-+#endif
-+
-+#ifdef __NetBSD__
-+static char cd_dev[64] = "/dev/rcd0d";
-+#endif
-+
-+#ifdef __DragonFly__
-+static char cd_dev[64] = "/dev/cd0d";
-+#endif
-
- static void CDAudio_Eject(void)
- {
-- if (cdfile == -1 || !enabled)
-- return; // no cd init'd
--
-- if ( ioctl(cdfile, CDROMEJECT) == -1 )
-- Con_DPrintf("ioctl cdromeject failed\n");
-+#if defined(__NetBSD__) || defined(__DragonFly__)
-+ int arg=0;
-+#endif
-+
-+ if (cdfile == -1 || !enabled)
-+ return; // no cd init'd
-+
-+#ifdef __linux__
-+ if ( ioctl(cdfile, CDROMEJECT) == -1 )
-+ Con_DPrintf("ioctl cdromeject failed\n");
-+#elif defined(__NetBSD__)
-+ if(ioctl(cdfile, DIOCLOCK, &arg) == -1)
-+ Con_DPrintf("ioctl cdromunlock failed\n");
-+ arg = 1;
-+ if ( ioctl(cdfile, DIOCEJECT, &arg) == -1 )
-+ Con_DPrintf("ioctl cdromeject failed\n");
-+#elif defined(__DragonFly__)
-+ ioctl(cdfile, CDIOCALLOW);
-+ if ( ioctl(cdfile, CDIOCEJECT) == -1 )
-+ Con_DPrintf("ioctl cdromeject failed\n");
-+#endif
- }
-
-
- static void CDAudio_CloseDoor(void)
- {
-- if (cdfile == -1 || !enabled)
-- return; // no cd init'd
-+if (cdfile == -1 || !enabled)
-+ return; // no cd init'd
-
-- if ( ioctl(cdfile, CDROMCLOSETRAY) == -1 )
-- Con_DPrintf("ioctl cdromclosetray failed\n");
-+#ifdef __linux__
-+ if ( ioctl(cdfile, CDROMCLOSETRAY) == -1 )
-+ Con_DPrintf("ioctl cdromclosetray failed\n");
-+#endif
-+#if defined(__NetBSD__) || defined(__DragonFly__)
-+ if(ioctl(cdfile, CDIOCCLOSE, NULL) == -1) {
-+ Con_DPrintf("ioctl cdromclosetray failed\n");
-+ }
-+#endif
- }
-
- static int CDAudio_GetAudioDiskInfo(void)
- {
-- struct cdrom_tochdr tochdr;
--
-- cdValid = false;
-+#ifdef __linux__
-+struct cdrom_tochdr tochdr;
-+#endif
-+#if defined(__NetBSD__) || defined(__DragonFly__)
-+struct ioc_toc_header tochdr;
-+#endif
-+
-+cdValid = false;
-+
-+#ifdef __linux
-+if ( ioctl(cdfile, CDROMREADTOCHDR, &tochdr) == -1 )
-+{
-+ Con_DPrintf("ioctl cdromreadtochdr failed\n");
-+ return -1;
-+}
-+#endif
-+
-+#if defined(__NetBSD__) || defined(__DragonFly__)
-+if ( ioctl(cdfile, CDIOREADTOCHEADER, &tochdr) == -1 )
-+{
-+ Con_DPrintf("ioctl cdromreadtochdr failed\n");
-+ return -1;
-+}
-+#endif
-+
-+#ifdef __linux__
-+if (tochdr.cdth_trk0 < 1)
-+ {
-+ Con_DPrintf("CDAudio: no music tracks\n");
-+ return -1;
-+ }
-+#endif
-+#if defined(__NetBSD__) || defined(__DragonFly__)
-+if (tochdr.starting_track < 1)
-+ {
-+ Con_DPrintf("CDAudio: no music tracks\n");
-+ return -1;
-+ }
-+#endif
-+
-+cdValid = true;
-+#ifdef __linux__
-+maxTrack = tochdr.cdth_trk1;
-+#endif
-+#if defined(__NetBSD__) || defined(__DragonFly__)
-+maxTrack = tochdr.ending_track;
-+#endif
-
-- if ( ioctl(cdfile, CDROMREADTOCHDR, &tochdr) == -1 )
-- {
-- Con_DPrintf("ioctl cdromreadtochdr failed\n");
-- return -1;
-- }
--
-- if (tochdr.cdth_trk0 < 1)
-- {
-- Con_DPrintf("CDAudio: no music tracks\n");
-- return -1;
-- }
--
-- cdValid = true;
-- maxTrack = tochdr.cdth_trk1;
--
-- return 0;
-+return 0;
- }
-
-
- void CDAudio_Play(byte track, qboolean looping)
- {
-- struct cdrom_tocentry entry;
-- struct cdrom_ti ti;
-+#ifdef __linux__
-+ struct cdrom_tocentry entry;
-+ struct cdrom_ti ti;
-+#endif
-+
-+#if defined(__NetBSD__) || defined(__DragonFly__)
-+ struct ioc_read_toc_entry entry;
-+ struct ioc_play_track ti;
-+ int arg=1;
-+#endif
-
-- if (cdfile == -1 || !enabled)
-- return;
-+ if (cdfile == -1 || !enabled)
-+ return;
-
-- if (!cdValid)
-- {
-- CDAudio_GetAudioDiskInfo();
-- if (!cdValid)
-- return;
-- }
-+ if (!cdValid)
-+ {
-+ CDAudio_GetAudioDiskInfo();
-+ if (!cdValid)
-+ return;
-+ }
-
-- track = remap[track];
-+ track = remap[track];
-
-- if (track < 1 || track > maxTrack)
-- {
-- Con_DPrintf("CDAudio: Bad track number %u.\n", track);
-- return;
-- }
-+ if (track < 1 || track > maxTrack)
-+ {
-+ Con_DPrintf("CDAudio: Bad track number %u.\n", track);
-+ return;
-+ }
-
-- // don't try to play a non-audio track
-- entry.cdte_track = track;
-- entry.cdte_format = CDROM_MSF;
-- if ( ioctl(cdfile, CDROMREADTOCENTRY, &entry) == -1 )
-- {
-- Con_DPrintf("ioctl cdromreadtocentry failed\n");
-- return;
-- }
-- if (entry.cdte_ctrl == CDROM_DATA_TRACK)
-- {
-- Con_Printf("CDAudio: track %i is not audio\n", track);
-- return;
-- }
-+#ifdef __linux__ /* Not sure what the equiv is for NetBSD */
-+ /* don't try to play a non-audio track */
-+ entry.cdte_track = track;
-+ entry.cdte_format = CDROM_MSF;
-+ if ( ioctl(cdfile, CDROMREADTOCENTRY, &entry) == -1 )
-+ {
-+ Con_DPrintf("ioctl cdromreadtocentry failed\n");
-+ return;
-+ }
-+ if (entry.cdte_ctrl == CDROM_DATA_TRACK)
-+ {
-+ Con_Printf("CDAudio: track %i is not audio\n", track);
-+ return;
-+ }
-
-- if (playing)
-- {
-- if (playTrack == track)
-- return;
-- CDAudio_Stop();
-- }
-+#endif
-
-- ti.cdti_trk0 = track;
-- ti.cdti_trk1 = track;
-- ti.cdti_ind0 = 1;
-- ti.cdti_ind1 = 99;
-+ if (playing)
-+ {
-+ if (playTrack == track)
-+ return;
-+ CDAudio_Stop();
-+ }
-
-- if ( ioctl(cdfile, CDROMPLAYTRKIND, &ti) == -1 )
-+#ifdef __linux__
-+ ti.cdti_trk0 = track;
-+ ti.cdti_trk1 = track;
-+ ti.cdti_ind0 = 1;
-+ ti.cdti_ind1 = 99;
-+ if ( ioctl(cdfile, CDROMPLAYTRKIND, &ti) == -1 )
- {
-- Con_DPrintf("ioctl cdromplaytrkind failed\n");
-- return;
-+ Con_DPrintf("ioctl cdromplaytrkind failed\n");
-+ return;
- }
-
-- if ( ioctl(cdfile, CDROMRESUME) == -1 )
-- Con_DPrintf("ioctl cdromresume failed\n");
-+ if ( ioctl(cdfile, CDROMRESUME) == -1 )
-+ Con_DPrintf("ioctl cdromresume failed\n");
-+#endif
-+
-+#if defined(__NetBSD__) || defined(__DragonFly__)
-+ ti.start_track = track;
-+ ti.end_track = track;
-+ ti.start_index = 1;
-+ ti.end_index = 99;
-+ if ( ioctl(cdfile, CDIOCPLAYTRACKS, &ti) == -1 )
-+ {
-+ Con_DPrintf("ioctl cdromplaytrkind failed\n");
-+ return;
-+ }
-
-- playLooping = looping;
-- playTrack = track;
-- playing = true;
-+ if ( ioctl(cdfile, CDIOCRESUME, &arg) == -1 )
-+ Con_DPrintf("ioctl cdromresume failed\n");
-+#endif
-+
-+ playLooping = looping;
-+ playTrack = track;
-+ playing = true;
-
-- if (cdvolume == 0.0)
-- CDAudio_Pause ();
-+ if (cdvolume == 0.0)
-+ CDAudio_Pause ();
- }
-
-
- void CDAudio_Stop(void)
- {
-- if (cdfile == -1 || !enabled)
-- return;
-+ if (cdfile == -1 || !enabled)
-+ return;
-
-- if (!playing)
-- return;
-+ if (!playing)
-+ return;
-
-- if ( ioctl(cdfile, CDROMSTOP) == -1 )
-- Con_DPrintf("ioctl cdromstop failed (%d)\n", errno);
-+#ifdef __linux__
-+ if ( ioctl(cdfile, CDROMSTOP) == -1 )
-+ Con_DPrintf("ioctl cdromstop failed (%d)\n", errno);
-+#endif
-+#if defined(__NetBSD__) || defined(__DragonFly__)
-+ if ( ioctl(cdfile, CDIOCSTOP) == -1 )
-+ Con_DPrintf("ioctl cdromstop failed (%d)\n", errno);
-+#endif
-
-- wasPlaying = false;
-- playing = false;
-+ wasPlaying = false;
-+ playing = false;
- }
-
- void CDAudio_Pause(void)
- {
-- if (cdfile == -1 || !enabled)
-- return;
--
-- if (!playing)
-- return;
--
-- if ( ioctl(cdfile, CDROMPAUSE) == -1 )
-- Con_DPrintf("ioctl cdrompause failed\n");
-+#ifdef PAUSE_BY_STOPPING
-+ qboolean t;
-+#endif
-+
-+ if (cdfile == -1 || !enabled)
-+ return;
-+
-+ if (!playing)
-+ return;
-+
-+#ifndef PAUSE_BY_STOPPING
-+#ifdef __linux__
-+ if ( ioctl(cdfile, CDROMPAUSE) == -1 )
-+ Con_DPrintf("ioctl cdrompause failed\n");
-+#endif
-+
-+#if defined(__NetBSD__) || defined(__DragonFly__)
-+ if ( ioctl(cdfile, CDIOCPAUSE) == -1 )
-+ Con_DPrintf("ioctl cdrompause failed\n");
-+#endif
-+#else
-+ t_playLooping = playLooping;
-+ t_playTrack=playTrack;
-+ t=playing;
-+ CDAudio_Stop();
-+ playing=t;
-+#endif
-
-- wasPlaying = playing;
-- playing = false;
-+ wasPlaying = playing;
-+ playing = false;
- }
-
-
- void CDAudio_Resume(void)
- {
-- if (cdfile == -1 || !enabled)
-- return;
-+ if (cdfile == -1 || !enabled)
-+ return;
-
-- if (!cdValid)
-- return;
-+ if (!cdValid)
-+ return;
-
-- if (!wasPlaying)
-- return;
-+ if (!wasPlaying)
-+ return;
-
-- if ( ioctl(cdfile, CDROMRESUME) == -1 )
-- Con_DPrintf("ioctl cdromresume failed\n");
-- playing = true;
-+#ifndef PAUSE_BY_STOPPING
-+#ifdef __linux__
-+ if ( ioctl(cdfile, CDROMRESUME) == -1 )
-+ Con_DPrintf("ioctl cdromresume failed\n");
-+#endif
-+
-+#if defined(__NetBSD__) || defined(__DragonFly__)
-+ if ( ioctl(cdfile, CDIOCRESUME) == -1 )
-+ Con_DPrintf("ioctl cdromresume failed\n");
-+#endif
-+#else
-+ CDAudio_Play(t_playTrack, t_playLooping);
-+#endif
-+
-+ playing = true;
- }
-
- static void CD_f (void)
-@@ -327,43 +474,72 @@ static void CD_f (void)
-
- void CDAudio_Update(void)
- {
-- struct cdrom_subchnl subchnl;
-- static time_t lastchk;
-+#ifdef __linux__
-+ struct cdrom_subchnl subchnl;
-+#endif
-+#if defined(__NetBSD__) || defined(__DragonFly__)
-+ struct ioc_read_subchannel subchnl;
-+ struct cd_sub_channel_info data;
-+#endif
-+ static time_t lastchk;
-
-- if (!enabled)
-- return;
-+ if (!enabled)
-+ return;
-
-- if (bgmvolume.value != cdvolume)
-+ if (bgmvolume.value != cdvolume)
-+ {
-+ if (cdvolume)
- {
-- if (cdvolume)
-- {
-- Cvar_SetValue ("bgmvolume", 0.0);
-- cdvolume = bgmvolume.value;
-- CDAudio_Pause ();
-- }
-- else
-- {
-- Cvar_SetValue ("bgmvolume", 1.0);
-- cdvolume = bgmvolume.value;
-- CDAudio_Resume ();
-- }
-+ Cvar_SetValue ("bgmvolume", 0.0);
-+ cdvolume = bgmvolume.value;
-+ CDAudio_Pause ();
- }
--
-- if (playing && lastchk < time(NULL)) {
-- lastchk = time(NULL) + 2; //two seconds between chks
-- subchnl.cdsc_format = CDROM_MSF;
-- if (ioctl(cdfile, CDROMSUBCHNL, &subchnl) == -1 ) {
-- Con_DPrintf("ioctl cdromsubchnl failed\n");
-- playing = false;
-- return;
-- }
-- if (subchnl.cdsc_audiostatus != CDROM_AUDIO_PLAY &&
-- subchnl.cdsc_audiostatus != CDROM_AUDIO_PAUSED) {
-- playing = false;
-- if (playLooping)
-- CDAudio_Play(playTrack, true);
-- }
-+ else
-+ {
-+ Cvar_SetValue ("bgmvolume", 1.0);
-+ cdvolume = bgmvolume.value;
-+ CDAudio_Resume ();
- }
-+ }
-+
-+
-+ if (playing && lastchk < time(NULL)) {
-+ lastchk = time(NULL) + 2; /* two seconds between chks */
-+#ifdef __linux
-+ subchnl.cdsc_format = CDROM_MSF;
-+ if (ioctl(cdfile, CDROMSUBCHNL, &subchnl) == -1 ) {
-+ Con_DPrintf("ioctl cdromsubchnl failed\n");
-+ playing = false;
-+ return;
-+ }
-+ if (subchnl.cdsc_audiostatus != CDROM_AUDIO_PLAY &&
-+ subchnl.cdsc_audiostatus != CDROM_AUDIO_PAUSED) {
-+ playing = false;
-+ if (playLooping)
-+ CDAudio_Play(playTrack, true);
-+ }
-+#endif
-+#if defined(__NetBSD__) || defined(__DragonFly__)
-+ subchnl.address_format = CD_MSF_FORMAT;
-+ subchnl.data_format = CD_CURRENT_POSITION;
-+ subchnl.data_len = sizeof(data);
-+ subchnl.track = playTrack;
-+ subchnl.data = &data;
-+
-+ if (ioctl(cdfile, CDIOCREADSUBCHANNEL, &subchnl) == -1 ) {
-+ Con_DPrintf("ioctl cdromsubchnl failed\n");
-+ playing = false;
-+ return;
-+ }
-+ if (subchnl.data->header.audio_status != CD_AS_PLAY_IN_PROGRESS &&
-+ subchnl.data->header.audio_status != CD_AS_PLAY_PAUSED) {
-+ playing = false;
-+ if (playLooping)
-+ CDAudio_Play(playTrack, true);
-+ }
-+#endif
-+ }
-+
- }
-
- int CDAudio_Init(void)
-@@ -382,9 +558,9 @@ int CDAudio_Init(void)
- }
-
- if ((cdfile = open(cd_dev, O_RDONLY)) == -1) {
-- Con_Printf("CDAudio_Init: open of \"%s\" failed (%i)\n", cd_dev, errno);
-- cdfile = -1;
-- return -1;
-+ Con_Printf("CDAudio_Init: open of \"%s\" failed (%i)\n", cd_dev, errno);
-+ cdfile = -1;
-+ return -1;
- }
-
- for (i = 0; i < 100; i++)
diff --git a/games/quake/patches/patch-ah b/games/quake/patches/patch-ah
deleted file mode 100644
index c4815fac542..00000000000
--- a/games/quake/patches/patch-ah
+++ /dev/null
@@ -1,14 +0,0 @@
-$NetBSD: patch-ah,v 1.3 2009/08/29 19:26:01 wiz Exp $
-
---- WinQuake/gl_vidlinuxglx.c Tue Dec 21 18:39:36 1999
-+++ WinQuake/gl_vidlinuxglx.c Thu Jan 13 22:29:03 2000
-@@ -20,7 +20,9 @@
- #include <termios.h>
- #include <sys/ioctl.h>
- #include <sys/stat.h>
-+#ifdef __linux__
- #include <sys/vt.h>
-+#endif
- #include <stdarg.h>
- #include <stdio.h>
- #include <signal.h>
diff --git a/games/quake/patches/patch-ai b/games/quake/patches/patch-ai
deleted file mode 100644
index 619332cabb4..00000000000
--- a/games/quake/patches/patch-ai
+++ /dev/null
@@ -1,84 +0,0 @@
-$NetBSD: patch-ai,v 1.10 2011/09/14 19:19:37 marino Exp $
-
---- WinQuake/Makefile.linuxi386.orig 1999-04-27 15:51:18.000000000 +0000
-+++ WinQuake/Makefile.linuxi386
-@@ -25,29 +25,31 @@ ARCH=i386
- endif
- NOARCH=noarch
-
--MOUNT_DIR=/grog/Projects/WinQuake
-+MOUNT_DIR=${WRKSRC}/WinQuake
- MASTER_DIR=/grog/Projects/QuakeMaster
--MESA_DIR=/usr/local/src/Mesa-2.6
-+#MESA_DIR=/usr/local/src/Mesa-2.6
- TDFXGL_DIR = /home/zoid/3dfxgl
-
--BUILD_DEBUG_DIR=debug$(ARCH)$(GLIBC)
--BUILD_RELEASE_DIR=release$(ARCH)$(GLIBC)
-+#BUILD_DEBUG_DIR=debug$(ARCH)$(GLIBC)
-+#BUILD_RELEASE_DIR=release$(ARCH)$(GLIBC)
-+BUILD_DEBUG_DIR=debug_version
-+BUILD_RELEASE_DIR=release_version
-
- EGCS=/usr/local/egcs-1.1.2/bin/gcc
--CC=$(EGCS)
-+#CC=$(EGCS)
-
--BASE_CFLAGS=-Dstricmp=strcasecmp
--RELEASE_CFLAGS=$(BASE_CFLAGS) -g -mpentiumpro -O6 -ffast-math -funroll-loops \
-+BASE_CFLAGS=-Dstricmp=strcasecmp -I${X11BASE}/include ${CFLAGS}
-+RELEASE_CFLAGS=$(BASE_CFLAGS) -g -mtune=pentiumpro -O6 -ffast-math -funroll-loops \
- -fomit-frame-pointer -fexpensive-optimizations
- DEBUG_CFLAGS=$(BASE_CFLAGS) -g
--LDFLAGS=-lm
-+LDFLAGS+=-lm
- SVGALDFLAGS=-lvga
--XLDFLAGS=-L/usr/X11R6/lib -lX11 -lXext -lXxf86dga
--XCFLAGS=-DX11
-+XLDFLAGS=-L/usr/X11R6/lib ${LDFLAGS} -lX11 -lXext -lXxf86dga
-+XCFLAGS=-DX11 -I${X11BASE}/include ${CFLAGS}
-
--MESAGLLDFLAGS=-L/usr/X11/lib -L/usr/local/lib -L$(MESA_DIR)/lib -lMesaGL -lglide2x -lX11 -lXext -ldl
-+MESAGLLDFLAGS=-L${X11BASE}/lib -L${LOCALBASE}/lib -L$(MESA_DIR)/lib -lMesaGL -lX11 -lXext
- TDFXGLLDFLAGS=-L$(TDFXGL_DIR)/release$(ARCH)$(GLIBC) -l3dfxgl -lglide2x -ldl
--GLLDFLAGS=-L/usr/X11/lib -L/usr/local/lib -lGL -lX11 -lXext -ldl -lXxf86dga -lXxf86vm -lm
-+GLLDFLAGS=-L${X11BASE}/lib ${LDFLAGS} -L${MESA_DIR}/lib -lGL -lX11 -lXext -lXxf86dga -lXxf86vm -lm
- GLCFLAGS=-DGLQUAKE -I$(MESA_DIR)/include -I/usr/include/glide
-
- DO_CC=$(CC) $(CFLAGS) -o $@ -c $<
-@@ -57,19 +59,28 @@ DO_GL_DEBUG_CC=$(CC) $(DEBUG_CFLAGS) $(G
- DO_X11_CC=$(CC) $(CFLAGS) $(XCFLAGS) -o $@ -c $<
- DO_X11_DEBUG_CC=$(CC) $(DEBUG_CFLAGS) $(XCFLAGS) -o $@ -c $<
- DO_O_CC=$(CC) -O $(CFLAGS) -o $@ -c $<
--DO_AS=$(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
--DO_GL_AS=$(CC) $(CFLAGS) $(GLCFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
-+#DO_AS=$(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
-+#DO_AS=$(CC) $(CFLAGS) -DAOUT -x assembler-with-cpp -o $@ -c $<
-+DO_AS=$(CC) $(CFLAGS) -x assembler-with-cpp -o $@ -c $<
-+#DO_GL_AS=$(CC) $(CFLAGS) $(GLCFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
-+#DO_GL_AS=$(CC) $(CFLAGS) $(GLCFLAGS) -DAOUT -x assembler-with-cpp -o $@ -c $<
-+DO_GL_AS=$(CC) $(CFLAGS) $(GLCFLAGS) -x assembler-with-cpp -o $@ -c $<
-
- #############################################################################
- # SETUP AND BUILD
- #############################################################################
-
--TARGETS=$(BUILDDIR)/bin/squake \
-- $(BUILDDIR)/bin/glquake \
-- $(BUILDDIR)/bin/glquake.glx \
-- $(BUILDDIR)/bin/glquake.3dfxgl \
-+#TARGETS=$(BUILDDIR)/bin/squake \
-+# $(BUILDDIR)/bin/glquake \
-+# $(BUILDDIR)/bin/glquake.glx \
-+# $(BUILDDIR)/bin/glquake.3dfxgl \
-+# $(BUILDDIR)/bin/quake.x11
-+# $(BUILDDIR)/bin/unixded
-+
-+TARGETS=$(BUILDDIR)/bin/glquake.glx \
- $(BUILDDIR)/bin/quake.x11
-- # $(BUILDDIR)/bin/unixded
-+
-+#TARGETS=$(BUILDDIR)/bin/quake.x11
-
- build_debug:
- @-mkdir $(BUILD_DEBUG_DIR) \
diff --git a/games/quake/patches/patch-aj b/games/quake/patches/patch-aj
deleted file mode 100644
index d62bb8ebc33..00000000000
--- a/games/quake/patches/patch-aj
+++ /dev/null
@@ -1,176 +0,0 @@
-$NetBSD: patch-aj,v 1.4 2009/08/29 19:26:01 wiz Exp $
-
---- 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>
-+
-+#ifdef __NetBSD__
-+#include <soundcard.h>
-+#endif
-+
-+#if defined(__DragonFly__)
-+#include <sys/soundcard.h>
-+#endif
-+
-+#ifdef __linux__
- #include <linux/soundcard.h>
-+#endif
-+
- #include <stdio.h>
- #include "quakedef.h"
-
--int audio_fd;
-+int audio_fd = -1;
- int snd_inited;
-
- static int tryrates[] = { 11025, 22051, 44100, 8000 };
-
-+#ifdef __linux__
-+const char *audio_device="/dev/dsp";
-+#define MMAP_PROTECTION PROT_WRITE
-+#endif
-+
-+#ifdef __NetBSD__
-+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 +74,29 @@ qboolean SNDDMA_Init(void)
-
- snd_inited = 0;
-
--// open /dev/dsp, confirm capability to mmap, and get size of dma buffer
-+// open /dev/dsp or whatever, confirm capability to mmap, and get size of
-+// dma buffer
-
-- audio_fd = open("/dev/dsp", O_RDWR);
-+ audio_fd = open(audio_device, O_RDWR);
- if (audio_fd < 0)
- {
-- perror("/dev/dsp");
-- Con_Printf("Could not open /dev/dsp\n");
-+ perror(audio_device);
-+ Con_Printf("Could not open %s\n",audio_device);
- return 0;
- }
-
- rc = ioctl(audio_fd, SNDCTL_DSP_RESET, 0);
- if (rc < 0)
- {
-- perror("/dev/dsp");
-- Con_Printf("Could not reset /dev/dsp\n");
-+ perror(audio_device);
-+ Con_Printf("Could not reset %s\n",audio_device);
- close(audio_fd);
- return 0;
- }
-
- if (ioctl(audio_fd, SNDCTL_DSP_GETCAPS, &caps)==-1)
- {
-- perror("/dev/dsp");
-+ perror(audio_device);
- Con_Printf("Sound driver too old\n");
- close(audio_fd);
- return 0;
-@@ -130,11 +158,11 @@ qboolean SNDDMA_Init(void)
- // memory map the dma buffer
-
- shm->buffer = (unsigned char *) mmap(NULL, info.fragstotal
-- * info.fragsize, PROT_WRITE, MAP_FILE|MAP_SHARED, audio_fd, 0);
-+ * info.fragsize, MMAP_PROTECTION, MAP_FILE|MAP_SHARED, audio_fd, 0);
- if (!shm->buffer || shm->buffer == (unsigned char *)-1)
- {
-- perror("/dev/dsp");
-- Con_Printf("Could not mmap /dev/dsp\n");
-+ perror(audio_device);
-+ Con_Printf("Could not mmap %s\n",audio_device);
- close(audio_fd);
- return 0;
- }
-@@ -145,8 +173,8 @@ qboolean SNDDMA_Init(void)
- rc = ioctl(audio_fd, SNDCTL_DSP_STEREO, &tmp);
- if (rc < 0)
- {
-- perror("/dev/dsp");
-- Con_Printf("Could not set /dev/dsp to stereo=%d", shm->channels);
-+ perror(audio_device);
-+ Con_Printf("Could not set %s to stereo=%d", audio_device, shm->channels);
- close(audio_fd);
- return 0;
- }
-@@ -158,8 +186,8 @@ qboolean SNDDMA_Init(void)
- rc = ioctl(audio_fd, SNDCTL_DSP_SPEED, &shm->speed);
- if (rc < 0)
- {
-- perror("/dev/dsp");
-- Con_Printf("Could not set /dev/dsp speed to %d", shm->speed);
-+ perror(audio_device);
-+ Con_Printf("Could not set %s speed to %d", audio_device, shm->speed);
- close(audio_fd);
- return 0;
- }
-@@ -170,7 +198,7 @@ qboolean SNDDMA_Init(void)
- rc = ioctl(audio_fd, SNDCTL_DSP_SETFMT, &rc);
- if (rc < 0)
- {
-- perror("/dev/dsp");
-+ perror(audio_device);
- Con_Printf("Could not support 16-bit data. Try 8-bit.\n");
- close(audio_fd);
- return 0;
-@@ -182,7 +210,7 @@ qboolean SNDDMA_Init(void)
- rc = ioctl(audio_fd, SNDCTL_DSP_SETFMT, &rc);
- if (rc < 0)
- {
-- perror("/dev/dsp");
-+ perror(audio_device);
- Con_Printf("Could not support 8-bit data.\n");
- close(audio_fd);
- return 0;
-@@ -190,7 +218,7 @@ qboolean SNDDMA_Init(void)
- }
- else
- {
-- perror("/dev/dsp");
-+ perror(audio_device);
- Con_Printf("%d-bit sound not supported.", shm->samplebits);
- close(audio_fd);
- return 0;
-@@ -202,7 +230,7 @@ qboolean SNDDMA_Init(void)
- rc = ioctl(audio_fd, SNDCTL_DSP_SETTRIGGER, &tmp);
- if (rc < 0)
- {
-- perror("/dev/dsp");
-+ perror(audio_device);
- Con_Printf("Could not toggle.\n");
- close(audio_fd);
- return 0;
-@@ -211,7 +239,7 @@ qboolean SNDDMA_Init(void)
- rc = ioctl(audio_fd, SNDCTL_DSP_SETTRIGGER, &tmp);
- if (rc < 0)
- {
-- perror("/dev/dsp");
-+ perror(audio_device);
- Con_Printf("Could not toggle.\n");
- close(audio_fd);
- return 0;
-@@ -233,7 +261,7 @@ int SNDDMA_GetDMAPos(void)
-
- if (ioctl(audio_fd, SNDCTL_DSP_GETOPTR, &count)==-1)
- {
-- perror("/dev/dsp");
-+ perror(audio_device);
- Con_Printf("Uh, sound dead.\n");
- close(audio_fd);
- snd_inited = 0;
diff --git a/games/quake/patches/patch-ak b/games/quake/patches/patch-ak
deleted file mode 100644
index 0dc7f5925f2..00000000000
--- a/games/quake/patches/patch-ak
+++ /dev/null
@@ -1,14 +0,0 @@
-$NetBSD: patch-ak,v 1.3 2009/08/29 19:26:01 wiz Exp $
-
---- WinQuake/vid_x.c.orig Tue Dec 21 18:40:22 1999
-+++ WinQuake/vid_x.c Fri Jan 28 23:34:06 2000
-@@ -711,6 +711,9 @@
- void VID_Shutdown (void)
- {
- Con_Printf("VID_Shutdown\n");
-+ /* if display hasn't been initialised, we don't have to close it */
-+ if (!x_disp)
-+ return;
- XAutoRepeatOn(x_disp);
- XCloseDisplay(x_disp);
- }
diff --git a/games/quake/patches/patch-al b/games/quake/patches/patch-al
deleted file mode 100644
index 7f83e128d6c..00000000000
--- a/games/quake/patches/patch-al
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-al,v 1.4 2009/08/29 19:26:01 wiz Exp $
-
---- QW/server/asm_i386.h.orig Tue Feb 8 11:39:20 2000
-+++ QW/server/asm_i386.h Tue Feb 8 11:39:37 2000
-@@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suit
- #ifndef __ASM_I386__
- #define __ASM_I386__
-
--#ifdef ELF
-+#if defined(ELF) || defined(__ELF__)
- #define C(label) label
- #else
- #define C(label) _##label
diff --git a/games/quake/patches/patch-am b/games/quake/patches/patch-am
deleted file mode 100644
index 7cc92a735e1..00000000000
--- a/games/quake/patches/patch-am
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-am,v 1.4 2009/08/29 19:26:01 wiz Exp $
-
---- QW/client/asm_i386.h.orig Tue Feb 8 11:39:49 2000
-+++ QW/client/asm_i386.h Tue Feb 8 11:40:03 2000
-@@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suit
- #ifndef __ASM_I386__
- #define __ASM_I386__
-
--#ifdef ELF
-+#if defined(ELF) || defined(__ELF__)
- #define C(label) label
- #else
- #define C(label) _##label
diff --git a/games/quake/patches/patch-an b/games/quake/patches/patch-an
deleted file mode 100644
index ba1bb39a53b..00000000000
--- a/games/quake/patches/patch-an
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-an,v 1.4 2009/08/29 19:26:01 wiz Exp $
-
---- WinQuake/asm_i386.h.orig Tue Feb 8 11:40:46 2000
-+++ WinQuake/asm_i386.h Tue Feb 8 11:40:59 2000
-@@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suit
- #ifndef __ASM_I386__
- #define __ASM_I386__
-
--#ifdef ELF
-+#if defined(ELF) || defined(__ELF__)
- #define C(label) label
- #else
- #define C(label) _##label
diff --git a/games/quake/patches/patch-ao b/games/quake/patches/patch-ao
deleted file mode 100644
index fc090dd53c8..00000000000
--- a/games/quake/patches/patch-ao
+++ /dev/null
@@ -1,27 +0,0 @@
-$NetBSD: patch-ao,v 1.3 2009/08/29 19:26:01 wiz Exp $
-
---- QW/client/glquake.h.orig Tue Dec 21 15:49:06 1999
-+++ QW/client/glquake.h
-@@ -35,15 +35,15 @@
-
-
- // Function prototypes for the Texture Object Extension routines
--typedef GLboolean (APIENTRY *ARETEXRESFUNCPTR)(GLsizei, const GLuint *,
-+typedef GLboolean (GLAPIENTRY *ARETEXRESFUNCPTR)(GLsizei, const GLuint *,
- const GLboolean *);
--typedef void (APIENTRY *BINDTEXFUNCPTR)(GLenum, GLuint);
--typedef void (APIENTRY *DELTEXFUNCPTR)(GLsizei, const GLuint *);
--typedef void (APIENTRY *GENTEXFUNCPTR)(GLsizei, GLuint *);
--typedef GLboolean (APIENTRY *ISTEXFUNCPTR)(GLuint);
--typedef void (APIENTRY *PRIORTEXFUNCPTR)(GLsizei, const GLuint *,
-+typedef void (GLAPIENTRY *BINDTEXFUNCPTR)(GLenum, GLuint);
-+typedef void (GLAPIENTRY *DELTEXFUNCPTR)(GLsizei, const GLuint *);
-+typedef void (GLAPIENTRY *GENTEXFUNCPTR)(GLsizei, GLuint *);
-+typedef GLboolean (GLAPIENTRY *ISTEXFUNCPTR)(GLuint);
-+typedef void (GLAPIENTRY *PRIORTEXFUNCPTR)(GLsizei, const GLuint *,
- const GLclampf *);
--typedef void (APIENTRY *TEXSUBIMAGEPTR)(int, int, int, int, int, int, int, int, void *);
-+typedef void (GLAPIENTRY *TEXSUBIMAGEPTR)(int, int, int, int, int, int, int, int, void *);
-
- extern BINDTEXFUNCPTR bindTexFunc;
- extern DELTEXFUNCPTR delTexFunc;
diff --git a/games/quake/patches/patch-ap b/games/quake/patches/patch-ap
deleted file mode 100644
index d0e5d48ae4c..00000000000
--- a/games/quake/patches/patch-ap
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-ap,v 1.4 2009/08/29 19:26:01 wiz Exp $
-
---- WinQuake/net.h.orig 1999-12-21 15:54:20.000000000 +0000
-+++ WinQuake/net.h
-@@ -238,7 +238,7 @@ typedef struct
- extern int hostCacheCount;
- extern hostcache_t hostcache[HOSTCACHESIZE];
-
--#if !defined(_WIN32 ) && !defined (__linux__) && !defined (__sun__)
-+#if !defined(_WIN32 ) && !defined (__linux__) && !defined (__sun__) && !defined (__NetBSD__) && defined(__DragonFly__)
- #ifndef htonl
- extern unsigned long htonl (unsigned long hostlong);
- #endif