doom: port to amd64
This commit is contained in:
parent
88505bff06
commit
3f522c745a
|
@ -89,7 +89,7 @@ doomdata_t reboundstore;
|
|||
//
|
||||
int NetbufferSize (void)
|
||||
{
|
||||
return (int)&(((doomdata_t *)0)->cmds[netbuffer->numtics]);
|
||||
return (int)(uintptr)&(((doomdata_t *)0)->cmds[netbuffer->numtics]);
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
@ -62,27 +62,6 @@ void I_Tactile(int on, int off, int total)
|
|||
USED(on, off, total);
|
||||
}
|
||||
|
||||
/*
|
||||
ticcmd_t emptycmd;
|
||||
ticcmd_t* I_BaseTiccmd(void)
|
||||
{
|
||||
return &emptycmd;
|
||||
}
|
||||
|
||||
|
||||
int I_GetHeapSize (void)
|
||||
{
|
||||
return mb_used*1024*1024;
|
||||
}
|
||||
|
||||
byte* I_ZoneBase (int* size)
|
||||
{
|
||||
*size = mb_used*1024*1024;
|
||||
return (byte *) malloc (*size);
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
//
|
||||
// I_Error
|
||||
//
|
||||
|
|
|
@ -37,9 +37,7 @@ byte* save_p;
|
|||
|
||||
// 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 - ((uintptr) save_p & 3)) & 3
|
||||
|
||||
//
|
||||
// P_ArchivePlayers
|
||||
|
@ -101,7 +99,7 @@ void P_UnArchivePlayers (void)
|
|||
if (players[i]. psprites[j].state)
|
||||
{
|
||||
players[i]. psprites[j].state
|
||||
= &states[ (int)players[i].psprites[j].state ];
|
||||
= &states[ (int)(uintptr)players[i].psprites[j].state ];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -299,11 +297,11 @@ void P_UnArchiveThinkers (void)
|
|||
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[(int)(uintptr)mobj->state];
|
||||
mobj->target = NULL;
|
||||
if (mobj->player)
|
||||
{
|
||||
mobj->player = &players[(int)mobj->player-1];
|
||||
mobj->player = &players[(int)(uintptr)mobj->player-1];
|
||||
mobj->player->mo = mobj;
|
||||
}
|
||||
P_SetThingPosition (mobj);
|
||||
|
@ -498,7 +496,7 @@ void P_UnArchiveSpecials (void)
|
|||
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[(int)(uintptr)ceiling->sector];
|
||||
ceiling->sector->specialdata = ceiling;
|
||||
|
||||
if (ceiling->thinker.function)
|
||||
|
@ -513,7 +511,7 @@ void P_UnArchiveSpecials (void)
|
|||
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[(int)(uintptr)door->sector];
|
||||
door->sector->specialdata = door;
|
||||
door->thinker.function = T_VerticalDoor;
|
||||
P_AddThinker (&door->thinker);
|
||||
|
@ -524,7 +522,7 @@ void P_UnArchiveSpecials (void)
|
|||
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[(int)(uintptr)floor->sector];
|
||||
floor->sector->specialdata = floor;
|
||||
floor->thinker.function = T_MoveFloor;
|
||||
P_AddThinker (&floor->thinker);
|
||||
|
@ -535,7 +533,7 @@ void P_UnArchiveSpecials (void)
|
|||
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[(int)(uintptr)plat->sector];
|
||||
plat->sector->specialdata = plat;
|
||||
|
||||
if (plat->thinker.function)
|
||||
|
@ -550,7 +548,7 @@ void P_UnArchiveSpecials (void)
|
|||
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[(int)(uintptr)flash->sector];
|
||||
flash->thinker.function = T_LightFlash;
|
||||
P_AddThinker (&flash->thinker);
|
||||
break;
|
||||
|
@ -560,7 +558,7 @@ void P_UnArchiveSpecials (void)
|
|||
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[(int)(uintptr)strobe->sector];
|
||||
strobe->thinker.function = T_StrobeFlash;
|
||||
P_AddThinker (&strobe->thinker);
|
||||
break;
|
||||
|
@ -570,7 +568,7 @@ void P_UnArchiveSpecials (void)
|
|||
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[(int)(uintptr)glow->sector];
|
||||
glow->thinker.function = T_Glow;
|
||||
P_AddThinker (&glow->thinker);
|
||||
break;
|
||||
|
|
|
@ -531,7 +531,7 @@ void P_GroupLines (void)
|
|||
}
|
||||
|
||||
// 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++)
|
||||
{
|
||||
|
|
|
@ -59,7 +59,6 @@ rcsid[] = "$Id: r_data.c,v 1.4 1997/02/03 16:47:55 b1 Exp $";
|
|||
|
||||
#pragma pack on
|
||||
|
||||
|
||||
/* Texture definition.
|
||||
** Each texture is composed of one or more patches,
|
||||
** with patches being lumps stored in the WAD.
|
||||
|
@ -87,7 +86,7 @@ typedef struct
|
|||
boolean masked;
|
||||
short width;
|
||||
short height;
|
||||
void **columndirectory; // OBSOLETE
|
||||
long columndirectory; // OBSOLETE
|
||||
short patchcount;
|
||||
mappatch_t patches[1];
|
||||
} maptexture_t;
|
||||
|
@ -483,13 +482,13 @@ void R_InitTextures (void)
|
|||
}
|
||||
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(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;
|
||||
|
||||
|
@ -519,12 +518,10 @@ void R_InitTextures (void)
|
|||
}
|
||||
|
||||
offset = LONG(*directory);
|
||||
|
||||
if (offset > maxoff)
|
||||
I_Error ("R_InitTextures: bad texture directory");
|
||||
|
||||
mtexture = (maptexture_t *) ( (byte *)maptex + offset);
|
||||
|
||||
texture = textures[i] =
|
||||
Z_Malloc (sizeof(texture_t)
|
||||
+ sizeof(texpatch_t)*(SHORT(mtexture->patchcount)-1),
|
||||
|
@ -549,8 +546,8 @@ void R_InitTextures (void)
|
|||
texture->name);
|
||||
}
|
||||
}
|
||||
texturecolumnlump[i] = Z_Malloc (texture->width*2, PU_STATIC,0);
|
||||
texturecolumnofs[i] = Z_Malloc (texture->width*2, PU_STATIC,0);
|
||||
texturecolumnlump[i] = Z_Malloc (texture->width*sizeof(short), PU_STATIC,0);
|
||||
texturecolumnofs[i] = Z_Malloc (texture->width*sizeof(short), PU_STATIC,0);
|
||||
|
||||
j = 1;
|
||||
while (j*2 <= texture->width)
|
||||
|
@ -571,7 +568,7 @@ void R_InitTextures (void)
|
|||
R_GenerateLookup (i);
|
||||
|
||||
// Create translation table for global animation.
|
||||
texturetranslation = Z_Malloc ((numtextures+1)*4, PU_STATIC, 0);
|
||||
texturetranslation = Z_Malloc ((numtextures+1)*sizeof(int), PU_STATIC, 0);
|
||||
|
||||
for (i=0 ; i<numtextures ; i++)
|
||||
texturetranslation[i] = i;
|
||||
|
@ -593,7 +590,7 @@ void R_InitFlats (void)
|
|||
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(int), PU_STATIC, 0);
|
||||
|
||||
for (i=0 ; i<numflats ; i++)
|
||||
flattranslation[i] = i;
|
||||
|
@ -615,9 +612,9 @@ void R_InitSpriteLumps (void)
|
|||
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(fixed_t), PU_STATIC, 0);
|
||||
spriteoffset = Z_Malloc (numspritelumps*sizeof(fixed_t), PU_STATIC, 0);
|
||||
spritetopoffset = Z_Malloc (numspritelumps*sizeof(fixed_t), PU_STATIC, 0);
|
||||
|
||||
for (i=0 ; i< numspritelumps ; i++)
|
||||
{
|
||||
|
@ -645,7 +642,7 @@ void R_InitColormaps (void)
|
|||
lump = W_GetNumForName("COLORMAP");
|
||||
length = W_LumpLength (lump) + 255;
|
||||
colormaps = Z_Malloc (length, PU_STATIC, 0);
|
||||
colormaps = (byte *)( ((int)colormaps + 255)&~0xff);
|
||||
colormaps = (byte *)( ((uintptr)colormaps + 255)&~0xff);
|
||||
W_ReadLump (lump,colormaps);
|
||||
}
|
||||
|
||||
|
|
|
@ -401,7 +401,7 @@ void R_InitTranslationTables (void)
|
|||
int i;
|
||||
|
||||
translationtables = Z_Malloc (256*3+255, PU_STATIC, 0);
|
||||
translationtables = (byte *)(( (int)translationtables + 255 )& ~255);
|
||||
translationtables = (byte *)(((uintptr)translationtables + 255) & ~255);
|
||||
|
||||
// translate just the 16 green colors
|
||||
for (i=0 ; i<256 ; i++)
|
||||
|
|
|
@ -179,7 +179,6 @@ void Z_Free (void* ptr)
|
|||
//
|
||||
#define MINFRAGMENT 64
|
||||
|
||||
|
||||
void*
|
||||
Z_Malloc
|
||||
( int size,
|
||||
|
@ -192,7 +191,7 @@ Z_Malloc
|
|||
memblock_t* newblock;
|
||||
memblock_t* base;
|
||||
|
||||
size = (size + 3) & ~3;
|
||||
size = (size + 7) & ~7;
|
||||
|
||||
// scan through the block list,
|
||||
// looking for the first free block
|
||||
|
@ -437,7 +436,7 @@ Z_ChangeTag2
|
|||
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 && (uintptr)block->user < 0x100)
|
||||
I_Error ("Z_ChangeTag: an owner is required for purgable blocks");
|
||||
|
||||
block->tag = tag;
|
||||
|
|
Loading…
Reference in a new issue