From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 10279 invoked from network); 21 Jan 1999 01:49:05 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 21 Jan 1999 01:49:05 -0000 Received: from fmuta.zabbo.net (zab@dsl-209-162-215-45.easystreet.com [209.162.215.45]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id UAA06110 for ; Wed, 20 Jan 1999 20:23:10 -0500 Received: from localhost (zab@localhost) by fmuta.zabbo.net (8.9.1/8.9.1) with ESMTP id RAA08168; Wed, 20 Jan 1999 17:23:08 -0800 Date: Wed, 20 Jan 1999 17:23:06 -0800 (PST) From: Zach Brown To: axp-list@redhat.com cc: wertmann@cs.uni-potsdam.de Subject: Re: Heretic on the alpha In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Wed, 20 Jan 1999, Jason Duerstock wrote: > On Wed, 20 Jan 1999, Ron Farrer wrote: > > > I just read on /. that the Heretic source has been ported to Linux > > (x86??) and I was woundering if anyone has tried to compile the source for > > Heretic on our favorite platform? > > Someone on IRC was complaining that the source had endianitis (that is, *nod* almost identical to doom's problems, really. Most of this patch was inspired by Thomas Bogendoerfer's doom patch.. This patch gets you a title screen and such, but loading maps is broken. If someone else could take it from here, I'd be happy. I'm really tired of wading through this "code" :) -- zach - - - - - - 007 373 5963 diff -urN linux-heretic.dist/Makefile linux-heretic/Makefile --- linux-heretic.dist/Makefile Wed Jan 20 13:09:13 1999 +++ linux-heretic/Makefile Wed Jan 20 14:57:19 1999 @@ -16,7 +16,7 @@ CFLAGS = -Wall -Wstrict-prototypes $(CDEFS.linux386) \ - -I/usr/X11R6/include $(COPT.x86) + -I/usr/X11R6/include $(COPT.alpha) X_LDFLAGS = -L/usr/X11R6/lib diff -urN linux-heretic.dist/doomdata.h linux-heretic/doomdata.h --- linux-heretic.dist/doomdata.h Wed Jan 13 17:41:39 1999 +++ linux-heretic/doomdata.h Wed Jan 20 16:02:42 1999 @@ -150,7 +150,10 @@ boolean masked; short width; short height; +/* ARGH void **columndirectory; // OBSOLETE +*/ + char obsolete[4]; short patchcount; mappatch_t patches[1]; } maptexture_t; diff -urN linux-heretic.dist/doomdef.h linux-heretic/doomdef.h --- linux-heretic.dist/doomdef.h Wed Jan 20 08:14:15 1999 +++ linux-heretic/doomdef.h Wed Jan 20 15:13:44 1999 @@ -434,8 +434,9 @@ int damage; /* For missiles */ int flags; int flags2; /* Heretic flags */ - int special1; /* Special info */ - int special2; /* Special info */ + /* need to fit pointers */ + long special1; /* Special info */ + long special2; /* Special info */ int health; int movedir; /* 0-7 */ int movecount; /* when 0, select a new dir */ Binary files linux-heretic.dist/heretic.wad and linux-heretic/heretic.wad differ diff -urN linux-heretic.dist/i_sound.c linux-heretic/i_sound.c --- linux-heretic.dist/i_sound.c Mon Jan 18 05:54:20 1999 +++ linux-heretic/i_sound.c Wed Jan 20 16:18:01 1999 @@ -89,7 +89,7 @@ int lengths[NUMSFX]; /* The actual output device. */ -int audio_fd; +int audio_fd = -1; /* * The global mixing buffer. diff -urN linux-heretic.dist/m_misc.c linux-heretic/m_misc.c --- linux-heretic.dist/m_misc.c Wed Jan 20 09:08:33 1999 +++ linux-heretic/m_misc.c Wed Jan 20 16:44:10 1999 @@ -384,7 +384,7 @@ { char *name; int *location; - int defaultvalue; + long defaultvalue; int scantranslate; /* PC scan code hack */ int untranslated; /* lousy hack */ } default_t; @@ -476,16 +476,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 } }; int numdefaults; @@ -513,7 +513,7 @@ if (defaults[i].defaultvalue > -0xfff && defaults[i].defaultvalue < 0xfff) { - v = *defaults[i].location; + v =*defaults[i].location; fprintf (f,"%s\t\t%i\n",defaults[i].name,v); } else { fprintf (f,"%s\t\t\"%s\"\n",defaults[i].name, @@ -553,6 +553,7 @@ numdefaults = sizeof(defaults)/sizeof(defaults[0]); for (i=0 ; itarget, MT_EGGFX); */ if(mo != NULL) { - mo->special1 = (int)actor->target; + mo->special1 = (long)actor->target; } } @@ -1906,7 +1906,7 @@ if(mo != NULL) { mo->z -= 32*FRACUNIT; - mo->special1 = (int)target; + mo->special1 = (long)target; mo->special2 = 50; /* Timer for active sound */ mo->health = 20*TICSPERSEC; /* Duration */ S_StartSound(actor, sfx_hedat3); @@ -2372,7 +2372,7 @@ P_ThrustMobj(mo, P_Random()<<24, (fixed_t)(4.5*FRACUNIT)); S_StartSound(mo, sfx_newpod); actor->special1++; /* Increment generated pod count */ - mo->special2 = (int)actor; /* Link the generator to the pod */ + mo->special2 = (long)actor; /* Link the generator to the pod */ return; } diff -urN linux-heretic.dist/p_pspr.c linux-heretic/p_pspr.c --- linux-heretic.dist/p_pspr.c Tue Jan 19 04:10:47 1999 +++ linux-heretic/p_pspr.c Wed Jan 20 15:16:11 1999 @@ -1252,7 +1252,7 @@ mo->momz = 2*FRACUNIT+((player->lookdir)<<(FRACBITS-5)); if(linetarget) { - mo->special1 = (int)linetarget; + mo->special1 = (long)linetarget; } } S_StartSound(player->mo, sfx_lobsht); @@ -1303,7 +1303,7 @@ P_AimLineAttack(ball, angle, 10*64*FRACUNIT); if(linetarget && ball->target != linetarget) { - ball->special1 = (int)linetarget; + ball->special1 = (long)linetarget; angle = R_PointToAngle2(ball->x, ball->y, linetarget->x, linetarget->y); newAngle = true; @@ -1469,7 +1469,7 @@ } if(linetarget) { - MissileMobj->special1 = (int)linetarget; + MissileMobj->special1 = (long)linetarget; } S_StartSound(MissileMobj, sfx_hrnpow); } diff -urN linux-heretic.dist/p_setup.c linux-heretic/p_setup.c --- linux-heretic.dist/p_setup.c Tue Jan 19 04:10:57 1999 +++ linux-heretic/p_setup.c Wed Jan 20 17:08:09 1999 @@ -456,7 +456,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 ; istate = &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); @@ -424,7 +424,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 = T_MoveCeiling; if (ceiling->thinker.function.acp1) ceiling->thinker.function.acp1 = (actionf_p1)T_MoveCeiling; @@ -436,7 +436,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); @@ -446,7 +446,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 = T_MoveFloor; floor->thinker.function.acp1 = (actionf_p1)T_MoveFloor; P_AddThinker (&floor->thinker); @@ -456,7 +456,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 = T_PlatRaise; if (plat->thinker.function.acp1) plat->thinker.function.acp1 = (actionf_p1)T_PlatRaise; @@ -468,7 +468,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; @@ -477,7 +477,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; @@ -486,7 +486,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 -urN linux-heretic.dist/r_data.c linux-heretic/r_data.c --- linux-heretic.dist/r_data.c Mon Jan 18 06:39:24 1999 +++ linux-heretic/r_data.c Wed Jan 20 16:50:05 1999 @@ -377,13 +377,13 @@ printf("\x8\x8\x8\x8\x8\x8\x8\x8\x8\x8"); - 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; @@ -454,7 +454,7 @@ /* * 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 ; 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; }