From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111c93,f02ae8bff979ed1d X-Google-Attributes: gid111c93,public From: tsbogend@alpha.franken.de (Thomas Bogendoerfer) Subject: Re: Any success with Doom? Date: 1998/01/27 Message-ID: <6alp6r$dnn$1@alpha.franken.de> X-Deja-AN: 319803694 References: <34bf6f88.0@rainbow.hrz.uni-siegen.de> <6ail95$9br$1@elektron.et.tudelft.nl> Content-Type: text/plain; charset=us-ascii Organization: My little private site Mime-Version: 1.0 Newsgroups: comp.os.linux.alpha 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 ; iid != 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>]