* Re: Any success with Doom?
1998-01-26 5:00 ` W.vanderMost
@ 1998-01-27 5:00 ` Thomas Bogendoerfer
1998-01-29 5:00 ` Nils Faerber
0 siblings, 1 reply; 8+ messages in thread
From: Thomas Bogendoerfer @ 1998-01-27 5:00 UTC (permalink / raw)
In article <6ail95$9br$1@elektron.et.tudelft.nl>,
wvdmost@elektron.et.tudelft.nl (W.vanderMost) writes:
> I have set up some http space for doom axp it's not much but it's a beginning 8)
Try the patch below. The difference between the patch I've posted on the
axp-list and this one is that I kludged the sound stuff not to write sound
data to stdin. Doom still crashes, when I quit it. Have fun.
Thomas.
diff -ru orig/linuxdoom-1.10/Makefile linuxdoom-1.10/Makefile
--- orig/linuxdoom-1.10/Makefile Mon Dec 22 20:55:36 1997
+++ linuxdoom-1.10/Makefile Sat Jan 24 12:59:57 1998
@@ -6,7 +6,7 @@
#
CC= gcc # gcc or g++
-CFLAGS=-g -Wall -DNORMALUNIX -DLINUX # -DUSEASM
+CFLAGS=-g -Wall -DNORMALUNIX -DLINUX -DSNDSRV -DSNDSERV # -DUSEASM
LDFLAGS=-L/usr/X11R6/lib
LIBS=-lXext -lX11 -lnsl -lm
@@ -92,4 +92,4 @@
#############################################################
#
-#############################################################
\ No newline at end of file
+#############################################################
diff -ru orig/linuxdoom-1.10/d_main.c linuxdoom-1.10/d_main.c
--- orig/linuxdoom-1.10/d_main.c Mon Dec 22 21:32:03 1997
+++ linuxdoom-1.10/d_main.c Sat Jan 24 13:00:25 1998
@@ -1119,7 +1119,7 @@
// for statistics driver
extern void* statcopy;
- statcopy = (void*)atoi(myargv[p+1]);
+ statcopy = (void*)(long)atoi(myargv[p+1]);
printf ("External statistics registered.\n");
}
diff -ru orig/linuxdoom-1.10/d_net.c linuxdoom-1.10/d_net.c
--- orig/linuxdoom-1.10/d_net.c Mon Dec 22 21:32:33 1997
+++ linuxdoom-1.10/d_net.c Thu Jan 22 00:56:33 1998
@@ -87,9 +87,9 @@
//
//
//
-int NetbufferSize (void)
+long NetbufferSize (void)
{
- return (int)&(((doomdata_t *)0)->cmds[netbuffer->numtics]);
+ return (long)&(((doomdata_t *)0)->cmds[netbuffer->numtics]);
}
//
diff -ru orig/linuxdoom-1.10/i_sound.c linuxdoom-1.10/i_sound.c
--- orig/linuxdoom-1.10/i_sound.c Mon Dec 22 20:57:15 1997
+++ linuxdoom-1.10/i_sound.c Sun Jan 25 23:16:24 1998
@@ -103,7 +103,7 @@
int lengths[NUMSFX];
// The actual output device.
-int audio_fd;
+int audio_fd = -1;
// The global mixing buffer.
// Basically, samples from all active internal channels
diff -ru orig/linuxdoom-1.10/i_video.c linuxdoom-1.10/i_video.c
--- orig/linuxdoom-1.10/i_video.c Mon Dec 22 21:39:01 1997
+++ linuxdoom-1.10/i_video.c Thu Jan 22 00:55:09 1998
@@ -685,8 +685,8 @@
// attach to the shared memory segment
image->data = X_shminfo.shmaddr = shmat(id, 0, 0);
- fprintf(stderr, "shared memory id=%d, addr=0x%x\n", id,
- (int) (image->data));
+ fprintf(stderr, "shared memory id=%d, addr=0x%lx\n", id,
+ (long) (image->data));
}
void I_InitGraphics(void)
@@ -986,13 +986,13 @@
{
fourpixels = lineptr[0];
- dpixel = *(double *)( (int)exp + ( (fourpixels&0xffff0000)>>13) );
+ dpixel = *(double *)( (long)exp + ( (fourpixels&0xffff0000)>>13) );
xline[0] = dpixel;
xline[160] = dpixel;
xline[320] = dpixel;
xline[480] = dpixel;
- dpixel = *(double *)( (int)exp + ( (fourpixels&0xffff)<<3 ) );
+ dpixel = *(double *)( (long)exp + ( (fourpixels&0xffff)<<3 ) );
xline[1] = dpixel;
xline[161] = dpixel;
xline[321] = dpixel;
@@ -1000,13 +1000,13 @@
fourpixels = lineptr[1];
- dpixel = *(double *)( (int)exp + ( (fourpixels&0xffff0000)>>13) );
+ dpixel = *(double *)( (long)exp + ( (fourpixels&0xffff0000)>>13) );
xline[2] = dpixel;
xline[162] = dpixel;
xline[322] = dpixel;
xline[482] = dpixel;
- dpixel = *(double *)( (int)exp + ( (fourpixels&0xffff)<<3 ) );
+ dpixel = *(double *)( (long)exp + ( (fourpixels&0xffff)<<3 ) );
xline[3] = dpixel;
xline[163] = dpixel;
xline[323] = dpixel;
@@ -1014,13 +1014,13 @@
fourpixels = lineptr[2];
- dpixel = *(double *)( (int)exp + ( (fourpixels&0xffff0000)>>13) );
+ dpixel = *(double *)( (long)exp + ( (fourpixels&0xffff0000)>>13) );
xline[4] = dpixel;
xline[164] = dpixel;
xline[324] = dpixel;
xline[484] = dpixel;
- dpixel = *(double *)( (int)exp + ( (fourpixels&0xffff)<<3 ) );
+ dpixel = *(double *)( (long)exp + ( (fourpixels&0xffff)<<3 ) );
xline[5] = dpixel;
xline[165] = dpixel;
xline[325] = dpixel;
@@ -1028,13 +1028,13 @@
fourpixels = lineptr[3];
- dpixel = *(double *)( (int)exp + ( (fourpixels&0xffff0000)>>13) );
+ dpixel = *(double *)( (long)exp + ( (fourpixels&0xffff0000)>>13) );
xline[6] = dpixel;
xline[166] = dpixel;
xline[326] = dpixel;
xline[486] = dpixel;
- dpixel = *(double *)( (int)exp + ( (fourpixels&0xffff)<<3 ) );
+ dpixel = *(double *)( (long)exp + ( (fourpixels&0xffff)<<3 ) );
xline[7] = dpixel;
xline[167] = dpixel;
xline[327] = dpixel;
diff -ru orig/linuxdoom-1.10/m_misc.c linuxdoom-1.10/m_misc.c
--- orig/linuxdoom-1.10/m_misc.c Mon Dec 22 21:43:11 1997
+++ linuxdoom-1.10/m_misc.c Sat Jan 24 13:00:25 1998
@@ -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,15 +254,15 @@
// UNIX hack, to be removed.
#ifdef SNDSERV
- {"sndserver", (int *) &sndserver_filename, (int) "sndserver"},
+ {"sndserver", (int *) &sndserver_filename, (long) "sndserver"},
{"mb_used", &mb_used, 2},
#endif
#endif
#ifdef LINUX
- {"mousedev", (int*)&mousedev, (int)"/dev/ttyS0"},
- {"mousetype", (int*)&mousetype, (int)"microsoft"},
+ {"mousedev", (int*)&mousedev, (long)"/dev/ttyS0"},
+ {"mousetype", (int*)&mousetype, (long)"microsoft"},
#endif
{"use_mouse",&usemouse, 1},
@@ -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 }
};
@@ -392,7 +392,7 @@
*defaults[i].location = parm;
else
*defaults[i].location =
- (int) newstring;
+ (long) newstring;
break;
}
}
diff -ru orig/linuxdoom-1.10/p_saveg.c linuxdoom-1.10/p_saveg.c
--- orig/linuxdoom-1.10/p_saveg.c Sun Dec 21 17:03:15 1997
+++ linuxdoom-1.10/p_saveg.c Thu Jan 22 00:52:53 1998
@@ -37,7 +37,7 @@
// Pads save_p to a 4-byte boundary
// so that the load/save works on SGI&Gecko.
-#define PADSAVEP() save_p += (4 - ((int) save_p & 3)) & 3
+#define PADSAVEP() save_p += (4 - ((long) save_p & 3)) & 3
@@ -101,7 +101,7 @@
if (players[i]. psprites[j].state)
{
players[i]. psprites[j].state
- = &states[ (int)players[i].psprites[j].state ];
+ = &states[ (long)players[i].psprites[j].state ];
}
}
}
@@ -299,11 +299,11 @@
mobj = Z_Malloc (sizeof(*mobj), PU_LEVEL, NULL);
memcpy (mobj, save_p, sizeof(*mobj));
save_p += sizeof(*mobj);
- mobj->state = &states[(int)mobj->state];
+ mobj->state = &states[(long)mobj->state];
mobj->target = NULL;
if (mobj->player)
{
- mobj->player = &players[(int)mobj->player-1];
+ mobj->player = &players[(long)mobj->player-1];
mobj->player->mo = mobj;
}
P_SetThingPosition (mobj);
@@ -498,7 +498,7 @@
ceiling = Z_Malloc (sizeof(*ceiling), PU_LEVEL, NULL);
memcpy (ceiling, save_p, sizeof(*ceiling));
save_p += sizeof(*ceiling);
- ceiling->sector = §ors[(int)ceiling->sector];
+ ceiling->sector = §ors[(long)ceiling->sector];
ceiling->sector->specialdata = ceiling;
if (ceiling->thinker.function.acp1)
@@ -513,7 +513,7 @@
door = Z_Malloc (sizeof(*door), PU_LEVEL, NULL);
memcpy (door, save_p, sizeof(*door));
save_p += sizeof(*door);
- door->sector = §ors[(int)door->sector];
+ door->sector = §ors[(long)door->sector];
door->sector->specialdata = door;
door->thinker.function.acp1 = (actionf_p1)T_VerticalDoor;
P_AddThinker (&door->thinker);
@@ -524,7 +524,7 @@
floor = Z_Malloc (sizeof(*floor), PU_LEVEL, NULL);
memcpy (floor, save_p, sizeof(*floor));
save_p += sizeof(*floor);
- floor->sector = §ors[(int)floor->sector];
+ floor->sector = §ors[(long)floor->sector];
floor->sector->specialdata = floor;
floor->thinker.function.acp1 = (actionf_p1)T_MoveFloor;
P_AddThinker (&floor->thinker);
@@ -535,7 +535,7 @@
plat = Z_Malloc (sizeof(*plat), PU_LEVEL, NULL);
memcpy (plat, save_p, sizeof(*plat));
save_p += sizeof(*plat);
- plat->sector = §ors[(int)plat->sector];
+ plat->sector = §ors[(long)plat->sector];
plat->sector->specialdata = plat;
if (plat->thinker.function.acp1)
@@ -550,7 +550,7 @@
flash = Z_Malloc (sizeof(*flash), PU_LEVEL, NULL);
memcpy (flash, save_p, sizeof(*flash));
save_p += sizeof(*flash);
- flash->sector = §ors[(int)flash->sector];
+ flash->sector = §ors[(long)flash->sector];
flash->thinker.function.acp1 = (actionf_p1)T_LightFlash;
P_AddThinker (&flash->thinker);
break;
@@ -560,7 +560,7 @@
strobe = Z_Malloc (sizeof(*strobe), PU_LEVEL, NULL);
memcpy (strobe, save_p, sizeof(*strobe));
save_p += sizeof(*strobe);
- strobe->sector = §ors[(int)strobe->sector];
+ strobe->sector = §ors[(long)strobe->sector];
strobe->thinker.function.acp1 = (actionf_p1)T_StrobeFlash;
P_AddThinker (&strobe->thinker);
break;
@@ -570,7 +570,7 @@
glow = Z_Malloc (sizeof(*glow), PU_LEVEL, NULL);
memcpy (glow, save_p, sizeof(*glow));
save_p += sizeof(*glow);
- glow->sector = §ors[(int)glow->sector];
+ glow->sector = §ors[(long)glow->sector];
glow->thinker.function.acp1 = (actionf_p1)T_Glow;
P_AddThinker (&glow->thinker);
break;
diff -ru orig/linuxdoom-1.10/p_setup.c linuxdoom-1.10/p_setup.c
--- orig/linuxdoom-1.10/p_setup.c Mon Dec 22 21:52:39 1997
+++ linuxdoom-1.10/p_setup.c Sat Jan 24 11:17:56 1998
@@ -533,7 +533,7 @@
}
// build line tables for each sector
- linebuffer = Z_Malloc (total*4, PU_LEVEL, 0);
+ linebuffer = Z_Malloc (total*sizeof(void *), PU_LEVEL, 0);
sector = sectors;
for (i=0 ; i<numsectors ; i++, sector++)
{
diff -ru orig/linuxdoom-1.10/r_data.c linuxdoom-1.10/r_data.c
--- orig/linuxdoom-1.10/r_data.c Mon Dec 22 21:57:47 1997
+++ linuxdoom-1.10/r_data.c Sat Jan 24 11:19:10 1998
@@ -87,7 +87,8 @@
boolean masked;
short width;
short height;
- void **columndirectory; // OBSOLETE
+// void **columndirectory; // OBSOLETE
+ int dummy;
short patchcount;
mappatch_t patches[1];
} maptexture_t;
@@ -479,13 +480,13 @@
}
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);
+ textures = Z_Malloc (numtextures*sizeof(void *), PU_STATIC, 0);
+ texturecolumnlump = Z_Malloc (numtextures*sizeof(void *), PU_STATIC, 0);
+ texturecolumnofs = Z_Malloc (numtextures*sizeof(void *), PU_STATIC, 0);
+ texturecomposite = Z_Malloc (numtextures*sizeof(void *), PU_STATIC, 0);
+ texturecompositesize = Z_Malloc (numtextures*sizeof(void *), PU_STATIC, 0);
+ texturewidthmask = Z_Malloc (numtextures*sizeof(void *), PU_STATIC, 0);
+ textureheight = Z_Malloc (numtextures*sizeof(void *), PU_STATIC, 0);
totalwidth = 0;
@@ -567,7 +568,7 @@
R_GenerateLookup (i);
// Create translation table for global animation.
- texturetranslation = Z_Malloc ((numtextures+1)*4, PU_STATIC, 0);
+ texturetranslation = Z_Malloc ((numtextures+1)*sizeof(void *), PU_STATIC, 0);
for (i=0 ; i<numtextures ; i++)
texturetranslation[i] = i;
@@ -587,7 +588,7 @@
numflats = lastflat - firstflat + 1;
// Create translation table for global animation.
- flattranslation = Z_Malloc ((numflats+1)*4, PU_STATIC, 0);
+ flattranslation = Z_Malloc ((numflats+1)*sizeof(void *), PU_STATIC, 0);
for (i=0 ; i<numflats ; i++)
flattranslation[i] = i;
@@ -609,9 +610,9 @@
lastspritelump = W_GetNumForName ("S_END") - 1;
numspritelumps = lastspritelump - firstspritelump + 1;
- spritewidth = Z_Malloc (numspritelumps*4, PU_STATIC, 0);
- spriteoffset = Z_Malloc (numspritelumps*4, PU_STATIC, 0);
- spritetopoffset = Z_Malloc (numspritelumps*4, PU_STATIC, 0);
+ spritewidth = Z_Malloc (numspritelumps*sizeof(void *), PU_STATIC, 0);
+ spriteoffset = Z_Malloc (numspritelumps*sizeof(void *), PU_STATIC, 0);
+ spritetopoffset = Z_Malloc (numspritelumps*sizeof(void *), PU_STATIC, 0);
for (i=0 ; i< numspritelumps ; i++)
{
@@ -639,7 +640,7 @@
lump = W_GetNumForName("COLORMAP");
length = W_LumpLength (lump) + 255;
colormaps = Z_Malloc (length, PU_STATIC, 0);
- colormaps = (byte *)( ((int)colormaps + 255)&~0xff);
+ colormaps = (byte *)( ((long)colormaps + 255)&~0xff);
W_ReadLump (lump,colormaps);
}
diff -ru orig/linuxdoom-1.10/r_draw.c linuxdoom-1.10/r_draw.c
--- orig/linuxdoom-1.10/r_draw.c Mon Dec 22 21:58:20 1997
+++ linuxdoom-1.10/r_draw.c Thu Jan 22 00:57:11 1998
@@ -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 )& ~255);
// translate just the 16 green colors
for (i=0 ; i<256 ; i++)
diff -ru orig/linuxdoom-1.10/z_zone.c linuxdoom-1.10/z_zone.c
--- orig/linuxdoom-1.10/z_zone.c Mon Dec 22 22:07:09 1997
+++ linuxdoom-1.10/z_zone.c Sat Jan 24 11:24:15 1998
@@ -192,7 +192,7 @@
memblock_t* newblock;
memblock_t* base;
- size = (size + 3) & ~3;
+ size = (size + (sizeof(void *)-1)) & ~(sizeof(void *)-1);
// scan through the block list,
// looking for the first free block
@@ -437,7 +437,7 @@
if (block->id != ZONEID)
I_Error ("Z_ChangeTag: freed a pointer without ZONEID");
- if (tag >= PU_PURGELEVEL && (unsigned)block->user < 0x100)
+ if (tag >= PU_PURGELEVEL && (unsigned long)block->user < 0x100)
I_Error ("Z_ChangeTag: an owner is required for purgable blocks");
block->tag = tag;
--
See, you not only have to be a good coder to create a system like Linux,
you have to be a sneaky bastard too ;-)
[Linus Torvalds in <4rikft$7g5@linux.cs.Helsinki.FI>]
^ permalink raw reply [flat|nested] 8+ messages in thread