summaryrefslogtreecommitdiff
path: root/games-fps/duke3d/files
diff options
context:
space:
mode:
Diffstat (limited to 'games-fps/duke3d/files')
-rw-r--r--games-fps/duke3d/files/20040817-credits.patch38
-rw-r--r--games-fps/duke3d/files/20040817-duke3d-makefile-opts.patch33
-rw-r--r--games-fps/duke3d/files/20040817-endian.patch26
-rw-r--r--games-fps/duke3d/files/20040817-gcc34.patch82
-rw-r--r--games-fps/duke3d/files/duke3d-20040817-as-needed.patch74
-rw-r--r--games-fps/duke3d/files/duke3d-20040817-gcc4.patch180
-rw-r--r--games-fps/duke3d/files/duke3d-20040817-ldflags.patch66
-rw-r--r--games-fps/duke3d/files/duke3d-20040817-noinline.patch18
-rw-r--r--games-fps/duke3d/files/duke3d.cfg194
-rw-r--r--games-fps/duke3d/files/network.cfg15
10 files changed, 726 insertions, 0 deletions
diff --git a/games-fps/duke3d/files/20040817-credits.patch b/games-fps/duke3d/files/20040817-credits.patch
new file mode 100644
index 000000000000..19eefa4bf423
--- /dev/null
+++ b/games-fps/duke3d/files/20040817-credits.patch
@@ -0,0 +1,38 @@
+--- a/menues.c 2003-08-17 22:16:10.000000000 +0200
++++ b/menues.c 2004-03-29 01:59:28.000000000 +0200
+@@ -1747,9 +1747,10 @@
+ case 996:
+ case 997:
+
+-// rotatesprite(c<<16,200<<15,65536L,0,MENUSCREEN,16,0,10+64,0,0,xdim-1,ydim-1);
+-// rotatesprite(c<<16,19<<16,65536L,0,MENUBAR,16,0,10,0,0,xdim-1,ydim-1);
+-// menutext(c,24,0,0,"CREDITS");
++ c = (320>>1);
++ rotatesprite(c<<16,200<<15,65536L,0,MENUSCREEN,16,0,10+64,0,0,xdim-1,ydim-1);
++ rotatesprite(c<<16,19<<16,65536L,0,MENUBAR,16,0,10,0,0,xdim-1,ydim-1);
++ menutext(c,24,0,0,"CREDITS");
+
+ if(KB_KeyPressed(sc_Escape)) { cmenu(0); break; }
+
+@@ -1926,6 +1927,21 @@
+
+ menutext(c,67+16+16+16+16+16,SHX(-7),PHX(-7),"QUIT");
+
++ gametext(c,67+16+16+16+16+16+16+16,"Duke Nukem 3D for "
++#if defined PLATFORM_MACOSX
++ "MacOS"
++#elif defined PLATFORM_DOS
++ "MS-Dos"
++#elif defined PLATFORM_WIN32
++ "Win32"
++#elif defined PLATFORM_UNIX
++ "Gentoo"
++#else
++ "unknown"
++#endif
++ ,16,2+8+16);
++ gametext(c,67+16+16+16+16+16+16+16+9,"build " __DATE__ " " __TIME__,16,2+8+16);
++
+ break;
+ // CTW END - MODIFICATION
+
diff --git a/games-fps/duke3d/files/20040817-duke3d-makefile-opts.patch b/games-fps/duke3d/files/20040817-duke3d-makefile-opts.patch
new file mode 100644
index 000000000000..9ed2a0052153
--- /dev/null
+++ b/games-fps/duke3d/files/20040817-duke3d-makefile-opts.patch
@@ -0,0 +1,33 @@
+--- a/Makefile.orig 2003-08-17 17:45:35.948650760 -0400
++++ b/Makefile 2003-08-17 17:46:36.894385600 -0400
+@@ -4,6 +4,8 @@
+ beos := false
+ macosx := false
+ #use_asm := true
++use_opengl := true
++use_physfs := false
+
+ #-----------------------------------------------------------------------------#
+ # If this makefile fails to detect Cygwin correctly, or you want to force
+@@ -80,6 +81,10 @@
+ buildengine/pragmas.o \
+ buildengine/unix_compat.o
+
++ifeq ($(strip $(use_opengl)),true)
++ BUILDOBJS += buildengine/buildgl.o
++endif
++
+ ifeq ($(strip $(use_asm)),true)
+ BUILDOBJS += buildengine/a_gnu.o buildengine/a_nasm.o
+ else
+@@ -106,6 +106,10 @@
+
+ LDLIBS = $(SDL_LDFLAGS) -lSDL -lSDL_mixer $(EXTRALDFLAGS)
+
++ifeq ($(strip $(use_physfs)),true)
++ LDLIBS += -lphysfs
++endif
++
+ # !!! FIXME: Do we even need this? It doesn't fly on MacOS X. --ryan.
+ #LDLIBS += -Wl,-E
+
diff --git a/games-fps/duke3d/files/20040817-endian.patch b/games-fps/duke3d/files/20040817-endian.patch
new file mode 100644
index 000000000000..3bcdc1379db6
--- /dev/null
+++ b/games-fps/duke3d/files/20040817-endian.patch
@@ -0,0 +1,26 @@
+--- buildengine/platform.h.old 2003-08-07 12:06:17.000000000 +0200
++++ buildengine/platform.h 2004-08-24 18:35:05.292291088 +0200
+@@ -5,6 +5,7 @@
+ #include "win32_compat.h"
+ #elif (defined PLATFORM_UNIX)
+ #include "unix_compat.h"
++#include <endian.h>
+ #elif (defined PLATFORM_DOS)
+ #include "doscmpat.h"
+ #else
+@@ -60,9 +61,15 @@
+ #define BUILDSWAP_INTEL16(x) _swap16(x)
+ #define BUILDSWAP_INTEL32(x) _swap32(x)
+ #else
++#if __BYTE_ORDER == __LITTLE_ENDIAN
+ #define PLATFORM_LITTLEENDIAN 1
+ #define BUILDSWAP_INTEL16(x) (x)
+ #define BUILDSWAP_INTEL32(x) (x)
++#else
++#define PLATFORM_BIGENDIAN 1
++#define BUILDSWAP_INTEL16(x) _swap16(x)
++#define BUILDSWAP_INTEL32(x) _swap32(x)
++#endif
+ #endif
+
+ extern int has_altivec; /* PowerPC-specific. */
diff --git a/games-fps/duke3d/files/20040817-gcc34.patch b/games-fps/duke3d/files/20040817-gcc34.patch
new file mode 100644
index 000000000000..a7de9c116383
--- /dev/null
+++ b/games-fps/duke3d/files/20040817-gcc34.patch
@@ -0,0 +1,82 @@
+--- source/astub.c.orig 2004-08-22 14:44:50.691126872 +0100
++++ source/astub.c 2004-08-22 14:47:15.532107696 +0100
+@@ -540,6 +540,11 @@
+ return(tempbuf);
+ } //end
+
++void SpriteName(short spritenum, char *lo2)
++{
++ sprintf(lo2,names[sprite[spritenum].picnum]);
++}// end SpriteName
++
+ const char *ExtGetSpriteCaption(short spritenum)
+ {
+
+@@ -608,7 +613,11 @@
+ // y1, y2 0-143 (status bar is 144 high, origin is top-left of STATUS BAR)
+ // col 0-15
+
+-
++void PrintStatus(char *string,int num,char x,char y,char color)
++{
++ sprintf(tempbuf,"%s %d",string,num);
++ printext16(x*8,y*8,color,-1,tempbuf,0);
++}
+
+ void TotalMem()
+ {
+@@ -1276,18 +1285,6 @@
+
+ }
+
+-
+-void PrintStatus(char *string,int num,char x,char y,char color)
+-{
+- sprintf(tempbuf,"%s %d",string,num);
+- printext16(x*8,y*8,color,-1,tempbuf,0);
+-}
+-
+-void SpriteName(short spritenum, char *lo2)
+-{
+- sprintf(lo2,names[sprite[spritenum].picnum]);
+-}// end SpriteName
+-
+ char GAMEpalette[768];
+ char WATERpalette[768];
+ char SLIMEpalette[768];
+@@ -1326,6 +1323,17 @@
+ ReadGamePalette();
+ }// end ReadPaletteTable
+
++void Ver()
++{
++ sprintf(tempbuf,"DUKE NUKEM BUILD: V032696");
++ if (qsetmode == 200) //In 3D mode
++ { printext256(60*8,24*8,11,-1,tempbuf,1);
++ rotatesprite((320-8)<<16,(200-8)<<16,64<<9,0,SPINNINGNUKEICON+(((4-totalclock>>3))&7),0,0,0,0,0,xdim-1,ydim-1);
++ }else
++ { printext16(0,0,15,-1,tempbuf,0);
++ }
++}
++
+ void Keys3d(void)
+ {
+ long i,count,rate,nexti;
+@@ -2206,17 +2214,6 @@
+ }
+ }
+
+-void Ver()
+-{
+- sprintf(tempbuf,"DUKE NUKEM BUILD: V032696");
+- if (qsetmode == 200) //In 3D mode
+- { printext256(60*8,24*8,11,-1,tempbuf,1);
+- rotatesprite((320-8)<<16,(200-8)<<16,64<<9,0,SPINNINGNUKEICON+(((4-totalclock>>3))&7),0,0,0,0,0,xdim-1,ydim-1);
+- }else
+- { printext16(0,0,15,-1,tempbuf,0);
+- }
+-}
+-
+ ActorMem(int i)
+ {int total=0,j;
+ switch(i)
diff --git a/games-fps/duke3d/files/duke3d-20040817-as-needed.patch b/games-fps/duke3d/files/duke3d-20040817-as-needed.patch
new file mode 100644
index 000000000000..c7793a833bf9
--- /dev/null
+++ b/games-fps/duke3d/files/duke3d-20040817-as-needed.patch
@@ -0,0 +1,74 @@
+diff -ur duke3d/source/buildengine/Makefile duke3d-patched/source/buildengine/Makefile
+--- source/buildengine/Makefile 2004-05-15 05:15:05.000000000 +0200
++++ source/buildengine/Makefile 2008-02-27 23:10:46.000000000 +0100
+@@ -99,11 +99,11 @@
+ ifeq ($(strip $(SDL_LIB_DIR)),please_set_me_cygwin_users)
+ $(error Cygwin users need to set the SDL_LIB_DIR envr var.)
+ else
+- SDL_LDFLAGS := -L$(SDL_LIB_DIR) -lSDL
++ SDL_LIBS := -L$(SDL_LIB_DIR) -lSDL
+ endif
+ else
+ SDL_CFLAGS := $(shell sdl-config --cflags)
+- SDL_LDFLAGS := $(shell sdl-config --libs)
++ SDL_LIBS := $(shell sdl-config --libs)
+ endif
+
+ CC = gcc
+@@ -202,7 +202,7 @@
+ ASMFLAGS = -f $(ASMOBJFMT) $(ASMDEFS)
+ LINKER = gcc
+ CFLAGS += $(USE_ASM) -funsigned-char -DPLATFORM_UNIX -Wall $(SDL_CFLAGS) -fno-omit-frame-pointer
+-LDFLAGS += $(SDL_LDFLAGS)
++LDLIBS += $(SDL_LIBS)
+
+ # Rules for turning source files into .o files
+ %.o: %.c
+@@ -236,17 +236,17 @@
+
+ ifeq ($(strip $(usedlls)),true)
+ $(ENGINEDLL) : $(ENGINEOBJS)
+- $(LINKER) -shared -o $(ENGINEDLL) $(LDFLAGS) $(ENGINEOBJS)
++ $(LINKER) -shared -o $(ENGINEDLL) $(LDFLAGS) $(ENGINEOBJS) $(LDLIBS)
+
+ $(NETDLL) : $(NETOBJS)
+- $(LINKER) -shared -o $(NETDLL) $(LDFLAGS) $(NETOBJS)
++ $(LINKER) -shared -o $(NETDLL) $(LDFLAGS) $(NETOBJS) $(LDLIBS)
+ endif
+
+ $(GAMEEXE) : $(ENGINEDLL) $(NETDLL) $(GAMEOBJS) $(PERLOBJS)
+- $(LINKER) -o $(GAMEEXE) $(LDFLAGS) $(LDPERL) $(PERLOBJS) $(GAMEOBJS) $(ENGINEDLL) $(NETDLL)
++ $(LINKER) -o $(GAMEEXE) $(LDFLAGS) $(PERLOBJS) $(GAMEOBJS) $(LDPERL) $(LDLIBS) $(ENGINEDLL) $(NETDLL)
+
+ $(BUILDEXE) : $(ENGINEDLL) $(BUILDOBJS)
+- $(LINKER) -o $(BUILDEXE) $(LDFLAGS) $(BUILDOBJS) $(ENGINEDLL)
++ $(LINKER) -o $(BUILDEXE) $(LDFLAGS) $(BUILDOBJS) $(LDLIBS) $(ENGINEDLL)
+
+ listclean:
+ @echo "A 'make clean' would remove" $(CLEANUP)
+diff -ur duke3d/source/Makefile duke3d-patched/source/Makefile
+--- source/Makefile 2004-05-15 05:14:16.000000000 +0200
++++ source/Makefile 2008-02-27 23:09:57.000000000 +0100
+@@ -45,11 +45,11 @@
+ ifeq ($(strip $(SDL_LIB_DIR)),please_set_me_cygwin_users)
+ $(error Cygwin users need to set the SDL_LIB_DIR envr var.)
+ else
+- SDL_LDFLAGS := -L$(SDL_LIB_DIR) -lSDL
++ SDL_LIBS := -L$(SDL_LIB_DIR) -lSDL
+ endif
+ else
+ SDL_CFLAGS := $(shell sdl-config --cflags)
+- SDL_LDFLAGS := $(shell sdl-config --libs) -L.
++ SDL_LIBS := $(shell sdl-config --libs) -L.
+ endif
+
+ ifeq ($(strip $(macosx)),true)
+@@ -104,7 +104,7 @@
+ #CC = icc
+ #CFLAGS = -g $(SDL_CFLAGS) -DUSE_SDL=1 -DPLATFORM_UNIX=1 -DUSE_I386_ASM=1 $(EXTRACFLAGS) -O2
+
+-LDLIBS = $(SDL_LDFLAGS) -lSDL -lSDL_mixer $(EXTRALDFLAGS)
++LDLIBS = $(SDL_LIBS) -lSDL -lSDL_mixer $(EXTRALDFLAGS)
+
+ # !!! FIXME: Do we even need this? It doesn't fly on MacOS X. --ryan.
+ #LDLIBS += -Wl,-E
diff --git a/games-fps/duke3d/files/duke3d-20040817-gcc4.patch b/games-fps/duke3d/files/duke3d-20040817-gcc4.patch
new file mode 100644
index 000000000000..3aaf67c6c90b
--- /dev/null
+++ b/games-fps/duke3d/files/duke3d-20040817-gcc4.patch
@@ -0,0 +1,180 @@
+iff -ur duke3d/source/buildengine/a.c duke3d-gcc4/source/buildengine/a.c
+--- source/buildengine/a.c 2004-11-25 13:55:21.000000000 -0500
++++ source/buildengine/a.c 2005-06-18 18:14:24.000000000 -0400
+@@ -186,7 +186,9 @@
+ if (i3 == 0)
+ {
+ i1 += i4;
+- ((unsigned long)i4) >>= mach3_al;
++ unsigned long temp = i4;
++ temp >>= mach3_al;
++ i4 = temp;
+ i4 = (i4&0xffffff00) | (source[i4]&0xff);
+ *dest = ((unsigned char*)i2)[i4];
+ return i1;
+diff -ur duke3d/source/buildengine/pragmas.c duke3d-gcc4/source/buildengine/pragmas.c
+--- source/buildengine/pragmas.c 2003-07-25 20:11:32.000000000 -0400
++++ source/buildengine/pragmas.c 2005-06-18 18:25:37.000000000 -0400
+@@ -56,28 +56,39 @@
+
+ void clearbufbyte(void *buffer, int size, long fill_value) {
+ int lsize;
++ unsigned char *p=buffer;
++ unsigned short *s=buffer;
+ switch(size){
+ case 0: return;
+- case 1: *((unsigned char*)buffer)++ = fill_value; return;
+- case 2: *((unsigned short*)buffer)++ = fill_value; return;
+- case 3: { unsigned char *p=buffer; p[2]=p[1]=p[0] = fill_value;} return;
++ case 1: *p = fill_value; return;
++ case 2: *s = fill_value; return;
++ case 3: { p[2]=p[1]=p[0] = fill_value;} return;
+ default:
+ if ((int)buffer&1) {
+- *((unsigned char*)buffer)++ = fill_value; size--;
++ *p = fill_value; ++p; size--;
++ buffer = p;
+ }
+ if ((int)buffer&2) {
+- *((unsigned short*)buffer)++ = fill_value; size-=2;
++ *s = fill_value; ++s; size-=2;
++ buffer = s;
+ }
+ lsize = size>>2;
++ unsigned int *up = buffer;
+ while(lsize) {
+- *((unsigned int*)buffer)++ = fill_value;
++ *up = fill_value;
++ ++up;
+ lsize--;
+ }
++ buffer = up;
+ if (size&2) {
+- *((unsigned short*)buffer)++ = fill_value;
++ s = buffer;
++ *s = fill_value;
++ ++s;
+ }
+ if (size&1) {
+- *((unsigned char*)buffer)++ = fill_value;
++ p = buffer;
++ *p = fill_value;
++ ++p;
+ }
+ }
+ }
+@@ -122,7 +133,7 @@
+ {
+ *((unsigned short *)source) = ((linum>>16)&0xffff);
+ linum += linum_inc;
+- ((unsigned char*)source) = ((unsigned char*)source) + 2;
++ source = ((unsigned char*)source) + 2;
+ size--;
+ if (size == 0) return;
+ }
+
+diff -u -r duke3d/source/buildengine/a.h duke3d.gcc4.1.1/source/buildengine/a.h
+--- source/buildengine/a.h 2003-04-11 08:54:06.000000000 +0200
++++ source/buildengine/a.h 2006-06-22 12:14:40.366393568 +0200
+@@ -116,56 +116,56 @@
+
+ #if ((defined __GNUC__) && (!defined C_IDENTIFIERS_UNDERSCORED))
+
+- long asm_mmxoverlay(void) __attribute__ ((alias ("_asm_mmxoverlay")));
+- long asm_sethlinesizes(long,long,long) __attribute__ ((alias ("_asm_sethlinesizes")));
+- long asm_setpalookupaddress(char *) __attribute__ ((alias ("_asm_setpalookupaddress")));
+- long asm_setuphlineasm4(long,long) __attribute__ ((alias ("_asm_setuphlineasm4")));
+- long asm_hlineasm4(long,long,long,long,long,long) __attribute__ ((alias ("_asm_hlineasm4")));
+- long asm_setuprhlineasm4(long,long,long,long,long,long) __attribute__ ((alias ("_asm_setuprhlineasm4")));
+- long asm_rhlineasm4(long,long,long,long,long,long) __attribute__ ((alias ("_asm_rhlineasm4")));
+- long asm_setuprmhlineasm4(long,long,long,long,long,long) __attribute__ ((alias ("_asm_setuprmhlineasm4")));
+- long asm_rmhlineasm4(long,long,long,long,long,long) __attribute__ ((alias ("_asm_rmhlineasm4")));
+- long asm_setupqrhlineasm4(long,long,long,long,long,long) __attribute__ ((alias ("_asm_setupqrhlineasm4")));
+- long asm_qrhlineasm4(long,long,long,long,long,long) __attribute__ ((alias ("_asm_qrhlineasm4")));
+- long asm_setvlinebpl(long) __attribute__ ((alias ("_asm_setvlinebpl")));
+- long asm_fixtransluscence(long) __attribute__ ((alias ("_asm_fixtransluscence")));
+- long asm_prevlineasm1(long,long,long,long,long,long) __attribute__ ((alias ("_asm_prevlineasm1")));
+- long asm_vlineasm1(long,long,long,long,long,long) __attribute__ ((alias ("_asm_vlineasm1")));
+- long asm_setuptvlineasm(long) __attribute__ ((alias ("_asm_setuptvlineasm")));
+- long asm_tvlineasm1(long,long,long,long,long,long) __attribute__ ((alias ("_asm_tvlineasm1")));
+- long asm_setuptvlineasm2(long,long,long) __attribute__ ((alias ("_asm_setuptvlineasm2")));
+- long asm_tvlineasm2(long,long,long,long,long,long) __attribute__ ((alias ("_asm_tvlineasm2")));
+- long asm_mvlineasm1(long,long,long,long,long,long) __attribute__ ((alias ("_asm_mvlineasm1")));
+- long asm_setupvlineasm(long) __attribute__ ((alias ("_asm_setupvlineasm")));
+- long asm_vlineasm4(long,long) __attribute__ ((alias ("_asm_vlineasm4")));
+- long asm_setupmvlineasm(long) __attribute__ ((alias ("_asm_setupmvlineasm")));
+- long asm_mvlineasm4(long,long) __attribute__ ((alias ("_asm_mvlineasm4")));
+- void asm_setupspritevline(long,long,long,long,long,long) __attribute__ ((alias ("_asm_setupspritevline")));
+- void asm_spritevline(long,long,long,long,long,long) __attribute__ ((alias ("_asm_spritevline")));
+- void asm_msetupspritevline(long,long,long,long,long,long) __attribute__ ((alias ("_asm_msetupspritevline")));
+- void asm_mspritevline(long,long,long,long,long,long) __attribute__ ((alias ("_asm_mspritevline")));
+- void asm_tsetupspritevline(long,long,long,long,long,long) __attribute__ ((alias ("_asm_tsetupspritevline")));
+- void asm_tspritevline(long,long,long,long,long,long) __attribute__ ((alias ("_asm_tspritevline")));
+- long asm_mhline(long,long,long,long,long,long) __attribute__ ((alias ("_asm_mhline")));
+- long asm_mhlineskipmodify(long,long,long,long,long,long) __attribute__ ((alias ("_asm_mhlineskipmodify")));
+- long asm_msethlineshift(long,long) __attribute__ ((alias ("_asm_msethlineshift")));
+- long asm_thline(long,long,long,long,long,long) __attribute__ ((alias ("_asm_thline")));
+- long asm_thlineskipmodify(long,long,long,long,long,long) __attribute__ ((alias ("_asm_thlineskipmodify")));
+- long asm_tsethlineshift(long,long) __attribute__ ((alias ("_asm_tsethlineshift")));
+- long asm_setupslopevlin(long,long,long) __attribute__ ((alias ("_asm_setupslopevlin")));
+- long asm_slopevlin(long,long,long,long,long,long) __attribute__ ((alias ("_asm_slopevlin")));
+- long asm_settransnormal(void) __attribute__ ((alias ("_asm_settransnormal")));
+- long asm_settransreverse(void) __attribute__ ((alias ("_asm_settransreverse")));
+- long asm_setupdrawslab(long,long) __attribute__ ((alias ("_asm_setupdrawslab")));
+- long asm_drawslab(long,long,long,long,long,long) __attribute__ ((alias ("_asm_drawslab")));
+- long asm_stretchhline(long,long,long,long,long,long) __attribute__ ((alias ("_asm_stretchhline")));
+- long asm_isvmwarerunning(void) __attribute__ ((alias ("_asm_isvmwarerunning")));
++ long asm_mmxoverlay(void) asm ("_asm_mmxoverlay");
++ long asm_sethlinesizes(long,long,long) asm ("_asm_sethlinesizes");
++ long asm_setpalookupaddress(char *) asm ("_asm_setpalookupaddress");
++ long asm_setuphlineasm4(long,long) asm ("_asm_setuphlineasm4");
++ long asm_hlineasm4(long,long,long,long,long,long) asm ("_asm_hlineasm4");
++ long asm_setuprhlineasm4(long,long,long,long,long,long) asm ("_asm_setuprhlineasm4");
++ long asm_rhlineasm4(long,long,long,long,long,long) asm ("_asm_rhlineasm4");
++ long asm_setuprmhlineasm4(long,long,long,long,long,long) asm ("_asm_setuprmhlineasm4");
++ long asm_rmhlineasm4(long,long,long,long,long,long) asm ("_asm_rmhlineasm4");
++ long asm_setupqrhlineasm4(long,long,long,long,long,long) asm ("_asm_setupqrhlineasm4");
++ long asm_qrhlineasm4(long,long,long,long,long,long) asm ("_asm_qrhlineasm4");
++ long asm_setvlinebpl(long) asm ("_asm_setvlinebpl");
++ long asm_fixtransluscence(long) asm ("_asm_fixtransluscence");
++ long asm_prevlineasm1(long,long,long,long,long,long) asm ("_asm_prevlineasm1");
++ long asm_vlineasm1(long,long,long,long,long,long) asm ("_asm_vlineasm1");
++ long asm_setuptvlineasm(long) asm ("_asm_setuptvlineasm");
++ long asm_tvlineasm1(long,long,long,long,long,long) asm ("_asm_tvlineasm1");
++ long asm_setuptvlineasm2(long,long,long) asm ("_asm_setuptvlineasm2");
++ long asm_tvlineasm2(long,long,long,long,long,long) asm ("_asm_tvlineasm2");
++ long asm_mvlineasm1(long,long,long,long,long,long) asm ("_asm_mvlineasm1");
++ long asm_setupvlineasm(long) asm ("_asm_setupvlineasm");
++ long asm_vlineasm4(long,long) asm ("_asm_vlineasm4");
++ long asm_setupmvlineasm(long) asm ("_asm_setupmvlineasm");
++ long asm_mvlineasm4(long,long) asm ("_asm_mvlineasm4");
++ void asm_setupspritevline(long,long,long,long,long,long) asm ("_asm_setupspritevline");
++ void asm_spritevline(long,long,long,long,long,long) asm ("_asm_spritevline");
++ void asm_msetupspritevline(long,long,long,long,long,long) asm ("_asm_msetupspritevline");
++ void asm_mspritevline(long,long,long,long,long,long) asm ("_asm_mspritevline");
++ void asm_tsetupspritevline(long,long,long,long,long,long) asm ("_asm_tsetupspritevline");
++ void asm_tspritevline(long,long,long,long,long,long) asm ("_asm_tspritevline");
++ long asm_mhline(long,long,long,long,long,long) asm ("_asm_mhline");
++ long asm_mhlineskipmodify(long,long,long,long,long,long) asm("_asm_mhlineskipmodify");
++ long asm_msethlineshift(long,long) asm("_asm_msethlineshift");
++ long asm_thline(long,long,long,long,long,long) asm("_asm_thline");
++ long asm_thlineskipmodify(long,long,long,long,long,long) asm("_asm_thlineskipmodify");
++ long asm_tsethlineshift(long,long) asm("_asm_tsethlineshift");
++ long asm_setupslopevlin(long,long,long) asm("_asm_setupslopevlin");
++ long asm_slopevlin(long,long,long,long,long,long) asm("_asm_slopevlin");
++ long asm_settransnormal(void) asm("_asm_settransnormal");
++ long asm_settransreverse(void) asm("_asm_settransreverse");
++ long asm_setupdrawslab(long,long) asm("_asm_setupdrawslab");
++ long asm_drawslab(long,long,long,long,long,long) asm("_asm_drawslab");
++ long asm_stretchhline(long,long,long,long,long,long) asm("_asm_stretchhline");
++ long asm_isvmwarerunning(void) asm("_asm_isvmwarerunning");
+
+ /*
+ * !!! I need a reference to this, for mprotect(), but the actual function
+ * !!! is never called in BUILD...just from other ASM routines. --ryan.
+ */
+- long asm_prohlineasm4(void) __attribute__ ((alias ("_asm_prohlineasm4")));
++ long asm_prohlineasm4(void) asm("_asm_prohlineasm4");
+
+ #endif /* ELF/GCC */
+ #endif /* defined USE_I386_ASM */
diff --git a/games-fps/duke3d/files/duke3d-20040817-ldflags.patch b/games-fps/duke3d/files/duke3d-20040817-ldflags.patch
new file mode 100644
index 000000000000..79179e663805
--- /dev/null
+++ b/games-fps/duke3d/files/duke3d-20040817-ldflags.patch
@@ -0,0 +1,66 @@
+--- source/buildengine/Makefile.old 2010-10-08 14:32:05.000000000 +0200
++++ source/buildengine/Makefile 2010-10-08 14:35:10.000000000 +0200
+@@ -73,7 +73,7 @@
+ endif
+
+ ifeq ($(strip $(solaris)),true)
+- LDFLAGS += -lsocket -lnsl
++ LIBS += -lsocket -lnsl
+ CFLAGS += -DPLATFORM_SOLARIS
+ endif
+
+@@ -129,7 +129,7 @@
+
+ ifeq ($(strip $(macosx)),true)
+ CFLAGS += -DPLATFORM_MACOSX=1 -faltivec -falign-loops=32 -falign-functions=32
+- LDFLAGS += -framework AppKit -lSDL -lSDLmain
++ LIBS += -framework AppKit -lSDL -lSDLmain
+ endif
+
+ ifeq ($(strip $(useopengl)),true)
+@@ -146,7 +146,7 @@
+
+ ifeq ($(strip $(usephysfs)),true)
+ CFLAGS += -DUSE_PHYSICSFS
+- LDFLAGS += -lphysfs
++ LIBS += -lphysfs
+ endif
+
+ ifeq ($(strip $(usedlls)),true)
+@@ -236,17 +236,17 @@
+
+ ifeq ($(strip $(usedlls)),true)
+ $(ENGINEDLL) : $(ENGINEOBJS)
+- $(LINKER) -shared -o $(ENGINEDLL) $(LDFLAGS) $(ENGINEOBJS) $(LDLIBS)
++ $(LINKER) -shared -o $(ENGINEDLL) $(LIBS) $(ENGINEOBJS) $(LDLIBS)
+
+ $(NETDLL) : $(NETOBJS)
+- $(LINKER) -shared -o $(NETDLL) $(LDFLAGS) $(NETOBJS) $(LDLIBS)
++ $(LINKER) -shared -o $(NETDLL) $(LIBS) $(NETOBJS) $(LDLIBS)
+ endif
+
+ $(GAMEEXE) : $(ENGINEDLL) $(NETDLL) $(GAMEOBJS) $(PERLOBJS)
+- $(LINKER) -o $(GAMEEXE) $(LDFLAGS) $(PERLOBJS) $(GAMEOBJS) $(LDPERL) $(LDLIBS) $(ENGINEDLL) $(NETDLL)
++ $(LINKER) $(LDFLAGS) -o $(GAMEEXE) $(LIBS) $(PERLOBJS) $(GAMEOBJS) $(LDPERL) $(LDLIBS) $(ENGINEDLL) $(NETDLL)
+
+ $(BUILDEXE) : $(ENGINEDLL) $(BUILDOBJS)
+- $(LINKER) -o $(BUILDEXE) $(LDFLAGS) $(BUILDOBJS) $(LDLIBS) $(ENGINEDLL)
++ $(LINKER) $(LDFLAGS) -o $(BUILDEXE) $(LIBS) $(BUILDOBJS) $(LDLIBS) $(ENGINEDLL)
+
+ listclean:
+ @echo "A 'make clean' would remove" $(CLEANUP)
+--- source/Makefile.old 2010-10-08 14:35:54.000000000 +0200
++++ source/Makefile 2010-10-08 14:37:34.000000000 +0200
+@@ -152,10 +152,10 @@
+ sounds.o \
+ dukemusc.o \
+ audiolib/audiolib.a
+- $(CC) $^ $(BUILDOBJS) $(LDLIBS) -o $@
++ $(CC) $(LDFLAGS) $^ $(BUILDOBJS) $(LDLIBS) -o $@
+
+ build: astub.o
+- $(CC) $^ $(BUILDOBJS) buildengine/build.o $(LDLIBS) -o $@
++ $(CC) $(LDFLAGS) $^ $(BUILDOBJS) buildengine/build.o $(LDLIBS) -o $@
+
+ clean:
+ $(MAKE) -C audiolib clean
diff --git a/games-fps/duke3d/files/duke3d-20040817-noinline.patch b/games-fps/duke3d/files/duke3d-20040817-noinline.patch
new file mode 100644
index 000000000000..a41c5c01d063
--- /dev/null
+++ b/games-fps/duke3d/files/duke3d-20040817-noinline.patch
@@ -0,0 +1,18 @@
+--- source/buildengine/engine.c.old 2009-02-06 09:11:54.000000000 +0100
++++ source/buildengine/engine.c 2009-02-06 09:19:12.000000000 +0100
+@@ -391,6 +391,7 @@
+ modify exact [eax ebx ecx]\
+
+ #elif (defined __GNUC__) || (defined __ICC)
++ __attribute__ ((noinline))
+ static long nsqrtasm(int i1)
+ {
+ long retval;
+@@ -601,6 +602,7 @@
+
+ #elif (defined __GNUC__) || (defined __ICC)
+
++ __attribute__ ((noinline))
+ int setgotpic(long i1)
+ {
+ int retval = 0;
diff --git a/games-fps/duke3d/files/duke3d.cfg b/games-fps/duke3d/files/duke3d.cfg
new file mode 100644
index 000000000000..2e8c4a0671b7
--- /dev/null
+++ b/games-fps/duke3d/files/duke3d.cfg
@@ -0,0 +1,194 @@
+[Setup]
+SetupVersion = "1.3D"
+
+[Screen Setup]
+ScreenMode = 2
+ScreenWidth = 1024
+ScreenHeight = 768
+Shadows = 1
+Password = ""
+Detail = 1
+Tilt = 1
+Messages = 1
+Out = 0
+ScreenSize = 8
+ScreenGamma = 0
+
+[Sound Setup]
+FXDevice = 0
+MusicDevice = 0
+FXVolume = 220
+MusicVolume = 200
+NumVoices = 8
+NumChannels = 2
+NumBits = 16
+MixRate = 44100
+MidiPort = 0x330
+BlasterAddress = 0x220
+BlasterType = 1
+BlasterInterrupt = 5
+BlasterDma8 = 1
+BlasterDma16 = 5
+BlasterEmu = 0x620
+ReverseStereo = 0
+SoundToggle = 1
+VoiceToggle = 1
+AmbienceToggle = 1
+MusicToggle = 1
+
+[KeyDefinitions]
+Move_Forward = "Up" "Kpad8"
+Move_Backward = "Down" "Kpad2"
+Turn_Left = "Left" "Kpad4"
+Turn_Right = "Right" "KPad6"
+Strafe = "LAlt" "RAlt"
+Fire = "LCtrl" "RCtrl"
+Open = "Space" ""
+Run = "LShift" "RShift"
+AutoRun = "CapLck" ""
+Jump = "A" "/"
+Crouch = "Z" ""
+Look_Up = "PgUp" "Kpad9"
+Look_Down = "PgDn" "Kpad3"
+Look_Left = "Insert" "Kpad0"
+Look_Right = "Delete" "Kpad."
+Strafe_Left = "," ""
+Strafe_Right = "." ""
+Aim_Up = "Home" "KPad7"
+Aim_Down = "End" "Kpad1"
+Weapon_1 = "1" ""
+Weapon_2 = "2" ""
+Weapon_3 = "3" ""
+Weapon_4 = "4" ""
+Weapon_5 = "5" ""
+Weapon_6 = "6" ""
+Weapon_7 = "7" ""
+Weapon_8 = "8" ""
+Weapon_9 = "9" ""
+Weapon_10 = "0" ""
+Inventory = "Enter" "KpdEnt"
+Inventory_Left = "[" ""
+Inventory_Right = "]" ""
+Holo_Duke = "H" ""
+Jetpack = "J" ""
+NightVision = "N" ""
+MedKit = "M" ""
+TurnAround = "BakSpc" ""
+SendMessage = "T" ""
+Map = "Tab" ""
+Shrink_Screen = "-" "Kpad-"
+Enlarge_Screen = "=" "Kpad+"
+Center_View = "KPad5" ""
+Holster_Weapon = "ScrLck" ""
+Show_Opponents_Weapon = "W" ""
+Map_Follow_Mode = "F" ""
+See_Coop_View = "K" ""
+Mouse_Aiming = "U" ""
+Toggle_Crosshair = "I" ""
+Steroids = "R" ""
+Quick_Kick = "`" ""
+Next_Weapon = "'" ""
+Previous_Weapon = ";" ""
+
+[Controls]
+ControllerType = 1
+JoystickPort = 0
+MouseSensitivity = 32768
+ExternalFilename = "EXTERNAL.EXE"
+EnableRudder = 0
+MouseAiming = 0
+MouseButton0 = "Fire"
+MouseButtonClicked0 = ""
+MouseButton1 = "Strafe"
+MouseButtonClicked1 = "Open"
+MouseButton2 = "Move_Forward"
+MouseButtonClicked2 = ""
+JoystickButton0 = "Fire"
+JoystickButtonClicked0 = ""
+JoystickButton1 = "Strafe"
+JoystickButtonClicked1 = "Inventory"
+JoystickButton2 = "Run"
+JoystickButtonClicked2 = "Jump"
+JoystickButton3 = "Open"
+JoystickButtonClicked3 = "Crouch"
+JoystickButton4 = "Aim_Down"
+JoystickButtonClicked4 = ""
+JoystickButton5 = "Look_Right"
+JoystickButtonClicked5 = ""
+JoystickButton6 = "Aim_Up"
+JoystickButtonClicked6 = ""
+JoystickButton7 = "Look_Left"
+JoystickButtonClicked7 = ""
+MouseAnalogAxes0 = "analog_turning"
+MouseDigitalAxes0_0 = ""
+MouseDigitalAxes0_1 = ""
+MouseAnalogScale0 = 0
+MouseAnalogAxes1 = "analog_moving"
+MouseDigitalAxes1_0 = ""
+MouseDigitalAxes1_1 = ""
+MouseAnalogScale1 = 0
+JoystickAnalogAxes0 = "analog_turning"
+JoystickDigitalAxes0_0 = ""
+JoystickDigitalAxes0_1 = ""
+JoystickAnalogScale0 = 0
+JoystickAnalogAxes1 = "analog_moving"
+JoystickDigitalAxes1_0 = ""
+JoystickDigitalAxes1_1 = ""
+JoystickAnalogScale1 = 0
+JoystickAnalogAxes2 = "analog_strafing"
+JoystickDigitalAxes2_0 = ""
+JoystickDigitalAxes2_1 = ""
+JoystickAnalogScale2 = 0
+JoystickAnalogAxes3 = ""
+JoystickDigitalAxes3_0 = "Run"
+JoystickDigitalAxes3_1 = ""
+JoystickAnalogScale3 = 0
+GamePadDigitalAxes0_0 = "Turn_Left"
+GamePadDigitalAxes0_1 = "Turn_Right"
+GamePadDigitalAxes1_0 = "Move_Forward"
+GamePadDigitalAxes1_1 = "Move_Backward"
+MouseAimingFlipped = 0
+GameMouseAiming = 0
+AimingFlag = 0
+
+[Comm Setup]
+ComPort = 2
+IrqNumber = 65535
+UartAddress = 65535
+PortSpeed = 9600
+ToneDial = 1
+SocketNumber = 65535
+NumberPlayers = 2
+ModemName = ""
+InitString = "ATZ"
+HangupString = "ATH0=0"
+DialoutString = ""
+PlayerName = "DUKE"
+RTSName = "DUKE.RTS"
+PhoneNumber = ""
+ConnectType = 0
+CommbatMacro#0 = "An inspiration for birth control."
+CommbatMacro#1 = "You're gonna die for that!"
+CommbatMacro#2 = "It hurts to be you."
+CommbatMacro#3 = "Lucky Son of a Bitch."
+CommbatMacro#4 = "Hmmm....Payback time."
+CommbatMacro#5 = "You bottom dwelling scum sucker."
+CommbatMacro#6 = "Damn, you're ugly."
+CommbatMacro#7 = "Ha ha ha...Wasted!"
+CommbatMacro#8 = "You suck!"
+CommbatMacro#9 = "AARRRGHHHHH!!!"
+
+[Misc]
+Executions = 5
+RunMode = 0
+Crosshairs = 1
+WeaponChoice0 = 3
+WeaponChoice1 = 4
+WeaponChoice2 = 5
+WeaponChoice3 = 7
+WeaponChoice4 = 8
+WeaponChoice5 = 6
+WeaponChoice6 = 0
+WeaponChoice7 = 2
+WeaponChoice8 = 9
+WeaponChoice9 = 1
diff --git a/games-fps/duke3d/files/network.cfg b/games-fps/duke3d/files/network.cfg
new file mode 100644
index 000000000000..46db8b3119fb
--- /dev/null
+++ b/games-fps/duke3d/files/network.cfg
@@ -0,0 +1,15 @@
+# lifted from happypenguin.org
+
+INTERFACE [your ip address]
+
+# only peer appears to work [SERVER or CLIENT or PEER]
+MODE peer
+
+# create an allow line for everyone who will connect
+ALLOW [another player's ip address]
+ALLOW [another player's ip address]
+ALLOW [another player's ip address]
+ALLOW [another player's ip address]
+
+# try to find [number] of players and start the game
+BROADCAST [number]