diff options
author | abs <abs@pkgsrc.org> | 2000-02-03 16:01:14 +0000 |
---|---|---|
committer | abs <abs@pkgsrc.org> | 2000-02-03 16:01:14 +0000 |
commit | fa022bb0af15901ed0a441e18a506b526c39ea97 (patch) | |
tree | 0f1d766ab7815b0e62697224dbad164dc717a4d7 /games/xdoom | |
parent | a52edb6e6a8d00d924df2e12bd3afc402f1b1fff (diff) | |
download | pkgsrc-fa022bb0af15901ed0a441e18a506b526c39ea97.tar.gz |
Update to 1.10nb1
Actually work with the supplied WAD file
One file-to-patch per patchfile
Remove strange 'post-patch' substitute X11_BASE phase
Fix numerous coredumps
Add a '-h' usage
Handle the sndserver dying
Make it work on little endian systems
Add a '-volume X' flag, and skip all sound code if 0
Other cleanup in some of the more repellant code areas.
Diffstat (limited to 'games/xdoom')
28 files changed, 783 insertions, 624 deletions
diff --git a/games/xdoom/Makefile b/games/xdoom/Makefile index 68c13ddc6f5..35522577775 100644 --- a/games/xdoom/Makefile +++ b/games/xdoom/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.10 1999/08/20 00:15:57 hubertf Exp $ +# $NetBSD: Makefile,v 1.11 2000/02/03 16:01:14 abs Exp $ DISTNAME= linuxdoom-1.10 -PKGNAME= xdoom-1.10 +PKGNAME= xdoom-1.10nb1 WRKSRC= ${WRKDIR} CATEGORIES= games x11 MASTER_SITES= ftp://ftp.idsoftware.com/idstuff/source/ @@ -24,13 +24,6 @@ post-extract: (cd ${WRKDIR}; ${GTAR} xzf linuxdoom-1.10.src.tgz) (cd ${WRKDIR}; ${GTAR} xzf sndserv.tgz) -post-patch: - @${MV} ${WRKSRC}/${DISTNAME}/i_sound.c ${WRKSRC}/foo - @${SED} -e 's@XXXPREFIXXXX@${PREFIX}@' <${WRKSRC}/foo> ${WRKSRC}/${DISTNAME}/i_sound.c - @${MV} ${WRKSRC}/${DISTNAME}/d_main.c ${WRKSRC}/foo - @${SED} -e 's@XXXPREFIXXXX@${PREFIX}@' <${WRKSRC}/foo> ${WRKSRC}/${DISTNAME}/d_main.c - @${RM} -f ${WRKSRC}/foo - do-build: cd ${WRKSRC}/${DISTNAME} ; ${GMAKE} X11BASE=${X11BASE} cd ${WRKSRC}/sndserv ; ${GMAKE} X11BASE=${X11BASE} diff --git a/games/xdoom/files/patch-sum b/games/xdoom/files/patch-sum index b1f0f1ce53c..8cd9e5ab35f 100644 --- a/games/xdoom/files/patch-sum +++ b/games/xdoom/files/patch-sum @@ -1,11 +1,28 @@ -$NetBSD: patch-sum,v 1.2 1999/12/29 21:47:03 tron Exp $ +$NetBSD: patch-sum,v 1.3 2000/02/03 16:01:14 abs Exp $ -MD5 (patch-aa) = 7749526d8edf1adcc295dc854daa6cff -MD5 (patch-ab) = aab64ff11eb3cace9af1e0069982fb92 -MD5 (patch-ac) = 4c573f258ce24464242bdf98aabb23ec -MD5 (patch-ad) = a05c1c46392a7685805e637f85c5a93e -MD5 (patch-ae) = 1c6b7c10905903682005a5e38f005895 -MD5 (patch-af) = 0665a6cb28fe4b3e8a8e0e93d33765fe -MD5 (patch-ag) = f5e6dad8e34f2a09e9c343beec650b2c -MD5 (patch-ah) = 4b4ce100e1bd3bf6aec20e1f050735b5 -MD5 (patch-ai) = ad62c66363c595d4df945dccc1476fe7 +MD5 (patch-aa) = 0939084c16cb728b3b16c575ff421367 +MD5 (patch-ab) = 4a3b1682fa0015a264145b189b1c1a55 +MD5 (patch-ac) = b08553ba738fe8710e5c0f35d59f77f6 +MD5 (patch-ad) = b746eda37b7befff012e46db89d9c704 +MD5 (patch-ae) = 0836d1ac5c8500a668defe6ea2b9af98 +MD5 (patch-af) = 30fa360d077bf6a2e7273852448c7568 +MD5 (patch-ag) = 40a7bade5965aa8aed8d5aff2dd9b474 +MD5 (patch-ah) = 1c016d5073ebd51ecc13f90d55f99908 +MD5 (patch-ai) = 8e8d581a6041ed2a1398b8783eb28893 +MD5 (patch-aj) = 6200a1e76fa3a4fd36e683a3921a5184 +MD5 (patch-ak) = a227ec099b6e4e38ab52dcebd634223e +MD5 (patch-al) = 0dcdd47afb7b5de69159b57cf470f3e3 +MD5 (patch-am) = d51728e7b5db384fd668c830422e1209 +MD5 (patch-an) = ec8c84a2cc009d7dc17b65fc3f8009e9 +MD5 (patch-ao) = 21d2e28cc9c42585982bd9ad94cbfef3 +MD5 (patch-ap) = 4edc4f1ef3ef66c7de90d5e6eb8904a6 +MD5 (patch-aq) = d524620a18d7b0c0bd9b05b3e2ed422f +MD5 (patch-ar) = c134589c85ca56f0ad55da2b81db0f8f +MD5 (patch-as) = b669bf4dbfe49438f6d41ed1d34f4aa3 +MD5 (patch-at) = ff74caf1c0aedc5d61357328a957da2e +MD5 (patch-au) = 78895c44f918477927273c4ad0f7b242 +MD5 (patch-av) = 6c6aec8eb1e9dd88f9a3821abe85aa80 +MD5 (patch-aw) = 880fa4d31a0354b57a76faaa64c9ce05 +MD5 (patch-ax) = 26725d9a4860a11efe6d849a932e0b7a +MD5 (patch-ay) = 05e41846ee605d761649b8ae7b137a0b +MD5 (patch-az) = 06a52aa52420969c688076caaa93cbcb diff --git a/games/xdoom/patches/patch-aa b/games/xdoom/patches/patch-aa index 94737ac9372..5d69acb86f7 100644 --- a/games/xdoom/patches/patch-aa +++ b/games/xdoom/patches/patch-aa @@ -1,14 +1,17 @@ -$NetBSD: patch-aa,v 1.4 1998/11/24 05:23:24 mycroft Exp $ ---- linuxdoom-1.10/Makefile.orig Mon Dec 22 12:55:36 1997 -+++ linuxdoom-1.10/Makefile Fri Aug 28 05:16:43 1998 -@@ -6,9 +6,10 @@ +$NetBSD: patch-aa,v 1.5 2000/02/03 16:01:15 abs Exp $ + +--- linuxdoom-1.10/Makefile.orig Mon Dec 22 19:55:36 1997 ++++ linuxdoom-1.10/Makefile Thu Feb 3 13:22:41 2000 +@@ -6,9 +6,12 @@ # CC= gcc # gcc or g++ -CFLAGS=-g -Wall -DNORMALUNIX -DLINUX # -DUSEASM -LDFLAGS=-L/usr/X11R6/lib -LIBS=-lXext -lX11 -lnsl -lm -+CFLAGS=-O2 -Wall -DNORMALUNIX -DSNDSRV # -DUSEASM ++X11BASE?=/usr/X11R6 ++ ++CFLAGS=-O2 -Wall -DNORMALUNIX -DSNDSRV -DINSTALL_PREFIX=\"$(X11BASE)\" #-DUSEASM +CFLAGS+= -I$(X11BASE)/include +LDFLAGS=-Wl,-R$(X11BASE)/lib -L$(X11BASE)/lib +LIBS=-lXext -lX11 -lm diff --git a/games/xdoom/patches/patch-ab b/games/xdoom/patches/patch-ab index 28668f2adeb..e41edbf5239 100644 --- a/games/xdoom/patches/patch-ab +++ b/games/xdoom/patches/patch-ab @@ -1,461 +1,35 @@ -$NetBSD: patch-ab,v 1.2 1998/09/06 16:37:44 hubertf Exp $ -*** 1.1.1.1 1998/07/03 16:32:29 ---- linuxdoom-1.10/d_net.h 1998/07/03 16:33:37 -*************** -*** 80,84 **** - { - // Supposed to be DOOMCOM_ID? -! long id; - - // DOOM executes an int to execute commands. ---- 80,84 ---- - { - // Supposed to be DOOMCOM_ID? -! int id; - - // DOOM executes an int to execute commands. -Index: linuxdoom-1.10/doomtype.h -=================================================================== -RCS file: /ca1/div/cvsroot/extern/doom/doomtype.h,v -retrieving revision 1.1.1.1 -diff -c -2 -r1.1.1.1 doomtype.h -*** 1.1.1.1 1998/07/03 16:32:16 ---- linuxdoom-1.10/doomtype.h 1998/07/15 21:12:05 -*************** -*** 47,51 **** - // Max pos 32-bit int. - #define MAXINT ((int)0x7fffffff) -- #define MAXLONG ((long)0x7fffffff) - #define MINCHAR ((char)0x80) - #define MINSHORT ((short)0x8000) ---- 47,50 ---- -*************** -*** 53,57 **** - // Max negative 32-bit integer. - #define MININT ((int)0x80000000) -- #define MINLONG ((long)0x80000000) - #endif - ---- 52,55 ---- -Index: linuxdoom-1.10/info.h -=================================================================== -RCS file: /ca1/div/cvsroot/extern/doom/info.h,v -retrieving revision 1.1.1.1 -diff -c -2 -r1.1.1.1 info.h -*** 1.1.1.1 1998/07/03 16:32:20 ---- linuxdoom-1.10/info.h 1998/07/03 16:33:41 -*************** -*** 1148,1157 **** - { - spritenum_t sprite; -! long frame; -! long tics; - // void (*action) (); - actionf_t action; - statenum_t nextstate; -! long misc1, misc2; - } state_t; - ---- 1148,1157 ---- - { - spritenum_t sprite; -! int frame; -! int tics; - // void (*action) (); - actionf_t action; - statenum_t nextstate; -! int misc1, misc2; - } state_t; - -Index: linuxdoom-1.10/m_bbox.h -=================================================================== -RCS file: /ca1/div/cvsroot/extern/doom/m_bbox.h,v -retrieving revision 1.1.1.1 -diff -c -2 -r1.1.1.1 m_bbox.h -*** 1.1.1.1 1998/07/03 16:32:20 ---- linuxdoom-1.10/m_bbox.h 1998/07/03 16:33:42 -*************** -*** 24,28 **** - #define __M_BBOX__ - -! #include <values.h> - - #include "m_fixed.h" ---- 24,28 ---- - #define __M_BBOX__ - -! #include "doomtype.h" - - #include "m_fixed.h" -Index: linuxdoom-1.10/m_swap.h -=================================================================== -RCS file: /ca1/div/cvsroot/extern/doom/m_swap.h,v -retrieving revision 1.1.1.1 -diff -c -2 -r1.1.1.1 m_swap.h -*** 1.1.1.1 1998/07/03 16:32:29 ---- linuxdoom-1.10/m_swap.h 1998/07/15 21:08:17 -*************** -*** 34,40 **** - #ifdef __BIG_ENDIAN__ - short SwapSHORT(short); -! long SwapLONG(long); - #define SHORT(x) ((short)SwapSHORT((unsigned short) (x))) -! #define LONG(x) ((long)SwapLONG((unsigned long) (x))) - #else - #define SHORT(x) (x) ---- 34,40 ---- - #ifdef __BIG_ENDIAN__ - short SwapSHORT(short); -! int SwapLONG(int); - #define SHORT(x) ((short)SwapSHORT((unsigned short) (x))) -! #define LONG(x) ((int)SwapLONG((unsigned int) (x))) - #else - #define SHORT(x) (x) -Index: linuxdoom-1.10/i_net.c -=================================================================== -RCS file: /ca1/div/cvsroot/extern/doom/i_net.c,v -retrieving revision 1.1.1.1 -diff -c -2 -r1.1.1.1 i_net.c -*** 1.1.1.1 1998/07/03 16:32:18 ---- linuxdoom-1.10/i_net.c 1998/07/15 21:11:38 -*************** -*** 51,69 **** - - -- -- // For some odd reason... -- #define ntohl(x) \ -- ((unsigned long int)((((unsigned long int)(x) & 0x000000ffU) << 24) | \ -- (((unsigned long int)(x) & 0x0000ff00U) << 8) | \ -- (((unsigned long int)(x) & 0x00ff0000U) >> 8) | \ -- (((unsigned long int)(x) & 0xff000000U) >> 24))) -- -- #define ntohs(x) \ -- ((unsigned short int)((((unsigned short int)(x) & 0x00ff) << 8) | \ -- (((unsigned short int)(x) & 0xff00) >> 8))) \ -- -- #define htonl(x) ntohl(x) -- #define htons(x) ntohs(x) -- - void NetSend (void); - boolean NetListen (void); ---- 51,54 ---- -*************** -*** 74,78 **** - // - -! int DOOMPORT = (IPPORT_USERRESERVED +0x1d ); - - int sendsocket; ---- 59,63 ---- - // - -! int DOOMPORT = (IPPORT_RESERVED +0x1d ); - - int sendsocket; -Index: linuxdoom-1.10/i_sound.c -=================================================================== -RCS file: /ca1/div/cvsroot/extern/doom/i_sound.c,v -retrieving revision 1.1.1.1 -diff -c -2 -r1.1.1.1 i_sound.c -*** 1.1.1.1 1998/07/03 16:32:18 ---- linuxdoom-1.10/i_sound.c 1998/07/15 20:05:49 -*************** -*** 42,47 **** ---- 42,49 ---- - #include <sys/ioctl.h> - -+ #ifdef LINUX - // Linux voxware output. - #include <linux/soundcard.h> -+ #endif - - // Timer stuff. Experimental. -Index: linuxdoom-1.10/i_video.c -=================================================================== -RCS file: /ca1/div/cvsroot/extern/doom/i_video.c,v -retrieving revision 1.1.1.1 -diff -c -2 -r1.1.1.1 i_video.c -*** 1.1.1.1 1998/07/03 16:32:18 ---- linuxdoom-1.10/i_video.c 1998/07/15 20:40:59 -*************** -*** 37,41 **** - // Had to dig up XShm.c for this one. - // It is in the libXext, but not in the XFree86 headers. -! #ifdef LINUX - int XShmGetEventBase( Display* dpy ); // problems with g++? - #endif ---- 37,41 ---- - // Had to dig up XShm.c for this one. - // It is in the libXext, but not in the XFree86 headers. -! #if defined(LINUX) || defined (__NetBSD__) - int XShmGetEventBase( Display* dpy ); // problems with g++? - #endif -*************** -*** 47,51 **** - - #include <netinet/in.h> -! #include <errnos.h> - #include <signal.h> - ---- 47,51 ---- - - #include <netinet/in.h> -! #include <errno.h> - #include <signal.h> - -Index: linuxdoom-1.10/m_menu.c -=================================================================== -RCS file: /ca1/div/cvsroot/extern/doom/m_menu.c,v -retrieving revision 1.1.1.1 -diff -c -2 -r1.1.1.1 m_menu.c -*** 1.1.1.1 1998/07/03 16:32:21 ---- linuxdoom-1.10/m_menu.c 1998/07/03 16:33:58 -*************** -*** 530,534 **** - continue; - } -! count = read (handle, &savegamestrings[i], SAVESTRINGSIZE); - close (handle); - LoadMenu[i].status = 1; ---- 530,534 ---- - continue; - } -! count = read (handle, savegamestrings[i], SAVESTRINGSIZE); - close (handle); - LoadMenu[i].status = 1; -Index: linuxdoom-1.10/m_misc.c -=================================================================== -RCS file: /ca1/div/cvsroot/extern/doom/m_misc.c,v -retrieving revision 1.1.1.1 -diff -c -2 -r1.1.1.1 m_misc.c -*** 1.1.1.1 1998/07/03 16:32:21 ---- linuxdoom-1.10/m_misc.c 1998/07/03 16:33:58 -*************** -*** 227,231 **** - char* name; - int* location; -! int defaultvalue; - int scantranslate; // PC scan code hack - int untranslated; // lousy hack ---- 227,231 ---- - char* name; - int* location; -! long defaultvalue; - int scantranslate; // PC scan code hack - int untranslated; // lousy hack -*************** -*** 255,260 **** - // UNIX hack, to be removed. - #ifdef SNDSERV -! {"sndserver", (int *) &sndserver_filename, (int) "sndserver"}, -! {"mb_used", &mb_used, 2}, - #endif - ---- 255,260 ---- - // UNIX hack, to be removed. - #ifdef SNDSERV -! {"sndserver", (int *) &sndserver_filename, (long) "sndserver"}, -! {"mb_used", &mb_used, 12}, - #endif - -*************** -*** 286,299 **** - {"usegamma",&usegamma, 0}, - -! {"chatmacro0", (int *) &chat_macros[0], (int) HUSTR_CHATMACRO0 }, -! {"chatmacro1", (int *) &chat_macros[1], (int) HUSTR_CHATMACRO1 }, -! {"chatmacro2", (int *) &chat_macros[2], (int) HUSTR_CHATMACRO2 }, -! {"chatmacro3", (int *) &chat_macros[3], (int) HUSTR_CHATMACRO3 }, -! {"chatmacro4", (int *) &chat_macros[4], (int) HUSTR_CHATMACRO4 }, -! {"chatmacro5", (int *) &chat_macros[5], (int) HUSTR_CHATMACRO5 }, -! {"chatmacro6", (int *) &chat_macros[6], (int) HUSTR_CHATMACRO6 }, -! {"chatmacro7", (int *) &chat_macros[7], (int) HUSTR_CHATMACRO7 }, -! {"chatmacro8", (int *) &chat_macros[8], (int) HUSTR_CHATMACRO8 }, -! {"chatmacro9", (int *) &chat_macros[9], (int) HUSTR_CHATMACRO9 } - - }; ---- 286,299 ---- - {"usegamma",&usegamma, 0}, - -! {"chatmacro0", (int *) &chat_macros[0], (long) HUSTR_CHATMACRO0 }, -! {"chatmacro1", (int *) &chat_macros[1], (long) HUSTR_CHATMACRO1 }, -! {"chatmacro2", (int *) &chat_macros[2], (long) HUSTR_CHATMACRO2 }, -! {"chatmacro3", (int *) &chat_macros[3], (long) HUSTR_CHATMACRO3 }, -! {"chatmacro4", (int *) &chat_macros[4], (long) HUSTR_CHATMACRO4 }, -! {"chatmacro5", (int *) &chat_macros[5], (long) HUSTR_CHATMACRO5 }, -! {"chatmacro6", (int *) &chat_macros[6], (long) HUSTR_CHATMACRO6 }, -! {"chatmacro7", (int *) &chat_macros[7], (long) HUSTR_CHATMACRO7 }, -! {"chatmacro8", (int *) &chat_macros[8], (long) HUSTR_CHATMACRO8 }, -! {"chatmacro9", (int *) &chat_macros[9], (long) HUSTR_CHATMACRO9 } - - }; -Index: linuxdoom-1.10/m_swap.c -=================================================================== -RCS file: /ca1/div/cvsroot/extern/doom/m_swap.c,v -retrieving revision 1.1.1.1 -diff -c -2 -r1.1.1.1 m_swap.c -*** 1.1.1.1 1998/07/03 16:32:31 ---- linuxdoom-1.10/m_swap.c 1998/07/15 20:56:48 -*************** -*** 43,47 **** - - // Swapping 32bit. -! unsigned long SwapLONG( unsigned long x) - { - return ---- 43,47 ---- - - // Swapping 32bit. -! unsigned int SwapLONG( unsigned int x) - { - return -Index: linuxdoom-1.10/p_setup.c -=================================================================== -RCS file: /ca1/div/cvsroot/extern/doom/p_setup.c,v -retrieving revision 1.1.1.1 -diff -c -2 -r1.1.1.1 p_setup.c -*** 1.1.1.1 1998/07/03 16:32:23 ---- linuxdoom-1.10/p_setup.c 1998/07/03 16:34:02 -*************** -*** 534,538 **** - - // build line tables for each sector -! linebuffer = Z_Malloc (total*4, PU_LEVEL, 0); - sector = sectors; - for (i=0 ; i<numsectors ; i++, sector++) ---- 534,538 ---- - - // build line tables for each sector -! linebuffer = Z_Malloc (total*sizeof(line_t*), PU_LEVEL, 0); - sector = sectors; - for (i=0 ; i<numsectors ; i++, sector++) -Index: linuxdoom-1.10/r_data.c -=================================================================== -RCS file: /ca1/div/cvsroot/extern/doom/r_data.c,v -retrieving revision 1.1.1.1 -diff -c -2 -r1.1.1.1 r_data.c -*** 1.1.1.1 1998/07/03 16:32:24 ---- linuxdoom-1.10/r_data.c 1998/07/15 20:54:12 -*************** -*** 42,47 **** - #include "r_sky.h" - -! #ifdef LINUX - #include <alloca.h> - #endif - ---- 42,49 ---- - #include "r_sky.h" - -! #if 0 - #include <alloca.h> -+ #else -+ #include <stdlib.h> - #endif - -*************** -*** 479,490 **** - } - numtextures = numtextures1 + numtextures2; -! -! textures = Z_Malloc (numtextures*4, PU_STATIC, 0); -! texturecolumnlump = Z_Malloc (numtextures*4, PU_STATIC, 0); -! texturecolumnofs = Z_Malloc (numtextures*4, PU_STATIC, 0); -! texturecomposite = Z_Malloc (numtextures*4, PU_STATIC, 0); -! texturecompositesize = Z_Malloc (numtextures*4, PU_STATIC, 0); -! texturewidthmask = Z_Malloc (numtextures*4, PU_STATIC, 0); -! textureheight = Z_Malloc (numtextures*4, PU_STATIC, 0); - - totalwidth = 0; ---- 481,492 ---- - } - numtextures = numtextures1 + numtextures2; -! textures = Z_Malloc (numtextures*sizeof(texture_t*), PU_STATIC, 0); -! texturecolumnlump = Z_Malloc (numtextures*sizeof(short*), PU_STATIC, 0); -! texturecolumnofs = Z_Malloc (numtextures*sizeof(unsigned short*), -! PU_STATIC, 0); -! texturecomposite = Z_Malloc (numtextures*sizeof(byte*), PU_STATIC, 0); -! texturecompositesize = Z_Malloc (numtextures*sizeof(int), PU_STATIC, 0); -! texturewidthmask = Z_Malloc (numtextures*sizeof(int), PU_STATIC, 0); -! textureheight = Z_Malloc (numtextures*sizeof(fixed_t), PU_STATIC, 0); - - totalwidth = 0; -*************** -*** 640,644 **** - length = W_LumpLength (lump) + 255; - colormaps = Z_Malloc (length, PU_STATIC, 0); -! colormaps = (byte *)( ((int)colormaps + 255)&~0xff); - W_ReadLump (lump,colormaps); - } ---- 642,646 ---- - length = W_LumpLength (lump) + 255; - colormaps = Z_Malloc (length, PU_STATIC, 0); -! colormaps = (byte *)( ((long)colormaps + 255)&~0xffL); - W_ReadLump (lump,colormaps); - } -Index: linuxdoom-1.10/r_draw.c -=================================================================== -RCS file: /ca1/div/cvsroot/extern/doom/r_draw.c,v -retrieving revision 1.1.1.1 -diff -c -2 -r1.1.1.1 r_draw.c -*** 1.1.1.1 1998/07/03 16:32:24 ---- linuxdoom-1.10/r_draw.c 1998/07/03 16:34:04 -*************** -*** 462,466 **** - - translationtables = Z_Malloc (256*3+255, PU_STATIC, 0); -! translationtables = (byte *)(( (int)translationtables + 255 )& ~255); - - // translate just the 16 green colors ---- 462,466 ---- - - translationtables = Z_Malloc (256*3+255, PU_STATIC, 0); -! translationtables = (byte *)(( (long)translationtables + 255 )& ~255L); - - // translate just the 16 green colors -Index: linuxdoom-1.10/w_wad.c -=================================================================== -RCS file: /ca1/div/cvsroot/extern/doom/w_wad.c,v -retrieving revision 1.1.1.1 -diff -c -2 -r1.1.1.1 w_wad.c -*** 1.1.1.1 1998/07/03 16:32:27 ---- linuxdoom-1.10/w_wad.c 1998/07/15 20:22:25 -*************** -*** 35,39 **** ---- 35,43 ---- - #include <fcntl.h> - #include <sys/stat.h> -+ #if 0 - #include <alloca.h> -+ #else -+ #include <stdlib.h> -+ #endif - #define O_BINARY 0 - #endif -Index: linuxdoom-1.10/z_zone.c -=================================================================== -RCS file: /ca1/div/cvsroot/extern/doom/z_zone.c,v -retrieving revision 1.1.1.1 -diff -c -2 -r1.1.1.1 z_zone.c -*** 1.1.1.1 1998/07/03 16:32:29 ---- linuxdoom-1.10/z_zone.c 1998/07/15 20:44:56 -*************** -*** 193,198 **** - memblock_t* base; - - size = (size + 3) & ~3; -! - // scan through the block list, - // looking for the first free block ---- 193,202 ---- - memblock_t* base; - -+ #ifdef __alpha -+ size = (size + 7) & ~7; -+ #else - size = (size + 3) & ~3; -! #endif -! - // scan through the block list, - // looking for the first free block +$NetBSD: patch-ab,v 1.3 2000/02/03 16:01:15 abs Exp $ + +--- linuxdoom-1.10/am_map.c.orig Mon Dec 22 19:58:32 1997 ++++ linuxdoom-1.10/am_map.c Thu Feb 3 01:33:44 2000 +@@ -783,7 +783,7 @@ + // + void AM_updateLightLev(void) + { +- static nexttic = 0; ++ static int nexttic = 0; + //static int litelevels[] = { 0, 3, 5, 6, 6, 7, 7, 7 }; + static int litelevels[] = { 0, 4, 7, 10, 12, 14, 15, 15 }; + static int litelevelscnt = 0; +@@ -856,9 +856,9 @@ + TOP =8 + }; + +- register outcode1 = 0; +- register outcode2 = 0; +- register outside; ++ register int outcode1 = 0; ++ register int outcode2 = 0; ++ register int outside; + + fpoint_t tmp; + int dx; +@@ -989,7 +989,7 @@ + register int ay; + register int d; + +- static fuck = 0; ++ static int fuck = 0; + + // For debugging only + if ( fl->a.x < 0 || fl->a.x >= f_w diff --git a/games/xdoom/patches/patch-ac b/games/xdoom/patches/patch-ac index 1a38f6c24cd..2889ceb0607 100644 --- a/games/xdoom/patches/patch-ac +++ b/games/xdoom/patches/patch-ac @@ -1,12 +1,66 @@ -$NetBSD: patch-ac,v 1.2 1998/09/06 16:37:44 hubertf Exp $ ---- d_main.c.orig Fri Aug 28 04:27:47 1998 -+++ linuxdoom-1.10/d_main.c Fri Aug 28 04:28:42 1998 -@@ -577,7 +577,7 @@ +$NetBSD: patch-ac,v 1.3 2000/02/03 16:01:15 abs Exp $ + +--- linuxdoom-1.10/d_main.c.orig Mon Dec 22 20:32:03 1997 ++++ linuxdoom-1.10/d_main.c Thu Feb 3 13:35:25 2000 +@@ -577,7 +577,11 @@ char *doomwaddir; doomwaddir = getenv("DOOMWADDIR"); if (!doomwaddir) -- doomwaddir = "."; -+ doomwaddir = "XXXPREFIXXXX/share/doom"; ++#ifdef INSTALL_PREFIX ++ doomwaddir = INSTALL_PREFIX"/share/doom"; ++#else + doomwaddir = "."; ++#endif // Commercial. doom2wad = malloc(strlen(doomwaddir)+1+9+1); +@@ -804,7 +808,32 @@ + + setbuf (stdout, NULL); + modifiedgame = false; +- ++ ++ if (myargc > 1 && strcmp(myargv[1], "-h")==0) ++ { ++ printf( ++"Many options are not explained, and some are just plain broken.\n\ ++Some more useful ones are:\n\ ++ -2 -3 -4 Scale the window by 2, 3, or 4 times.\n\ ++ -config FILE Load/save configuration from FILE.\n\ ++ -episode N Set starting expisode to N.\n\ ++ -grabmouse Grab the mouse to control movement.\n\ ++ -volume N Set volume (default 8).\n\ ++ -skill N Set starting skill level to N.\n\ ++\n\ ++Others are:\n\ ++ ++-altdeath -debugfile -file -nodraw -respawn -warp \n\ ++-avg -devparm -geom -nomonsters -shdev -wart \n\ ++-cdrom -disp -loadgame -playdemo -statcopy \n\ ++-comdev -dup -maxdemo -port -timedemo \n\ ++ -extratic -net -record -timer \n\ ++-deathmatch -fast -noblit -regdev -turbo \n\ ++ ++"); ++ exit(0); ++ } ++ + nomonsters = M_CheckParm ("-nomonsters"); + respawnparm = M_CheckParm ("-respawn"); + fastparm = M_CheckParm ("-fast"); +@@ -1013,6 +1042,15 @@ + + printf ("M_LoadDefaults: Load system defaults.\n"); + M_LoadDefaults (); // load before initing other systems ++ ++ /* Must be after M_LoadDefaults */ ++ p = M_CheckParm ("-volume"); ++ if (p && p < myargc-1) ++ { ++ int vol = atoi(myargv[p+1]); ++ S_SetSfxVolume(vol); ++ S_SetMusicVolume(vol); ++ } + + printf ("Z_Init: Init zone memory allocation daemon. \n"); + Z_Init (); diff --git a/games/xdoom/patches/patch-ad b/games/xdoom/patches/patch-ad index 83f7578647b..6ed5c3908ad 100644 --- a/games/xdoom/patches/patch-ad +++ b/games/xdoom/patches/patch-ad @@ -1,16 +1,13 @@ -$NetBSD: patch-ad,v 1.2 1998/09/06 16:37:45 hubertf Exp $ ---- i_sound.c.orig Sun Sep 6 17:42:40 1998 -+++ linuxdoom-1.10/i_sound.c Sun Sep 6 17:43:59 1998 -@@ -747,7 +747,11 @@ - getenv("DOOMWADDIR"), - sndserver_filename); - else -- sprintf(buffer, "%s", sndserver_filename); -+ sprintf(buffer, "XXXPREFIXXXX/bin/%s", sndserver_filename); -+ -+ /* sndserver won't find its wadfile if DOMMWADDIR isn't set - HF */ -+ if(!getenv("DOOMWADDIR")) -+ setenv("DOOMWADDIR","XXXPREFIXXXX/share/doom",1); - - // start sound process - if ( !access(buffer, X_OK) ) +$NetBSD: patch-ad,v 1.3 2000/02/03 16:01:15 abs Exp $ + +--- linuxdoom-1.10/d_net.h.orig Sun Dec 14 11:53:05 1997 ++++ linuxdoom-1.10/d_net.h Thu Feb 3 01:33:46 2000 +@@ -79,7 +79,7 @@ + typedef struct + { + // Supposed to be DOOMCOM_ID? +- long id; ++ int id; + + // DOOM executes an int to execute commands. + short intnum; diff --git a/games/xdoom/patches/patch-ae b/games/xdoom/patches/patch-ae index 4759c3057ba..6d71a1cb534 100644 --- a/games/xdoom/patches/patch-ae +++ b/games/xdoom/patches/patch-ae @@ -1,32 +1,18 @@ -$NetBSD: patch-ae,v 1.2 1999/12/29 21:47:04 tron Exp $ +$NetBSD: patch-ae,v 1.3 2000/02/03 16:01:15 abs Exp $ ---- sndserv/linux.c.orig Sun Jan 26 08:45:01 1997 -+++ sndserv/linux.c Wed Dec 29 22:41:14 1999 -@@ -39,11 +39,14 @@ - #include <stdio.h> - #include <fcntl.h> - #include <unistd.h> -+#include <sys/ioctl.h> +--- linuxdoom-1.10/doomtype.h.orig Mon Dec 22 20:05:27 1997 ++++ linuxdoom-1.10/doomtype.h Thu Feb 3 01:33:46 2000 +@@ -46,13 +46,11 @@ --#include <linux/soundcard.h> -+#include <soundcard.h> + // Max pos 32-bit int. + #define MAXINT ((int)0x7fffffff) +-#define MAXLONG ((long)0x7fffffff) + #define MINCHAR ((char)0x80) + #define MINSHORT ((short)0x8000) - #include "soundsrv.h" + // Max negative 32-bit integer. + #define MININT ((int)0x80000000) +-#define MINLONG ((long)0x80000000) + #endif -+#define SOUND_DEV "/dev/sound" -+ - int audio_fd; - void -@@ -76,9 +79,9 @@ - - int i; - -- audio_fd = open("/dev/dsp", O_WRONLY); -+ audio_fd = open(SOUND_DEV, O_WRONLY); - if (audio_fd<0) -- fprintf(stderr, "Could not open /dev/dsp\n"); -+ fprintf(stderr, "Could not open "SOUND_DEV"\n"); - - - i = 11 | (2<<16); diff --git a/games/xdoom/patches/patch-af b/games/xdoom/patches/patch-af index 3200f0119e4..9c6ffd33019 100644 --- a/games/xdoom/patches/patch-af +++ b/games/xdoom/patches/patch-af @@ -1,16 +1,21 @@ -$NetBSD: patch-af,v 1.3 1998/11/24 05:23:24 mycroft Exp $ +$NetBSD: patch-af,v 1.4 2000/02/03 16:01:15 abs Exp $ ---- sndserv/Makefile.orig Mon Dec 22 22:17:10 1997 -+++ sndserv/Makefile Tue Nov 24 01:26:59 1998 -@@ -7,9 +7,9 @@ - # - - CC=gcc --CFLAGS=-O -DNORMALUNIX -DLINUX -+CFLAGS=-O2 -DNORMALUNIX -DLINUX - LDFLAGS= --LIBS=-lm -+LIBS=-lm -lossaudio - - O=linux - +--- linuxdoom-1.10/g_game.c.orig Mon Dec 22 20:35:29 1997 ++++ linuxdoom-1.10/g_game.c Thu Feb 3 01:33:47 2000 +@@ -1586,12 +1586,14 @@ + + gameaction = ga_nothing; + demobuffer = demo_p = W_CacheLumpName (defdemoname, PU_STATIC); +- if ( *demo_p++ != VERSION) ++ if ( *demo_p/100 != VERSION/100 || *demo_p%100 > VERSION%100 ) + { +- fprintf( stderr, "Demo is from a different game version!\n"); ++ fprintf( stderr, "Demo is from a different game version (%.2f / %.2f)!\n", ++ demo_p[-1]/(float)100, VERSION/(float)100); + gameaction = ga_nothing; + return; + } ++ ++demo_p; + + skill = *demo_p++; + episode = *demo_p++; diff --git a/games/xdoom/patches/patch-ag b/games/xdoom/patches/patch-ag index 24d5b3041f2..9b7ef2b192c 100644 --- a/games/xdoom/patches/patch-ag +++ b/games/xdoom/patches/patch-ag @@ -1,17 +1,35 @@ -$NetBSD: patch-ag,v 1.1 1998/12/14 14:43:10 mycroft Exp $ +$NetBSD: patch-ag,v 1.2 2000/02/03 16:01:15 abs Exp $ ---- linuxdoom-1.10/r_data.c~ Mon Dec 14 09:38:47 1998 -+++ linuxdoom-1.10/r_data.c Mon Dec 14 09:37:51 1998 -@@ -86,10 +86,10 @@ - typedef struct - { - char name[8]; -- boolean masked; -+ short masked[2]; // OBSOLETE - short width; - short height; -- void **columndirectory; // OBSOLETE -+ short columndirectory[2]; // OBSOLETE - short patchcount; - mappatch_t patches[1]; - } maptexture_t; +--- linuxdoom-1.10/i_net.c.orig Mon Dec 22 20:37:46 1997 ++++ linuxdoom-1.10/i_net.c Thu Feb 3 01:33:48 2000 +@@ -50,21 +50,6 @@ + + + +- +-// For some odd reason... +-#define ntohl(x) \ +- ((unsigned long int)((((unsigned long int)(x) & 0x000000ffU) << 24) | \ +- (((unsigned long int)(x) & 0x0000ff00U) << 8) | \ +- (((unsigned long int)(x) & 0x00ff0000U) >> 8) | \ +- (((unsigned long int)(x) & 0xff000000U) >> 24))) +- +-#define ntohs(x) \ +- ((unsigned short int)((((unsigned short int)(x) & 0x00ff) << 8) | \ +- (((unsigned short int)(x) & 0xff00) >> 8))) \ +- +-#define htonl(x) ntohl(x) +-#define htons(x) ntohs(x) +- + void NetSend (void); + boolean NetListen (void); + +@@ -73,7 +58,7 @@ + // NETWORKING + // + +-int DOOMPORT = (IPPORT_USERRESERVED +0x1d ); ++int DOOMPORT = (IPPORT_RESERVED +0x1d ); + + int sendsocket; + int insocket; diff --git a/games/xdoom/patches/patch-ah b/games/xdoom/patches/patch-ah index 97c9d6c7109..dcb71542f34 100644 --- a/games/xdoom/patches/patch-ah +++ b/games/xdoom/patches/patch-ah @@ -1,22 +1,59 @@ -$NetBSD: patch-ah,v 1.1 1999/03/15 01:54:32 sommerfe Exp $ +$NetBSD: patch-ah,v 1.2 2000/02/03 16:01:15 abs Exp $ -*** linuxdoom-1.10/info.h.orig Sun Mar 14 17:14:18 1999 ---- linuxdoom-1.10/info.h Sun Mar 14 17:14:46 1999 -*************** -*** 1156,1162 **** - } state_t; - - extern state_t states[NUMSTATES]; -! extern char *sprnames[NUMSPRITES]; - - - ---- 1156,1163 ---- - } state_t; - - extern state_t states[NUMSTATES]; -! /* R_InitSpriteDefs insists on a NULL terminated list, add one for NULL. (jfw) */ -! extern char *sprnames[NUMSPRITES+1]; - - - +--- linuxdoom-1.10/i_sound.c.orig Mon Dec 22 19:57:15 1997 ++++ linuxdoom-1.10/i_sound.c Thu Feb 3 02:56:08 2000 +@@ -41,8 +41,11 @@ + #include <unistd.h> + #include <sys/ioctl.h> + ++#ifdef LINUX + // Linux voxware output. + #include <linux/soundcard.h> ++#endif ++ + + // Timer stuff. Experimental. + #include <time.h> +@@ -482,8 +485,12 @@ + #ifdef SNDSERV + if (sndserver) + { +- fprintf(sndserver, "p%2.2x%2.2x%2.2x%2.2x\n", id, pitch, vol, sep); +- fflush(sndserver); ++ if (fprintf(sndserver, "p%2.2x%2.2x%2.2x%2.2x\n", id, pitch, vol, sep) ++ <= 0 || fflush(sndserver) ) ++ { ++ fprintf(stderr, "Unable to write to sndserver - closing\n"); ++ sndserver = 0; ++ } + } + // warning: control reaches end of non-void function. + return id; +@@ -745,13 +752,25 @@ + getenv("DOOMWADDIR"), + sndserver_filename); + else +- sprintf(buffer, "%s", sndserver_filename); ++#ifdef INSTALL_PREFIX ++ { ++ sprintf(buffer, INSTALL_PREFIX"/bin/%s", sndserver_filename); ++ /* sndserver won't find its wadfile if DOMMWADDIR isn't set - HF */ ++ if(!getenv("DOOMWADDIR")) ++ setenv("DOOMWADDIR", INSTALL_PREFIX"/share/doom", 1); ++ } ++#else ++ strcpy(buffer, sndserver_filename); ++#endif ++ + + // start sound process +- if ( !access(buffer, X_OK) ) ++ if (!access(buffer, X_OK) ) + { + strcat(buffer, " -quiet"); + sndserver = popen(buffer, "w"); ++ /* Don't die with SIGPIPE if the sndserver has problems */ ++ signal(SIGPIPE, (void (*)(int)) SIG_IGN); + } + else + fprintf(stderr, "Could not start sound server [%s]\n", buffer); diff --git a/games/xdoom/patches/patch-ai b/games/xdoom/patches/patch-ai index e15640e7b2e..a7fcc49c37d 100644 --- a/games/xdoom/patches/patch-ai +++ b/games/xdoom/patches/patch-ai @@ -1,39 +1,55 @@ -$NetBSD: patch-ai,v 1.1 1999/03/15 01:54:32 sommerfe Exp $ - -*** linuxdoom-1.10/info.c.orig Sun Mar 14 17:11:53 1999 ---- linuxdoom-1.10/info.c Sun Mar 14 17:12:02 1999 -*************** -*** 37,43 **** - - #include "p_mobj.h" - -! char *sprnames[NUMSPRITES] = { - "TROO","SHTG","PUNG","PISG","PISF","SHTF","SHT2","CHGG","CHGF","MISG", - "MISF","SAWG","PLSG","PLSF","BFGG","BFGF","BLUD","PUFF","BAL1","BAL2", - "PLSS","PLSE","MISL","BFS1","BFE1","BFE2","TFOG","IFOG","PLAY","POSS", ---- 37,43 ---- - - #include "p_mobj.h" - -! char *sprnames[NUMSPRITES+1] = { - "TROO","SHTG","PUNG","PISG","PISF","SHTF","SHT2","CHGG","CHGF","MISG", - "MISF","SAWG","PLSG","PLSF","BFGG","BFGF","BLUD","PUFF","BAL1","BAL2", - "PLSS","PLSE","MISL","BFS1","BFE1","BFE2","TFOG","IFOG","PLAY","POSS", -*************** -*** 51,57 **** - "POL3","POL1","POL6","GOR2","GOR3","GOR4","GOR5","SMIT","COL1","COL2", - "COL3","COL4","CAND","CBRA","COL6","TRE1","TRE2","ELEC","CEYE","FSKU", - "COL5","TBLU","TGRN","TRED","SMBT","SMGT","SMRT","HDB1","HDB2","HDB3", -! "HDB4","HDB5","HDB6","POB1","POB2","BRS1","TLMP","TLP2" - }; - - ---- 51,57 ---- - "POL3","POL1","POL6","GOR2","GOR3","GOR4","GOR5","SMIT","COL1","COL2", - "COL3","COL4","CAND","CBRA","COL6","TRE1","TRE2","ELEC","CEYE","FSKU", - "COL5","TBLU","TGRN","TRED","SMBT","SMGT","SMRT","HDB1","HDB2","HDB3", -! "HDB4","HDB5","HDB6","POB1","POB2","BRS1","TLMP","TLP2", 0 - }; - - +$NetBSD: patch-ai,v 1.2 2000/02/03 16:01:15 abs Exp $ +--- linuxdoom-1.10/i_video.c.orig Mon Dec 22 20:39:01 1997 ++++ linuxdoom-1.10/i_video.c Thu Feb 3 02:48:08 2000 +@@ -36,7 +36,7 @@ + #include <X11/extensions/XShm.h> + // Had to dig up XShm.c for this one. + // It is in the libXext, but not in the XFree86 headers. +-#ifdef LINUX ++#if defined(LINUX) || defined (__NetBSD__) + int XShmGetEventBase( Display* dpy ); // problems with g++? + #endif + +@@ -46,13 +46,14 @@ + #include <sys/socket.h> + + #include <netinet/in.h> +-#include <errnos.h> ++#include <errno.h> + #include <signal.h> + + #include "doomstat.h" + #include "i_system.h" + #include "v_video.h" + #include "m_argv.h" ++#include "m_swap.h" /* For BYTE_ORDER == BIG_ENDIAN */ + #include "d_main.h" + + #include "doomdef.h" +@@ -164,15 +165,20 @@ + void I_ShutdownGraphics(void) + { + // Detach from X server +- if (!XShmDetach(X_display, &X_shminfo)) ++ if (X_shminfo.shmid) ++ { ++ if (!XShmDetach(X_display, &X_shminfo)) + I_Error("XShmDetach() failed in I_ShutdownGraphics()"); + +- // Release shared memory. +- shmdt(X_shminfo.shmaddr); +- shmctl(X_shminfo.shmid, IPC_RMID, 0); ++ // Release shared memory. ++ shmdt(X_shminfo.shmaddr); ++ shmctl(X_shminfo.shmid, IPC_RMID, 0); ++ X_shminfo.shmid = 0; ++ } + + // Paranoia. +- image->data = NULL; ++ if (image) ++ image->data = NULL; + } + + diff --git a/games/xdoom/patches/patch-aj b/games/xdoom/patches/patch-aj new file mode 100644 index 00000000000..88168af74a5 --- /dev/null +++ b/games/xdoom/patches/patch-aj @@ -0,0 +1,22 @@ +$NetBSD: patch-aj,v 1.1 2000/02/03 16:01:15 abs Exp $ + +--- linuxdoom-1.10/info.c.orig Mon Dec 22 20:39:32 1997 ++++ linuxdoom-1.10/info.c Thu Feb 3 01:33:51 2000 +@@ -37,7 +37,7 @@ + + #include "p_mobj.h" + +-char *sprnames[NUMSPRITES] = { ++char *sprnames[NUMSPRITES+1] = { + "TROO","SHTG","PUNG","PISG","PISF","SHTF","SHT2","CHGG","CHGF","MISG", + "MISF","SAWG","PLSG","PLSF","BFGG","BFGF","BLUD","PUFF","BAL1","BAL2", + "PLSS","PLSE","MISL","BFS1","BFE1","BFE2","TFOG","IFOG","PLAY","POSS", +@@ -51,7 +51,7 @@ + "POL3","POL1","POL6","GOR2","GOR3","GOR4","GOR5","SMIT","COL1","COL2", + "COL3","COL4","CAND","CBRA","COL6","TRE1","TRE2","ELEC","CEYE","FSKU", + "COL5","TBLU","TGRN","TRED","SMBT","SMGT","SMRT","HDB1","HDB2","HDB3", +- "HDB4","HDB5","HDB6","POB1","POB2","BRS1","TLMP","TLP2" ++ "HDB4","HDB5","HDB6","POB1","POB2","BRS1","TLMP","TLP2", 0 + }; + + diff --git a/games/xdoom/patches/patch-ak b/games/xdoom/patches/patch-ak new file mode 100644 index 00000000000..606c58c5d2f --- /dev/null +++ b/games/xdoom/patches/patch-ak @@ -0,0 +1,14 @@ +$NetBSD: patch-ak,v 1.1 2000/02/03 16:01:15 abs Exp $ + +--- linuxdoom-1.10/info.h.orig Mon Dec 22 20:11:18 1997 ++++ linuxdoom-1.10/info.h Thu Feb 3 01:33:51 2000 +@@ -1156,7 +1156,8 @@ + } state_t; + + extern state_t states[NUMSTATES]; +-extern char *sprnames[NUMSPRITES]; ++/* R_InitSpriteDefs insists on a NULL terminated list, add one for NULL. (jfw) */ ++extern char *sprnames[NUMSPRITES+1]; + + + diff --git a/games/xdoom/patches/patch-al b/games/xdoom/patches/patch-al new file mode 100644 index 00000000000..deac1b77a8f --- /dev/null +++ b/games/xdoom/patches/patch-al @@ -0,0 +1,13 @@ +$NetBSD: patch-al,v 1.1 2000/02/03 16:01:15 abs Exp $ + +--- linuxdoom-1.10/m_bbox.h.orig Mon Dec 22 20:12:16 1997 ++++ linuxdoom-1.10/m_bbox.h Thu Feb 3 01:33:52 2000 +@@ -23,7 +23,7 @@ + #ifndef __M_BBOX__ + #define __M_BBOX__ + +-#include <values.h> ++#include "doomtype.h" + + #include "m_fixed.h" + diff --git a/games/xdoom/patches/patch-am b/games/xdoom/patches/patch-am new file mode 100644 index 00000000000..d9a4d973aad --- /dev/null +++ b/games/xdoom/patches/patch-am @@ -0,0 +1,13 @@ +$NetBSD: patch-am,v 1.1 2000/02/03 16:01:15 abs Exp $ + +--- linuxdoom-1.10/m_menu.c.orig Mon Dec 22 20:42:21 1997 ++++ linuxdoom-1.10/m_menu.c Thu Feb 3 01:33:53 2000 +@@ -529,7 +529,7 @@ + LoadMenu[i].status = 0; + continue; + } +- count = read (handle, &savegamestrings[i], SAVESTRINGSIZE); ++ count = read (handle, savegamestrings[i], SAVESTRINGSIZE); + close (handle); + LoadMenu[i].status = 1; + } diff --git a/games/xdoom/patches/patch-an b/games/xdoom/patches/patch-an new file mode 100644 index 00000000000..8e4497379b1 --- /dev/null +++ b/games/xdoom/patches/patch-an @@ -0,0 +1,51 @@ +$NetBSD: patch-an,v 1.1 2000/02/03 16:01:15 abs Exp $ + +--- linuxdoom-1.10/m_misc.c.orig Mon Dec 22 20:43:11 1997 ++++ linuxdoom-1.10/m_misc.c Thu Feb 3 01:33:54 2000 +@@ -226,7 +226,7 @@ + { + char* name; + int* location; +- int defaultvalue; ++ long defaultvalue; + int scantranslate; // PC scan code hack + int untranslated; // lousy hack + } default_t; +@@ -254,8 +254,8 @@ + + // UNIX hack, to be removed. + #ifdef SNDSERV +- {"sndserver", (int *) &sndserver_filename, (int) "sndserver"}, +- {"mb_used", &mb_used, 2}, ++ {"sndserver", (int *) &sndserver_filename, (long) "sndserver"}, ++ {"mb_used", &mb_used, 12}, + #endif + + #endif +@@ -285,16 +285,16 @@ + + {"usegamma",&usegamma, 0}, + +- {"chatmacro0", (int *) &chat_macros[0], (int) HUSTR_CHATMACRO0 }, +- {"chatmacro1", (int *) &chat_macros[1], (int) HUSTR_CHATMACRO1 }, +- {"chatmacro2", (int *) &chat_macros[2], (int) HUSTR_CHATMACRO2 }, +- {"chatmacro3", (int *) &chat_macros[3], (int) HUSTR_CHATMACRO3 }, +- {"chatmacro4", (int *) &chat_macros[4], (int) HUSTR_CHATMACRO4 }, +- {"chatmacro5", (int *) &chat_macros[5], (int) HUSTR_CHATMACRO5 }, +- {"chatmacro6", (int *) &chat_macros[6], (int) HUSTR_CHATMACRO6 }, +- {"chatmacro7", (int *) &chat_macros[7], (int) HUSTR_CHATMACRO7 }, +- {"chatmacro8", (int *) &chat_macros[8], (int) HUSTR_CHATMACRO8 }, +- {"chatmacro9", (int *) &chat_macros[9], (int) HUSTR_CHATMACRO9 } ++ {"chatmacro0", (int *) &chat_macros[0], (long) HUSTR_CHATMACRO0 }, ++ {"chatmacro1", (int *) &chat_macros[1], (long) HUSTR_CHATMACRO1 }, ++ {"chatmacro2", (int *) &chat_macros[2], (long) HUSTR_CHATMACRO2 }, ++ {"chatmacro3", (int *) &chat_macros[3], (long) HUSTR_CHATMACRO3 }, ++ {"chatmacro4", (int *) &chat_macros[4], (long) HUSTR_CHATMACRO4 }, ++ {"chatmacro5", (int *) &chat_macros[5], (long) HUSTR_CHATMACRO5 }, ++ {"chatmacro6", (int *) &chat_macros[6], (long) HUSTR_CHATMACRO6 }, ++ {"chatmacro7", (int *) &chat_macros[7], (long) HUSTR_CHATMACRO7 }, ++ {"chatmacro8", (int *) &chat_macros[8], (long) HUSTR_CHATMACRO8 }, ++ {"chatmacro9", (int *) &chat_macros[9], (long) HUSTR_CHATMACRO9 } + + }; + diff --git a/games/xdoom/patches/patch-ao b/games/xdoom/patches/patch-ao new file mode 100644 index 00000000000..ba11c321149 --- /dev/null +++ b/games/xdoom/patches/patch-ao @@ -0,0 +1,24 @@ +$NetBSD: patch-ao,v 1.1 2000/02/03 16:01:15 abs Exp $ + +--- linuxdoom-1.10/m_swap.c.orig Mon Dec 22 20:43:51 1997 ++++ linuxdoom-1.10/m_swap.c Thu Feb 3 01:33:55 2000 +@@ -31,8 +31,8 @@ + #include "m_swap.h" + + +-// Not needed with big endian. +-#ifndef __BIG_ENDIAN__ ++// Only needed with big endian. ++#ifdef __BIG_ENDIAN__ + + // Swap 16bit, that is, MSB and LSB byte. + unsigned short SwapSHORT(unsigned short x) +@@ -42,7 +42,7 @@ + } + + // Swapping 32bit. +-unsigned long SwapLONG( unsigned long x) ++unsigned int SwapLONG( unsigned int x) + { + return + (x>>24) diff --git a/games/xdoom/patches/patch-ap b/games/xdoom/patches/patch-ap new file mode 100644 index 00000000000..3bcd4d33498 --- /dev/null +++ b/games/xdoom/patches/patch-ap @@ -0,0 +1,25 @@ +$NetBSD: patch-ap,v 1.1 2000/02/03 16:01:15 abs Exp $ + +--- linuxdoom-1.10/m_swap.h.orig Mon Dec 22 20:14:41 1997 ++++ linuxdoom-1.10/m_swap.h Thu Feb 3 01:33:56 2000 +@@ -28,14 +28,17 @@ + #pragma interface + #endif + ++#if BYTE_ORDER == BIG_ENDIAN ++#define __BIG_ENDIAN__ 1 ++#endif + + // Endianess handling. + // WAD files are stored little endian. + #ifdef __BIG_ENDIAN__ +-short SwapSHORT(short); +-long SwapLONG(long); ++unsigned short SwapSHORT(unsigned short); ++unsigned int SwapLONG(unsigned int); + #define SHORT(x) ((short)SwapSHORT((unsigned short) (x))) +-#define LONG(x) ((long)SwapLONG((unsigned long) (x))) ++#define LONG(x) ((int)SwapLONG((unsigned int) (x))) + #else + #define SHORT(x) (x) + #define LONG(x) (x) diff --git a/games/xdoom/patches/patch-aq b/games/xdoom/patches/patch-aq new file mode 100644 index 00000000000..b5fae9cd28a --- /dev/null +++ b/games/xdoom/patches/patch-aq @@ -0,0 +1,13 @@ +$NetBSD: patch-aq,v 1.1 2000/02/03 16:01:15 abs Exp $ + +--- linuxdoom-1.10/p_setup.c.orig Mon Dec 22 20:52:39 1997 ++++ linuxdoom-1.10/p_setup.c Thu Feb 3 01:33:56 2000 +@@ -533,7 +533,7 @@ + } + + // build line tables for each sector +- linebuffer = Z_Malloc (total*4, PU_LEVEL, 0); ++ linebuffer = Z_Malloc (total*sizeof(line_t*), PU_LEVEL, 0); + sector = sectors; + for (i=0 ; i<numsectors ; i++, sector++) + { diff --git a/games/xdoom/patches/patch-ar b/games/xdoom/patches/patch-ar new file mode 100644 index 00000000000..d3d63b3f9a9 --- /dev/null +++ b/games/xdoom/patches/patch-ar @@ -0,0 +1,17 @@ +$NetBSD: patch-ar,v 1.1 2000/02/03 16:01:15 abs Exp $ + +--- linuxdoom-1.10/r_data.c.orig Mon Dec 22 20:57:47 1997 ++++ linuxdoom-1.10/r_data.c Thu Feb 3 01:34:00 2000 +@@ -84,10 +84,10 @@ + typedef struct + { + char name[8]; +- boolean masked; ++ short masked[2]; // OBSOLETE + short width; + short height; +- void **columndirectory; // OBSOLETE ++ short columndirectory[2]; // OBSOLETE + short patchcount; + mappatch_t patches[1]; + } maptexture_t; diff --git a/games/xdoom/patches/patch-as b/games/xdoom/patches/patch-as new file mode 100644 index 00000000000..5370b302c2e --- /dev/null +++ b/games/xdoom/patches/patch-as @@ -0,0 +1,13 @@ +$NetBSD: patch-as,v 1.1 2000/02/03 16:01:15 abs Exp $ + +--- linuxdoom-1.10/r_draw.c.orig Mon Dec 22 20:58:20 1997 ++++ linuxdoom-1.10/r_draw.c Thu Feb 3 01:34:01 2000 +@@ -461,7 +461,7 @@ + int i; + + translationtables = Z_Malloc (256*3+255, PU_STATIC, 0); +- translationtables = (byte *)(( (int)translationtables + 255 )& ~255); ++ translationtables = (byte *)(( (long)translationtables + 255 )& ~255L); + + // translate just the 16 green colors + for (i=0 ; i<256 ; i++) diff --git a/games/xdoom/patches/patch-at b/games/xdoom/patches/patch-at new file mode 100644 index 00000000000..e475b8fa83d --- /dev/null +++ b/games/xdoom/patches/patch-at @@ -0,0 +1,123 @@ +$NetBSD: patch-at,v 1.1 2000/02/03 16:01:15 abs Exp $ + +--- linuxdoom-1.10/s_sound.c.orig Thu Feb 3 13:28:09 2000 ++++ linuxdoom-1.10/s_sound.c Thu Feb 3 13:37:06 2000 +@@ -115,6 +115,7 @@ + // Maximum volume of music. Useless so far. + int snd_MusicVolume = 15; + ++static int no_sound = 0; + + + // whether songs are mus_paused +@@ -164,6 +165,8 @@ + { + int i; + ++ if (no_sound) ++ return; + fprintf( stderr, "S_Init: default sfx volume %d\n", sfxVolume); + + // Whatever these did with DMX, these are rather dummies now. +@@ -204,6 +207,8 @@ + int cnum; + int mnum; + ++ if (no_sound) ++ return; + // kill all playing sounds at start of level + // (trust me - a good idea) + for (cnum=0 ; cnum<numChannels ; cnum++) +@@ -268,6 +273,8 @@ + mobj_t* origin = (mobj_t *) origin_p; + + ++ if (no_sound) ++ return; + // Debug. + /*fprintf( stderr, + "S_StartSoundAtVolume: playing sound %d (%s)\n", +@@ -403,6 +410,9 @@ + // if (sfx_id == sfx_sawful) + // sfx_id = sfx_itemup; + #endif ++ ++ if (no_sound) ++ return; + + S_StartSoundAtVolume(origin, sfx_id, snd_SfxVolume); + +@@ -473,6 +483,9 @@ + + int cnum; + ++ if (no_sound) ++ return; ++ + for (cnum=0 ; cnum<numChannels ; cnum++) + { + if (channels[cnum].sfxinfo && channels[cnum].origin == origin) +@@ -496,6 +509,8 @@ + // + void S_PauseSound(void) + { ++ if (no_sound) ++ return; + if (mus_playing && !mus_paused) + { + I_PauseSong(mus_playing->handle); +@@ -505,6 +520,8 @@ + + void S_ResumeSound(void) + { ++ if (no_sound) ++ return; + if (mus_playing && mus_paused) + { + I_ResumeSong(mus_playing->handle); +@@ -529,6 +546,8 @@ + mobj_t* listener = (mobj_t*)listener_p; + + ++ if (no_sound) ++ return; + + // Clean up unused data. + // This is currently not done for 16bit (sounds cached static). +@@ -636,6 +655,8 @@ + + snd_SfxVolume = volume; + ++ if (volume == 0) ++ no_sound = ! volume; + } + + // +@@ -711,6 +732,8 @@ + int i; + channel_t* c = &channels[cnum]; + ++ if (no_sound) ++ return; + if (c->sfxinfo) + { + // stop the sound playing +@@ -762,6 +785,9 @@ + fixed_t ady; + angle_t angle; + ++ if (no_sound) ++ return(1); ++ + // calculate the distance to sound origin + // and clip it if necessary + adx = abs(listener->x - source->x); +@@ -834,6 +860,8 @@ + + channel_t* c; + ++ if (no_sound) ++ return(-1); + // Find an open channel + for (cnum=0 ; cnum<numChannels ; cnum++) + { diff --git a/games/xdoom/patches/patch-au b/games/xdoom/patches/patch-au new file mode 100644 index 00000000000..c0fdc62b8a2 --- /dev/null +++ b/games/xdoom/patches/patch-au @@ -0,0 +1,16 @@ +$NetBSD: patch-au,v 1.1 2000/02/03 16:01:15 abs Exp $ + +--- linuxdoom-1.10/w_wad.c.orig Mon Dec 22 21:05:36 1997 ++++ linuxdoom-1.10/w_wad.c Thu Feb 3 01:34:02 2000 +@@ -34,7 +34,11 @@ + #include <malloc.h> + #include <fcntl.h> + #include <sys/stat.h> ++#if 0 + #include <alloca.h> ++#else ++#include <stdlib.h> ++#endif + #define O_BINARY 0 + #endif + diff --git a/games/xdoom/patches/patch-av b/games/xdoom/patches/patch-av new file mode 100644 index 00000000000..69679e8594d --- /dev/null +++ b/games/xdoom/patches/patch-av @@ -0,0 +1,16 @@ +$NetBSD: patch-av,v 1.1 2000/02/03 16:01:16 abs Exp $ + +--- linuxdoom-1.10/w_wad.h.orig Mon Dec 22 20:25:32 1997 ++++ linuxdoom-1.10/w_wad.h Thu Feb 3 01:34:03 2000 +@@ -36,9 +36,8 @@ + { + // Should be "IWAD" or "PWAD". + char identification[4]; +- int numlumps; +- int infotableofs; +- ++ int32_t numlumps __attribute__ ((packed)); ++ int32_t infotableofs __attribute__ ((packed)); + } wadinfo_t; + + diff --git a/games/xdoom/patches/patch-aw b/games/xdoom/patches/patch-aw new file mode 100644 index 00000000000..00427ccb9dd --- /dev/null +++ b/games/xdoom/patches/patch-aw @@ -0,0 +1,18 @@ +$NetBSD: patch-aw,v 1.1 2000/02/03 16:01:16 abs Exp $ + +--- linuxdoom-1.10/z_zone.c.orig Mon Dec 22 21:07:09 1997 ++++ linuxdoom-1.10/z_zone.c Thu Feb 3 01:34:04 2000 +@@ -192,8 +192,12 @@ + memblock_t* newblock; + memblock_t* base; + ++#ifdef __alpha ++ size = (size + 7) & ~7; ++#else + size = (size + 3) & ~3; +- ++#endif ++ + // scan through the block list, + // looking for the first free block + // of sufficient size, diff --git a/games/xdoom/patches/patch-ax b/games/xdoom/patches/patch-ax new file mode 100644 index 00000000000..222350fd5b1 --- /dev/null +++ b/games/xdoom/patches/patch-ax @@ -0,0 +1,16 @@ +$NetBSD: patch-ax,v 1.1 2000/02/03 16:01:16 abs Exp $ + +--- sndserv/Makefile.orig Mon Dec 22 21:17:10 1997 ++++ sndserv/Makefile Thu Feb 3 01:34:04 2000 +@@ -7,9 +7,9 @@ + # + + CC=gcc +-CFLAGS=-O -DNORMALUNIX -DLINUX ++CFLAGS=-O2 -DNORMALUNIX + LDFLAGS= +-LIBS=-lm ++LIBS=-lm -lossaudio + + O=linux + diff --git a/games/xdoom/patches/patch-ay b/games/xdoom/patches/patch-ay new file mode 100644 index 00000000000..7a3e2e8e9e9 --- /dev/null +++ b/games/xdoom/patches/patch-ay @@ -0,0 +1,35 @@ +$NetBSD: patch-ay,v 1.1 2000/02/03 16:01:16 abs Exp $ + +--- sndserv/linux.c.orig Sun Jan 26 07:45:01 1997 ++++ sndserv/linux.c Thu Feb 3 01:34:05 2000 +@@ -39,11 +39,14 @@ + #include <stdio.h> + #include <fcntl.h> + #include <unistd.h> ++#include <sys/ioctl.h> + +-#include <linux/soundcard.h> ++#include <soundcard.h> + + #include "soundsrv.h" + ++#define SOUND_DEV "/dev/sound" ++ + int audio_fd; + + void +@@ -76,9 +79,12 @@ + + int i; + +- audio_fd = open("/dev/dsp", O_WRONLY); ++ audio_fd = open(SOUND_DEV, O_WRONLY); + if (audio_fd<0) +- fprintf(stderr, "Could not open /dev/dsp\n"); ++ { ++ perror("sndserv: Could not open "SOUND_DEV); ++ exit(-1); ++ } + + + i = 11 | (2<<16); diff --git a/games/xdoom/patches/patch-az b/games/xdoom/patches/patch-az new file mode 100644 index 00000000000..9df4adcfe54 --- /dev/null +++ b/games/xdoom/patches/patch-az @@ -0,0 +1,30 @@ +$NetBSD: patch-az,v 1.1 2000/02/03 16:01:16 abs Exp $ + +--- sndserv/wadread.c.orig Thu Jan 30 19:54:23 1997 ++++ sndserv/wadread.c Thu Feb 3 01:34:06 2000 +@@ -94,12 +94,7 @@ + // Something new. + // This version of w_wad.c does handle endianess. + // +-#ifndef __BIG_ENDIAN__ +- +-#define LONG(x) (x) +-#define SHORT(x) (x) +- +-#else ++#if defined(__BIG_ENDIAN__) || (BYTE_ORDER == BIG_ENDIAN) + + #define LONG(x) ((long)SwapLONG((unsigned long) (x))) + #define SHORT(x) ((short)SwapSHORT((unsigned short) (x))) +@@ -118,6 +113,11 @@ + return + (x>>8) | (x<<8); + } ++ ++#else ++ ++#define LONG(x) (x) ++#define SHORT(x) (x) + + #endif + |