ref: 8eea5599865e62e9a849856e996952262fbeee6c
parent: bb66e1f0f272824e5850e760a8788daaba7641a2
author: Konstantinn Bonnet <qu7uux@gmail.com>
date: Thu Feb 18 05:32:06 EST 2016
fixed types, remove silly typedefs
--- a/act1.c
+++ b/act1.c
@@ -17,7 +17,7 @@
struct
{
- int picnum;
+ s16int picnum;
stat_t type;
} statinfo[] =
{
@@ -136,7 +136,7 @@
===============
*/
-void SpawnStatic (int tilex, int tiley, int type)
+void SpawnStatic (s16int tilex, s16int tiley, s16int type)
{
laststatobj->shapenum = statinfo[type].picnum;
laststatobj->tilex = tilex;
@@ -146,7 +146,7 @@
switch (statinfo[type].type)
{
case block:
- (unsigned)actorat[tilex][tiley] = 1; // consider it a blocking tile
+ (u16int)actorat[tilex][tiley] = 1; // consider it a blocking tile
case dressing:
laststatobj->flags = 0;
break;
@@ -196,9 +196,9 @@
===============
*/
-void PlaceItemType (int itemtype, int tilex, int tiley)
+void PlaceItemType (s16int itemtype, s16int tilex, s16int tiley)
{
- int type;
+ s16int type;
statobj_t *spot;
//
@@ -270,14 +270,14 @@
#define OPENTICS 300
doorobj_t doorobjlist[MAXDOORS],*lastdoorobj;
-int doornum;
+s16int doornum;
-unsigned doorposition[MAXDOORS]; // leading edge of door 0=closed
+u16int doorposition[MAXDOORS]; // leading edge of door 0=closed
// 0xffff = fully open
-byte far areaconnect[NUMAREAS][NUMAREAS];
+u8int far areaconnect[NUMAREAS][NUMAREAS];
-boolean areabyplayer[NUMAREAS];
+int areabyplayer[NUMAREAS];
/*
@@ -290,9 +290,9 @@
==============
*/
-void RecursiveConnect (int areanumber)
+void RecursiveConnect (s16int areanumber)
{
- int i;
+ s16int i;
for (i=0;i<NUMAREAS;i++)
{
@@ -347,10 +347,10 @@
===============
*/
-void SpawnDoor (int tilex, int tiley, boolean vertical, int lock)
+void SpawnDoor (s16int tilex, s16int tiley, int vertical, s16int lock)
{
- int areanumber;
- unsigned far *map;
+ s16int areanumber;
+ u16int far *map;
if (doornum==64)
Quit ("64+ doors on level!");
@@ -362,7 +362,7 @@
lastdoorobj->lock = lock;
lastdoorobj->action = dr_closed;
- (unsigned)actorat[tilex][tiley] = doornum | 0x80; // consider it a solid wall
+ (u16int)actorat[tilex][tiley] = doornum | 0x80; // consider it a solid wall
//
// make the door tile a special tile, and mark the adjacent tiles
@@ -397,7 +397,7 @@
=====================
*/
-void OpenDoor (int door)
+void OpenDoor (s16int door)
{
if (doorobjlist[door].action == dr_open)
doorobjlist[door].ticcount = 0; // reset open time
@@ -414,9 +414,9 @@
=====================
*/
-void CloseDoor (int door)
+void CloseDoor (s16int door)
{
- int tilex,tiley,area;
+ s16int tilex,tiley,area;
objtype *check;
//
@@ -479,7 +479,7 @@
//
// make the door space solid
//
- (unsigned)actorat[tilex][tiley]
+ (u16int)actorat[tilex][tiley]
= door | 0x80;
}
@@ -495,9 +495,9 @@
=====================
*/
-void OperateDoor (int door)
+void OperateDoor (s16int door)
{
- int lock;
+ s16int lock;
lock = doorobjlist[door].lock;
if (lock >= dr_lock1 && lock <= dr_lock4)
@@ -535,7 +535,7 @@
===============
*/
-void DoorOpen (int door)
+void DoorOpen (s16int door)
{
if ( (doorobjlist[door].ticcount += tics) >= OPENTICS)
CloseDoor (door);
@@ -551,11 +551,11 @@
===============
*/
-void DoorOpening (int door)
+void DoorOpening (s16int door)
{
- int area1,area2;
- unsigned far *map;
- long position;
+ s16int area1,area2;
+ u16int far *map;
+ s32int position;
position = doorposition[door];
if (!position)
@@ -614,17 +614,17 @@
===============
*/
-void DoorClosing (int door)
+void DoorClosing (s16int door)
{
- int area1,area2,move;
- unsigned far *map;
- long position;
- int tilex,tiley;
+ s16int area1,area2,move;
+ u16int far *map;
+ s32int position;
+ s16int tilex,tiley;
tilex = doorobjlist[door].tilex;
tiley = doorobjlist[door].tiley;
- if ( ((unsigned)actorat[tilex][tiley] != (door | 0x80))
+ if ( ((u16int)actorat[tilex][tiley] != (door | 0x80))
|| (player->tilex == tilex && player->tiley == tiley) )
{ // something got inside the door
OpenDoor (door);
@@ -685,7 +685,7 @@
void MoveDoors (void)
{
- int door;
+ s16int door;
if (gamestate.victoryflag) // don't move door during victory sequence
return;
@@ -716,10 +716,10 @@
=============================================================================
*/
-unsigned pwallstate;
-unsigned pwallpos; // amount a pushable wall has been moved (0-63)
-unsigned pwallx,pwally;
-int pwalldir;
+u16int pwallstate;
+u16int pwallpos; // amount a pushable wall has been moved (0-63)
+u16int pwallx,pwally;
+s16int pwalldir;
/*
===============
@@ -729,9 +729,9 @@
===============
*/
-void PushWall (int checkx, int checky, int dir)
+void PushWall (s16int checkx, s16int checky, s16int dir)
{
- int oldtile;
+ s16int oldtile;
if (pwallstate)
return;
@@ -749,7 +749,7 @@
SD_PlaySound (NOWAYSND);
return;
}
- (unsigned)actorat[checkx][checky-1] =
+ (u16int)actorat[checkx][checky-1] =
tilemap[checkx][checky-1] = oldtile;
break;
@@ -759,7 +759,7 @@
SD_PlaySound (NOWAYSND);
return;
}
- (unsigned)actorat[checkx+1][checky] =
+ (u16int)actorat[checkx+1][checky] =
tilemap[checkx+1][checky] = oldtile;
break;
@@ -769,7 +769,7 @@
SD_PlaySound (NOWAYSND);
return;
}
- (unsigned)actorat[checkx][checky+1] =
+ (u16int)actorat[checkx][checky+1] =
tilemap[checkx][checky+1] = oldtile;
break;
@@ -779,7 +779,7 @@
SD_PlaySound (NOWAYSND);
return;
}
- (unsigned)actorat[checkx-1][checky] =
+ (u16int)actorat[checkx-1][checky] =
tilemap[checkx-1][checky] = oldtile;
break;
}
@@ -808,7 +808,7 @@
void MovePWalls (void)
{
- int oldblock,oldtile;
+ s16int oldblock,oldtile;
if (!pwallstate)
return;
@@ -826,7 +826,7 @@
// the tile can now be walked into
//
tilemap[pwallx][pwally] = 0;
- (unsigned)actorat[pwallx][pwally] = 0;
+ (u16int)actorat[pwallx][pwally] = 0;
*(mapsegs[0]+farmapylookup[pwally]+pwallx) = player->areanumber+AREATILE;
//
@@ -851,7 +851,7 @@
pwallstate = 0;
return;
}
- (unsigned)actorat[pwallx][pwally-1] =
+ (u16int)actorat[pwallx][pwally-1] =
tilemap[pwallx][pwally-1] = oldtile;
break;
@@ -862,7 +862,7 @@
pwallstate = 0;
return;
}
- (unsigned)actorat[pwallx+1][pwally] =
+ (u16int)actorat[pwallx+1][pwally] =
tilemap[pwallx+1][pwally] = oldtile;
break;
@@ -873,7 +873,7 @@
pwallstate = 0;
return;
}
- (unsigned)actorat[pwallx][pwally+1] =
+ (u16int)actorat[pwallx][pwally+1] =
tilemap[pwallx][pwally+1] = oldtile;
break;
@@ -884,7 +884,7 @@
pwallstate = 0;
return;
}
- (unsigned)actorat[pwallx-1][pwally] =
+ (u16int)actorat[pwallx-1][pwally] =
tilemap[pwallx-1][pwally] = oldtile;
break;
}
--- a/act2.c
+++ b/act2.c
@@ -39,7 +39,7 @@
dirtype dirtable[9] = {northwest,north,northeast,west,nodir,east,
southwest,south,southeast};
-int starthitpoints[4][NUMENEMIES] =
+s16int starthitpoints[4][NUMENEMIES] =
//
// BABY MODE
//
@@ -263,11 +263,11 @@
#define PROJSIZE 0x2000
-boolean ProjectileTryMove (objtype *ob)
+int ProjectileTryMove (objtype *ob)
{
- int xl,yl,xh,yh,x,y;
+ s16int xl,yl,xh,yh,x,y;
objtype *check;
- long deltax,deltay;
+ s32int deltax,deltay;
xl = (ob->x-PROJSIZE) >>TILESHIFT;
yl = (ob->y-PROJSIZE) >>TILESHIFT;
@@ -301,11 +301,11 @@
void T_Projectile (objtype *ob)
{
- long deltax,deltay;
- int damage;
- long speed;
+ s32int deltax,deltay;
+ s16int damage;
+ s32int speed;
- speed = (long)ob->speed*tics;
+ speed = (s32int)ob->speed*tics;
deltax = FixedByFrac(speed,costable[ob->angle]);
deltay = -FixedByFrac(speed,sintable[ob->angle]);
@@ -844,9 +844,9 @@
===============
*/
-void SpawnStand (enemy_t which, int tilex, int tiley, int dir)
+void SpawnStand (enemy_t which, s16int tilex, s16int tiley, s16int dir)
{
- unsigned far *map,tile;
+ u16int far *map,tile;
switch (which)
{
@@ -916,7 +916,7 @@
===============
*/
-void SpawnDeadGuard (int tilex, int tiley)
+void SpawnDeadGuard (s16int tilex, s16int tiley)
{
SpawnNewObj (tilex,tiley,&s_grddie4);
new->obclass = inertobj;
@@ -933,9 +933,9 @@
===============
*/
-void SpawnBoss (int tilex, int tiley)
+void SpawnBoss (s16int tilex, s16int tiley)
{
- unsigned far *map,tile;
+ u16int far *map,tile;
SpawnNewObj (tilex,tiley,&s_bossstand);
new->speed = SPDPATROL;
@@ -956,9 +956,9 @@
===============
*/
-void SpawnGretel (int tilex, int tiley)
+void SpawnGretel (s16int tilex, s16int tiley)
{
- unsigned far *map,tile;
+ u16int far *map,tile;
SpawnNewObj (tilex,tiley,&s_gretelstand);
new->speed = SPDPATROL;
@@ -980,7 +980,7 @@
===============
*/
-void SpawnPatrol (enemy_t which, int tilex, int tiley, int dir)
+void SpawnPatrol (enemy_t which, s16int tilex, s16int tiley, s16int dir)
{
switch (which)
{
@@ -1088,7 +1088,7 @@
case guardobj:
{
- int sounds[9]={ DEATHSCREAM1SND,
+ s16int sounds[9]={ DEATHSCREAM1SND,
DEATHSCREAM2SND,
DEATHSCREAM3SND,
DEATHSCREAM4SND,
@@ -1243,9 +1243,9 @@
===============
*/
-void SpawnTrans (int tilex, int tiley)
+void SpawnTrans (s16int tilex, s16int tiley)
{
- unsigned far *map,tile;
+ u16int far *map,tile;
if (SoundBlasterPresent && DigiMode != sds_Off)
s_transdie01.tictime = 105;
@@ -1324,9 +1324,9 @@
===============
*/
-void SpawnUber (int tilex, int tiley)
+void SpawnUber (s16int tilex, s16int tiley)
{
- unsigned far *map,tile;
+ u16int far *map,tile;
if (SoundBlasterPresent && DigiMode != sds_Off)
s_uberdie01.tictime = 70;
@@ -1350,7 +1350,7 @@
void T_UShoot (objtype *ob)
{
- int dx,dy,dist;
+ s16int dx,dy,dist;
T_Shoot (ob);
@@ -1423,9 +1423,9 @@
===============
*/
-void SpawnWill (int tilex, int tiley)
+void SpawnWill (s16int tilex, s16int tiley)
{
- unsigned far *map,tile;
+ u16int far *map,tile;
if (SoundBlasterPresent && DigiMode != sds_Off)
s_willdie2.tictime = 70;
@@ -1449,9 +1449,9 @@
void T_Will (objtype *ob)
{
- long move;
- int dx,dy,dist;
- boolean dodge;
+ s32int move;
+ s16int dx,dy,dist;
+ int dodge;
dodge = false;
dx = abs(ob->tilex - player->tilex);
@@ -1514,8 +1514,8 @@
//
// fix position to account for round off during moving
//
- ob->x = ((long)ob->tilex<<TILESHIFT)+TILEGLOBAL/2;
- ob->y = ((long)ob->tiley<<TILESHIFT)+TILEGLOBAL/2;
+ ob->x = ((s32int)ob->tilex<<TILESHIFT)+TILEGLOBAL/2;
+ ob->y = ((s32int)ob->tiley<<TILESHIFT)+TILEGLOBAL/2;
move -= ob->distance;
@@ -1598,9 +1598,9 @@
===============
*/
-void SpawnDeath (int tilex, int tiley)
+void SpawnDeath (s16int tilex, s16int tiley)
{
- unsigned far *map,tile;
+ u16int far *map,tile;
if (SoundBlasterPresent && DigiMode != sds_Off)
s_deathdie2.tictime = 105;
@@ -1623,9 +1623,9 @@
void T_Launch (objtype *ob)
{
- long deltax,deltay;
+ s32int deltax,deltay;
float angle;
- int iangle;
+ s16int iangle;
deltax = player->x - ob->x;
deltay = ob->y - player->y;
@@ -1791,9 +1791,9 @@
===============
*/
-void SpawnAngel (int tilex, int tiley)
+void SpawnAngel (s16int tilex, s16int tiley)
{
- unsigned far *map,tile;
+ u16int far *map,tile;
if (SoundBlasterPresent && DigiMode != sds_Off)
@@ -1910,9 +1910,9 @@
===============
*/
-void SpawnSpectre (int tilex, int tiley)
+void SpawnSpectre (s16int tilex, s16int tiley)
{
- unsigned far *map,tile;
+ u16int far *map,tile;
SpawnNewObj (tilex,tiley,&s_spectrewait1);
new->obclass = spectreobj;
@@ -1933,10 +1933,10 @@
void A_Dormant (objtype *ob)
{
- long deltax,deltay;
- int xl,xh,yl,yh;
- int x,y;
- unsigned tile;
+ s32int deltax,deltay;
+ s16int xl,xh,yl,yh;
+ s16int x,y;
+ u16int tile;
deltax = ob->x - player->x;
if (deltax < -MINACTORDIST || deltax > MINACTORDIST)
@@ -1991,9 +1991,9 @@
===============
*/
-void SpawnGhosts (int which, int tilex, int tiley)
+void SpawnGhosts (s16int which, s16int tilex, s16int tiley)
{
- unsigned far *map,tile;
+ u16int far *map,tile;
switch(which)
{
@@ -2209,9 +2209,9 @@
===============
*/
-void SpawnSchabbs (int tilex, int tiley)
+void SpawnSchabbs (s16int tilex, s16int tiley)
{
- unsigned far *map,tile;
+ u16int far *map,tile;
if (DigiMode != sds_Off)
s_schabbdie2.tictime = 140;
@@ -2238,9 +2238,9 @@
===============
*/
-void SpawnGift (int tilex, int tiley)
+void SpawnGift (s16int tilex, s16int tiley)
{
- unsigned far *map,tile;
+ u16int far *map,tile;
if (DigiMode != sds_Off)
s_giftdie2.tictime = 140;
@@ -2267,9 +2267,9 @@
===============
*/
-void SpawnFat (int tilex, int tiley)
+void SpawnFat (s16int tilex, s16int tiley)
{
- unsigned far *map,tile;
+ u16int far *map,tile;
if (DigiMode != sds_Off)
s_fatdie2.tictime = 140;
@@ -2298,9 +2298,9 @@
void T_SchabbThrow (objtype *ob)
{
- long deltax,deltay;
+ s32int deltax,deltay;
float angle;
- int iangle;
+ s16int iangle;
deltax = player->x - ob->x;
deltay = ob->y - player->y;
@@ -2338,9 +2338,9 @@
void T_GiftThrow (objtype *ob)
{
- long deltax,deltay;
+ s32int deltax,deltay;
float angle;
- int iangle;
+ s16int iangle;
deltax = player->x - ob->x;
deltay = ob->y - player->y;
@@ -2379,9 +2379,9 @@
void T_Schabb (objtype *ob)
{
- long move;
- int dx,dy,dist;
- boolean dodge;
+ s32int move;
+ s16int dx,dy,dist;
+ int dodge;
dodge = false;
dx = abs(ob->tilex - player->tilex);
@@ -2440,8 +2440,8 @@
//
// fix position to account for round off during moving
//
- ob->x = ((long)ob->tilex<<TILESHIFT)+TILEGLOBAL/2;
- ob->y = ((long)ob->tiley<<TILESHIFT)+TILEGLOBAL/2;
+ ob->x = ((s32int)ob->tilex<<TILESHIFT)+TILEGLOBAL/2;
+ ob->y = ((s32int)ob->tiley<<TILESHIFT)+TILEGLOBAL/2;
move -= ob->distance;
@@ -2471,9 +2471,9 @@
void T_Gift (objtype *ob)
{
- long move;
- int dx,dy,dist;
- boolean dodge;
+ s32int move;
+ s16int dx,dy,dist;
+ int dodge;
dodge = false;
dx = abs(ob->tilex - player->tilex);
@@ -2532,8 +2532,8 @@
//
// fix position to account for round off during moving
//
- ob->x = ((long)ob->tilex<<TILESHIFT)+TILEGLOBAL/2;
- ob->y = ((long)ob->tiley<<TILESHIFT)+TILEGLOBAL/2;
+ ob->x = ((s32int)ob->tilex<<TILESHIFT)+TILEGLOBAL/2;
+ ob->y = ((s32int)ob->tiley<<TILESHIFT)+TILEGLOBAL/2;
move -= ob->distance;
@@ -2563,9 +2563,9 @@
void T_Fat (objtype *ob)
{
- long move;
- int dx,dy,dist;
- boolean dodge;
+ s32int move;
+ s16int dx,dy,dist;
+ int dodge;
dodge = false;
dx = abs(ob->tilex - player->tilex);
@@ -2624,8 +2624,8 @@
//
// fix position to account for round off during moving
//
- ob->x = ((long)ob->tilex<<TILESHIFT)+TILEGLOBAL/2;
- ob->y = ((long)ob->tiley<<TILESHIFT)+TILEGLOBAL/2;
+ ob->x = ((s32int)ob->tilex<<TILESHIFT)+TILEGLOBAL/2;
+ ob->y = ((s32int)ob->tiley<<TILESHIFT)+TILEGLOBAL/2;
move -= ob->distance;
@@ -2823,9 +2823,9 @@
===============
*/
-void SpawnFakeHitler (int tilex, int tiley)
+void SpawnFakeHitler (s16int tilex, s16int tiley)
{
- unsigned far *map,tile;
+ u16int far *map,tile;
if (DigiMode != sds_Off)
@@ -2853,9 +2853,9 @@
===============
*/
-void SpawnHitler (int tilex, int tiley)
+void SpawnHitler (s16int tilex, s16int tiley)
{
- unsigned far *map,tile;
+ u16int far *map,tile;
if (DigiMode != sds_Off)
s_hitlerdie2.tictime = 140;
@@ -2885,7 +2885,7 @@
void A_HitlerMorph (objtype *ob)
{
- unsigned far *map,tile,hitpoints[4]={500,700,800,900};
+ u16int far *map,tile,hitpoints[4]={500,700,800,900};
SpawnNewObj (ob->tilex,ob->tiley,&s_hitlerchase1);
@@ -2932,9 +2932,9 @@
void T_FakeFire (objtype *ob)
{
- long deltax,deltay;
+ s32int deltax,deltay;
float angle;
- int iangle;
+ s16int iangle;
deltax = player->x - ob->x;
deltay = ob->y - player->y;
@@ -2973,9 +2973,9 @@
void T_Fake (objtype *ob)
{
- long move;
- int dx,dy,dist;
- boolean dodge;
+ s32int move;
+ s16int dx,dy,dist;
+ int dodge;
if (CheckLine(ob)) // got a shot at player?
{
@@ -3013,8 +3013,8 @@
//
// fix position to account for round off during moving
//
- ob->x = ((long)ob->tilex<<TILESHIFT)+TILEGLOBAL/2;
- ob->y = ((long)ob->tiley<<TILESHIFT)+TILEGLOBAL/2;
+ ob->x = ((s32int)ob->tilex<<TILESHIFT)+TILEGLOBAL/2;
+ ob->y = ((s32int)ob->tiley<<TILESHIFT)+TILEGLOBAL/2;
move -= ob->distance;
@@ -3068,9 +3068,9 @@
void T_Chase (objtype *ob)
{
- long move;
- int dx,dy,dist,chance;
- boolean dodge;
+ s32int move;
+ s16int dx,dy,dist,chance;
+ int dodge;
if (gamestate.victoryflag)
return;
@@ -3179,8 +3179,8 @@
//
// fix position to account for round off during moving
//
- ob->x = ((long)ob->tilex<<TILESHIFT)+TILEGLOBAL/2;
- ob->y = ((long)ob->tiley<<TILESHIFT)+TILEGLOBAL/2;
+ ob->x = ((s32int)ob->tilex<<TILESHIFT)+TILEGLOBAL/2;
+ ob->y = ((s32int)ob->tiley<<TILESHIFT)+TILEGLOBAL/2;
move -= ob->distance;
@@ -3206,7 +3206,7 @@
void T_Ghosts (objtype *ob)
{
- long move;
+ s32int move;
if (ob->dir == nodir)
@@ -3233,8 +3233,8 @@
//
// fix position to account for round off during moving
//
- ob->x = ((long)ob->tilex<<TILESHIFT)+TILEGLOBAL/2;
- ob->y = ((long)ob->tiley<<TILESHIFT)+TILEGLOBAL/2;
+ ob->x = ((s32int)ob->tilex<<TILESHIFT)+TILEGLOBAL/2;
+ ob->y = ((s32int)ob->tiley<<TILESHIFT)+TILEGLOBAL/2;
move -= ob->distance;
@@ -3256,9 +3256,9 @@
void T_DogChase (objtype *ob)
{
- long move;
- int dist,chance;
- long dx,dy;
+ s32int move;
+ s16int dist,chance;
+ s32int dx,dy;
if (ob->dir == nodir)
@@ -3305,8 +3305,8 @@
//
// fix position to account for round off during moving
//
- ob->x = ((long)ob->tilex<<TILESHIFT)+TILEGLOBAL/2;
- ob->y = ((long)ob->tiley<<TILESHIFT)+TILEGLOBAL/2;
+ ob->x = ((s32int)ob->tilex<<TILESHIFT)+TILEGLOBAL/2;
+ ob->y = ((s32int)ob->tiley<<TILESHIFT)+TILEGLOBAL/2;
move -= ob->distance;
@@ -3339,7 +3339,7 @@
void SelectPathDir (objtype *ob)
{
- unsigned spot;
+ u16int spot;
spot = MAPSPOT(ob->tilex,ob->tiley,1)-ICONARROWS;
@@ -3366,8 +3366,8 @@
void T_Path (objtype *ob)
{
- long move;
- long deltax,deltay,size;
+ s32int move;
+ s32int deltax,deltay,size;
if (SightPlayer (ob))
return;
@@ -3410,8 +3410,8 @@
- ob->x = ((long)ob->tilex<<TILESHIFT)+TILEGLOBAL/2;
- ob->y = ((long)ob->tiley<<TILESHIFT)+TILEGLOBAL/2;
+ ob->x = ((s32int)ob->tilex<<TILESHIFT)+TILEGLOBAL/2;
+ ob->y = ((s32int)ob->tiley<<TILESHIFT)+TILEGLOBAL/2;
move -= ob->distance;
SelectPathDir (ob);
@@ -3443,8 +3443,8 @@
void T_Shoot (objtype *ob)
{
- int dx,dy,dist;
- int hitchance,damage;
+ s16int dx,dy,dist;
+ s16int hitchance,damage;
hitchance = 128;
@@ -3529,8 +3529,8 @@
void T_Bite (objtype *ob)
{
- long dx,dy;
- int hitchance,damage;
+ s32int dx,dy;
+ s16int hitchance,damage;
PlaySoundLocActor(DOGATTACKSND,ob); // JAB
@@ -3620,7 +3620,7 @@
void SpawnBJVictory (void)
{
- unsigned far *map,tile;
+ u16int far *map,tile;
SpawnNewObj (player->tilex,player->tiley+1,&s_bjrun1);
new->x = player->x;
@@ -3642,7 +3642,7 @@
void T_BJRun (objtype *ob)
{
- long move;
+ s32int move;
move = BJRUNSPEED*tics;
@@ -3655,8 +3655,8 @@
}
- ob->x = ((long)ob->tilex<<TILESHIFT)+TILEGLOBAL/2;
- ob->y = ((long)ob->tiley<<TILESHIFT)+TILEGLOBAL/2;
+ ob->x = ((s32int)ob->tilex<<TILESHIFT)+TILEGLOBAL/2;
+ ob->y = ((s32int)ob->tiley<<TILESHIFT)+TILEGLOBAL/2;
move -= ob->distance;
SelectPathDir (ob);
@@ -3680,7 +3680,7 @@
void T_BJJump (objtype *ob)
{
- long move;
+ s32int move;
move = BJJUMPSPEED*tics;
MoveObj (ob,move);
@@ -3728,9 +3728,9 @@
===============
*/
-boolean CheckPosition (objtype *ob)
+int CheckPosition (objtype *ob)
{
- int x,y,xl,yl,xh,yh;
+ s16int x,y,xl,yl,xh,yh;
objtype *check;
xl = (ob->x-PLAYERSIZE) >>TILESHIFT;
@@ -3764,11 +3764,11 @@
void A_StartDeathCam (objtype *ob)
{
- long dx,dy;
+ s32int dx,dy;
float fangle;
- long xmove,ymove;
- long dist;
- int temp,i;
+ s32int xmove,ymove;
+ s32int dist;
+ s16int temp,i;
FinishPaletteShifts ();
@@ -3832,7 +3832,7 @@
dist += 0x1000;
} while (!CheckPosition (player));
- plux = player->x >> UNSIGNEDSHIFT; // scale to fit in unsigned
+ plux = player->x >> UNSIGNEDSHIFT; // scale to fit in u16int
pluy = player->y >> UNSIGNEDSHIFT;
player->tilex = player->x >> TILESHIFT; // scale to tile values
player->tiley = player->y >> TILESHIFT;
--- a/agent.c
+++ b/agent.c
@@ -32,13 +32,13 @@
//
// player state info
//
-boolean running;
-long thrustspeed;
+int running;
+s32int thrustspeed;
-unsigned plux,pluy; // player coordinates scaled to unsigned
+u16int plux,pluy; // player coordinates scaled to u16int
-int anglefrac;
-int gotgatgun; // JR
+s16int anglefrac;
+s16int gotgatgun; // JR
objtype *LastAttacker;
@@ -58,7 +58,7 @@
statetype s_attack = {false,0,0,T_Attack,NULL,NULL};
-long playerxmove,playerymove;
+s32int playerxmove,playerymove;
struct atkinf
{
@@ -73,11 +73,11 @@
};
-int strafeangle[9] = {0,90,180,270,45,135,225,315,0};
+s16int strafeangle[9] = {0,90,180,270,45,135,225,315,0};
void DrawWeapon (void);
-void GiveWeapon (int weapon);
-void GiveAmmo (int ammo);
+void GiveWeapon (s16int weapon);
+void GiveAmmo (s16int ammo);
//===========================================================================
@@ -91,10 +91,10 @@
//----------
-boolean TryMove (objtype *ob);
+int TryMove (objtype *ob);
void T_Player (objtype *ob);
-void ClipMove (objtype *ob, long xmove, long ymove);
+void ClipMove (objtype *ob, s32int xmove, s32int ymove);
/*
=============================================================================
@@ -116,7 +116,7 @@
void CheckWeaponChange (void)
{
- int i,buttons;
+ s16int i,buttons;
if (!gamestate.ammo) // must use knife with no ammo
return;
@@ -148,10 +148,10 @@
void ControlMovement (objtype *ob)
{
- long oldx,oldy;
- int angle,maxxmove;
- int angleunits;
- long speed;
+ s32int oldx,oldy;
+ s16int angle,maxxmove;
+ s16int angleunits;
+ s32int speed;
thrustspeed = 0;
@@ -241,9 +241,9 @@
==================
*/
-void StatusDrawPic (unsigned x, unsigned y, unsigned picnum)
+void StatusDrawPic (u16int x, u16int y, u16int picnum)
{
- unsigned temp;
+ u16int temp;
temp = bufferofs;
bufferofs = 0;
@@ -302,7 +302,7 @@
#define FACETICS 70
-int facecount;
+s16int facecount;
void UpdateFace (void)
{
@@ -334,9 +334,9 @@
===============
*/
-void LatchNumber (int x, int y, int width, long number)
+void LatchNumber (s16int x, s16int y, s16int width, s32int number)
{
- unsigned length,c;
+ u16int length,c;
char str[20];
ltoa (number,str,10);
@@ -383,7 +383,7 @@
===============
*/
-void TakeDamage (int points,objtype *attacker)
+void TakeDamage (s16int points,objtype *attacker)
{
LastAttacker = attacker;
@@ -431,7 +431,7 @@
===============
*/
-void HealSelf (int points)
+void HealSelf (s16int points)
{
gamestate.health += points;
if (gamestate.health>100)
@@ -520,7 +520,7 @@
===============
*/
-void GivePoints (long points)
+void GivePoints (s32int points)
{
gamestate.score += points;
while (gamestate.score >= gamestate.nextextra)
@@ -578,7 +578,7 @@
==================
*/
-void GiveWeapon (int weapon)
+void GiveWeapon (s16int weapon)
{
GiveAmmo (6);
@@ -614,7 +614,7 @@
===============
*/
-void GiveAmmo (int ammo)
+void GiveAmmo (s16int ammo)
{
if (!gamestate.ammo) // knife was out
{
@@ -640,7 +640,7 @@
==================
*/
-void GiveKey (int key)
+void GiveKey (s16int key)
{
gamestate.keys |= (1<<key);
DrawKeys ();
@@ -798,11 +798,11 @@
===================
*/
-boolean TryMove (objtype *ob)
+int TryMove (objtype *ob)
{
- int xl,yl,xh,yh,x,y;
+ s16int xl,yl,xh,yh,x,y;
objtype *check;
- long deltax,deltay;
+ s32int deltax,deltay;
xl = (ob->x-PLAYERSIZE) >>TILESHIFT;
yl = (ob->y-PLAYERSIZE) >>TILESHIFT;
@@ -863,9 +863,9 @@
===================
*/
-void ClipMove (objtype *ob, long xmove, long ymove)
+void ClipMove (objtype *ob, s32int xmove, s32int ymove)
{
- long basex,basey;
+ s32int basex,basey;
basex = ob->x;
basey = ob->y;
@@ -876,8 +876,8 @@
return;
if (noclip && ob->x > 2*TILEGLOBAL && ob->y > 2*TILEGLOBAL &&
- ob->x < (((long)(mapwidth-1))<<TILESHIFT)
- && ob->y < (((long)(mapheight-1))<<TILESHIFT) )
+ ob->x < (((s32int)(mapwidth-1))<<TILESHIFT)
+ && ob->y < (((s32int)(mapheight-1))<<TILESHIFT) )
return; // walk through walls
if (!SD_SoundPlaying())
@@ -925,11 +925,11 @@
===================
*/
-void Thrust (int angle, long speed)
+void Thrust (s16int angle, s32int speed)
{
- long xmove,ymove;
- long slowmax;
- unsigned offset;
+ s32int xmove,ymove;
+ s32int slowmax;
+ u16int offset;
//
@@ -1008,8 +1008,8 @@
void Cmd_Use (void)
{
objtype *check;
- int checkx,checky,doornum,dir;
- boolean elevatorok;
+ s16int checkx,checky,doornum,dir;
+ int elevatorok;
//
@@ -1097,7 +1097,7 @@
===============
*/
-void SpawnPlayer (int tilex, int tiley, int dir)
+void SpawnPlayer (s16int tilex, s16int tiley, s16int dir)
{
player->obclass = playerobj;
player->active = true;
@@ -1105,8 +1105,8 @@
player->tiley = tiley;
player->areanumber =
*(mapsegs[0] + farmapylookup[player->tiley]+player->tilex);
- player->x = ((long)tilex<<TILESHIFT)+TILEGLOBAL/2;
- player->y = ((long)tiley<<TILESHIFT)+TILEGLOBAL/2;
+ player->x = ((s32int)tilex<<TILESHIFT)+TILEGLOBAL/2;
+ player->y = ((s32int)tiley<<TILESHIFT)+TILEGLOBAL/2;
player->state = &s_player;
player->angle = (1-dir)*90;
if (player->angle<0)
@@ -1133,7 +1133,7 @@
void KnifeAttack (objtype *ob)
{
objtype *check,*closest;
- long dist;
+ s32int dist;
SD_PlaySound (ATKKNIFESND);
// actually fire
@@ -1168,9 +1168,9 @@
void GunAttack (objtype *ob)
{
objtype *check,*closest,*oldclosest;
- int damage;
- int dx,dy,dist;
- long viewdist;
+ s16int damage;
+ s16int dx,dy,dist;
+ s32int viewdist;
switch (gamestate.weapon)
{
@@ -1254,7 +1254,7 @@
void VictorySpin (void)
{
- long desty;
+ s32int desty;
if (player->angle > 270)
{
@@ -1269,7 +1269,7 @@
player->angle = 270;
}
- desty = (((long)player->tiley-5)<<TILESHIFT)-0x3000;
+ desty = (((s32int)player->tiley-5)<<TILESHIFT)-0x3000;
if (player->y > desty)
{
@@ -1312,7 +1312,7 @@
if (gamestate.victoryflag) // watching the BJ actor
return;
- plux = player->x >> UNSIGNEDSHIFT; // scale to fit in unsigned
+ plux = player->x >> UNSIGNEDSHIFT; // scale to fit in u16int
pluy = player->y >> UNSIGNEDSHIFT;
player->tilex = player->x >> TILESHIFT; // scale to tile values
player->tiley = player->y >> TILESHIFT;
@@ -1412,7 +1412,7 @@
return;
- plux = player->x >> UNSIGNEDSHIFT; // scale to fit in unsigned
+ plux = player->x >> UNSIGNEDSHIFT; // scale to fit in u16int
pluy = player->y >> UNSIGNEDSHIFT;
player->tilex = player->x >> TILESHIFT; // scale to tile values
player->tiley = player->y >> TILESHIFT;
--- a/ca.c
+++ b/ca.c
@@ -32,15 +32,15 @@
typedef struct
{
- unsigned bit0,bit1; // 0-255 is a character, > is a pointer to a node
+ u16int bit0,bit1; // 0-255 is a character, > is a pointer to a node
} huffnode;
typedef struct
{
- unsigned RLEWtag;
- long headeroffsets[100];
- byte tileinfo[];
+ u16int RLEWtag;
+ s32int headeroffsets[100];
+ u8int tileinfo[];
} mapfiletype;
@@ -52,18 +52,18 @@
=============================================================================
*/
-byte _seg *tinf;
-int mapon;
+u8int _seg *tinf;
+s16int mapon;
-unsigned _seg *mapsegs[MAPPLANES];
+u16int _seg *mapsegs[MAPPLANES];
maptype _seg *mapheaderseg[NUMMAPS];
-byte _seg *audiosegs[NUMSNDCHUNKS];
+u8int _seg *audiosegs[NUMSNDCHUNKS];
void _seg *grsegs[NUMCHUNKS];
-byte far grneeded[NUMCHUNKS];
-byte ca_levelbit,ca_levelnum;
+u8int far grneeded[NUMCHUNKS];
+u8int ca_levelbit,ca_levelnum;
-int profilehandle,debughandle;
+s16int profilehandle,debughandle;
char audioname[13]="AUDIO.";
@@ -75,14 +75,14 @@
=============================================================================
*/
-extern long far CGAhead;
-extern long far EGAhead;
-extern byte CGAdict;
-extern byte EGAdict;
-extern byte far maphead;
-extern byte mapdict;
-extern byte far audiohead;
-extern byte audiodict;
+extern s32int far CGAhead;
+extern s32int far EGAhead;
+extern u8int CGAdict;
+extern u8int EGAdict;
+extern u8int far maphead;
+extern u8int mapdict;
+extern u8int far audiohead;
+extern u8int audiodict;
char extension[5], // Need a string, not constant to change cache files
@@ -96,8 +96,8 @@
void CA_CannotOpen(char *string);
-long _seg *grstarts; // array of offsets in egagraph, -1 for sparse
-long _seg *audiostarts; // array of offsets in audio / audiot
+s32int _seg *grstarts; // array of offsets in egagraph, -1 for sparse
+s32int _seg *audiostarts; // array of offsets in audio / audiot
#ifdef GRHEADERLINKED
huffnode *grhuffman;
@@ -112,31 +112,31 @@
#endif
-int grhandle; // handle to EGAGRAPH
-int maphandle; // handle to MAPTEMP / GAMEMAPS
-int audiohandle; // handle to AUDIOT / AUDIO
+s16int grhandle; // handle to EGAGRAPH
+s16int maphandle; // handle to MAPTEMP / GAMEMAPS
+s16int audiohandle; // handle to AUDIOT / AUDIO
-long chunkcomplen,chunkexplen;
+s32int chunkcomplen,chunkexplen;
SDMode oldsoundmode;
-void CAL_CarmackExpand (unsigned far *source, unsigned far *dest,
- unsigned length);
+void CAL_CarmackExpand (u16int far *source, u16int far *dest,
+ u16int length);
#ifdef THREEBYTEGRSTARTS
#define FILEPOSSIZE 3
-//#define GRFILEPOS(c) (*(long far *)(((byte far *)grstarts)+(c)*3)&0xffffff)
-long GRFILEPOS(int c)
+//#define GRFILEPOS(c) (*(s32int far *)(((u8int far *)grstarts)+(c)*3)&0xffffff)
+s32int GRFILEPOS(s16int c)
{
- long value;
- int offset;
+ s32int value;
+ s16int offset;
offset = c*3;
- value = *(long far *)(((byte far *)grstarts)+offset);
+ value = *(s32int far *)(((u8int far *)grstarts)+offset);
value &= 0x00ffffffl;
@@ -192,7 +192,7 @@
============================
*/
-void CAL_GetGrChunkLength (int chunk)
+void CAL_GetGrChunkLength (s16int chunk)
{
lseek(grhandle,GRFILEPOS(chunk),SEEK_SET);
read(grhandle,&chunkexplen,sizeof(chunkexplen));
@@ -210,7 +210,7 @@
==========================
*/
-boolean CA_FarRead (int handle, byte far *dest, long length)
+int CA_FarRead (s16int handle, u8int far *dest, s32int length)
{
if (length>0xffffl)
Quit ("CA_FarRead doesn't support 64K reads yet!");
@@ -246,7 +246,7 @@
==========================
*/
-boolean CA_FarWrite (int handle, byte far *source, long length)
+int CA_FarWrite (s16int handle, u8int far *source, s32int length)
{
if (length>0xffffl)
Quit ("CA_FarWrite doesn't support 64K reads yet!");
@@ -283,10 +283,10 @@
==========================
*/
-boolean CA_ReadFile (char *filename, memptr *ptr)
+int CA_ReadFile (char *filename, uchar **ptr)
{
- int handle;
- long size;
+ s16int handle;
+ s32int size;
if ((handle = open(filename,O_RDONLY | O_BINARY, S_IREAD)) == -1)
return false;
@@ -312,10 +312,10 @@
==========================
*/
-boolean CA_WriteFile (char *filename, void far *ptr, long length)
+int CA_WriteFile (char *filename, void far *ptr, s32int length)
{
- int handle;
- long size;
+ s16int handle;
+ s32int size;
handle = open(filename,O_CREAT | O_BINARY | O_WRONLY,
S_IREAD | S_IWRITE | S_IFREG);
@@ -344,10 +344,10 @@
==========================
*/
-boolean CA_LoadFile (char *filename, memptr *ptr)
+int CA_LoadFile (char *filename, uchar **ptr)
{
- int handle;
- long size;
+ s16int handle;
+ s32int size;
if ((handle = open(filename,O_RDONLY | O_BINARY, S_IREAD)) == -1)
return false;
@@ -387,7 +387,7 @@
void CAL_OptimizeNodes (huffnode *table)
{
huffnode *node;
- int i;
+ s16int i;
node = table;
@@ -394,9 +394,9 @@
for (i=0;i<255;i++)
{
if (node->bit0 >= 256)
- node->bit0 = (unsigned)(table+(node->bit0-256));
+ node->bit0 = (u16int)(table+(node->bit0-256));
if (node->bit1 >= 256)
- node->bit1 = (unsigned)(table+(node->bit1-256));
+ node->bit1 = (u16int)(table+(node->bit1-256));
node++;
}
}
@@ -415,13 +415,13 @@
======================
*/
-void CAL_HuffExpand (byte huge *source, byte huge *dest,
- long length,huffnode *hufftable, boolean screenhack)
+void CAL_HuffExpand (u8int huge *source, u8int huge *dest,
+ s32int length,huffnode *hufftable, int screenhack)
{
-// unsigned bit,byte,node,code;
- unsigned sourceseg,sourceoff,destseg,destoff,endoff;
+// u16int bit,byte,node,code;
+ u16int sourceseg,sourceoff,destseg,destoff,endoff;
huffnode *headptr;
- byte mapmask;
+ u8int mapmask;
// huffnode *nodeon;
headptr = hufftable+254; // head node is allways node 254
@@ -606,10 +606,10 @@
#define NEARTAG 0xa7
#define FARTAG 0xa8
-void CAL_CarmackExpand (unsigned far *source, unsigned far *dest, unsigned length)
+void CAL_CarmackExpand (u16int far *source, u16int far *dest, u16int length)
{
- unsigned ch,chhigh,count,offset;
- unsigned far *copyptr, far *inptr, far *outptr;
+ u16int ch,chhigh,count,offset;
+ u16int far *copyptr, far *inptr, far *outptr;
length/=2;
@@ -625,13 +625,13 @@
count = ch&0xff;
if (!count)
{ // have to insert a word containing the tag byte
- ch |= *((unsigned char far *)inptr)++;
+ ch |= *((uchar far *)inptr)++;
*outptr++ = ch;
length--;
}
else
{
- offset = *((unsigned char far *)inptr)++;
+ offset = *((uchar far *)inptr)++;
copyptr = outptr - offset;
length -= count;
while (count--)
@@ -643,7 +643,7 @@
count = ch&0xff;
if (!count)
{ // have to insert a word containing the tag byte
- ch |= *((unsigned char far *)inptr)++;
+ ch |= *((uchar far *)inptr)++;
*outptr++ = ch;
length --;
}
@@ -674,12 +674,12 @@
======================
*/
-long CA_RLEWCompress (unsigned huge *source, long length, unsigned huge *dest,
- unsigned rlewtag)
+s32int CA_RLEWCompress (u16int huge *source, s32int length, u16int huge *dest,
+ u16int rlewtag)
{
- long complength;
- unsigned value,count,i;
- unsigned huge *start,huge *end;
+ s32int complength;
+ u16int value,count,i;
+ u16int huge *start,huge *end;
start = dest;
@@ -731,12 +731,12 @@
======================
*/
-void CA_RLEWexpand (unsigned huge *source, unsigned huge *dest,long length,
- unsigned rlewtag)
+void CA_RLEWexpand (u16int huge *source, u16int huge *dest,s32int length,
+ u16int rlewtag)
{
-// unsigned value,count,i;
- unsigned huge *end;
- unsigned sourceseg,sourceoff,destseg,destoff,endseg,endoff;
+// u16int value,count,i;
+ u16int huge *end;
+ u16int sourceseg,sourceoff,destseg,destoff,endseg,endoff;
//
@@ -861,13 +861,13 @@
void CAL_SetupGrFile (void)
{
char fname[13];
- int handle;
- memptr compseg;
+ s16int handle;
+ uchar *compseg;
#ifdef GRHEADERLINKED
grhuffman = (huffnode *)&EGAdict;
- grstarts = (long _seg *)FP_SEG(&EGAhead);
+ grstarts = (s32int _seg *)FP_SEG(&EGAhead);
CAL_OptimizeNodes (grhuffman);
@@ -890,7 +890,7 @@
//
// load the data offsets from ???head.ext
//
- MM_GetPtr (&(memptr)grstarts,(NUMCHUNKS+1)*FILEPOSSIZE);
+ MM_GetPtr (&(uchar *)grstarts,(NUMCHUNKS+1)*FILEPOSSIZE);
strcpy(fname,gheadname);
strcat(fname,extension);
@@ -899,7 +899,7 @@
O_RDONLY | O_BINARY, S_IREAD)) == -1)
CA_CannotOpen(fname);
- CA_FarRead(handle, (memptr)grstarts, (NUMCHUNKS+1)*FILEPOSSIZE);
+ CA_FarRead(handle, (uchar *)grstarts, (NUMCHUNKS+1)*FILEPOSSIZE);
close(handle);
@@ -920,11 +920,11 @@
//
// load the pic and sprite headers into the arrays in the data segment
//
- MM_GetPtr(&(memptr)pictable,NUMPICS*sizeof(pictabletype));
+ MM_GetPtr(&(uchar *)pictable,NUMPICS*sizeof(pictabletype));
CAL_GetGrChunkLength(STRUCTPIC); // position file pointer
MM_GetPtr(&compseg,chunkcomplen);
CA_FarRead (grhandle,compseg,chunkcomplen);
- CAL_HuffExpand (compseg, (byte huge *)pictable,NUMPICS*sizeof(pictabletype),grhuffman,false);
+ CAL_HuffExpand (compseg, (u8int huge *)pictable,NUMPICS*sizeof(pictabletype),grhuffman,false);
MM_FreePtr(&compseg);
}
@@ -941,9 +941,9 @@
void CAL_SetupMapFile (void)
{
- int i;
- int handle;
- long length,pos;
+ s16int i;
+ s16int handle;
+ s32int length,pos;
char fname[13];
//
@@ -958,12 +958,12 @@
CA_CannotOpen(fname);
length = filelength(handle);
- MM_GetPtr (&(memptr)tinf,length);
+ MM_GetPtr (&(uchar *)tinf,length);
CA_FarRead(handle, tinf, length);
close(handle);
#else
- tinf = (byte _seg *)FP_SEG(&maphead);
+ tinf = (u8int _seg *)FP_SEG(&maphead);
#endif
@@ -995,10 +995,10 @@
if (pos<0) // $FFFFFFFF start is a sparse map
continue;
- MM_GetPtr(&(memptr)mapheaderseg[i],sizeof(maptype));
- MM_SetLock(&(memptr)mapheaderseg[i],true);
+ MM_GetPtr(&(uchar *)mapheaderseg[i],sizeof(maptype));
+ MM_SetLock(&(uchar *)mapheaderseg[i],true);
lseek(maphandle,pos,SEEK_SET);
- CA_FarRead (maphandle,(memptr)mapheaderseg[i],sizeof(maptype));
+ CA_FarRead (maphandle,(uchar *)mapheaderseg[i],sizeof(maptype));
}
//
@@ -1006,8 +1006,8 @@
//
for (i=0;i<MAPPLANES;i++)
{
- MM_GetPtr (&(memptr)mapsegs[i],64*64*2);
- MM_SetLock (&(memptr)mapsegs[i],true);
+ MM_GetPtr (&(uchar *)mapsegs[i],64*64*2);
+ MM_SetLock (&(uchar *)mapsegs[i],true);
}
}
@@ -1025,8 +1025,8 @@
void CAL_SetupAudioFile (void)
{
- int handle;
- long length;
+ s16int handle;
+ s32int length;
char fname[13];
//
@@ -1041,13 +1041,13 @@
CA_CannotOpen(fname);
length = filelength(handle);
- MM_GetPtr (&(memptr)audiostarts,length);
- CA_FarRead(handle, (byte far *)audiostarts, length);
+ MM_GetPtr (&(uchar *)audiostarts,length);
+ CA_FarRead(handle, (u8int far *)audiostarts, length);
close(handle);
#else
audiohuffman = (huffnode *)&audiodict;
CAL_OptimizeNodes (audiohuffman);
- audiostarts = (long _seg *)FP_SEG(&audiohead);
+ audiostarts = (s32int _seg *)FP_SEG(&audiohead);
#endif
//
@@ -1131,18 +1131,18 @@
======================
*/
-void CA_CacheAudioChunk (int chunk)
+void CA_CacheAudioChunk (s16int chunk)
{
- long pos,compressed;
+ s32int pos,compressed;
#ifdef AUDIOHEADERLINKED
- long expanded;
- memptr bigbufferseg;
- byte far *source;
+ s32int expanded;
+ uchar *bigbufferseg;
+ u8int far *source;
#endif
if (audiosegs[chunk])
{
- MM_SetPurge (&(memptr)audiosegs[chunk],0);
+ MM_SetPurge (&(uchar *)audiosegs[chunk],0);
return; // allready in memory
}
@@ -1157,7 +1157,7 @@
#ifndef AUDIOHEADERLINKED
- MM_GetPtr (&(memptr)audiosegs[chunk],compressed);
+ MM_GetPtr (&(uchar *)audiosegs[chunk],compressed);
if (mmerror)
return;
@@ -1180,9 +1180,9 @@
source = bigbufferseg;
}
- expanded = *(long far *)source;
+ expanded = *(s32int far *)source;
source += 4; // skip over length
- MM_GetPtr (&(memptr)audiosegs[chunk],expanded);
+ MM_GetPtr (&(uchar *)audiosegs[chunk],expanded);
if (mmerror)
goto done;
CAL_HuffExpand (source,audiosegs[chunk],expanded,audiohuffman,false);
@@ -1207,7 +1207,7 @@
void CA_LoadAllSounds (void)
{
- unsigned start,i;
+ u16int start,i;
switch (oldsoundmode)
{
@@ -1223,7 +1223,7 @@
for (i=0;i<NUMSOUNDS;i++,start++)
if (audiosegs[start])
- MM_SetPurge (&(memptr)audiosegs[start],3); // make purgable
+ MM_SetPurge (&(uchar *)audiosegs[start],3); // make purgable
cachein:
@@ -1258,9 +1258,9 @@
======================
*/
-void CAL_ExpandGrChunk (int chunk, byte far *source)
+void CAL_ExpandGrChunk (s16int chunk, u8int far *source)
{
- long expanded;
+ s32int expanded;
if (chunk >= STARTTILE8 && chunk < STARTEXTERNS)
@@ -1288,9 +1288,9 @@
else
{
//
- // everything else has an explicit size longword
+ // everything else has an explicit size u32int
//
- expanded = *(long far *)source;
+ expanded = *(s32int far *)source;
source += 4; // skip over length
}
@@ -1315,12 +1315,12 @@
======================
*/
-void CA_CacheGrChunk (int chunk)
+void CA_CacheGrChunk (s16int chunk)
{
- long pos,compressed;
- memptr bigbufferseg;
- byte far *source;
- int next;
+ s32int pos,compressed;
+ uchar *bigbufferseg;
+ u8int far *source;
+ s16int next;
grneeded[chunk] |= ca_levelbit; // make sure it doesn't get removed
if (grsegs[chunk])
@@ -1378,12 +1378,12 @@
======================
*/
-void CA_CacheScreen (int chunk)
+void CA_CacheScreen (s16int chunk)
{
- long pos,compressed,expanded;
- memptr bigbufferseg;
- byte far *source;
- int next;
+ s32int pos,compressed,expanded;
+ uchar *bigbufferseg;
+ u8int far *source;
+ s16int next;
//
// load the chunk into a buffer
@@ -1401,7 +1401,7 @@
CA_FarRead(grhandle,bigbufferseg,compressed);
source = bigbufferseg;
- expanded = *(long far *)source;
+ expanded = *(s32int far *)source;
source += 4; // skip over length
//
@@ -1425,16 +1425,16 @@
======================
*/
-void CA_CacheMap (int mapnum)
+void CA_CacheMap (s16int mapnum)
{
- long pos,compressed;
- int plane;
- memptr *dest,bigbufferseg;
- unsigned size;
- unsigned far *source;
+ s32int pos,compressed;
+ s16int plane;
+ uchar **dest,bigbufferseg;
+ u16int size;
+ u16int far *source;
#ifdef CARMACIZED
- memptr buffer2seg;
- long expanded;
+ uchar *buffer2seg;
+ s32int expanded;
#endif
mapon = mapnum;
@@ -1449,7 +1449,7 @@
pos = mapheaderseg[mapnum]->planestart[plane];
compressed = mapheaderseg[mapnum]->planelength[plane];
- dest = &(memptr)mapsegs[plane];
+ dest = &(uchar *)mapsegs[plane];
lseek(maphandle,pos,SEEK_SET);
if (compressed<=BUFFERSIZE)
@@ -1461,7 +1461,7 @@
source = bigbufferseg;
}
- CA_FarRead(maphandle,(byte far *)source,compressed);
+ CA_FarRead(maphandle,(u8int far *)source,compressed);
#ifdef CARMACIZED
//
// unhuffman, then unRLEW
@@ -1472,8 +1472,8 @@
expanded = *source;
source++;
MM_GetPtr (&buffer2seg,expanded);
- CAL_CarmackExpand (source, (unsigned far *)buffer2seg,expanded);
- CA_RLEWexpand (((unsigned far *)buffer2seg)+1,*dest,size,
+ CAL_CarmackExpand (source, (u16int far *)buffer2seg,expanded);
+ CA_RLEWexpand (((u16int far *)buffer2seg)+1,*dest,size,
((mapfiletype _seg *)tinf)->RLEWtag);
MM_FreePtr (&buffer2seg);
@@ -1505,7 +1505,7 @@
void CA_UpLevel (void)
{
- int i;
+ s16int i;
if (ca_levelnum==7)
Quit ("CA_UpLevel: Up past level 7!");
@@ -1512,7 +1512,7 @@
for (i=0;i<NUMCHUNKS;i++)
if (grsegs[i])
- MM_SetPurge (&(memptr)grsegs[i],3);
+ MM_SetPurge (&(uchar *)grsegs[i],3);
ca_levelbit<<=1;
ca_levelnum++;
}
@@ -1553,7 +1553,7 @@
void CA_ClearMarks (void)
{
- int i;
+ s16int i;
for (i=0;i<NUMCHUNKS;i++)
grneeded[i]&=~ca_levelbit;
@@ -1594,7 +1594,7 @@
void CA_SetGrPurge (void)
{
- int i;
+ s16int i;
//
// free graphics
@@ -1603,7 +1603,7 @@
for (i=0;i<NUMCHUNKS;i++)
if (grsegs[i])
- MM_SetPurge (&(memptr)grsegs[i],3);
+ MM_SetPurge (&(uchar *)grsegs[i],3);
}
@@ -1620,7 +1620,7 @@
void CA_SetAllPurge (void)
{
- int i;
+ s16int i;
//
@@ -1628,7 +1628,7 @@
//
for (i=0;i<NUMSNDCHUNKS;i++)
if (audiosegs[i])
- MM_SetPurge (&(memptr)audiosegs[i],3);
+ MM_SetPurge (&(uchar *)audiosegs[i],3);
//
// free graphics
@@ -1650,11 +1650,11 @@
void CA_CacheMarks (void)
{
- int i,next,numcache;
- long pos,endpos,nextpos,nextendpos,compressed;
- long bufferstart,bufferend; // file position of general buffer
- byte far *source;
- memptr bigbufferseg;
+ s16int i,next,numcache;
+ s32int pos,endpos,nextpos,nextendpos,compressed;
+ s32int bufferstart,bufferend; // file position of general buffer
+ u8int far *source;
+ uchar *bigbufferseg;
numcache = 0;
//
@@ -1703,7 +1703,7 @@
&& bufferend>= endpos)
{
// data is allready in buffer
- source = (byte _seg *)bufferseg+(pos-bufferstart);
+ source = (u8int _seg *)bufferseg+(pos-bufferstart);
}
else
{
--- a/ca.h
+++ b/ca.h
@@ -10,9 +10,9 @@
typedef struct
{
- long planestart[3];
- unsigned planelength[3];
- unsigned width,height;
+ s32int planestart[3];
+ u16int planelength[3];
+ u16int width,height;
char name[16];
} maptype;
@@ -20,20 +20,20 @@
extern char audioname[13];
-extern byte _seg *tinf;
-extern int mapon;
+extern u8int _seg *tinf;
+extern s16int mapon;
-extern unsigned _seg *mapsegs[MAPPLANES];
+extern u16int _seg *mapsegs[MAPPLANES];
extern maptype _seg *mapheaderseg[NUMMAPS];
-extern byte _seg *audiosegs[NUMSNDCHUNKS];
+extern u8int _seg *audiosegs[NUMSNDCHUNKS];
extern void _seg *grsegs[NUMCHUNKS];
-extern byte far grneeded[NUMCHUNKS];
-extern byte ca_levelbit,ca_levelnum;
+extern u8int far grneeded[NUMCHUNKS];
+extern u8int ca_levelbit,ca_levelnum;
extern char *titleptr[8];
-extern int profilehandle,debughandle;
+extern s16int profilehandle,debughandle;
extern char extension[5],
gheadname[10],
@@ -44,12 +44,12 @@
aheadname[10],
afilename[10];
-extern long _seg *grstarts; // array of offsets in egagraph, -1 for sparse
-extern long _seg *audiostarts; // array of offsets in audio / audiot
+extern s32int _seg *grstarts; // array of offsets in egagraph, -1 for sparse
+extern s32int _seg *audiostarts; // array of offsets in audio / audiot
//
// hooks for custom cache dialogs
//
-extern void (*drawcachebox) (char *title, unsigned numcache);
+extern void (*drawcachebox) (char *title, u16int numcache);
extern void (*updatecachebox) (void);
extern void (*finishcachebox) (void);
@@ -57,30 +57,30 @@
// just for the score box reshifting
-void CAL_ShiftSprite (unsigned segment,unsigned source,unsigned dest,
- unsigned width, unsigned height, unsigned pixshift);
+void CAL_ShiftSprite (u16int segment,u16int source,u16int dest,
+ u16int width, u16int height, u16int pixshift);
//===========================================================================
void CA_OpenDebug (void);
void CA_CloseDebug (void);
-boolean CA_FarRead (int handle, byte far *dest, long length);
-boolean CA_FarWrite (int handle, byte far *source, long length);
-boolean CA_ReadFile (char *filename, memptr *ptr);
-boolean CA_LoadFile (char *filename, memptr *ptr);
-boolean CA_WriteFile (char *filename, void far *ptr, long length);
+int CA_FarRead (s16int handle, u8int far *dest, s32int length);
+int CA_FarWrite (s16int handle, u8int far *source, s32int length);
+int CA_ReadFile (char *filename, uchar **ptr);
+int CA_LoadFile (char *filename, uchar **ptr);
+int CA_WriteFile (char *filename, void far *ptr, s32int length);
-long CA_RLEWCompress (unsigned huge *source, long length, unsigned huge *dest,
- unsigned rlewtag);
+s32int CA_RLEWCompress (u16int huge *source, s32int length, u16int huge *dest,
+ u16int rlewtag);
-void CA_RLEWexpand (unsigned huge *source, unsigned huge *dest,long length,
- unsigned rlewtag);
+void CA_RLEWexpand (u16int huge *source, u16int huge *dest,s32int length,
+ u16int rlewtag);
void CA_Startup (void);
void CA_Shutdown (void);
void CA_SetGrPurge (void);
-void CA_CacheAudioChunk (int chunk);
+void CA_CacheAudioChunk (s16int chunk);
void CA_LoadAllSounds (void);
void CA_UpLevel (void);
@@ -93,9 +93,9 @@
#define CA_MarkGrChunk(chunk) grneeded[chunk]|=ca_levelbit
-void CA_CacheGrChunk (int chunk);
-void CA_CacheMap (int mapnum);
+void CA_CacheGrChunk (s16int chunk);
+void CA_CacheMap (s16int mapnum);
void CA_CacheMarks (void);
-void CA_CacheScreen (int chunk);
+void CA_CacheScreen (s16int chunk);
--- a/debug.c
+++ b/debug.c
@@ -24,7 +24,7 @@
*/
-int DebugKeys (void);
+s16int DebugKeys (void);
/*
=============================================================================
@@ -35,8 +35,8 @@
*/
-int maporgx;
-int maporgy;
+s16int maporgx;
+s16int maporgy;
enum {mapview,tilemapview,actoratview,visview} viewtype;
void ViewMap (void);
@@ -53,9 +53,9 @@
void DebugMemory (void)
{
- int i;
+ s16int i;
char scratch[80],str[10];
- long mem;
+ s32int mem;
spritetype _seg *block;
CenterWindow (16,7);
@@ -85,7 +85,7 @@
void CountObjects (void)
{
- int i,total,count,active,inactive,doors;
+ s16int i,total,count,active,inactive,doors;
objtype *obj;
CenterWindow (16,7);
@@ -136,11 +136,11 @@
void PicturePause (void)
{
- int i;
- byte p;
- unsigned x;
- byte far *dest,far *src;
- memptr buffer;
+ s16int i;
+ u8int p;
+ u16int x;
+ u8int far *dest,far *src;
+ uchar *buffer;
VW_ColorBorder (15);
FinishPaletteShifts ();
@@ -166,7 +166,7 @@
for (p=0;p<4;p++)
{
src = MK_FP(0xa000,displayofs);
- dest = (byte far *)buffer+p;
+ dest = (u8int far *)buffer+p;
VGAREADMAP(p);
for (x=0;x<16000;x++,dest+=4)
*dest = *src++;
@@ -177,7 +177,7 @@
for (p=0;p<4;p++)
{
src = MK_FP(0xa000,0);
- dest = (byte far *)buffer+51200+p;
+ dest = (u8int far *)buffer+51200+p;
VGAREADMAP(p);
for (x=0;x<3200;x++,dest+=4)
*dest = *src++;
@@ -216,15 +216,15 @@
#pragma warn -pia
void ShapeTest (void)
{
-extern word NumDigi;
-extern word _seg *DigiList;
+extern u16int NumDigi;
+extern u16int _seg *DigiList;
static char buf[10];
- boolean done;
- ScanCode scan;
- int i,j,k,x;
- longword l;
- memptr addr;
+ int done;
+ u8int scan;
+ s16int i,j,k,x;
+ u32int l;
+ uchar *addr;
PageListStruct far *page;
CenterWindow(20,16);
@@ -268,7 +268,7 @@
US_Print("\n Address: ");
addr = PM_GetPageAddress(i);
- sprintf(buf,"0x%04x",(word)addr);
+ sprintf(buf,"0x%04x",(u16int)addr);
US_Print(buf);
if (addr)
@@ -281,7 +281,7 @@
bufferofs += 32*SCREENWIDTH;
postx = 128;
postwidth = 1;
- postsource = ((long)((unsigned)addr))<<16;
+ postsource = ((s32int)((u16int)addr))<<16;
for (x=0;x<64;x++,postx++,postsource+=64)
{
wallheight[postx] = 256;
@@ -314,7 +314,7 @@
}
else
{
- byte far *dp = (byte far *)MK_FP(addr,0);
+ u8int far *dp = (u8int far *)MK_FP(addr,0);
for (j = 0;j < NumDigi;j++)
{
k = (DigiList[(j * 2) + 1] + (PMPageSize - 1)) / PMPageSize;
@@ -335,8 +335,8 @@
}
for (j = 0;j < page->length;j += 32)
{
- byte v = dp[j];
- int v2 = (unsigned)v;
+ u8int v = dp[j];
+ s16int v2 = (u16int)v;
v2 -= 128;
v2 /= 4;
if (v2 < 0)
@@ -412,10 +412,10 @@
================
*/
-int DebugKeys (void)
+s16int DebugKeys (void)
{
- boolean esc;
- int level,i;
+ int esc;
+ s16int level,i;
if (Keyboard[sc_B]) // B = border color
{
@@ -610,8 +610,8 @@
void OverheadRefresh (void)
{
- unsigned x,y,endx,endy,sx,sy;
- unsigned tile;
+ u16int x,y,endx,endy,sx,sy;
+ u16int tile;
endx = maporgx+VIEWTILEX;
@@ -639,7 +639,7 @@
break;
#endif
case actoratview:
- tile = (unsigned)actorat[x][y];
+ tile = (u16int)actorat[x][y];
break;
}
@@ -668,7 +668,7 @@
void ViewMap (void)
{
- boolean button0held;
+ int button0held;
viewtype = actoratview;
// button0held = false;
--- a/def.h
+++ b/def.h
@@ -35,8 +35,8 @@
#define MAPSPOT(x,y,plane) (*(mapsegs[plane]+farmapylookup[y]+x))
#define SIGN(x) ((x)>0?1:-1)
-#define ABS(x) ((int)(x)>0?(x):-(x))
-#define LABS(x) ((long)(x)>0?(x):-(x))
+#define ABS(x) ((s16int)(x)>0?(x):-(x))
+#define LABS(x) ((s32int)(x)>0?(x):-(x))
/*
=============================================================================
@@ -477,8 +477,6 @@
=============================================================================
*/
-typedef long fixed;
-
typedef enum {
di_north,
di_east,
@@ -601,9 +599,9 @@
typedef struct statestruct
{
- boolean rotate;
- int shapenum; // a shapenum of -1 means get from ob->temp1
- int tictime;
+ int rotate;
+ s16int shapenum; // a shapenum of -1 means get from ob->temp1
+ s16int tictime;
void (*think) (),(*action) ();
struct statestruct *next;
} statetype;
@@ -617,11 +615,11 @@
typedef struct statstruct
{
- byte tilex,tiley;
- byte *visspot;
- int shapenum; // if shapenum == -1 the obj has been removed
- byte flags;
- byte itemnumber;
+ u8int tilex,tiley;
+ u8int *visspot;
+ s16int shapenum; // if shapenum == -1 the obj has been removed
+ u8int flags;
+ u8int itemnumber;
} statobj_t;
@@ -633,11 +631,11 @@
typedef struct doorstruct
{
- byte tilex,tiley;
- boolean vertical;
- byte lock;
+ u8int tilex,tiley;
+ int vertical;
+ u8int lock;
enum {dr_open,dr_closed,dr_opening,dr_closing} action;
- int ticcount;
+ s16int ticcount;
} doorobj_t;
@@ -650,28 +648,28 @@
typedef struct objstruct
{
activetype active;
- int ticcount;
+ s16int ticcount;
classtype obclass;
statetype *state;
- byte flags; // FL_SHOOTABLE, etc
+ u8int flags; // FL_SHOOTABLE, etc
- long distance; // if negative, wait for that door to open
+ s32int distance; // if negative, wait for that door to open
dirtype dir;
- fixed x,y;
- unsigned tilex,tiley;
- byte areanumber;
+ s32int x,y;
+ u16int tilex,tiley;
+ u8int areanumber;
- int viewx;
- unsigned viewheight;
- fixed transx,transy; // in global coord
+ s16int viewx;
+ u16int viewheight;
+ s32int transx,transy; // in global coord
- int angle;
- int hitpoints;
- long speed;
+ s16int angle;
+ s16int hitpoints;
+ s32int speed;
- int temp1,temp2,temp3;
+ s16int temp1,temp2,temp3;
struct objstruct *next,*prev;
} objtype;
@@ -714,23 +712,23 @@
typedef struct
{
- int difficulty;
- int mapon;
- long oldscore,score,nextextra;
- int lives;
- int health;
- int ammo;
- int keys;
+ s16int difficulty;
+ s16int mapon;
+ s32int oldscore,score,nextextra;
+ s16int lives;
+ s16int health;
+ s16int ammo;
+ s16int keys;
weapontype bestweapon,weapon,chosenweapon;
- int faceframe;
- int attackframe,attackcount,weaponframe;
+ s16int faceframe;
+ s16int attackframe,attackcount,weaponframe;
- int episode,secretcount,treasurecount,killcount,
+ s16int episode,secretcount,treasurecount,killcount,
secrettotal,treasuretotal,killtotal;
- long TimeCount;
- long killx,killy;
- boolean victoryflag; // set during victory animations
+ s32int TimeCount;
+ s32int killx,killy;
+ int victoryflag; // set during victory animations
} gametype;
@@ -756,41 +754,41 @@
=============================================================================
*/
-extern boolean MS_CheckParm (char far *string);
+extern int MS_CheckParm (char far *string);
extern char str[80],str2[20];
-extern int tedlevelnum;
-extern boolean tedlevel;
-extern boolean nospr;
-extern boolean IsA386;
+extern s16int tedlevelnum;
+extern int tedlevel;
+extern int nospr;
+extern int IsA386;
-extern byte far *scalermemory;
+extern u8int far *scalermemory;
-extern fixed focallength;
-extern unsigned viewangles;
-extern unsigned screenofs;
-extern int viewwidth;
-extern int viewheight;
-extern int centerx;
-extern int shootdelta;
+extern s32int focallength;
+extern u16int viewangles;
+extern u16int screenofs;
+extern s16int viewwidth;
+extern s16int viewheight;
+extern s16int centerx;
+extern s16int shootdelta;
-extern int dirangle[9];
+extern s16int dirangle[9];
-extern boolean startgame,loadedgame,virtualreality;
-extern int mouseadjustment;
+extern int startgame,loadedgame,virtualreality;
+extern s16int mouseadjustment;
//
// math tables
//
-extern int pixelangle[MAXVIEWWIDTH];
-extern long far finetangent[FINEANGLES/4];
-extern fixed far sintable[],far *costable;
+extern s16int pixelangle[MAXVIEWWIDTH];
+extern s32int far finetangent[FINEANGLES/4];
+extern s32int far sintable[],far *costable;
//
// derived constants
//
-extern fixed scale,maxslope;
-extern long heightnumerator;
-extern int minheightdiv;
+extern s32int scale,maxslope;
+extern s32int heightnumerator;
+extern s16int minheightdiv;
extern char configname[13];
@@ -800,13 +798,13 @@
void OrderingInfo (void);
void TEDDeath(void);
void Quit (char *error);
-void CalcProjection (long focal);
-boolean SetViewSize (unsigned width, unsigned height);
-void NewGame (int difficulty,int episode);
-void NewViewSize (int width);
-boolean LoadTheGame(int file,int x,int y);
-boolean SaveTheGame(int file,int x,int y);
-void ShowViewSize (int width);
+void CalcProjection (s32int focal);
+int SetViewSize (u16int width, u16int height);
+void NewGame (s16int difficulty,s16int episode);
+void NewViewSize (s16int width);
+int LoadTheGame(s16int file,s16int x,s16int y);
+int SaveTheGame(s16int file,s16int x,s16int y);
+void ShowViewSize (s16int width);
void ShutdownId (void);
@@ -819,16 +817,16 @@
*/
-extern boolean ingame,fizzlein;
-extern unsigned latchpics[NUMLATCHPICS];
+extern int ingame,fizzlein;
+extern u16int latchpics[NUMLATCHPICS];
extern gametype gamestate;
-extern int doornum;
+extern s16int doornum;
extern char demoname[13];
-extern long spearx,speary;
-extern unsigned spearangle;
-extern boolean spearflag;
+extern s32int spearx,speary;
+extern u16int spearangle;
+extern int spearflag;
void DrawPlayBorder (void);
@@ -839,7 +837,7 @@
void FizzleOut (void);
void GameLoop (void);
void ClearMemory (void);
-void PlayDemo (int demonumber);
+void PlayDemo (s16int demonumber);
void RecordDemo (void);
void DrawAllPlayBorder (void);
void DrawHighScores(void);
@@ -847,9 +845,9 @@
// JAB
-#define PlaySoundLocTile(s,tx,ty) PlaySoundLocGlobal(s,(((long)(tx) << TILESHIFT) + (1L << (TILESHIFT - 1))),(((long)ty << TILESHIFT) + (1L << (TILESHIFT - 1))))
+#define PlaySoundLocTile(s,tx,ty) PlaySoundLocGlobal(s,(((s32int)(tx) << TILESHIFT) + (1L << (TILESHIFT - 1))),(((s32int)ty << TILESHIFT) + (1L << (TILESHIFT - 1))))
#define PlaySoundLocActor(s,ob) PlaySoundLocGlobal(s,(ob)->x,(ob)->y)
-void PlaySoundLocGlobal(word s,fixed gx,fixed gy);
+void PlaySoundLocGlobal(u16int s,s32int gx,s32int gy);
void UpdateSoundLoc(void);
@@ -862,12 +860,12 @@
*/
#ifdef SPEAR
-extern long funnyticount; // FOR FUNNY BJ FACE
+extern s32int funnyticount; // FOR FUNNY BJ FACE
#endif
extern exit_t playstate;
-extern boolean madenoise;
+extern int madenoise;
extern objtype objlist[MAXACTORS],*new,*obj,*player,*lastobj,
*objfreelist,*killerobj;
@@ -874,42 +872,42 @@
extern statobj_t statobjlist[MAXSTATS],*laststatobj;
extern doorobj_t doorobjlist[MAXDOORS],*lastdoorobj;
-extern unsigned farmapylookup[MAPSIZE];
-extern byte *nearmapylookup[MAPSIZE];
+extern u16int farmapylookup[MAPSIZE];
+extern u8int *nearmapylookup[MAPSIZE];
-extern byte tilemap[MAPSIZE][MAPSIZE]; // wall values only
-extern byte spotvis[MAPSIZE][MAPSIZE];
+extern u8int tilemap[MAPSIZE][MAPSIZE]; // wall values only
+extern u8int spotvis[MAPSIZE][MAPSIZE];
extern objtype *actorat[MAPSIZE][MAPSIZE];
#define UPDATESIZE (UPDATEWIDE*UPDATEHIGH)
-extern byte update[UPDATESIZE];
+extern u8int update[UPDATESIZE];
-extern boolean singlestep,godmode,noclip;
-extern int extravbls;
+extern int singlestep,godmode,noclip;
+extern s16int extravbls;
//
// control info
//
-extern boolean mouseenabled,joystickenabled,joypadenabled,joystickprogressive;
-extern int joystickport;
-extern int dirscan[4];
-extern int buttonscan[NUMBUTTONS];
-extern int buttonmouse[4];
-extern int buttonjoy[4];
+extern int mouseenabled,joystickenabled,joypadenabled,joystickprogressive;
+extern s16int joystickport;
+extern s16int dirscan[4];
+extern s16int buttonscan[NUMBUTTONS];
+extern s16int buttonmouse[4];
+extern s16int buttonjoy[4];
-extern boolean buttonheld[NUMBUTTONS];
+extern int buttonheld[NUMBUTTONS];
-extern int viewsize;
+extern s16int viewsize;
//
// curent user input
//
-extern int controlx,controly; // range from -100 to 100
-extern boolean buttonstate[NUMBUTTONS];
+extern s16int controlx,controly; // range from -100 to 100
+extern int buttonstate[NUMBUTTONS];
-extern boolean demorecord,demoplayback;
+extern int demorecord,demoplayback;
extern char far *demoptr, far *lastdemoptr;
-extern memptr demobuffer;
+extern uchar *demobuffer;
@@ -916,7 +914,7 @@
void InitRedShifts (void);
void FinishPaletteShifts (void);
-void CenterWindow(word w,word h);
+void CenterWindow(u16int w,u16int h);
void InitActorList (void);
void GetNewActor (void);
void RemoveObj (objtype *gone);
@@ -924,7 +922,7 @@
void StopMusic(void);
void StartMusic(void);
void PlayLoop (void);
-void StartDamageFlash (int damage);
+void StartDamageFlash (s16int damage);
void StartBonusFlash (void);
/*
@@ -938,7 +936,7 @@
void IntroScreen (void);
void PreloadGraphics(void);
void LevelCompleted (void);
-void CheckHighScore (long score,word other);
+void CheckHighScore (s32int score,u16int other);
void Victory (void);
void ClearSplitVWB (void);
@@ -951,7 +949,7 @@
=============================================================================
*/
-int DebugKeys (void);
+s16int DebugKeys (void);
void PicturePause (void);
@@ -963,54 +961,54 @@
=============================================================================
*/
-extern unsigned screenloc[3];
-extern unsigned freelatch;
+extern u16int screenloc[3];
+extern u16int freelatch;
-extern long lasttimecount;
-extern long frameon;
-extern boolean fizzlein;
+extern s32int lasttimecount;
+extern s32int frameon;
+extern int fizzlein;
-extern unsigned wallheight[MAXVIEWWIDTH];
+extern u16int wallheight[MAXVIEWWIDTH];
-extern fixed tileglobal;
-extern fixed focallength;
-extern fixed mindist;
+extern s32int tileglobal;
+extern s32int focallength;
+extern s32int mindist;
//
// math tables
//
-extern int pixelangle[MAXVIEWWIDTH];
-extern long far finetangent[FINEANGLES/4];
-extern fixed far sintable[],far *costable;
+extern s16int pixelangle[MAXVIEWWIDTH];
+extern s32int far finetangent[FINEANGLES/4];
+extern s32int far sintable[],far *costable;
//
// derived constants
//
-extern fixed scale;
-extern long heightnumerator,mindist;
+extern s32int scale;
+extern s32int heightnumerator,mindist;
//
// refresh variables
//
-extern fixed viewx,viewy; // the focal point
-extern int viewangle;
-extern fixed viewsin,viewcos;
+extern s32int viewx,viewy; // the focal point
+extern s16int viewangle;
+extern s32int viewsin,viewcos;
-extern long postsource;
-extern unsigned postx;
-extern unsigned postwidth;
+extern s32int postsource;
+extern u16int postx;
+extern u16int postwidth;
-extern int horizwall[],vertwall[];
+extern s16int horizwall[],vertwall[];
-extern unsigned pwallpos;
+extern u16int pwallpos;
-fixed FixedByFrac (fixed a, fixed b);
+s32int FixedByFrac (s32int a, s32int b);
void TransformActor (objtype *ob);
void BuildTables (void);
void ClearScreen (void);
-int CalcRotate (objtype *ob);
+s16int CalcRotate (objtype *ob);
void DrawScaleds (void);
void CalcTics (void);
void FixOfs (void);
@@ -1033,22 +1031,22 @@
extern dirtype diagonal[9][9];
-void InitHitRect (objtype *ob, unsigned radius);
-void SpawnNewObj (unsigned tilex, unsigned tiley, statetype *state);
+void InitHitRect (objtype *ob, u16int radius);
+void SpawnNewObj (u16int tilex, u16int tiley, statetype *state);
void NewState (objtype *ob, statetype *state);
-boolean TryWalk (objtype *ob);
+int TryWalk (objtype *ob);
void SelectChaseDir (objtype *ob);
void SelectDodgeDir (objtype *ob);
void SelectRunDir (objtype *ob);
-void MoveObj (objtype *ob, long move);
-boolean SightPlayer (objtype *ob);
+void MoveObj (objtype *ob, s32int move);
+int SightPlayer (objtype *ob);
void KillActor (objtype *ob);
-void DamageActor (objtype *ob, unsigned damage);
+void DamageActor (objtype *ob, u16int damage);
-boolean CheckLine (objtype *ob);
-boolean CheckSight (objtype *ob);
+int CheckLine (objtype *ob);
+int CheckSight (objtype *ob);
/*
@@ -1064,37 +1062,37 @@
typedef struct
{
- unsigned codeofs[65];
- unsigned width[65];
- byte code[];
+ u16int codeofs[65];
+ u16int width[65];
+ u8int code[];
} t_compscale;
typedef struct
{
- unsigned leftpix,rightpix;
- unsigned dataofs[64];
+ u16int leftpix,rightpix;
+ u16int dataofs[64];
// table data after dataofs[rightpix-leftpix+1]
} t_compshape;
extern t_compscale _seg *scaledirectory[MAXSCALEHEIGHT+1];
-extern long fullscalefarcall[MAXSCALEHEIGHT+1];
+extern s32int fullscalefarcall[MAXSCALEHEIGHT+1];
-extern byte bitmasks1[8][8];
-extern byte bitmasks2[8][8];
-extern unsigned wordmasks[8][8];
+extern u8int bitmasks1[8][8];
+extern u8int bitmasks2[8][8];
+extern u16int wordmasks[8][8];
-extern byte mapmasks1[4][8];
-extern byte mapmasks2[4][8];
-extern byte mapmasks3[4][8];
+extern u8int mapmasks1[4][8];
+extern u8int mapmasks2[4][8];
+extern u8int mapmasks3[4][8];
-extern int maxscale,maxscaleshl2;
+extern s16int maxscale,maxscaleshl2;
-extern boolean insetupscaling;
+extern int insetupscaling;
-void SetupScaling (int maxscaleheight);
-void ScaleShape (int xcenter, int shapenum, unsigned height);
-void SimpleScaleShape (int xcenter, int shapenum, unsigned height);
+void SetupScaling (s16int maxscaleheight);
+void ScaleShape (s16int xcenter, s16int shapenum, u16int height);
+void SimpleScaleShape (s16int xcenter, s16int shapenum, u16int height);
/*
=============================================================================
@@ -1107,32 +1105,32 @@
//
// player state info
//
-extern boolean running;
-extern long thrustspeed;
-extern unsigned plux,pluy; // player coordinates scaled to unsigned
+extern int running;
+extern s32int thrustspeed;
+extern u16int plux,pluy; // player coordinates scaled to u16int
-extern int anglefrac;
-extern int facecount;
+extern s16int anglefrac;
+extern s16int facecount;
-void SpawnPlayer (int tilex, int tiley, int dir);
+void SpawnPlayer (s16int tilex, s16int tiley, s16int dir);
void DrawFace (void);
void DrawHealth (void);
-void TakeDamage (int points,objtype *attacker);
-void HealSelf (int points);
+void TakeDamage (s16int points,objtype *attacker);
+void HealSelf (s16int points);
void DrawLevel (void);
void DrawLives (void);
void GiveExtraMan (void);
void DrawScore (void);
-void GivePoints (long points);
+void GivePoints (s32int points);
void DrawWeapon (void);
void DrawKeys (void);
-void GiveWeapon (int weapon);
+void GiveWeapon (s16int weapon);
void DrawAmmo (void);
-void GiveAmmo (int ammo);
-void GiveKey (int key);
+void GiveAmmo (s16int ammo);
+void GiveKey (s16int key);
void GetBonus (statobj_t *check);
-void Thrust (int angle, long speed);
+void Thrust (s16int angle, s32int speed);
/*
=============================================================================
@@ -1143,30 +1141,30 @@
*/
extern doorobj_t doorobjlist[MAXDOORS],*lastdoorobj;
-extern int doornum;
+extern s16int doornum;
-extern unsigned doorposition[MAXDOORS],pwallstate;
+extern u16int doorposition[MAXDOORS],pwallstate;
-extern byte far areaconnect[NUMAREAS][NUMAREAS];
+extern u8int far areaconnect[NUMAREAS][NUMAREAS];
-extern boolean areabyplayer[NUMAREAS];
+extern int areabyplayer[NUMAREAS];
-extern unsigned pwallstate;
-extern unsigned pwallpos; // amount a pushable wall has been moved (0-63)
-extern unsigned pwallx,pwally;
-extern int pwalldir;
+extern u16int pwallstate;
+extern u16int pwallpos; // amount a pushable wall has been moved (0-63)
+extern u16int pwallx,pwally;
+extern s16int pwalldir;
void InitDoorList (void);
void InitStaticList (void);
-void SpawnStatic (int tilex, int tiley, int type);
-void SpawnDoor (int tilex, int tiley, boolean vertical, int lock);
+void SpawnStatic (s16int tilex, s16int tiley, s16int type);
+void SpawnDoor (s16int tilex, s16int tiley, int vertical, s16int lock);
void MoveDoors (void);
void MovePWalls (void);
-void OpenDoor (int door);
-void PlaceItemType (int itemtype, int tilex, int tiley);
-void PushWall (int checkx, int checky, int dir);
-void OperateDoor (int door);
+void OpenDoor (s16int door);
+void PlaceItemType (s16int itemtype, s16int tilex, s16int tiley);
+void PushWall (s16int checkx, s16int checky, s16int dir);
+void OperateDoor (s16int door);
void InitAreas (void);
/*
@@ -1240,27 +1238,27 @@
extern statetype s_giftdeathcam2;
extern statetype s_fatdeathcam2;
-void SpawnStand (enemy_t which, int tilex, int tiley, int dir);
-void SpawnPatrol (enemy_t which, int tilex, int tiley, int dir);
+void SpawnStand (enemy_t which, s16int tilex, s16int tiley, s16int dir);
+void SpawnPatrol (enemy_t which, s16int tilex, s16int tiley, s16int dir);
void KillActor (objtype *ob);
-void US_ControlPanel(byte);
+void US_ControlPanel(u8int);
-void SpawnDeadGuard (int tilex, int tiley);
-void SpawnBoss (int tilex, int tiley);
-void SpawnGretel (int tilex, int tiley);
-void SpawnTrans (int tilex, int tiley);
-void SpawnUber (int tilex, int tiley);
-void SpawnWill (int tilex, int tiley);
-void SpawnDeath (int tilex, int tiley);
-void SpawnAngel (int tilex, int tiley);
-void SpawnSpectre (int tilex, int tiley);
-void SpawnGhosts (int which, int tilex, int tiley);
-void SpawnSchabbs (int tilex, int tiley);
-void SpawnGift (int tilex, int tiley);
-void SpawnFat (int tilex, int tiley);
-void SpawnFakeHitler (int tilex, int tiley);
-void SpawnHitler (int tilex, int tiley);
+void SpawnDeadGuard (s16int tilex, s16int tiley);
+void SpawnBoss (s16int tilex, s16int tiley);
+void SpawnGretel (s16int tilex, s16int tiley);
+void SpawnTrans (s16int tilex, s16int tiley);
+void SpawnUber (s16int tilex, s16int tiley);
+void SpawnWill (s16int tilex, s16int tiley);
+void SpawnDeath (s16int tilex, s16int tiley);
+void SpawnAngel (s16int tilex, s16int tiley);
+void SpawnSpectre (s16int tilex, s16int tiley);
+void SpawnGhosts (s16int which, s16int tilex, s16int tiley);
+void SpawnSchabbs (s16int tilex, s16int tiley);
+void SpawnGift (s16int tilex, s16int tiley);
+void SpawnFat (s16int tilex, s16int tiley);
+void SpawnFakeHitler (s16int tilex, s16int tiley);
+void SpawnHitler (s16int tilex, s16int tiley);
/*
=============================================================================
--- a/detect.c
+++ b/detect.c
@@ -4,10 +4,10 @@
// particular I/O location
//
///////////////////////////////////////////////////////////////////////////
-static boolean
-SDL_CheckSB(int port)
+static int
+SDL_CheckSB(s16int port)
{
- int i;
+ s16int i;
sbLocation = port << 4; // Initialize stuff for later use
@@ -55,10 +55,10 @@
// it just passes it directly to SDL_CheckSB()
//
///////////////////////////////////////////////////////////////////////////
-static boolean
-SDL_DetectSoundBlaster(int port)
+static int
+SDL_DetectSoundBlaster(s16int port)
{
- int i;
+ s16int i;
if (port == 0) // If user specifies default, use 2
port = 2;
--- a/draw.asm
+++ b/draw.asm
@@ -71,7 +71,7 @@
;
; xpartialbyystep
;
-; multiplies long [ystep] (possibly negative), by word [xpartial] (in BX)
+; multiplies s32int [ystep] (possibly negative), by word [xpartial] (in BX)
;
; returns dx:ax
; trashes bx,cx,di
@@ -126,7 +126,7 @@
;
; ypartialbyxstep
;
-; multiplies long [xstep] (possibly negative), by word [ypartial] (in BP)
+; multiplies s32int [xstep] (possibly negative), by word [ypartial] (in BP)
;
; returns dx:ax
; trashes cx,di,bp
--- a/draw.c
+++ b/draw.c
@@ -30,42 +30,42 @@
#ifdef DEBUGWALLS
-unsigned screenloc[3]= {0,0,0};
+u16int screenloc[3]= {0,0,0};
#else
-unsigned screenloc[3]= {PAGE1START,PAGE2START,PAGE3START};
+u16int screenloc[3]= {PAGE1START,PAGE2START,PAGE3START};
#endif
-unsigned freelatch = FREESTART;
+u16int freelatch = FREESTART;
-long lasttimecount;
-long frameon;
+s32int lasttimecount;
+s32int frameon;
-unsigned wallheight[MAXVIEWWIDTH];
+u16int wallheight[MAXVIEWWIDTH];
-fixed tileglobal = TILEGLOBAL;
-fixed mindist = MINDIST;
+s32int tileglobal = TILEGLOBAL;
+s32int mindist = MINDIST;
//
// math tables
//
-int pixelangle[MAXVIEWWIDTH];
-long far finetangent[FINEANGLES/4];
-fixed far sintable[ANGLES+ANGLES/4],far *costable = sintable+(ANGLES/4);
+s16int pixelangle[MAXVIEWWIDTH];
+s32int far finetangent[FINEANGLES/4];
+s32int far sintable[ANGLES+ANGLES/4],far *costable = sintable+(ANGLES/4);
//
// refresh variables
//
-fixed viewx,viewy; // the focal point
-int viewangle;
-fixed viewsin,viewcos;
+s32int viewx,viewy; // the focal point
+s16int viewangle;
+s32int viewsin,viewcos;
-fixed FixedByFrac (fixed a, fixed b);
+s32int FixedByFrac (s32int a, s32int b);
void TransformActor (objtype *ob);
void BuildTables (void);
void ClearScreen (void);
-int CalcRotate (objtype *ob);
+s16int CalcRotate (objtype *ob);
void DrawScaleds (void);
void CalcTics (void);
void FixOfs (void);
@@ -76,30 +76,30 @@
//
// wall optimization variables
//
-int lastside; // true for vertical
-long lastintercept;
-int lasttilehit;
+s16int lastside; // true for vertical
+s32int lastintercept;
+s16int lasttilehit;
//
// ray tracing variables
//
-int focaltx,focalty,viewtx,viewty;
+s16int focaltx,focalty,viewtx,viewty;
-int midangle,angle;
-unsigned xpartial,ypartial;
-unsigned xpartialup,xpartialdown,ypartialup,ypartialdown;
-unsigned xinttile,yinttile;
+s16int midangle,angle;
+u16int xpartial,ypartial;
+u16int xpartialup,xpartialdown,ypartialup,ypartialdown;
+u16int xinttile,yinttile;
-unsigned tilehit;
-unsigned pixx;
+u16int tilehit;
+u16int pixx;
-int xtile,ytile;
-int xtilestep,ytilestep;
-long xintercept,yintercept;
-long xstep,ystep;
+s16int xtile,ytile;
+s16int xtilestep,ytilestep;
+s32int xintercept,yintercept;
+s32int xstep,ystep;
-int horizwall[MAXWALLTILES],vertwall[MAXWALLTILES];
+s16int horizwall[MAXWALLTILES],vertwall[MAXWALLTILES];
/*
@@ -138,7 +138,7 @@
#pragma warn -rvl // I stick the return value in with ASMs
-fixed FixedByFrac (fixed a, fixed b)
+s32int FixedByFrac (s32int a, s32int b)
{
//
// setup
@@ -209,9 +209,9 @@
//
void TransformActor (objtype *ob)
{
- int ratio;
- fixed gx,gy,gxt,gyt,nx,ny;
- long temp;
+ s16int ratio;
+ s32int gx,gy,gxt,gyt,nx,ny;
+ s32int temp;
//
// translate point to view centered coordinates
@@ -284,17 +284,17 @@
========================
*/
-boolean TransformTile (int tx, int ty, int *dispx, int *dispheight)
+int TransformTile (s16int tx, s16int ty, s16int *dispx, s16int *dispheight)
{
- int ratio;
- fixed gx,gy,gxt,gyt,nx,ny;
- long temp;
+ s16int ratio;
+ s32int gx,gy,gxt,gyt,nx,ny;
+ s32int temp;
//
// translate point to view centered coordinates
//
- gx = ((long)tx<<TILESHIFT)+0x8000-viewx;
- gy = ((long)ty<<TILESHIFT)+0x8000-viewy;
+ gx = ((s32int)tx<<TILESHIFT)+0x8000-viewx;
+ gy = ((s32int)ty<<TILESHIFT)+0x8000-viewy;
//
// calculate newx
@@ -356,12 +356,12 @@
#pragma warn -rvl // I stick the return value in with ASMs
-int CalcHeight (void)
+s16int CalcHeight (void)
{
- int transheight;
- int ratio;
- fixed gxt,gyt,nx,ny;
- long gx,gy;
+ s16int transheight;
+ s16int ratio;
+ s32int gxt,gyt,nx,ny;
+ s32int gx,gy;
gx = xintercept-viewx;
gxt = FixedByFrac(gx,viewcos);
@@ -393,9 +393,9 @@
===================
*/
-long postsource;
-unsigned postx;
-unsigned postwidth;
+s32int postsource;
+u16int postx;
+u16int postwidth;
void near ScalePost (void) // VGA version
{
@@ -476,8 +476,8 @@
void HitVertWall (void)
{
- int wallpic;
- unsigned texture;
+ s16int wallpic;
+ u16int texture;
texture = (yintercept>>4)&0xfc0;
if (xtilestep == -1)
@@ -490,7 +490,7 @@
if (lastside==1 && lastintercept == xtile && lasttilehit == tilehit)
{
// in the same wall type as last time, so check for optimized draw
- if (texture == (unsigned)postsource)
+ if (texture == (u16int)postsource)
{
// wide scale
postwidth++;
@@ -500,7 +500,7 @@
else
{
ScalePost ();
- (unsigned)postsource = texture;
+ (u16int)postsource = texture;
postwidth = 1;
postx = pixx;
}
@@ -529,8 +529,8 @@
else
wallpic = vertwall[tilehit];
- *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(wallpic);
- (unsigned)postsource = texture;
+ *( ((u16int *)&postsource)+1) = (u16int)PM_GetPage(wallpic);
+ (u16int)postsource = texture;
}
}
@@ -549,8 +549,8 @@
void HitHorizWall (void)
{
- int wallpic;
- unsigned texture;
+ s16int wallpic;
+ u16int texture;
texture = (xintercept>>4)&0xfc0;
if (ytilestep == -1)
@@ -562,7 +562,7 @@
if (lastside==0 && lastintercept == ytile && lasttilehit == tilehit)
{
// in the same wall type as last time, so check for optimized draw
- if (texture == (unsigned)postsource)
+ if (texture == (u16int)postsource)
{
// wide scale
postwidth++;
@@ -572,7 +572,7 @@
else
{
ScalePost ();
- (unsigned)postsource = texture;
+ (u16int)postsource = texture;
postwidth = 1;
postx = pixx;
}
@@ -601,8 +601,8 @@
else
wallpic = horizwall[tilehit];
- *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(wallpic);
- (unsigned)postsource = texture;
+ *( ((u16int *)&postsource)+1) = (u16int)PM_GetPage(wallpic);
+ (u16int)postsource = texture;
}
}
@@ -619,7 +619,7 @@
void HitHorizDoor (void)
{
- unsigned texture,doorpage,doornum;
+ u16int texture,doorpage,doornum;
doornum = tilehit&0x7f;
texture = ( (xintercept-doorposition[doornum]) >> 4) &0xfc0;
@@ -629,7 +629,7 @@
if (lasttilehit == tilehit)
{
// in the same door as last time, so check for optimized draw
- if (texture == (unsigned)postsource)
+ if (texture == (u16int)postsource)
{
// wide scale
postwidth++;
@@ -639,7 +639,7 @@
else
{
ScalePost ();
- (unsigned)postsource = texture;
+ (u16int)postsource = texture;
postwidth = 1;
postx = pixx;
}
@@ -670,8 +670,8 @@
break;
}
- *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(doorpage);
- (unsigned)postsource = texture;
+ *( ((u16int *)&postsource)+1) = (u16int)PM_GetPage(doorpage);
+ (u16int)postsource = texture;
}
}
@@ -687,7 +687,7 @@
void HitVertDoor (void)
{
- unsigned texture,doorpage,doornum;
+ u16int texture,doorpage,doornum;
doornum = tilehit&0x7f;
texture = ( (yintercept-doorposition[doornum]) >> 4) &0xfc0;
@@ -697,7 +697,7 @@
if (lasttilehit == tilehit)
{
// in the same door as last time, so check for optimized draw
- if (texture == (unsigned)postsource)
+ if (texture == (u16int)postsource)
{
// wide scale
postwidth++;
@@ -707,7 +707,7 @@
else
{
ScalePost ();
- (unsigned)postsource = texture;
+ (u16int)postsource = texture;
postwidth = 1;
postx = pixx;
}
@@ -738,8 +738,8 @@
break;
}
- *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(doorpage+1);
- (unsigned)postsource = texture;
+ *( ((u16int *)&postsource)+1) = (u16int)PM_GetPage(doorpage+1);
+ (u16int)postsource = texture;
}
}
@@ -758,8 +758,8 @@
void HitHorizPWall (void)
{
- int wallpic;
- unsigned texture,offset;
+ s16int wallpic;
+ u16int texture,offset;
texture = (xintercept>>4)&0xfc0;
offset = pwallpos<<10;
@@ -776,7 +776,7 @@
if (lasttilehit == tilehit)
{
// in the same wall type as last time, so check for optimized draw
- if (texture == (unsigned)postsource)
+ if (texture == (u16int)postsource)
{
// wide scale
postwidth++;
@@ -786,7 +786,7 @@
else
{
ScalePost ();
- (unsigned)postsource = texture;
+ (u16int)postsource = texture;
postwidth = 1;
postx = pixx;
}
@@ -803,8 +803,8 @@
wallpic = horizwall[tilehit&63];
- *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(wallpic);
- (unsigned)postsource = texture;
+ *( ((u16int *)&postsource)+1) = (u16int)PM_GetPage(wallpic);
+ (u16int)postsource = texture;
}
}
@@ -822,8 +822,8 @@
void HitVertPWall (void)
{
- int wallpic;
- unsigned texture,offset;
+ s16int wallpic;
+ u16int texture,offset;
texture = (yintercept>>4)&0xfc0;
offset = pwallpos<<10;
@@ -840,7 +840,7 @@
if (lasttilehit == tilehit)
{
// in the same wall type as last time, so check for optimized draw
- if (texture == (unsigned)postsource)
+ if (texture == (u16int)postsource)
{
// wide scale
postwidth++;
@@ -850,7 +850,7 @@
else
{
ScalePost ();
- (unsigned)postsource = texture;
+ (u16int)postsource = texture;
postwidth = 1;
postx = pixx;
}
@@ -867,8 +867,8 @@
wallpic = vertwall[tilehit&63];
- *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(wallpic);
- (unsigned)postsource = texture;
+ *( ((u16int *)&postsource)+1) = (u16int)PM_GetPage(wallpic);
+ (u16int)postsource = texture;
}
}
@@ -888,7 +888,7 @@
void ClearScreen (void)
{
- unsigned floor=egaFloor[gamestate.episode*10+mapon],
+ u16int floor=egaFloor[gamestate.episode*10+mapon],
ceiling=egaCeiling[gamestate.episode*10+mapon];
//
@@ -943,7 +943,7 @@
#endif
//==========================================================================
-unsigned vgaCeiling[]=
+u16int vgaCeiling[]=
{
#ifndef SPEAR
0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0xbfbf,
@@ -969,7 +969,7 @@
void VGAClearScreen (void)
{
- unsigned ceiling=vgaCeiling[gamestate.episode*10+mapon];
+ u16int ceiling=vgaCeiling[gamestate.episode*10+mapon];
//
// clear the screen
@@ -1021,9 +1021,9 @@
=====================
*/
-int CalcRotate (objtype *ob)
+s16int CalcRotate (objtype *ob)
{
- int angle,viewangle;
+ s16int angle,viewangle;
// this isn't exactly correct, as it should vary by a trig value,
// but it is close enough with only eight rotations
@@ -1062,7 +1062,7 @@
typedef struct
{
- int viewx,
+ s16int viewx,
viewheight,
shapenum;
} visobj_t;
@@ -1071,11 +1071,11 @@
void DrawScaleds (void)
{
- int i,j,least,numvisable,height;
- memptr shape;
- byte *tilespot,*visspot;
- int shapenum;
- unsigned spotloc;
+ s16int i,j,least,numvisable,height;
+ uchar *shape;
+ u8int *tilespot,*visspot;
+ s16int shapenum;
+ u16int spotloc;
statobj_t *statptr;
objtype *obj;
@@ -1195,12 +1195,12 @@
==============
*/
-int weaponscale[NUMWEAPONS] = {SPR_KNIFEREADY,SPR_PISTOLREADY
+s16int weaponscale[NUMWEAPONS] = {SPR_KNIFEREADY,SPR_PISTOLREADY
,SPR_MACHINEGUNREADY,SPR_CHAINREADY};
void DrawPlayerWeapon (void)
{
- int shapenum;
+ s16int shapenum;
#ifndef SPEAR
if (gamestate.victoryflag)
@@ -1235,7 +1235,7 @@
void CalcTics (void)
{
- long newtime,oldtimecount;
+ s32int newtime,oldtimecount;
//
// calculate tics since last refresh for adaptive timing
@@ -1335,7 +1335,7 @@
void ThreeDRefresh (void)
{
- int tracedir;
+ s16int tracedir;
// this wouldn't need to be done except for my debugger/video wierdness
outportb (SC_INDEX,SC_MAPMASK);
--- a/game.c
+++ b/game.c
@@ -25,18 +25,18 @@
=============================================================================
*/
-boolean ingame,fizzlein;
-unsigned latchpics[NUMLATCHPICS];
+int ingame,fizzlein;
+u16int latchpics[NUMLATCHPICS];
gametype gamestate;
-long spearx,speary;
-unsigned spearangle;
-boolean spearflag;
+s32int spearx,speary;
+u16int spearangle;
+int spearflag;
//
// ELEVATOR BACK MAPS - REMEMBER (-1)!!
//
-int ElevatorBackTo[]={1,1,7,3,5,3};
+s16int ElevatorBackTo[]={1,1,7,3,5,3};
void ScanInfoPlane (void);
void SetupGameLevel (void);
@@ -71,10 +71,10 @@
==========================
*/
- fixed globalsoundx,globalsoundy;
- int leftchannel,rightchannel;
+ s32int globalsoundx,globalsoundy;
+ s16int leftchannel,rightchannel;
#define ATABLEMAX 15
-byte righttable[ATABLEMAX][ATABLEMAX * 2] = {
+u8int righttable[ATABLEMAX][ATABLEMAX * 2] = {
{ 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 6, 0, 0, 0, 0, 0, 1, 3, 5, 8, 8, 8, 8, 8, 8, 8, 8},
{ 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 6, 4, 0, 0, 0, 0, 0, 2, 4, 6, 8, 8, 8, 8, 8, 8, 8, 8},
{ 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 6, 6, 4, 1, 0, 0, 0, 1, 2, 4, 6, 8, 8, 8, 8, 8, 8, 8, 8},
@@ -91,7 +91,7 @@
{ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8},
{ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8}
};
-byte lefttable[ATABLEMAX][ATABLEMAX * 2] = {
+u8int lefttable[ATABLEMAX][ATABLEMAX * 2] = {
{ 8, 8, 8, 8, 8, 8, 8, 8, 5, 3, 1, 0, 0, 0, 0, 0, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8},
{ 8, 8, 8, 8, 8, 8, 8, 8, 6, 4, 2, 0, 0, 0, 0, 0, 4, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8},
{ 8, 8, 8, 8, 8, 8, 8, 8, 6, 4, 2, 1, 0, 0, 0, 1, 4, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8},
@@ -110,10 +110,10 @@
};
void
-SetSoundLoc(fixed gx,fixed gy)
+SetSoundLoc(s32int gx,s32int gy)
{
- fixed xt,yt;
- int x,y;
+ s32int xt,yt;
+ s16int x,y;
//
// translate point to view centered coordinates
@@ -167,7 +167,7 @@
=
==========================
*/
-void PlaySoundLocGlobal(word s,fixed gx,fixed gy)
+void PlaySoundLocGlobal(u16int s,s32int gx,s32int gy)
{
SetSoundLoc(gx,gy);
SD_PositionSound(leftchannel,rightchannel);
@@ -220,9 +220,9 @@
void ScanInfoPlane (void)
{
- unsigned x,y,i,j;
- int tile;
- unsigned far *start;
+ u16int x,y,i,j;
+ s16int tile;
+ u16int far *start;
start = mapsegs[1];
for (y=0;y<mapheight;y++)
@@ -624,8 +624,8 @@
void SetupGameLevel (void)
{
- int x,y,i;
- unsigned far *map,tile,spot;
+ s16int x,y,i;
+ u16int far *map,tile,spot;
if (!loadedgame)
@@ -671,13 +671,13 @@
{
// solid wall
tilemap[x][y] = tile;
- (unsigned)actorat[x][y] = tile;
+ (u16int)actorat[x][y] = tile;
}
else
{
// area floor
tilemap[x][y] = 0;
- (unsigned)actorat[x][y] = 0;
+ (u16int)actorat[x][y] = 0;
}
}
@@ -734,7 +734,7 @@
if (tile == AMBUSHTILE)
{
tilemap[x][y] = 0;
- if ( (unsigned)actorat[x][y] == AMBUSHTILE)
+ if ( (u16int)actorat[x][y] == AMBUSHTILE)
actorat[x][y] = NULL;
if (*map >= AREATILE)
@@ -776,7 +776,7 @@
void DrawPlayBorderSides (void)
{
- int xl,yl;
+ s16int xl,yl;
xl = 160-viewwidth/2;
yl = (200-STATUSLINES-viewheight)/2;
@@ -799,7 +799,7 @@
void DrawAllPlayBorderSides (void)
{
- unsigned i,temp;
+ u16int i,temp;
temp = bufferofs;
for (i=0;i<3;i++)
@@ -819,7 +819,7 @@
*/
void DrawAllPlayBorder (void)
{
- unsigned i,temp;
+ u16int i,temp;
temp = bufferofs;
for (i=0;i<3;i++)
@@ -840,7 +840,7 @@
void DrawPlayBorder (void)
{
- int xl,yl;
+ s16int xl,yl;
VWB_Bar (0,0,320,200-STATUSLINES,127);
@@ -867,8 +867,8 @@
void DrawPlayScreen (void)
{
- int i,j,p,m;
- unsigned temp;
+ s16int i,j,p,m;
+ u16int temp;
VW_FadeOut ();
@@ -911,7 +911,7 @@
#define MAXDEMOSIZE 8192
-void StartDemoRecord (int levelnumber)
+void StartDemoRecord (s16int levelnumber)
{
MM_GetPtr (&demobuffer,MAXDEMOSIZE);
MM_SetLock (&demobuffer,true);
@@ -936,7 +936,7 @@
void FinishDemoRecord (void)
{
- long length,level;
+ s32int length,level;
demorecord = false;
@@ -943,7 +943,7 @@
length = demoptr - (char far *)demobuffer;
demoptr = ((char far *)demobuffer)+1;
- *(unsigned far *)demoptr = length;
+ *(u16int far *)demoptr = length;
CenterWindow(24,3);
PrintY+=6;
@@ -978,7 +978,7 @@
void RecordDemo (void)
{
- int level,esc;
+ s16int level,esc;
CenterWindow(26,3);
PrintY+=6;
@@ -1041,16 +1041,16 @@
==================
*/
-void PlayDemo (int demonumber)
+void PlayDemo (s16int demonumber)
{
- int length;
+ s16int length;
#ifdef DEMOSEXTERN
// debug: load chunk
#ifndef SPEARDEMO
- int dems[4]={T_DEMO0,T_DEMO1,T_DEMO2,T_DEMO3};
+ s16int dems[4]={T_DEMO0,T_DEMO1,T_DEMO2,T_DEMO3};
#else
- int dems[1]={T_DEMO0};
+ s16int dems[1]={T_DEMO0};
#endif
CA_CacheGrChunk(dems[demonumber]);
@@ -1066,7 +1066,7 @@
NewGame (1,0);
gamestate.mapon = *demoptr++;
gamestate.difficulty = gd_hard;
- length = *((unsigned far *)demoptr)++;
+ length = *((u16int far *)demoptr)++;
demoptr++;
lastdemoptr = demoptr-4+length;
@@ -1114,8 +1114,8 @@
void Died (void)
{
float fangle;
- long dx,dy;
- int iangle,curangle,clockwise,counter,change;
+ s32int dx,dy;
+ s16int iangle,curangle,clockwise,counter,change;
gamestate.weapon = -1; // take away weapon
SD_PlaySound (PLAYERDEATHSND);
@@ -1237,9 +1237,9 @@
void GameLoop (void)
{
- int i,xl,yl,xh,yh;
+ s16int i,xl,yl,xh,yh;
char num[20];
- boolean died;
+ int died;
#ifdef MYPROFILE
clock_t start,end;
#endif
@@ -1291,7 +1291,7 @@
SD_PlaySound(GETSPEARSND);
if (DigiMode != sds_Off)
{
- long lasttimecount = TimeCount;
+ s32int lasttimecount = TimeCount;
while(TimeCount < lasttimecount+150)
//while(DigiPlaying!=false)
--- a/heads.h
+++ b/heads.h
@@ -47,15 +47,9 @@
// v1.0d1
//
-typedef enum {false,true} boolean;
-typedef unsigned char byte;
-typedef unsigned int word;
-typedef unsigned long longword;
-typedef byte * Ptr;
+typedef short s16int;
+typedef int s32int;
-#define nil ((void *)0)
-
-
#include "ID_MM.H"
#include "ID_PM.H"
#include "ID_CA.H"
@@ -83,14 +77,14 @@
#define UPDATETERMINATE 0x0301
-extern unsigned mapwidth,mapheight,tics;
-extern boolean compatability;
+extern u16int mapwidth,mapheight,tics;
+extern int compatability;
-extern byte *updateptr;
-extern unsigned uwidthtable[UPDATEHIGH];
-extern unsigned blockstarts[UPDATEWIDE*UPDATEHIGH];
+extern u8int *updateptr;
+extern u16int uwidthtable[UPDATEHIGH];
+extern u16int blockstarts[UPDATEWIDE*UPDATEHIGH];
-extern byte fontcolor,backcolor;
+extern u8int fontcolor,backcolor;
#define SETFONTCOLOR(f,b) fontcolor=f;backcolor=b;
--- a/in.c
+++ b/in.c
@@ -50,26 +50,26 @@
//
// configuration variables
//
-boolean MousePresent;
-boolean JoysPresent[MaxJoys];
-boolean JoyPadPresent;
+int MousePresent;
+int JoysPresent[MaxJoys];
+int JoyPadPresent;
// Global variables
- boolean Keyboard[NumCodes];
- boolean Paused;
+ int Keyboard[NumCodes];
+ int Paused;
char LastASCII;
- ScanCode LastScan;
+ u8int LastScan;
KeyboardDef KbdDefs = {0x1d,0x38,0x47,0x48,0x49,0x4b,0x4d,0x4f,0x50,0x51};
JoystickDef JoyDefs[MaxJoys];
ControlType Controls[MaxPlayers];
- longword MouseDownCount;
+ u32int MouseDownCount;
Demo DemoMode = demo_Off;
- byte _seg *DemoBuffer;
- word DemoOffset,DemoSize;
+ u8int _seg *DemoBuffer;
+ u16int DemoOffset,DemoSize;
/*
=============================================================================
@@ -78,7 +78,7 @@
=============================================================================
*/
-static byte far ASCIINames[] = // Unshifted ASCII for scan codes
+static u8int far ASCIINames[] = // Unshifted ASCII for scan codes
{
// 0 1 2 3 4 5 6 7 8 9 A B C D E F
0 ,27 ,'1','2','3','4','5','6','7','8','9','0','-','=',8 ,9 , // 0
@@ -116,9 +116,9 @@
};
-static boolean IN_Started;
-static boolean CapsLock;
-static ScanCode CurCode,LastCode;
+static int IN_Started;
+static int CapsLock;
+static u8int CurCode,LastCode;
static Direction DirTable[] = // Quick lookup for total direction
{
@@ -142,10 +142,10 @@
static void interrupt
INL_KeyService(void)
{
-static boolean special;
- byte k,c,
+static int special;
+ u8int k,c,
temp;
- int i;
+ s16int i;
k = inportb(0x60); // Get the scan code
@@ -215,7 +215,7 @@
//
///////////////////////////////////////////////////////////////////////////
static void
-INL_GetMouseDelta(int *x,int *y)
+INL_GetMouseDelta(s16int *x,s16int *y)
{
Mouse(MDelta);
*x = _CX;
@@ -228,10 +228,10 @@
// mouse driver
//
///////////////////////////////////////////////////////////////////////////
-static word
+static u16int
INL_GetMouseButtons(void)
{
- word buttons;
+ u16int buttons;
Mouse(MButtons);
buttons = _BX;
@@ -244,11 +244,11 @@
//
///////////////////////////////////////////////////////////////////////////
void
-IN_GetJoyAbs(word joy,word *xp,word *yp)
+IN_GetJoyAbs(u16int joy,u16int *xp,u16int *yp)
{
- byte xb,yb,
+ u8int xb,yb,
xs,ys;
- word x,y;
+ u16int x,y;
x = y = 0;
xs = joy? 2 : 0; // Find shift value for x axis
@@ -321,12 +321,12 @@
// joystick (from +/-127)
//
///////////////////////////////////////////////////////////////////////////
-void INL_GetJoyDelta(word joy,int *dx,int *dy)
+void INL_GetJoyDelta(u16int joy,s16int *dx,s16int *dy)
{
- word x,y;
- longword time;
+ u16int x,y;
+ u32int time;
JoystickDef *def;
-static longword lasttime;
+ static u32int lasttime;
IN_GetJoyAbs(joy,&x,&y);
def = JoyDefs + joy;
@@ -386,10 +386,10 @@
// joystick
//
///////////////////////////////////////////////////////////////////////////
-static word
-INL_GetJoyButtons(word joy)
+static u16int
+INL_GetJoyButtons(u16int joy)
{
-register word result;
+register u16int result;
result = inportb(0x201); // Get all the joystick buttons
result >>= joy? 6 : 4; // Shift into bits 0-1
@@ -404,11 +404,11 @@
// specified joystick
//
///////////////////////////////////////////////////////////////////////////
-word
-IN_GetJoyButtonsDB(word joy)
+u16int
+IN_GetJoyButtonsDB(u16int joy)
{
- longword lasttime;
- word result1,result2;
+ u32int lasttime;
+ u16int result1,result2;
do
{
@@ -455,7 +455,7 @@
// INL_StartMouse() - Detects and sets up the mouse
//
///////////////////////////////////////////////////////////////////////////
-static boolean
+static int
INL_StartMouse(void)
{
#if 0
@@ -468,7 +468,7 @@
return(false);
#endif
union REGS regs;
- unsigned char far *vector;
+ uchar far *vector;
if ((vector=MK_FP(peek(0,0x33*4+2),peek(0,0x33*4)))==NULL)
@@ -495,7 +495,7 @@
// INL_SetJoyScale() - Sets up scaling values for the specified joystick
//
static void
-INL_SetJoyScale(word joy)
+INL_SetJoyScale(u16int joy)
{
JoystickDef *def;
@@ -513,9 +513,9 @@
//
///////////////////////////////////////////////////////////////////////////
void
-IN_SetupJoy(word joy,word minx,word maxx,word miny,word maxy)
+IN_SetupJoy(u16int joy,u16int minx,u16int maxx,u16int miny,u16int maxy)
{
- word d,r;
+ u16int d,r;
JoystickDef *def;
def = &JoyDefs[joy];
@@ -543,10 +543,10 @@
// The auto-config assumes the joystick is centered
//
///////////////////////////////////////////////////////////////////////////
-static boolean
-INL_StartJoy(word joy)
+static int
+INL_StartJoy(u16int joy)
{
- word x,y;
+ u16int x,y;
IN_GetJoyAbs(joy,&x,&y);
@@ -569,7 +569,7 @@
//
///////////////////////////////////////////////////////////////////////////
static void
-INL_ShutJoy(word joy)
+INL_ShutJoy(u16int joy)
{
JoysPresent[joy] = false;
}
@@ -583,8 +583,8 @@
void
IN_Startup(void)
{
- boolean checkjoys,checkmouse;
- word i;
+ int checkjoys,checkmouse;
+ u16int i;
if (IN_Started)
return;
@@ -619,7 +619,7 @@
//
///////////////////////////////////////////////////////////////////////////
void
-IN_Default(boolean gotit,ControlType in)
+IN_Default(int gotit,ControlType in)
{
if
(
@@ -640,7 +640,7 @@
void
IN_Shutdown(void)
{
- word i;
+ u16int i;
if (!IN_Started)
return;
@@ -673,7 +673,7 @@
void
IN_ClearKeysDown(void)
{
- int i;
+ s16int i;
LastScan = sc_None;
LastASCII = key_None;
@@ -688,12 +688,12 @@
//
///////////////////////////////////////////////////////////////////////////
void
-IN_ReadControl(int player,ControlInfo *info)
+IN_ReadControl(s16int player,ControlInfo *info)
{
- boolean realdelta;
- byte dbyte;
- word buttons;
- int dx,dy;
+ int realdelta;
+ u8int dbyte;
+ u16int buttons;
+ s16int dx,dy;
Motion mx,my;
ControlType type;
register KeyboardDef *def;
@@ -819,7 +819,7 @@
//
///////////////////////////////////////////////////////////////////////////
void
-IN_SetControlType(int player,ControlType type)
+IN_SetControlType(s16int player,ControlType type)
{
// DEBUG - check that requested type is present?
Controls[player] = type;
@@ -831,10 +831,10 @@
// returns the scan code
//
///////////////////////////////////////////////////////////////////////////
-ScanCode
+u8int
IN_WaitForKey(void)
{
- ScanCode result;
+ u8int result;
while (!(result = LastScan))
;
@@ -866,11 +866,11 @@
//
///////////////////////////////////////////////////////////////////////////
-boolean btnstate[8];
+int btnstate[8];
void IN_StartAck(void)
{
- unsigned i,buttons;
+ u16int i,buttons;
//
// get initial state of everything
@@ -888,9 +888,9 @@
}
-boolean IN_CheckAck (void)
+int IN_CheckAck (void)
{
- unsigned i,buttons;
+ u16int i,buttons;
//
// see if something has been pressed
@@ -932,9 +932,9 @@
// button up.
//
///////////////////////////////////////////////////////////////////////////
-boolean IN_UserInput(longword delay)
+int IN_UserInput(u32int delay)
{
- longword lasttime;
+ u32int lasttime;
lasttime = TimeCount;
IN_StartAck ();
@@ -956,7 +956,7 @@
===================
*/
-byte IN_MouseButtons (void)
+u8int IN_MouseButtons (void)
{
if (MousePresent)
{
@@ -976,9 +976,9 @@
===================
*/
-byte IN_JoyButtons (void)
+u8int IN_JoyButtons (void)
{
- unsigned joybits;
+ u16int joybits;
joybits = inportb(0x201); // Get all the joystick buttons
joybits >>= 4; // only the high bits are useful
--- a/in.h
+++ b/in.h
@@ -17,7 +17,6 @@
#define MaxJoys 2
#define NumCodes 128
-typedef byte ScanCode;
#define sc_None 0
#define sc_Bad 0xff
#define sc_Return 0x1c
@@ -132,20 +131,20 @@
dir_None
} Direction;
typedef struct {
- boolean button0,button1,button2,button3;
- int x,y;
+ int button0,button1,button2,button3;
+ s16int x,y;
Motion xaxis,yaxis;
Direction dir;
} CursorInfo;
typedef CursorInfo ControlInfo;
typedef struct {
- ScanCode button0,button1,
+ u8int button0,button1,
upleft, up, upright,
left, right,
downleft, down, downright;
} KeyboardDef;
typedef struct {
- word joyMinX,joyMinY,
+ u16int joyMinX,joyMinY,
threshMinX,threshMinY,
threshMaxX,threshMaxY,
joyMaxX,joyMaxY,
@@ -153,19 +152,19 @@
joyMultXH,joyMultYH;
} JoystickDef;
// Global variables
-extern boolean Keyboard[],
+extern int Keyboard[],
MousePresent,
JoysPresent[];
-extern boolean Paused;
+extern int Paused;
extern char LastASCII;
-extern ScanCode LastScan;
+extern u8int LastScan;
extern KeyboardDef KbdDefs;
extern JoystickDef JoyDefs[];
extern ControlType Controls[MaxPlayers];
extern Demo DemoMode;
-extern byte _seg *DemoBuffer;
-extern word DemoOffset,DemoSize;
+extern u8int _seg *DemoBuffer;
+extern u16int DemoOffset,DemoSize;
// Function prototypes
#define IN_KeyDown(code) (Keyboard[(code)])
@@ -174,29 +173,29 @@
// DEBUG - put names in prototypes
extern void IN_Startup(void),IN_Shutdown(void),
- IN_Default(boolean gotit,ControlType in),
+ IN_Default(int gotit,ControlType in),
IN_SetKeyHook(void (*)()),
IN_ClearKeysDown(void),
IN_ReadCursor(CursorInfo *),
- IN_ReadControl(int,ControlInfo *),
- IN_SetControlType(int,ControlType),
- IN_GetJoyAbs(word joy,word *xp,word *yp),
- IN_SetupJoy(word joy,word minx,word maxx,
- word miny,word maxy),
+ IN_ReadControl(s16int,ControlInfo *),
+ IN_SetControlType(s16int,ControlType),
+ IN_GetJoyAbs(u16int joy,u16int *xp,u16int *yp),
+ IN_SetupJoy(u16int joy,u16int minx,u16int maxx,
+ u16int miny,u16int maxy),
IN_StopDemo(void),IN_FreeDemoBuffer(void),
IN_Ack(void),IN_AckBack(void);
-extern boolean IN_UserInput(longword delay);
+extern int IN_UserInput(u32int delay);
extern char IN_WaitForASCII(void);
-extern ScanCode IN_WaitForKey(void);
-extern word IN_GetJoyButtonsDB(word joy);
-extern byte *IN_GetScanName(ScanCode);
+extern u8int IN_WaitForKey(void);
+extern u16int IN_GetJoyButtonsDB(u16int joy);
+extern u8int *IN_GetScanName(u8int);
-byte IN_MouseButtons (void);
-byte IN_JoyButtons (void);
+u8int IN_MouseButtons (void);
+u8int IN_JoyButtons (void);
-void INL_GetJoyDelta(word joy,int *dx,int *dy);
+void INL_GetJoyDelta(u16int joy,s16int *dx,s16int *dy);
void IN_StartAck(void);
-boolean IN_CheckAck (void);
+int IN_CheckAck (void);
#endif
--- a/inter.c
+++ b/inter.c
@@ -34,7 +34,7 @@
//
////////////////////////////////////////////////////////
-void EndScreen (int palette, int screen)
+void EndScreen (s16int palette, s16int screen)
{
CA_CacheScreen (screen);
VW_UpdateScreen ();
@@ -108,8 +108,8 @@
void Victory (void)
{
#ifndef SPEARDEMO
- long sec;
- int i,min,kr,sr,tr,x;
+ s32int sec;
+ s16int i,min,kr,sr,tr,x;
char tempstr[8];
#define RATIOX 6
@@ -328,15 +328,15 @@
//==========================================================================
-void Write(int x,int y,char *string)
+void Write(s16int x,s16int y,char *string)
{
- int alpha[]={L_NUM0PIC,L_NUM1PIC,L_NUM2PIC,L_NUM3PIC,L_NUM4PIC,L_NUM5PIC,
+ s16int alpha[]={L_NUM0PIC,L_NUM1PIC,L_NUM2PIC,L_NUM3PIC,L_NUM4PIC,L_NUM5PIC,
L_NUM6PIC,L_NUM7PIC,L_NUM8PIC,L_NUM9PIC,L_COLONPIC,0,0,0,0,0,0,L_APIC,L_BPIC,
L_CPIC,L_DPIC,L_EPIC,L_FPIC,L_GPIC,L_HPIC,L_IPIC,L_JPIC,L_KPIC,
L_LPIC,L_MPIC,L_NPIC,L_OPIC,L_PPIC,L_QPIC,L_RPIC,L_SPIC,L_TPIC,
L_UPIC,L_VPIC,L_WPIC,L_XPIC,L_YPIC,L_ZPIC};
- int i,ox,nx,ny;
+ s16int i,ox,nx,ny;
char ch;
@@ -391,8 +391,8 @@
//
void BJ_Breathe(void)
{
- static int which=0,max=10;
- int pics[2]={L_GUYPIC,L_GUY2PIC};
+ static s16int which=0,max=10;
+ s16int pics[2]={L_GUYPIC,L_GUY2PIC};
if (TimeCount>max)
@@ -436,10 +436,10 @@
char timestr[6];
} times;
- int x,i,min,sec,ratio,kr,sr,tr;
- unsigned temp;
+ s16int x,i,min,sec,ratio,kr,sr,tr;
+ u16int temp;
char tempstr[10];
- long bonus,timeleft=0;
+ s32int bonus,timeleft=0;
times parTimes[]=
{
#ifndef SPEAR
@@ -665,7 +665,7 @@
{
for (i=0;i<=timeleft;i++)
{
- ltoa((long)i*PAR_AMOUNT,tempstr,10);
+ ltoa((s32int)i*PAR_AMOUNT,tempstr,10);
x=36-strlen(tempstr)*2;
Write(x,7,tempstr);
if (!(i%(PAR_AMOUNT/10)))
@@ -836,7 +836,7 @@
x=RATIOXX-strlen(tempstr)*2;
Write(x,18,tempstr);
- bonus=(long)timeleft*PAR_AMOUNT+
+ bonus=(s32int)timeleft*PAR_AMOUNT+
(PERCENT100AMT*(kr==100))+
(PERCENT100AMT*(sr==100))+
(PERCENT100AMT*(tr==100));
@@ -969,13 +969,13 @@
=================
*/
-boolean PreloadUpdate(unsigned current, unsigned total)
+int PreloadUpdate(u16int current, u16int total)
{
- unsigned w = WindowW - 10;
+ u16int w = WindowW - 10;
VWB_Bar(WindowX + 5,WindowY + WindowH - 3,w,2,BLACK);
- w = ((long)w * current) / total;
+ w = ((s32int)w * current) / total;
if (w)
{
VWB_Bar(WindowX + 5,WindowY + WindowH - 3,w,2,0x37); //SECONDCOLOR);
@@ -1030,8 +1030,8 @@
void DrawHighScores(void)
{
char buffer[16],*str,buffer1[5];
- byte temp,temp1,temp2,temp3;
- word i,j,
+ u8int temp,temp1,temp2,temp3;
+ u16int i,j,
w,h,
x,y;
HighScore *s;
@@ -1192,10 +1192,10 @@
=======================
*/
-void CheckHighScore (long score,word other)
+void CheckHighScore (s32int score,u16int other)
{
- word i,j;
- int n;
+ u16int i,j;
+ s16int n;
HighScore myscore;
strcpy(myscore.name,"");
@@ -1458,9 +1458,9 @@
far MiscCorrect[4][5] = {"ss","8",STR_STAR,"45"};
-int BackDoor(char *s)
+s16int BackDoor(char *s)
{
- int i;
+ s16int i;
strlwr(s);
@@ -1488,7 +1488,7 @@
#define TYPEBOX_BKGD 0x9c
#define PRINTCOLOR HIGHLIGHT
- int i,match,whichboss,bossnum,try,whichline,enemypicked[4]={0,0,0,0},
+ s16int i,match,whichboss,bossnum,try,whichline,enemypicked[4]={0,0,0,0},
bosses[4] = { BOSSPIC1PIC,BOSSPIC2PIC,BOSSPIC3PIC,BOSSPIC4PIC },
whichone,whichpicked[4]={0,0,0,0},quiztype,whichmem,
memberpicked[5]={0,0,0,0,0},wordpicked[5]={0,0,0,0,0},whichword;
@@ -1679,7 +1679,7 @@
}
else
{
- int start;
+ s16int start;
SD_PlaySound(BONUS1UPSND);
@@ -1696,7 +1696,7 @@
}
for (i=0;i<NUMSOUNDS;i++,start++)
- MM_FreePtr ((memptr *)&audiosegs[start]);
+ MM_FreePtr ((uchar **)&audiosegs[start]);
return;
}
}
--- a/main.c
+++ b/main.c
@@ -41,31 +41,31 @@
*/
char str[80],str2[20];
-int tedlevelnum;
-boolean tedlevel;
-boolean nospr;
-boolean IsA386;
-int dirangle[9] = {0,ANGLES/8,2*ANGLES/8,3*ANGLES/8,4*ANGLES/8,
+s16int tedlevelnum;
+int tedlevel;
+int nospr;
+int IsA386;
+s16int dirangle[9] = {0,ANGLES/8,2*ANGLES/8,3*ANGLES/8,4*ANGLES/8,
5*ANGLES/8,6*ANGLES/8,7*ANGLES/8,ANGLES};
//
// proejection variables
//
-fixed focallength;
-unsigned screenofs;
-int viewwidth;
-int viewheight;
-int centerx;
-int shootdelta; // pixels away from centerx a target can be
-fixed scale,maxslope;
-long heightnumerator;
-int minheightdiv;
+s32int focallength;
+u16int screenofs;
+s16int viewwidth;
+s16int viewheight;
+s16int centerx;
+s16int shootdelta; // pixels away from centerx a target can be
+s32int scale,maxslope;
+s32int heightnumerator;
+s16int minheightdiv;
void Quit (char *error);
-boolean startgame,loadedgame,virtualreality;
-int mouseadjustment;
+int startgame,loadedgame,virtualreality;
+s16int mouseadjustment;
char configname[13]="CONFIG.";
@@ -89,7 +89,7 @@
void ReadConfig(void)
{
- int file;
+ s16int file;
SDMode sd;
SMMode sm;
SDSMode sds;
@@ -192,7 +192,7 @@
void WriteConfig(void)
{
- int file;
+ s16int file;
file = open(configname,O_CREAT | O_BINARY | O_WRONLY,
S_IREAD | S_IWRITE | S_IFREG);
@@ -241,9 +241,9 @@
void Patch386 (void)
{
extern void far jabhack2(void);
-extern int far CheckIs386(void);
+extern s16int far CheckIs386(void);
- int i;
+ s16int i;
for (i = 1;i < _argc;i++)
if (US_CheckParm(_argv[i],JHParmStrings) == 0)
@@ -273,7 +273,7 @@
=====================
*/
-void NewGame (int difficulty,int episode)
+void NewGame (s16int difficulty,s16int episode)
{
memset (&gamestate,0,sizeof(gamestate));
gamestate.difficulty = difficulty;
@@ -290,7 +290,7 @@
//===========================================================================
-void DiskFlopAnim(int x,int y)
+void DiskFlopAnim(s16int x,s16int y)
{
static char which=0;
if (!x && !y)
@@ -301,9 +301,9 @@
}
-long DoChecksum(byte far *source,unsigned size,long checksum)
+s32int DoChecksum(u8int far *source,u16int size,s32int checksum)
{
- unsigned i;
+ u16int i;
for (i=0;i<size-1;i++)
checksum += source[i]^source[i+1];
@@ -320,10 +320,10 @@
==================
*/
-boolean SaveTheGame(int file,int x,int y)
+int SaveTheGame(s16int file,s16int x,s16int y)
{
struct diskfree_t dfree;
- long avail,size,checksum;
+ s32int avail,size,checksum;
objtype *ob,nullobj;
@@ -330,7 +330,7 @@
if (_dos_getdiskfree(0,&dfree))
Quit("Error in _dos_getdiskfree call");
- avail = (long)dfree.avail_clusters *
+ avail = (s32int)dfree.avail_clusters *
dfree.bytes_per_sector *
dfree.sectors_per_cluster;
@@ -364,23 +364,23 @@
DiskFlopAnim(x,y);
CA_FarWrite (file,(void far *)&gamestate,sizeof(gamestate));
- checksum = DoChecksum((byte far *)&gamestate,sizeof(gamestate),checksum);
+ checksum = DoChecksum((u8int far *)&gamestate,sizeof(gamestate),checksum);
DiskFlopAnim(x,y);
#ifdef SPEAR
CA_FarWrite (file,(void far *)&LevelRatios[0],sizeof(LRstruct)*20);
- checksum = DoChecksum((byte far *)&LevelRatios[0],sizeof(LRstruct)*20,checksum);
+ checksum = DoChecksum((u8int far *)&LevelRatios[0],sizeof(LRstruct)*20,checksum);
#else
CA_FarWrite (file,(void far *)&LevelRatios[0],sizeof(LRstruct)*8);
- checksum = DoChecksum((byte far *)&LevelRatios[0],sizeof(LRstruct)*8,checksum);
+ checksum = DoChecksum((u8int far *)&LevelRatios[0],sizeof(LRstruct)*8,checksum);
#endif
DiskFlopAnim(x,y);
CA_FarWrite (file,(void far *)tilemap,sizeof(tilemap));
- checksum = DoChecksum((byte far *)tilemap,sizeof(tilemap),checksum);
+ checksum = DoChecksum((u8int far *)tilemap,sizeof(tilemap),checksum);
DiskFlopAnim(x,y);
CA_FarWrite (file,(void far *)actorat,sizeof(actorat));
- checksum = DoChecksum((byte far *)actorat,sizeof(actorat),checksum);
+ checksum = DoChecksum((u8int far *)actorat,sizeof(actorat),checksum);
CA_FarWrite (file,(void far *)areaconnect,sizeof(areaconnect));
CA_FarWrite (file,(void far *)areabyplayer,sizeof(areabyplayer));
@@ -398,29 +398,29 @@
DiskFlopAnim(x,y);
CA_FarWrite (file,(void far *)&laststatobj,sizeof(laststatobj));
- checksum = DoChecksum((byte far *)&laststatobj,sizeof(laststatobj),checksum);
+ checksum = DoChecksum((u8int far *)&laststatobj,sizeof(laststatobj),checksum);
DiskFlopAnim(x,y);
CA_FarWrite (file,(void far *)statobjlist,sizeof(statobjlist));
- checksum = DoChecksum((byte far *)statobjlist,sizeof(statobjlist),checksum);
+ checksum = DoChecksum((u8int far *)statobjlist,sizeof(statobjlist),checksum);
DiskFlopAnim(x,y);
CA_FarWrite (file,(void far *)doorposition,sizeof(doorposition));
- checksum = DoChecksum((byte far *)doorposition,sizeof(doorposition),checksum);
+ checksum = DoChecksum((u8int far *)doorposition,sizeof(doorposition),checksum);
DiskFlopAnim(x,y);
CA_FarWrite (file,(void far *)doorobjlist,sizeof(doorobjlist));
- checksum = DoChecksum((byte far *)doorobjlist,sizeof(doorobjlist),checksum);
+ checksum = DoChecksum((u8int far *)doorobjlist,sizeof(doorobjlist),checksum);
DiskFlopAnim(x,y);
CA_FarWrite (file,(void far *)&pwallstate,sizeof(pwallstate));
- checksum = DoChecksum((byte far *)&pwallstate,sizeof(pwallstate),checksum);
+ checksum = DoChecksum((u8int far *)&pwallstate,sizeof(pwallstate),checksum);
CA_FarWrite (file,(void far *)&pwallx,sizeof(pwallx));
- checksum = DoChecksum((byte far *)&pwallx,sizeof(pwallx),checksum);
+ checksum = DoChecksum((u8int far *)&pwallx,sizeof(pwallx),checksum);
CA_FarWrite (file,(void far *)&pwally,sizeof(pwally));
- checksum = DoChecksum((byte far *)&pwally,sizeof(pwally),checksum);
+ checksum = DoChecksum((u8int far *)&pwally,sizeof(pwally),checksum);
CA_FarWrite (file,(void far *)&pwalldir,sizeof(pwalldir));
- checksum = DoChecksum((byte far *)&pwalldir,sizeof(pwalldir),checksum);
+ checksum = DoChecksum((u8int far *)&pwalldir,sizeof(pwalldir),checksum);
CA_FarWrite (file,(void far *)&pwallpos,sizeof(pwallpos));
- checksum = DoChecksum((byte far *)&pwallpos,sizeof(pwallpos),checksum);
+ checksum = DoChecksum((u8int far *)&pwallpos,sizeof(pwallpos),checksum);
//
// WRITE OUT CHECKSUM
@@ -440,9 +440,9 @@
==================
*/
-boolean LoadTheGame(int file,int x,int y)
+int LoadTheGame(s16int file,s16int x,s16int y)
{
- long checksum,oldchecksum;
+ s32int checksum,oldchecksum;
objtype *ob,nullobj;
@@ -450,15 +450,15 @@
DiskFlopAnim(x,y);
CA_FarRead (file,(void far *)&gamestate,sizeof(gamestate));
- checksum = DoChecksum((byte far *)&gamestate,sizeof(gamestate),checksum);
+ checksum = DoChecksum((u8int far *)&gamestate,sizeof(gamestate),checksum);
DiskFlopAnim(x,y);
#ifdef SPEAR
CA_FarRead (file,(void far *)&LevelRatios[0],sizeof(LRstruct)*20);
- checksum = DoChecksum((byte far *)&LevelRatios[0],sizeof(LRstruct)*20,checksum);
+ checksum = DoChecksum((u8int far *)&LevelRatios[0],sizeof(LRstruct)*20,checksum);
#else
CA_FarRead (file,(void far *)&LevelRatios[0],sizeof(LRstruct)*8);
- checksum = DoChecksum((byte far *)&LevelRatios[0],sizeof(LRstruct)*8,checksum);
+ checksum = DoChecksum((u8int far *)&LevelRatios[0],sizeof(LRstruct)*8,checksum);
#endif
DiskFlopAnim(x,y);
@@ -466,10 +466,10 @@
DiskFlopAnim(x,y);
CA_FarRead (file,(void far *)tilemap,sizeof(tilemap));
- checksum = DoChecksum((byte far *)tilemap,sizeof(tilemap),checksum);
+ checksum = DoChecksum((u8int far *)tilemap,sizeof(tilemap),checksum);
DiskFlopAnim(x,y);
CA_FarRead (file,(void far *)actorat,sizeof(actorat));
- checksum = DoChecksum((byte far *)actorat,sizeof(actorat),checksum);
+ checksum = DoChecksum((u8int far *)actorat,sizeof(actorat),checksum);
CA_FarRead (file,(void far *)areaconnect,sizeof(areaconnect));
CA_FarRead (file,(void far *)areabyplayer,sizeof(areabyplayer));
@@ -495,29 +495,29 @@
DiskFlopAnim(x,y);
CA_FarRead (file,(void far *)&laststatobj,sizeof(laststatobj));
- checksum = DoChecksum((byte far *)&laststatobj,sizeof(laststatobj),checksum);
+ checksum = DoChecksum((u8int far *)&laststatobj,sizeof(laststatobj),checksum);
DiskFlopAnim(x,y);
CA_FarRead (file,(void far *)statobjlist,sizeof(statobjlist));
- checksum = DoChecksum((byte far *)statobjlist,sizeof(statobjlist),checksum);
+ checksum = DoChecksum((u8int far *)statobjlist,sizeof(statobjlist),checksum);
DiskFlopAnim(x,y);
CA_FarRead (file,(void far *)doorposition,sizeof(doorposition));
- checksum = DoChecksum((byte far *)doorposition,sizeof(doorposition),checksum);
+ checksum = DoChecksum((u8int far *)doorposition,sizeof(doorposition),checksum);
DiskFlopAnim(x,y);
CA_FarRead (file,(void far *)doorobjlist,sizeof(doorobjlist));
- checksum = DoChecksum((byte far *)doorobjlist,sizeof(doorobjlist),checksum);
+ checksum = DoChecksum((u8int far *)doorobjlist,sizeof(doorobjlist),checksum);
DiskFlopAnim(x,y);
CA_FarRead (file,(void far *)&pwallstate,sizeof(pwallstate));
- checksum = DoChecksum((byte far *)&pwallstate,sizeof(pwallstate),checksum);
+ checksum = DoChecksum((u8int far *)&pwallstate,sizeof(pwallstate),checksum);
CA_FarRead (file,(void far *)&pwallx,sizeof(pwallx));
- checksum = DoChecksum((byte far *)&pwallx,sizeof(pwallx),checksum);
+ checksum = DoChecksum((u8int far *)&pwallx,sizeof(pwallx),checksum);
CA_FarRead (file,(void far *)&pwally,sizeof(pwally));
- checksum = DoChecksum((byte far *)&pwally,sizeof(pwally),checksum);
+ checksum = DoChecksum((u8int far *)&pwally,sizeof(pwally),checksum);
CA_FarRead (file,(void far *)&pwalldir,sizeof(pwalldir));
- checksum = DoChecksum((byte far *)&pwalldir,sizeof(pwalldir),checksum);
+ checksum = DoChecksum((u8int far *)&pwalldir,sizeof(pwalldir),checksum);
CA_FarRead (file,(void far *)&pwallpos,sizeof(pwallpos));
- checksum = DoChecksum((byte far *)&pwallpos,sizeof(pwallpos),checksum);
+ checksum = DoChecksum((u8int far *)&pwallpos,sizeof(pwallpos),checksum);
CA_FarRead (file,(void far *)&oldchecksum,sizeof(oldchecksum));
@@ -585,10 +585,10 @@
void BuildTables (void)
{
- int i;
+ s16int i;
float angle,anglestep;
double tang;
- fixed value;
+ s32int value;
//
@@ -638,15 +638,15 @@
====================
*/
-void CalcProjection (long focal)
+void CalcProjection (s32int focal)
{
- int i;
- long intang;
+ s16int i;
+ s32int intang;
float angle;
double tang;
double planedist;
double globinhalf;
- int halfview;
+ s16int halfview;
double halfangle,facedist;
@@ -674,7 +674,7 @@
for (i=0;i<halfview;i++)
{
// start 1/2 pixel over, so viewangle bisects two middle pixels
- tang = (long)i*VIEWGLOBAL/viewwidth/facedist;
+ tang = (s32int)i*VIEWGLOBAL/viewwidth/facedist;
angle = atan(tang);
intang = angle*radtoint;
pixelangle[halfview-1-i] = intang;
@@ -705,7 +705,7 @@
void SetupWalls (void)
{
- int i;
+ s16int i;
for (i=1;i<MAXWALLTILES;i++)
{
@@ -726,7 +726,7 @@
void SignonScreen (void) // VGA version
{
- unsigned segstart,seglength;
+ u16int segstart,seglength;
VL_SetVGAPlaneMode ();
VL_TestPaletteSet ();
@@ -816,9 +816,9 @@
=================
*/
-boolean MS_CheckParm (char far *check)
+int MS_CheckParm (char far *check)
{
- int i;
+ s16int i;
char *parm;
for (i = 1;i<_argc;i++)
@@ -846,7 +846,7 @@
=====================
*/
-static int wolfdigimap[] =
+static s16int wolfdigimap[] =
{
// These first sounds are in the upload version
#ifndef SPEAR
@@ -961,7 +961,7 @@
void InitDigiMap (void)
{
- int *map;
+ s16int *map;
for (map = wolfdigimap;*map != LASTSOUND;map += 2)
DigiMap[map[0]] = map[1];
@@ -1014,8 +1014,8 @@
#ifndef SPEARDEMO
void DoJukebox(void)
{
- int which,lastsong=-1;
- unsigned start,songs[]=
+ s16int which,lastsong=-1;
+ u16int start,songs[]=
{
#ifndef SPEAR
GETTHEM_MUS,
@@ -1144,8 +1144,8 @@
void InitGame (void)
{
- int i,x,y;
- unsigned *blockstart;
+ s16int i,x,y;
+ u16int *blockstart;
if (MS_CheckParm ("virtual"))
virtualreality = true;
@@ -1171,12 +1171,12 @@
if (mminfo.mainmem < 257000L && !MS_CheckParm("debugmode"))
#endif
{
- memptr screen;
+ uchar *screen;
CA_CacheGrChunk (ERRORSCREEN);
screen = grsegs[ERRORSCREEN];
ShutdownId();
- movedata ((unsigned)screen,7+7*160,0xb800,0,17*160);
+ movedata ((u16int)screen,7+7*160,0xb800,0,17*160);
gotoxy (1,23);
exit(1);
}
@@ -1235,7 +1235,7 @@
#if 0
{
-int temp,i;
+s16int temp,i;
temp = viewsize;
profilehandle = open("SCALERS.TXT", O_CREAT | O_WRONLY | O_TEXT);
for (i=1;i<20;i++)
@@ -1275,7 +1275,7 @@
==========================
*/
-boolean SetViewSize (unsigned width, unsigned height)
+int SetViewSize (u16int width, u16int height)
{
viewwidth = width&~15; // must be divisable by 16
viewheight = height&~1; // must be even
@@ -1306,9 +1306,9 @@
}
-void ShowViewSize (int width)
+void ShowViewSize (s16int width)
{
- int oldwidth,oldheight;
+ s16int oldwidth,oldheight;
oldwidth = viewwidth;
oldheight = viewheight;
@@ -1322,7 +1322,7 @@
}
-void NewViewSize (int width)
+void NewViewSize (s16int width)
{
CA_UpLevel ();
MM_SortMem ();
@@ -1345,8 +1345,8 @@
void Quit (char *error)
{
- unsigned finscreen;
- memptr screen;
+ u16int finscreen;
+ uchar *screen;
if (virtualreality)
geninterrupt(0x61);
@@ -1370,7 +1370,7 @@
if (error && *error)
{
- movedata ((unsigned)screen,7,0xb800,0,7*160);
+ movedata ((u16int)screen,7,0xb800,0,7*160);
gotoxy (10,4);
puts(error);
gotoxy (1,8);
@@ -1381,7 +1381,7 @@
{
clrscr();
#ifndef JAPAN
- movedata ((unsigned)screen,7,0xb800,0,4000);
+ movedata ((u16int)screen,7,0xb800,0,4000);
gotoxy(1,24);
#endif
//asm mov bh,0
@@ -1410,10 +1410,10 @@
void DemoLoop (void)
{
- static int LastDemo;
- int i,level;
- long nsize;
- memptr nullblock;
+ static s16int LastDemo;
+ s16int i,level;
+ s32int nsize;
+ uchar *nullblock;
//
// check for launch from ted
@@ -1449,7 +1449,7 @@
//
-// nsize = (long)40*1024;
+// nsize = (s32int)40*1024;
// MM_GetPtr(&nullblock,nsize);
#ifndef DEMOTEST
@@ -1585,7 +1585,7 @@
void main (void)
{
- int i;
+ s16int i;
#ifdef BETA
--- a/menu.c
+++ b/menu.c
@@ -270,7 +270,7 @@
;
-int color_hlite[]={
+s16int color_hlite[]={
DEACTIVE,
HIGHLIGHT,
READHCOLOR,
@@ -284,10 +284,10 @@
0x6b
};
-int EpisodeSelect[6]={1};
+s16int EpisodeSelect[6]={1};
-int SaveGamesAvail[10],StartGame,SoundStatus=1,pickquick;
+s16int SaveGamesAvail[10],StartGame,SoundStatus=1,pickquick;
char SaveGameNames[10][32],SaveName[13]="SAVEGAM?.";
@@ -296,7 +296,7 @@
// INPUT MANAGER SCANCODE TABLES
//
////////////////////////////////////////////////////////////////////
-static byte
+static u8int
*ScanNames[] = // Scan code names with single chars
{
"?","?","1","2","3","4","5","6","7","8","9","0","-","+","?","?",
@@ -329,9 +329,9 @@
// Wolfenstein Control Panel! Ta Da!
//
////////////////////////////////////////////////////////////////////
-void US_ControlPanel(byte scancode)
+void US_ControlPanel(u8int scancode)
{
- int which,i,start;
+ s16int which,i,start;
if (ingame)
@@ -476,7 +476,7 @@
if (SoundMode != sdm_Off)
for (i=0;i<NUMSOUNDS;i++,start++)
if (audiosegs[start])
- MM_SetPurge (&(memptr)audiosegs[start],3); // make purgable
+ MM_SetPurge (&(uchar *)audiosegs[start],3); // make purgable
}
#endif
@@ -647,7 +647,7 @@
// CHECK QUICK-KEYS & QUIT (WHILE IN A GAME)
//
////////////////////////////////////////////////////////////////////
-int CP_CheckQuick(unsigned scancode)
+s16int CP_CheckQuick(u16int scancode)
{
switch(scancode)
{
@@ -830,7 +830,7 @@
#endif
#endif
{
- int i;
+ s16int i;
VW_UpdateScreen();
@@ -861,7 +861,7 @@
// END THE CURRENT GAME
//
////////////////////////////////////////////////////////////////////
-int CP_EndGame(void)
+s16int CP_EndGame(void)
{
#ifdef JAPAN
if (!GetYorN(7,8,C_JAPQUITPIC))
@@ -925,7 +925,7 @@
////////////////////////////////////////////////////////////////////
void CP_NewGame(void)
{
- int which,episode;
+ s16int which,episode;
#ifdef SPEAR
UnCacheLump (OPTIONS_LUMP_START,OPTIONS_LUMP_END);
@@ -1049,7 +1049,7 @@
//
void DrawNewEpisode(void)
{
- int i;
+ s16int i;
#ifdef JAPAN
CA_CacheScreen(S_EPISODEPIC);
@@ -1121,7 +1121,7 @@
//
// DRAW NEW GAME GRAPHIC
//
-void DrawNewGameDiff(int w)
+void DrawNewGameDiff(s16int w)
{
VWB_DrawPic(NM_X+185,NM_Y+7,w+C_BABYMODEPIC);
}
@@ -1134,7 +1134,7 @@
////////////////////////////////////////////////////////////////////
void CP_Sound(void)
{
- int which,i;
+ s16int which,i;
#ifdef SPEAR
@@ -1251,7 +1251,7 @@
//
void DrawSoundMenu(void)
{
- int i,on;
+ s16int i,on;
#ifdef JAPAN
@@ -1340,7 +1340,7 @@
//
// DRAW LOAD/SAVE IN PROGRESS
//
-void DrawLSAction(int which)
+void DrawLSAction(s16int which)
{
#define LSA_X 96
#define LSA_Y 80
@@ -1370,9 +1370,9 @@
// LOAD SAVED GAMES
//
////////////////////////////////////////////////////////////////////
-int CP_LoadGame(int quick)
+s16int CP_LoadGame(s16int quick)
{
- int handle,which,exit=0;
+ s16int handle,which,exit=0;
char name[13];
@@ -1465,9 +1465,9 @@
//
// HIGHLIGHT CURRENT SELECTED ENTRY
//
-void TrackWhichGame(int w)
+void TrackWhichGame(s16int w)
{
- static int lastgameon=0;
+ static s16int lastgameon=0;
PrintLSEntry(lastgameon,TEXTCOLOR);
PrintLSEntry(w,HIGHLIGHT);
@@ -1480,12 +1480,12 @@
//
// DRAW THE LOAD/SAVE SCREEN
//
-void DrawLoadSaveScreen(int loadsave)
+void DrawLoadSaveScreen(s16int loadsave)
{
#define DISKX 100
#define DISKY 0
- int i;
+ s16int i;
ClearMScreen();
@@ -1513,7 +1513,7 @@
//
// PRINT LOAD/SAVE GAME ENTRY W/BOX OUTLINE
//
-void PrintLSEntry(int w,int color)
+void PrintLSEntry(s16int w,s16int color)
{
SETFONTCOLOR(color,BKGDCOLOR);
DrawOutline(LSM_X+LSItems.indent,LSM_Y+w*13,LSM_W-LSItems.indent-15,11,color,color);
@@ -1535,10 +1535,10 @@
// SAVE CURRENT GAME
//
////////////////////////////////////////////////////////////////////
-int CP_SaveGame(int quick)
+s16int CP_SaveGame(s16int quick)
{
- int handle,which,exit=0;
- unsigned nwritten;
+ s16int handle,which,exit=0;
+ u16int nwritten;
char name[13],input[32];
@@ -1660,7 +1660,7 @@
// CALIBRATE JOYSTICK
//
////////////////////////////////////////////////////////////////////
-int CalibrateJoystick(void)
+s16int CalibrateJoystick(void)
{
#define CALX 85
#define CALY 40
@@ -1667,7 +1667,7 @@
#define CALW 158
#define CALH 140
- unsigned xmin,ymin,xmax,ymax,jb;
+ u16int xmin,ymin,xmax,ymax,jb;
@@ -1762,7 +1762,7 @@
{
#define CTL_SPC 70
enum {MOUSEENABLE,JOYENABLE,USEPORT2,PADENABLE,MOUSESENS,CUSTOMIZE};
- int i,which;
+ s16int i,which;
#ifdef SPEAR
@@ -1884,7 +1884,7 @@
void MouseSensitivity(void)
{
ControlInfo ci;
- int exit=0,oldMA;
+ s16int exit=0,oldMA;
oldMA=mouseadjustment;
@@ -1961,7 +1961,7 @@
//
void DrawCtlScreen(void)
{
- int i,x,y;
+ s16int i,x,y;
#ifdef JAPAN
@@ -2049,7 +2049,7 @@
void CustomControls(void)
{
- int which;
+ s16int which;
DrawCustomScreen();
@@ -2131,11 +2131,11 @@
// ENTER CONTROL DATA FOR ANY TYPE OF CONTROL
//
enum {FWRD,RIGHT,BKWD,LEFT};
-int moveorder[4]={LEFT,RIGHT,FWRD,BKWD};
+s16int moveorder[4]={LEFT,RIGHT,FWRD,BKWD};
-void EnterCtrlData(int index,CustomCtrls *cust,void (*DrawRtn)(int),void (*PrintRtn)(int),int type)
+void EnterCtrlData(s16int index,CustomCtrls *cust,void (*DrawRtn)(s16int),void (*PrintRtn)(s16int),s16int type)
{
- int j,exit,tick,redraw,which,x,picked;
+ s16int j,exit,tick,redraw,which,x,picked;
ControlInfo ci;
@@ -2193,7 +2193,7 @@
do
{
- int button,result=0;
+ s16int button,result=0;
if (type==KEYBOARDBTNS||type==KEYBOARDMOVE)
@@ -2236,7 +2236,7 @@
if (result)
{
- int z;
+ s16int z;
for (z=0;z<4;z++)
@@ -2263,7 +2263,7 @@
if (result)
{
- int z;
+ s16int z;
for (z=0;z<4;z++)
@@ -2366,10 +2366,10 @@
//
// FIXUP GUN CURSOR OVERDRAW SHIT
//
-void FixupCustom(int w)
+void FixupCustom(s16int w)
{
- static int lastwhich=-1;
- int y=CST_Y+26+w*13;
+ static s16int lastwhich=-1;
+ s16int y=CST_Y+26+w*13;
VWB_Hlin(7,32,y-1,DEACTIVE);
@@ -2424,7 +2424,7 @@
//
void DrawCustomScreen(void)
{
- int i;
+ s16int i;
#ifdef JAPAN
@@ -2612,9 +2612,9 @@
}
-void PrintCustMouse(int i)
+void PrintCustMouse(s16int i)
{
- int j;
+ s16int j;
for (j=0;j<4;j++)
if (order[i]==buttonmouse[j])
@@ -2625,9 +2625,9 @@
}
}
-void DrawCustMouse(int hilight)
+void DrawCustMouse(s16int hilight)
{
- int i,color;
+ s16int i,color;
color=TEXTCOLOR;
@@ -2648,9 +2648,9 @@
PrintCustMouse(i);
}
-void PrintCustJoy(int i)
+void PrintCustJoy(s16int i)
{
- int j;
+ s16int j;
for (j=0;j<4;j++)
if (order[i]==buttonjoy[j])
@@ -2661,9 +2661,9 @@
}
}
-void DrawCustJoy(int hilight)
+void DrawCustJoy(s16int hilight)
{
- int i,color;
+ s16int i,color;
color=TEXTCOLOR;
@@ -2685,15 +2685,15 @@
}
-void PrintCustKeybd(int i)
+void PrintCustKeybd(s16int i)
{
PrintX=CST_START+CST_SPC*i;
US_Print(IN_GetScanName(buttonscan[order[i]]));
}
-void DrawCustKeybd(int hilight)
+void DrawCustKeybd(s16int hilight)
{
- int i,color;
+ s16int i,color;
color=TEXTCOLOR;
@@ -2706,15 +2706,15 @@
PrintCustKeybd(i);
}
-void PrintCustKeys(int i)
+void PrintCustKeys(s16int i)
{
PrintX=CST_START+CST_SPC*i;
US_Print(IN_GetScanName(dirscan[moveorder[i]]));
}
-void DrawCustKeys(int hilight)
+void DrawCustKeys(s16int hilight)
{
- int i,color;
+ s16int i,color;
color=TEXTCOLOR;
@@ -2735,7 +2735,7 @@
////////////////////////////////////////////////////////////////////
void CP_ChangeView(void)
{
- int exit=0,oldview,newview;
+ s16int exit=0,oldview,newview;
ControlInfo ci;
@@ -2811,7 +2811,7 @@
//
// DRAW THE CHANGEVIEW SCREEN
//
-void DrawChangeView(int view)
+void DrawChangeView(s16int view)
{
#ifdef JAPAN
CA_CacheScreen(S_CHANGEPIC);
@@ -2843,7 +2843,7 @@
////////////////////////////////////////////////////////////////////
void CP_Quit(void)
{
- int i;
+ s16int i;
#ifdef JAPAN
@@ -2896,8 +2896,8 @@
#endif
#define FILLCOLOR 14
- long memory,emshere,xmshere;
- int i,num,ems[10]={100,200,300,400,500,600,700,800,900,1000},
+ s32int memory,emshere,xmshere;
+ s16int i,num,ems[10]={100,200,300,400,500,600,700,800,900,1000},
xms[10]={100,200,300,400,500,600,700,800,900,1000},
main[10]={32,64,96,128,160,192,224,256,288,320};
@@ -2981,9 +2981,9 @@
// Un/Cache a LUMP of graphics
//
////////////////////////////////////////////////////////////////////
-void CacheLump(int lumpstart,int lumpend)
+void CacheLump(s16int lumpstart,s16int lumpend)
{
- int i;
+ s16int i;
for (i=lumpstart;i<=lumpend;i++)
CA_CacheGrChunk(i);
@@ -2990,9 +2990,9 @@
}
-void UnCacheLump(int lumpstart,int lumpend)
+void UnCacheLump(s16int lumpstart,s16int lumpend)
{
- int i;
+ s16int i;
for (i=lumpstart;i<=lumpend;i++)
if (grsegs[i])
@@ -3005,7 +3005,7 @@
// Draw a window for a menu
//
////////////////////////////////////////////////////////////////////
-void DrawWindow(int x,int y,int w,int h,int wcolor)
+void DrawWindow(s16int x,s16int y,s16int w,s16int h,s16int wcolor)
{
VWB_Bar(x,y,w,h,wcolor);
DrawOutline(x,y,w,h,BORD2COLOR,DEACTIVE);
@@ -3012,7 +3012,7 @@
}
-void DrawOutline(int x,int y,int w,int h,int color1,int color2)
+void DrawOutline(s16int x,s16int y,s16int w,s16int h,s16int color1,s16int color2)
{
VWB_Hlin(x,x+w,y,color2);
VWB_Vlin(y,y+h,x,color2);
@@ -3030,7 +3030,7 @@
{
struct ffblk f;
char name[13];
- int which,i;
+ s16int which,i;
//
@@ -3062,7 +3062,7 @@
which=f.ff_name[7]-'0';
if (which<10)
{
- int handle;
+ s16int handle;
char temp[32];
SaveGamesAvail[which]=1;
@@ -3103,11 +3103,11 @@
// Handle moving gun around a menu
//
////////////////////////////////////////////////////////////////////
-int HandleMenu(CP_iteminfo *item_i,CP_itemtype far *items,void (*routine)(int w))
+s16int HandleMenu(CP_iteminfo *item_i,CP_itemtype far *items,void (*routine)(s16int w))
{
char key;
- static int redrawitem=1,lastitem=-1;
- int i,x,y,basey,exit,which,shape,timer;
+ static s16int redrawitem=1,lastitem=-1;
+ s16int i,x,y,basey,exit,which,shape,timer;
ControlInfo ci;
@@ -3170,7 +3170,7 @@
key=LastASCII;
if (key)
{
- int ok=0;
+ s16int ok=0;
//
// CHECK FOR SCREEN CAPTURE
@@ -3349,7 +3349,7 @@
//
// ERASE GUN & DE-HIGHLIGHT STRING
//
-void EraseGun(CP_iteminfo *item_i,CP_itemtype far *items,int x,int y,int which)
+void EraseGun(CP_iteminfo *item_i,CP_itemtype far *items,s16int x,s16int y,s16int which)
{
VWB_Bar(x-1,y,25,16,BKGDCOLOR);
SetTextColor(items+which,0);
@@ -3364,7 +3364,7 @@
//
// DRAW HALF STEP OF GUN TO NEXT POSITION
//
-void DrawHalfStep(int x,int y)
+void DrawHalfStep(s16int x,s16int y)
{
VWB_DrawPic(x,y,C_CURSOR1PIC);
VW_UpdateScreen();
@@ -3377,7 +3377,7 @@
//
// DRAW GUN AT NEW POSITION
//
-void DrawGun(CP_iteminfo *item_i,CP_itemtype far *items,int x,int *y,int which,int basey,void (*routine)(int w))
+void DrawGun(CP_iteminfo *item_i,CP_itemtype far *items,s16int x,s16int *y,s16int which,s16int basey,void (*routine)(s16int w))
{
VWB_Bar(x-1,*y,25,16,BKGDCOLOR);
*y=basey+which*13;
@@ -3402,7 +3402,7 @@
// DELAY FOR AN AMOUNT OF TICS OR UNTIL CONTROLS ARE INACTIVE
//
////////////////////////////////////////////////////////////////////
-void TicDelay(int count)
+void TicDelay(s16int count)
{
ControlInfo ci;
@@ -3422,7 +3422,7 @@
////////////////////////////////////////////////////////////////////
void DrawMenu(CP_iteminfo *item_i,CP_itemtype far *items)
{
- int i,which=item_i->curpos;
+ s16int i,which=item_i->curpos;
WindowX=PrintX=item_i->x+item_i->indent;
@@ -3454,7 +3454,7 @@
// SET TEXT COLOR (HIGHLIGHT OR NO)
//
////////////////////////////////////////////////////////////////////
-void SetTextColor(CP_itemtype far *items,int hlight)
+void SetTextColor(CP_itemtype far *items,s16int hlight)
{
if (hlight)
{SETFONTCOLOR(color_hlite[items->active],BKGDCOLOR);}
@@ -3488,7 +3488,7 @@
////////////////////////////////////////////////////////////////////
void ReadAnyControl(ControlInfo *ci)
{
- int mouseactive=0;
+ s16int mouseactive=0;
IN_ReadControl(0,ci);
@@ -3495,7 +3495,7 @@
if (mouseenabled)
{
- int mousey,mousex;
+ s16int mousey,mousex;
// READ MOUSE MOTION COUNTERS
@@ -3551,7 +3551,7 @@
if (joystickenabled && !mouseactive)
{
- int jx,jy,jb;
+ s16int jx,jy,jb;
INL_GetJoyDelta(joystickport,&jx,&jy);
@@ -3589,9 +3589,9 @@
// DRAW DIALOG AND CONFIRM YES OR NO TO QUESTION
//
////////////////////////////////////////////////////////////////////
-int Confirm(char far *string)
+s16int Confirm(char far *string)
{
- int xit=0,i,x,y,tick=0,time,whichsnd[2]={ESCPRESSEDSND,SHOOTSND};
+ s16int xit=0,i,x,y,tick=0,time,whichsnd[2]={ESCPRESSEDSND,SHOOTSND};
Message(string);
@@ -3665,9 +3665,9 @@
// DRAW MESSAGE & GET Y OR N
//
////////////////////////////////////////////////////////////////////
-int GetYorN(int x,int y,int pic)
+s16int GetYorN(s16int x,s16int y,s16int pic)
{
- int xit=0,whichsnd[2]={ESCPRESSEDSND,SHOOTSND};
+ s16int xit=0,whichsnd[2]={ESCPRESSEDSND,SHOOTSND};
CA_CacheGrChunk(pic);
@@ -3723,7 +3723,7 @@
////////////////////////////////////////////////////////////////////
void Message(char far *string)
{
- int h=0,w=0,mw=0,i,x,y,time;
+ s16int h=0,w=0,mw=0,i,x,y,time;
fontstruct _seg *font;
@@ -3761,14 +3761,14 @@
// THIS MAY BE FIXED A LITTLE LATER...
//
////////////////////////////////////////////////////////////////////
-static int lastmusic;
+static s16int lastmusic;
-void StartCPMusic(int song)
+void StartCPMusic(s16int song)
{
musicnames chunk;
if (audiosegs[STARTMUSIC + lastmusic]) // JDC
- MM_FreePtr ((memptr *)&audiosegs[STARTMUSIC + lastmusic]);
+ MM_FreePtr ((uchar **)&audiosegs[STARTMUSIC + lastmusic]);
lastmusic = song;
SD_MusicOff();
@@ -3781,7 +3781,7 @@
mmerror = false;
else
{
- MM_SetLock(&((memptr)audiosegs[STARTMUSIC + chunk]),true);
+ MM_SetLock(&((uchar *)audiosegs[STARTMUSIC + chunk]),true);
SD_StartMusic((MusicGroup far *)audiosegs[STARTMUSIC + chunk]);
}
}
@@ -3789,7 +3789,7 @@
void FreeMusic (void)
{
if (audiosegs[STARTMUSIC + lastmusic]) // JDC
- MM_FreePtr ((memptr *)&audiosegs[STARTMUSIC + lastmusic]);
+ MM_FreePtr ((uchar **)&audiosegs[STARTMUSIC + lastmusic]);
}
@@ -3799,11 +3799,11 @@
// specified scan code
//
///////////////////////////////////////////////////////////////////////////
-byte *
-IN_GetScanName(ScanCode scan)
+u8int *
+IN_GetScanName(u8int scan)
{
- byte **p;
- ScanCode far *s;
+ u8int **p;
+ u8int far *s;
for (s = ExtScanCodes,p = ExtScanNames;*s;p++,s++)
if (*s == scan)
@@ -3843,7 +3843,7 @@
///////////////////////////////////////////////////////////////////////////
void DrawMenuGun(CP_iteminfo *iteminfo)
{
- int x,y;
+ s16int x,y;
x=iteminfo->x;
@@ -3857,7 +3857,7 @@
// DRAW SCREEN TITLE STRIPES
//
///////////////////////////////////////////////////////////////////////////
-void DrawStripes(int y)
+void DrawStripes(s16int y)
{
#ifndef SPEAR
VWB_Bar(0,y,320,24,0);
--- a/menu.h
+++ b/menu.h
@@ -91,17 +91,17 @@
// TYPEDEFS
//
typedef struct {
- int x,y,amount,curpos,indent;
+ s16int x,y,amount,curpos,indent;
} CP_iteminfo;
typedef struct {
- int active;
+ s16int active;
char string[36];
- void (* routine)(int temp1);
+ void (* routine)(s16int temp1);
} CP_itemtype;
typedef struct {
- int allowed[4];
+ s16int allowed[4];
} CustomCtrls;
extern CP_itemtype far MainMenu[],far NewEMenu[];
@@ -114,19 +114,19 @@
void CleanupControlPanel(void);
void DrawMenu(CP_iteminfo *item_i,CP_itemtype far *items);
-int HandleMenu(CP_iteminfo *item_i,
+s16int HandleMenu(CP_iteminfo *item_i,
CP_itemtype far *items,
- void (*routine)(int w));
+ void (*routine)(s16int w));
void ClearMScreen(void);
-void DrawWindow(int x,int y,int w,int h,int wcolor);
-void DrawOutline(int x,int y,int w,int h,int color1,int color2);
+void DrawWindow(s16int x,s16int y,s16int w,s16int h,s16int wcolor);
+void DrawOutline(s16int x,s16int y,s16int w,s16int h,s16int color1,s16int color2);
void WaitKeyUp(void);
void ReadAnyControl(ControlInfo *ci);
-void TicDelay(int count);
-void CacheLump(int lumpstart,int lumpend);
-void UnCacheLump(int lumpstart,int lumpend);
-void StartCPMusic(int song);
-int Confirm(char far *string);
+void TicDelay(s16int count);
+void CacheLump(s16int lumpstart,s16int lumpend);
+void UnCacheLump(s16int lumpstart,s16int lumpend);
+void StartCPMusic(s16int song);
+s16int Confirm(char far *string);
void Message(char far *string);
void CheckPause(void);
void ShootSnd(void);
@@ -133,54 +133,54 @@
void CheckSecretMissions(void);
void BossKey(void);
-void DrawGun(CP_iteminfo *item_i,CP_itemtype far *items,int x,int *y,int which,int basey,void (*routine)(int w));
-void DrawHalfStep(int x,int y);
-void EraseGun(CP_iteminfo *item_i,CP_itemtype far *items,int x,int y,int which);
-void SetTextColor(CP_itemtype far *items,int hlight);
+void DrawGun(CP_iteminfo *item_i,CP_itemtype far *items,s16int x,s16int *y,s16int which,s16int basey,void (*routine)(s16int w));
+void DrawHalfStep(s16int x,s16int y);
+void EraseGun(CP_iteminfo *item_i,CP_itemtype far *items,s16int x,s16int y,s16int which);
+void SetTextColor(CP_itemtype far *items,s16int hlight);
void DrawMenuGun(CP_iteminfo *iteminfo);
-void DrawStripes(int y);
+void DrawStripes(s16int y);
void DefineMouseBtns(void);
void DefineJoyBtns(void);
void DefineKeyBtns(void);
void DefineKeyMove(void);
-void EnterCtrlData(int index,CustomCtrls *cust,void (*DrawRtn)(int),void (*PrintRtn)(int),int type);
+void EnterCtrlData(s16int index,CustomCtrls *cust,void (*DrawRtn)(s16int),void (*PrintRtn)(s16int),s16int type);
void DrawMainMenu(void);
void DrawSoundMenu(void);
-void DrawLoadSaveScreen(int loadsave);
+void DrawLoadSaveScreen(s16int loadsave);
void DrawNewEpisode(void);
void DrawNewGame(void);
-void DrawChangeView(int view);
+void DrawChangeView(s16int view);
void DrawMouseSens(void);
void DrawCtlScreen(void);
void DrawCustomScreen(void);
-void DrawLSAction(int which);
-void DrawCustMouse(int hilight);
-void DrawCustJoy(int hilight);
-void DrawCustKeybd(int hilight);
-void DrawCustKeys(int hilight);
-void PrintCustMouse(int i);
-void PrintCustJoy(int i);
-void PrintCustKeybd(int i);
-void PrintCustKeys(int i);
+void DrawLSAction(s16int which);
+void DrawCustMouse(s16int hilight);
+void DrawCustJoy(s16int hilight);
+void DrawCustKeybd(s16int hilight);
+void DrawCustKeys(s16int hilight);
+void PrintCustMouse(s16int i);
+void PrintCustJoy(s16int i);
+void PrintCustKeybd(s16int i);
+void PrintCustKeys(s16int i);
-void PrintLSEntry(int w,int color);
-void TrackWhichGame(int w);
-void DrawNewGameDiff(int w);
-void FixupCustom(int w);
+void PrintLSEntry(s16int w,s16int color);
+void TrackWhichGame(s16int w);
+void DrawNewGameDiff(s16int w);
+void FixupCustom(s16int w);
void CP_NewGame(void);
void CP_Sound(void);
-int CP_LoadGame(int quick);
-int CP_SaveGame(int quick);
+s16int CP_LoadGame(s16int quick);
+s16int CP_SaveGame(s16int quick);
void CP_Control(void);
void CP_ChangeView(void);
void CP_ExitOptions(void);
void CP_Quit(void);
void CP_ViewScores(void);
-int CP_EndGame(void);
-int CP_CheckQuick(unsigned scancode);
+s16int CP_EndGame(void);
+s16int CP_CheckQuick(u16int scancode);
void CustomControls(void);
void MouseSensitivity(void);
@@ -189,7 +189,7 @@
//
// VARIABLES
//
-extern int SaveGamesAvail[10],StartGame,SoundStatus;
+extern s16int SaveGamesAvail[10],StartGame,SoundStatus;
extern char SaveGameNames[10][32],SaveName[13];
enum {MOUSE,JOYSTICK,KEYBOARDBTNS,KEYBOARDMOVE}; // FOR INPUT TYPES
@@ -218,14 +218,14 @@
// WL_INTER
//
typedef struct {
- int kill,secret,treasure;
- long time;
+ s16int kill,secret,treasure;
+ s32int time;
} LRstruct;
extern LRstruct LevelRatios[];
-void Write (int x,int y,char *string);
+void Write (s16int x,s16int y,char *string);
void NonShareware(void);
-int GetYorN(int x,int y,int pic);
+s16int GetYorN(s16int x,s16int y,s16int pic);
--- a/mm.c
+++ b/mm.c
@@ -47,9 +47,9 @@
typedef struct mmblockstruct
{
- unsigned start,length;
- unsigned attributes;
- memptr *useptr; // pointer to the segment start
+ u16int start,length;
+ u16int attributes;
+ uchar **useptr; // pointer to the segment start
struct mmblockstruct far *next;
} mmblocktype;
@@ -70,8 +70,8 @@
*/
mminfotype mminfo;
-memptr bufferseg;
-boolean mmerror;
+uchar *bufferseg;
+int mmerror;
void (* beforesort) (void);
void (* aftersort) (void);
@@ -84,7 +84,7 @@
=============================================================================
*/
-boolean mmstarted;
+int mmstarted;
void far *farheap;
void *nearheap;
@@ -92,13 +92,13 @@
mmblocktype far mmblocks[MAXBLOCKS]
,far *mmhead,far *mmfree,far *mmrover,far *mmnew;
-boolean bombonerror;
+int bombonerror;
-//unsigned totalEMSpages,freeEMSpages,EMSpageframe,EMSpagesmapped,EMShandle;
+//u16int totalEMSpages,freeEMSpages,EMSpageframe,EMSpagesmapped,EMShandle;
void (* XMSaddr) (void); // far pointer to XMS driver
-unsigned numUMBs,UMBbase[MAXUMBS];
+u16int numUMBs,UMBbase[MAXUMBS];
//==========================================================================
@@ -106,12 +106,12 @@
// local prototypes
//
-boolean MML_CheckForEMS (void);
+int MML_CheckForEMS (void);
void MML_ShutdownEMS (void);
void MM_MapEMS (void);
-boolean MML_CheckForXMS (void);
+int MML_CheckForXMS (void);
void MML_ShutdownXMS (void);
-void MML_UseSpace (unsigned segstart, unsigned seglength);
+void MML_UseSpace (u16int segstart, u16int seglength);
void MML_ClearBlock (void);
//==========================================================================
@@ -126,7 +126,7 @@
=======================
*/
-boolean MML_CheckForXMS (void)
+int MML_CheckForXMS (void)
{
numUMBs = 0;
@@ -155,7 +155,7 @@
void MML_SetupXMS (void)
{
- unsigned base,size;
+ u16int base,size;
asm {
mov ax,0x4310
@@ -207,8 +207,8 @@
void MML_ShutdownXMS (void)
{
- int i;
- unsigned base;
+ s16int i;
+ u16int base;
for (i=0;i<numUMBs;i++)
{
@@ -234,11 +234,11 @@
======================
*/
-void MML_UseSpace (unsigned segstart, unsigned seglength)
+void MML_UseSpace (u16int segstart, u16int seglength)
{
mmblocktype far *scan,far *last;
- unsigned oldend;
- long extra;
+ u16int oldend;
+ s32int extra;
scan = last = mmhead;
mmrover = mmhead; // reset rover to start of memory
@@ -332,10 +332,10 @@
void MM_Startup (void)
{
- int i;
- unsigned long length;
+ s16int i;
+ u32int length;
void far *start;
- unsigned segstart,seglength,endfree;
+ u16int segstart,seglength,endfree;
if (mmstarted)
MM_Shutdown ();
@@ -432,12 +432,12 @@
====================
*/
-void MM_GetPtr (memptr *baseptr,unsigned long size)
+void MM_GetPtr (uchar **baseptr,u32int size)
{
mmblocktype far *scan,far *lastscan,far *endscan
,far *purge,far *next;
- int search;
- unsigned needed,startseg;
+ s16int search;
+ u16int needed,startseg;
needed = (size+15)/16; // convert size from bytes to paragraphs
@@ -489,7 +489,7 @@
//
purge = lastscan->next;
lastscan->next = mmnew;
- mmnew->start = *(unsigned *)baseptr = startseg;
+ mmnew->start = *(u16int *)baseptr = startseg;
mmnew->next = scan;
while ( purge != scan)
{ // free the purgable block
@@ -520,9 +520,9 @@
{
extern char configname[];
-extern boolean insetupscaling;
-extern int viewsize;
-boolean SetViewSize (unsigned width, unsigned height);
+extern int insetupscaling;
+extern s16int viewsize;
+int SetViewSize (u16int width, u16int height);
#define HEIGHTRATIO 0.50
//
// wolf hack -- size the view down
@@ -556,7 +556,7 @@
====================
*/
-void MM_FreePtr (memptr *baseptr)
+void MM_FreePtr (uchar **baseptr)
{
mmblocktype far *scan,far *last;
@@ -591,7 +591,7 @@
=====================
*/
-void MM_SetPurge (memptr *baseptr, int purge)
+void MM_SetPurge (uchar **baseptr, s16int purge)
{
mmblocktype far *start;
@@ -627,7 +627,7 @@
=====================
*/
-void MM_SetLock (memptr *baseptr, boolean locked)
+void MM_SetLock (uchar **baseptr, int locked)
{
mmblocktype far *start;
@@ -666,8 +666,8 @@
void MM_SortMem (void)
{
mmblocktype far *scan,far *last,far *next;
- unsigned start,length,source,dest;
- int playing;
+ u16int start,length,source,dest;
+ s16int playing;
//
// lock down a currently playing sound
@@ -684,7 +684,7 @@
playing += STARTADLIBSOUNDS;
break;
}
- MM_SetLock(&(memptr)audiosegs[playing],true);
+ MM_SetLock(&(uchar *)audiosegs[playing],true);
}
@@ -739,7 +739,7 @@
movedata(source,0,dest,0,length*16);
scan->start = start;
- *(unsigned *)scan->useptr = start;
+ *(u16int *)scan->useptr = start;
}
start = scan->start + scan->length;
}
@@ -755,7 +755,7 @@
aftersort();
if (playing)
- MM_SetLock(&(memptr)audiosegs[playing],false);
+ MM_SetLock(&(uchar *)audiosegs[playing],false);
}
@@ -772,8 +772,8 @@
void MM_ShowMemory (void)
{
mmblocktype far *scan;
- unsigned color,temp,x,y;
- long end,owner;
+ u16int color,temp,x,y;
+ s32int end,owner;
char scratch[80],str[10];
temp = bufferofs;
@@ -822,8 +822,8 @@
void MM_DumpData (void)
{
mmblocktype far *scan,far *best;
- long lowest,oldlowest;
- unsigned owner;
+ s32int lowest,oldlowest;
+ u16int owner;
char lock,purge;
FILE *dumpfile;
@@ -842,7 +842,7 @@
scan = mmhead;
while (scan)
{
- owner = (unsigned)scan->useptr;
+ owner = (u16int)scan->useptr;
if (owner && owner<lowest && owner > oldlowest)
{
@@ -864,7 +864,7 @@
else
lock = '-';
fprintf (dumpfile,"0x%p (%c%c) = %u\n"
- ,(unsigned)lowest,lock,purge,best->length);
+ ,(u16int)lowest,lock,purge,best->length);
}
} while (lowest != 0xffff);
@@ -886,9 +886,9 @@
======================
*/
-long MM_UnusedMemory (void)
+s32int MM_UnusedMemory (void)
{
- unsigned free;
+ u16int free;
mmblocktype far *scan;
free = 0;
@@ -916,9 +916,9 @@
======================
*/
-long MM_TotalFree (void)
+s32int MM_TotalFree (void)
{
- unsigned free;
+ u16int free;
mmblocktype far *scan;
free = 0;
@@ -945,7 +945,7 @@
=====================
*/
-void MM_BombOnError (boolean bomb)
+void MM_BombOnError (int bomb)
{
bombonerror = bomb;
}
--- a/mm.h
+++ b/mm.h
@@ -55,18 +55,16 @@
//==========================================================================
-typedef void _seg * memptr;
-
typedef struct
{
- long nearheap,farheap,EMSmem,XMSmem,mainmem;
+ s32int nearheap,farheap,EMSmem,XMSmem,mainmem;
} mminfotype;
//==========================================================================
extern mminfotype mminfo;
-extern memptr bufferseg;
-extern boolean mmerror;
+extern uchar *bufferseg;
+extern int mmerror;
extern void (* beforesort) (void);
extern void (* aftersort) (void);
@@ -77,20 +75,20 @@
void MM_Shutdown (void);
void MM_MapEMS (void);
-void MM_GetPtr (memptr *baseptr,unsigned long size);
-void MM_FreePtr (memptr *baseptr);
+void MM_GetPtr (uchar **baseptr,u32int size);
+void MM_FreePtr (uchar **baseptr);
-void MM_SetPurge (memptr *baseptr, int purge);
-void MM_SetLock (memptr *baseptr, boolean locked);
+void MM_SetPurge (uchar **baseptr, s16int purge);
+void MM_SetLock (uchar **baseptr, int locked);
void MM_SortMem (void);
void MM_ShowMemory (void);
-long MM_UnusedMemory (void);
-long MM_TotalFree (void);
+s32int MM_UnusedMemory (void);
+s32int MM_TotalFree (void);
-void MM_BombOnError (boolean bomb);
+void MM_BombOnError (int bomb);
-void MML_UseSpace (unsigned segstart, unsigned seglength);
+void MML_UseSpace (u16int segstart, u16int seglength);
#endif
\ No newline at end of file
--- a/munge.c
+++ b/munge.c
@@ -7,10 +7,10 @@
=================
*/
-void VL_MungePic (unsigned char far *source, unsigned width, unsigned height)
+void VL_MungePic (uchar far *source, u16int width, u16int height)
{
- unsigned x,y,plane,size,pwidth;
- unsigned char far *temp, far *dest, far *srcline;
+ u16int x,y,plane,size,pwidth;
+ uchar far *temp, far *dest, far *srcline;
size = width*height;
@@ -20,7 +20,7 @@
//
// copy the pic to a temp buffer
//
- temp = (unsigned char far *)farmalloc (size);
+ temp = (uchar far *)farmalloc (size);
if (!temp)
errout ("Non enough memory for munge buffer!\n");
--- a/play.c
+++ b/play.c
@@ -22,60 +22,60 @@
=============================================================================
*/
-boolean madenoise; // true when shooting or screaming
+int madenoise; // true when shooting or screaming
exit_t playstate;
-int DebugOk;
+s16int DebugOk;
objtype objlist[MAXACTORS],*new,*obj,*player,*lastobj,
*objfreelist,*killerobj;
-unsigned farmapylookup[MAPSIZE];
-byte *nearmapylookup[MAPSIZE];
+u16int farmapylookup[MAPSIZE];
+u8int *nearmapylookup[MAPSIZE];
-boolean singlestep,godmode,noclip;
-int extravbls;
+int singlestep,godmode,noclip;
+s16int extravbls;
-byte tilemap[MAPSIZE][MAPSIZE]; // wall values only
-byte spotvis[MAPSIZE][MAPSIZE];
+u8int tilemap[MAPSIZE][MAPSIZE]; // wall values only
+u8int spotvis[MAPSIZE][MAPSIZE];
objtype *actorat[MAPSIZE][MAPSIZE];
//
// replacing refresh manager
//
-unsigned mapwidth,mapheight,tics;
-boolean compatability;
-byte *updateptr;
-unsigned mapwidthtable[64];
-unsigned uwidthtable[UPDATEHIGH];
-unsigned blockstarts[UPDATEWIDE*UPDATEHIGH];
-byte update[UPDATESIZE];
+u16int mapwidth,mapheight,tics;
+int compatability;
+u8int *updateptr;
+u16int mapwidthtable[64];
+u16int uwidthtable[UPDATEHIGH];
+u16int blockstarts[UPDATEWIDE*UPDATEHIGH];
+u8int update[UPDATESIZE];
//
// control info
//
-boolean mouseenabled,joystickenabled,joypadenabled,joystickprogressive;
-int joystickport;
-int dirscan[4] = {sc_UpArrow,sc_RightArrow,sc_DownArrow,sc_LeftArrow};
-int buttonscan[NUMBUTTONS] =
+int mouseenabled,joystickenabled,joypadenabled,joystickprogressive;
+s16int joystickport;
+s16int dirscan[4] = {sc_UpArrow,sc_RightArrow,sc_DownArrow,sc_LeftArrow};
+s16int buttonscan[NUMBUTTONS] =
{sc_Control,sc_Alt,sc_RShift,sc_Space,sc_1,sc_2,sc_3,sc_4};
-int buttonmouse[4]={bt_attack,bt_strafe,bt_use,bt_nobutton};
-int buttonjoy[4]={bt_attack,bt_strafe,bt_use,bt_run};
+s16int buttonmouse[4]={bt_attack,bt_strafe,bt_use,bt_nobutton};
+s16int buttonjoy[4]={bt_attack,bt_strafe,bt_use,bt_run};
-int viewsize;
+s16int viewsize;
-boolean buttonheld[NUMBUTTONS];
+int buttonheld[NUMBUTTONS];
-boolean demorecord,demoplayback;
+int demorecord,demoplayback;
char far *demoptr, far *lastdemoptr;
-memptr demobuffer;
+uchar *demobuffer;
//
// curent user input
//
-int controlx,controly; // range from -100 to 100 per tic
-boolean buttonstate[NUMBUTTONS];
+s16int controlx,controly; // range from -100 to 100 per tic
+int buttonstate[NUMBUTTONS];
@@ -82,7 +82,7 @@
//===========================================================================
-void CenterWindow(word w,word h);
+void CenterWindow(u16int w,u16int h);
void InitObjList (void);
void RemoveObj (objtype *gone);
void PollControls (void);
@@ -104,7 +104,7 @@
//
// LIST OF SONGS FOR EACH VERSION
//
-int songs[]=
+s16int songs[]=
{
#ifndef SPEAR
//
@@ -207,7 +207,7 @@
XFUNKIE_MUS,
XDEATH_MUS,
XGETYOU_MUS, // DON'T KNOW
- ULTIMATE_MUS, // Trans Gr�sse
+ ULTIMATE_MUS, // Trans Gr�sse
DUNGEON_MUS,
GOINGAFT_MUS,
@@ -260,7 +260,7 @@
void PollKeyboardButtons (void)
{
- int i;
+ s16int i;
for (i=0;i<NUMBUTTONS;i++)
if (Keyboard[buttonscan[i]])
@@ -278,7 +278,7 @@
void PollMouseButtons (void)
{
- int buttons;
+ s16int buttons;
buttons = IN_MouseButtons ();
@@ -302,7 +302,7 @@
void PollJoystickButtons (void)
{
- int buttons;
+ s16int buttons;
buttons = IN_JoyButtons ();
@@ -375,7 +375,7 @@
void PollMouseMove (void)
{
- int mousexmove,mouseymove;
+ s16int mousexmove,mouseymove;
Mouse(MDelta);
mousexmove = _CX;
@@ -397,7 +397,7 @@
void PollJoystickMove (void)
{
- int joyx,joyy;
+ s16int joyx,joyy;
INL_GetJoyDelta(joystickport,&joyx,&joyy);
@@ -454,8 +454,8 @@
void PollControls (void)
{
- int max,min,i;
- byte buttonbits;
+ s16int max,min,i;
+ u8int buttonbits;
//
// get timing info for last frame
@@ -505,8 +505,8 @@
if (demoptr == lastdemoptr)
playstate = ex_completed; // demo is done
- controlx *= (int)tics;
- controly *= (int)tics;
+ controlx *= (s16int)tics;
+ controly *= (s16int)tics;
return;
}
@@ -554,8 +554,8 @@
//
// save info out to demo buffer
//
- controlx /= (int)tics;
- controly /= (int)tics;
+ controlx /= (s16int)tics;
+ controly /= (s16int)tics;
buttonbits = 0;
@@ -573,8 +573,8 @@
if (demoptr >= lastdemoptr)
Quit ("Demo buffer overflowed!");
- controlx *= (int)tics;
- controly *= (int)tics;
+ controlx *= (s16int)tics;
+ controly *= (s16int)tics;
}
}
@@ -594,7 +594,7 @@
#define MAXX 320
#define MAXY 160
-void CenterWindow(word w,word h)
+void CenterWindow(u16int w,u16int h)
{
FixOfs ();
US_DrawWindow(((MAXX / 8) - w) / 2,((MAXY / 8) - h) / 2,w,h);
@@ -613,9 +613,9 @@
void CheckKeys (void)
{
- int i;
- byte scan;
- unsigned temp;
+ s16int i;
+ u8int scan;
+ u16int temp;
if (screenfaded || demoplayback) // don't do anything with a faded screen
@@ -870,11 +870,11 @@
=========================
*/
-int objcount;
+s16int objcount;
void InitActorList (void)
{
- int i;
+ s16int i;
//
// init the actor lists
@@ -998,14 +998,14 @@
void StopMusic(void)
{
- int i;
+ s16int i;
SD_MusicOff();
for (i = 0;i < LASTMUSIC;i++)
if (audiosegs[STARTMUSIC + i])
{
- MM_SetPurge(&((memptr)audiosegs[STARTMUSIC + i]),3);
- MM_SetLock(&((memptr)audiosegs[STARTMUSIC + i]),false);
+ MM_SetPurge(&((uchar *)audiosegs[STARTMUSIC + i]),3);
+ MM_SetLock(&((uchar *)audiosegs[STARTMUSIC + i]),false);
}
}
@@ -1037,7 +1037,7 @@
mmerror = false;
else
{
- MM_SetLock(&((memptr)audiosegs[STARTMUSIC + chunk]),true);
+ MM_SetLock(&((uchar *)audiosegs[STARTMUSIC + chunk]),true);
SD_StartMusic((MusicGroup far *)audiosegs[STARTMUSIC + chunk]);
}
}
@@ -1059,13 +1059,13 @@
#define WHITETICS 6
-byte far redshifts[NUMREDSHIFTS][768];
-byte far whiteshifts[NUMREDSHIFTS][768];
+u8int far redshifts[NUMREDSHIFTS][768];
+u8int far whiteshifts[NUMREDSHIFTS][768];
-int damagecount,bonuscount;
-boolean palshifted;
+s16int damagecount,bonuscount;
+int palshifted;
-extern byte far gamepal;
+extern u8int far gamepal;
/*
=====================
@@ -1077,8 +1077,8 @@
void InitRedShifts (void)
{
- byte far *workptr, far *baseptr;
- int i,j,delta;
+ u8int far *workptr, far *baseptr;
+ s16int i,j,delta;
//
@@ -1086,7 +1086,7 @@
//
for (i=1;i<=NUMREDSHIFTS;i++)
{
- workptr = (byte far *)&redshifts[i-1][0];
+ workptr = (u8int far *)&redshifts[i-1][0];
baseptr = &gamepal;
for (j=0;j<=255;j++)
@@ -1102,7 +1102,7 @@
for (i=1;i<=NUMWHITESHIFTS;i++)
{
- workptr = (byte far *)&whiteshifts[i-1][0];
+ workptr = (u8int far *)&whiteshifts[i-1][0];
baseptr = &gamepal;
for (j=0;j<=255;j++)
@@ -1154,7 +1154,7 @@
=====================
*/
-void StartDamageFlash (int damage)
+void StartDamageFlash (s16int damage)
{
damagecount += damage;
}
@@ -1170,7 +1170,7 @@
void UpdatePaletteShifts (void)
{
- int red,white;
+ s16int red,white;
if (bonuscount)
{
@@ -1362,13 +1362,13 @@
=
===================
*/
-long funnyticount;
+s32int funnyticount;
void PlayLoop (void)
{
- int give;
- int helmetangle;
+ s16int give;
+ s16int helmetangle;
playstate = TimeCount = lasttimecount = 0;
frameon = 0;
--- a/pm.c
+++ b/pm.c
@@ -8,38 +8,38 @@
#pragma hdrstop
// Main Mem specific variables
- boolean MainPresent;
- memptr MainMemPages[PMMaxMainMem];
+ int MainPresent;
+ uchar *MainMemPages[PMMaxMainMem];
PMBlockAttr MainMemUsed[PMMaxMainMem];
- int MainPagesAvail;
+ s16int MainPagesAvail;
// EMS specific variables
- boolean EMSPresent;
- word EMSAvail,EMSPagesAvail,EMSHandle,
+ int EMSPresent;
+ u16int EMSAvail,EMSPagesAvail,EMSHandle,
EMSPageFrame,EMSPhysicalPage;
EMSListStruct EMSList[EMSFrameCount];
// XMS specific variables
- boolean XMSPresent;
- word XMSAvail,XMSPagesAvail,XMSHandle;
- longword XMSDriver;
- int XMSProtectPage = -1;
+ int XMSPresent;
+ u16int XMSAvail,XMSPagesAvail,XMSHandle;
+ u32int XMSDriver;
+ s16int XMSProtectPage = -1;
// File specific variables
char PageFileName[13] = {"VSWAP."};
- int PageFile = -1;
- word ChunksInFile;
- word PMSpriteStart,PMSoundStart;
+ s16int PageFile = -1;
+ u16int ChunksInFile;
+ u16int PMSpriteStart,PMSoundStart;
// General usage variables
- boolean PMStarted,
+ int PMStarted,
PMPanicMode,
PMThrashing;
- word XMSPagesUsed,
+ u16int XMSPagesUsed,
EMSPagesUsed,
MainPagesUsed,
PMNumBlocks;
- long PMFrameCount;
+ s32int PMFrameCount;
PageListStruct far *PMPages,
_seg *PMSegPages;
@@ -55,7 +55,7 @@
// PML_MapEMS() - Maps a logical page to a physical page
//
void
-PML_MapEMS(word logical,word physical)
+PML_MapEMS(u16int logical,u16int physical)
{
_AL = physical;
_BX = logical;
@@ -78,16 +78,16 @@
char EMMDriverName[9] = "EMMXXXX0";
-boolean
+int
PML_StartupEMS(void)
{
- int i;
- long size;
+ s16int i;
+ s32int size;
EMSPresent = false; // Assume that we'll fail
EMSAvail = 0;
- _DX = (word)EMMDriverName;
+ _DX = (u16int)EMMDriverName;
_AX = 0x3d00;
geninterrupt(0x21); // try to open EMMXXXX0 device
asm jnc gothandle
@@ -139,10 +139,10 @@
EMSAvail = _BX;
// Don't hog all available EMS
- size = EMSAvail * (long)EMSPageSize;
- if (size - (EMSPageSize * 2) > (ChunksInFile * (long)PMPageSize))
+ size = EMSAvail * (s32int)EMSPageSize;
+ if (size - (EMSPageSize * 2) > (ChunksInFile * (s32int)PMPageSize))
{
- size = (ChunksInFile * (long)PMPageSize) + EMSPageSize;
+ size = (ChunksInFile * (s32int)PMPageSize) + EMSPageSize;
EMSAvail = size / EMSPageSize;
}
@@ -153,7 +153,7 @@
goto error;
EMSHandle = _DX;
- mminfo.EMSmem += EMSAvail * (long)EMSPageSize;
+ mminfo.EMSmem += EMSAvail * (s32int)EMSPageSize;
// Initialize EMS mapping cache
for (i = 0;i < EMSFrameCount;i++)
@@ -193,7 +193,7 @@
// Makes sure that there's at least a page of XMS available
// Allocates any remaining XMS (rounded down to the nearest page size)
//
-boolean
+int
PML_StartupXMS(void)
{
XMSPresent = false; // Assume failure
@@ -241,31 +241,31 @@
// Will round an odd-length request up to the next even value
//
void
-PML_XMSCopy(boolean toxms,byte far *addr,word xmspage,word length)
+PML_XMSCopy(int toxms,u8int far *addr,u16int xmspage,u16int length)
{
- longword xoffset;
+ u32int xoffset;
struct
{
- longword length;
- word source_handle;
- longword source_offset;
- word target_handle;
- longword target_offset;
+ u32int length;
+ u16int source_handle;
+ u32int source_offset;
+ u16int target_handle;
+ u32int target_offset;
} copy;
if (!addr)
Quit("PML_XMSCopy: zero address");
- xoffset = (longword)xmspage * PMPageSize;
+ xoffset = (u32int)xmspage * PMPageSize;
copy.length = (length + 1) & ~1;
copy.source_handle = toxms? 0 : XMSHandle;
- copy.source_offset = toxms? (long)addr : xoffset;
+ copy.source_offset = toxms? (s32int)addr : xoffset;
copy.target_handle = toxms? XMSHandle : 0;
- copy.target_offset = toxms? xoffset : (long)addr;
+ copy.target_offset = toxms? xoffset : (s32int)addr;
asm push si
- _SI = (word)©
+ _SI = (u16int)©
XMS_CALL(XMS_MOVE);
asm pop si
if (!_AX)
@@ -281,7 +281,7 @@
// segment address to the specified XMS page
//
void
-PML_CopyToXMS(byte far *source,int targetpage,word length)
+PML_CopyToXMS(u8int far *source,s16int targetpage,u16int length)
{
PML_XMSCopy(true,source,targetpage,length);
}
@@ -291,7 +291,7 @@
// page to the specified real mode address
//
void
-PML_CopyFromXMS(byte far *target,int sourcepage,word length)
+PML_CopyFromXMS(u8int far *target,s16int sourcepage,u16int length)
{
PML_XMSCopy(false,target,sourcepage,length);
}
@@ -324,9 +324,9 @@
// PM_UnlockMainMem() macros should be used instead.
//
void
-PM_SetMainMemPurge(int level)
+PM_SetMainMemPurge(s16int level)
{
- int i;
+ s16int i;
for (i = 0;i < PMMaxMainMem;i++)
if (MainMemPages[i])
@@ -349,9 +349,9 @@
void
PM_CheckMainMem(void)
{
- boolean allocfailed;
- int i,n;
- memptr *p;
+ int allocfailed;
+ s16int i,n;
+ uchar **p;
PMBlockAttr *used;
PageListStruct far *page;
@@ -418,8 +418,8 @@
void
PML_StartupMainMem(void)
{
- int i,n;
- memptr *p;
+ s16int i,n;
+ uchar **p;
MainPagesAvail = 0;
MM_BombOnError(false);
@@ -447,8 +447,8 @@
void
PML_ShutdownMainMem(void)
{
- int i;
- memptr *p;
+ s16int i;
+ uchar **p;
// DEBUG - mark pages as unallocated & decrease page count as appropriate
for (i = 0,p = MainMemPages;i < PMMaxMainMem;i++,p++)
@@ -466,7 +466,7 @@
// PML_ReadFromFile() - Reads some data in from the page file
//
void
-PML_ReadFromFile(byte far *buf,long offset,word length)
+PML_ReadFromFile(u8int far *buf,s32int offset,u16int length)
{
if (!buf)
Quit("PML_ReadFromFile: Null pointer");
@@ -484,11 +484,11 @@
void
PML_OpenPageFile(void)
{
- int i;
- long size;
+ s16int i;
+ s32int size;
void _seg *buf;
- longword far *offsetptr;
- word far *lengthptr;
+ u32int far *offsetptr;
+ u16int far *lengthptr;
PageListStruct far *page;
PageFile = open(PageFileName,O_RDONLY + O_BINARY);
@@ -502,27 +502,27 @@
// Allocate and clear the page list
PMNumBlocks = ChunksInFile;
- MM_GetPtr(&(memptr)PMSegPages,sizeof(PageListStruct) * PMNumBlocks);
- MM_SetLock(&(memptr)PMSegPages,true);
+ MM_GetPtr(&(uchar *)PMSegPages,sizeof(PageListStruct) * PMNumBlocks);
+ MM_SetLock(&(uchar *)PMSegPages,true);
PMPages = (PageListStruct far *)PMSegPages;
_fmemset(PMPages,0,sizeof(PageListStruct) * PMNumBlocks);
// Read in the chunk offsets
- size = sizeof(longword) * ChunksInFile;
+ size = sizeof(u32int) * ChunksInFile;
MM_GetPtr(&buf,size);
- if (!CA_FarRead(PageFile,(byte far *)buf,size))
+ if (!CA_FarRead(PageFile,(u8int far *)buf,size))
Quit("PML_OpenPageFile: Offset read failed");
- offsetptr = (longword far *)buf;
+ offsetptr = (u32int far *)buf;
for (i = 0,page = PMPages;i < ChunksInFile;i++,page++)
page->offset = *offsetptr++;
MM_FreePtr(&buf);
// Read in the chunk lengths
- size = sizeof(word) * ChunksInFile;
+ size = sizeof(u16int) * ChunksInFile;
MM_GetPtr(&buf,size);
- if (!CA_FarRead(PageFile,(byte far *)buf,size))
+ if (!CA_FarRead(PageFile,(u8int far *)buf,size))
Quit("PML_OpenPageFile: Length read failed");
- lengthptr = (word far *)buf;
+ lengthptr = (u16int far *)buf;
for (i = 0,page = PMPages;i < ChunksInFile;i++,page++)
page->length = *lengthptr++;
MM_FreePtr(&buf);
@@ -538,7 +538,7 @@
close(PageFile);
if (PMSegPages)
{
- MM_SetLock(&(memptr)PMSegPages,false);
+ MM_SetLock(&(uchar *)PMSegPages,false);
MM_FreePtr(&(void _seg *)PMSegPages);
}
}
@@ -558,11 +558,11 @@
//
#if 1
#pragma argsused // DEBUG - remove lock parameter
-memptr
-PML_GetEMSAddress(int page,PMLockType lock)
+uchar *
+PML_GetEMSAddress(s16int page,PMLockType lock)
{
- int i,emspage;
- word emsoff,emsbase,offset;
+ s16int i,emspage;
+ u16int emsoff,emsbase,offset;
emsoff = page & (PMEMSSubPage - 1);
emsbase = page - emsoff;
@@ -581,7 +581,7 @@
// If page isn't already mapped in, find LRU EMS frame, and use it
if (emspage == -1)
{
- longword last = MAXLONG;
+ u32int last = MAXLONG;
for (i = 0;i < EMSFrameCount;i++)
{
if (EMSList[i].lastHit < last)
@@ -601,19 +601,19 @@
EMSList[emspage].lastHit = PMFrameCount;
offset = emspage * EMSPageSizeSeg;
offset += emsoff * PMPageSizeSeg;
- return((memptr)(EMSPageFrame + offset));
+ return((uchar *)(EMSPageFrame + offset));
}
#else
-memptr
-PML_GetEMSAddress(int page,PMLockType lock)
+uchar *
+PML_GetEMSAddress(s16int page,PMLockType lock)
{
- word emspage;
+ u16int emspage;
emspage = (lock < pml_EMSLock)? 3 : (lock - pml_EMSLock);
PML_MapEMS(page / PMEMSSubPage,emspage);
- return((memptr)(EMSPageFrame + (emspage * EMSPageSizeSeg)
+ return((uchar *)(EMSPageFrame + (emspage * EMSPageSizeSeg)
+ ((page & (PMEMSSubPage - 1)) * PMPageSizeSeg)));
}
#endif
@@ -624,8 +624,8 @@
// Returns nil if block isn't cached into Main Memory or EMS
//
//
-memptr
-PM_GetPageAddress(int pagenum)
+uchar *
+PM_GetPageAddress(s16int pagenum)
{
PageListStruct far *page;
@@ -643,10 +643,10 @@
// present & unlocked main/EMS page (or main page if mainonly is true)
//
int
-PML_GiveLRUPage(boolean mainonly)
+PML_GiveLRUPage(int mainonly)
{
- int i,lru;
- long last;
+ s16int i,lru;
+ s32int last;
PageListStruct far *page;
for (i = 0,page = PMPages,lru = -1,last = MAXLONG;i < ChunksInFile;i++,page++)
@@ -677,8 +677,8 @@
int
PML_GiveLRUXMSPage(void)
{
- int i,lru;
- long last;
+ s16int i,lru;
+ s32int last;
PageListStruct far *page;
for (i = 0,page = PMPages,lru = -1,last = MAXLONG;i < ChunksInFile;i++,page++)
@@ -702,9 +702,9 @@
// it with the main/EMS page
//
void
-PML_PutPageInXMS(int pagenum)
+PML_PutPageInXMS(s16int pagenum)
{
- int usexms;
+ s16int usexms;
PageListStruct far *page;
if (!XMSPresent)
@@ -731,10 +731,10 @@
// PML_TransferPageSpace() - A page is being replaced, so give the new page
// the old one's address space. Returns the address of the new page.
//
-memptr
-PML_TransferPageSpace(int orig,int new)
+uchar *
+PML_TransferPageSpace(s16int orig,s16int new)
{
- memptr addr;
+ uchar *addr;
PageListStruct far *origpage,far *newpage;
if (orig == new)
@@ -776,11 +776,11 @@
// If mainonly is true, free EMS will be ignored, and only main pages
// will be looked at by PML_GiveLRUPage().
//
-byte far *
-PML_GetAPageBuffer(int pagenum,boolean mainonly)
+u8int far *
+PML_GetAPageBuffer(s16int pagenum,int mainonly)
{
- byte far *addr = nil;
- int i,n;
+ u8int far *addr = nil;
+ s16int i,n;
PMBlockAttr *used;
PageListStruct far *page;
@@ -828,11 +828,11 @@
// it won't copy over the page that we're trying to get from XMS.
// (pages that are being purged are copied into XMS, if possible)
//
-memptr
-PML_GetPageFromXMS(int pagenum,boolean mainonly)
+uchar *
+PML_GetPageFromXMS(s16int pagenum,int mainonly)
{
- byte far *checkaddr;
- memptr addr = nil;
+ u8int far *checkaddr;
+ uchar *addr = nil;
PageListStruct far *page;
page = &PMPages[pagenum];
@@ -842,7 +842,7 @@
checkaddr = PML_GetAPageBuffer(pagenum,mainonly);
if (FP_OFF(checkaddr))
Quit("PML_GetPageFromXMS: Non segment pointer");
- addr = (memptr)FP_SEG(checkaddr);
+ addr = (uchar *)FP_SEG(checkaddr);
PML_CopyFromXMS(addr,page->xmsPage,page->length);
XMSProtectPage = -1;
}
@@ -856,9 +856,9 @@
// only be loaded into main.
//
void
-PML_LoadPage(int pagenum,boolean mainonly)
+PML_LoadPage(s16int pagenum,int mainonly)
{
- byte far *addr;
+ u8int far *addr;
PageListStruct far *page;
addr = PML_GetAPageBuffer(pagenum,mainonly);
@@ -873,10 +873,10 @@
// If not in XMS, load into Main Memory or EMS
//
#pragma warn -pia
-memptr
-PM_GetPage(int pagenum)
+uchar *
+PM_GetPage(s16int pagenum)
{
- memptr result;
+ uchar *result;
if (pagenum >= ChunksInFile)
Quit("PM_GetPage: Invalid page request");
@@ -893,7 +893,7 @@
if (!(result = PM_GetPageAddress(pagenum)))
{
- boolean mainonly = (pagenum >= PMSoundStart);
+ int mainonly = (pagenum >= PMSoundStart);
if (!PMPages[pagenum].offset) // JDC: sparse page
Quit ("Tried to load a sparse page!");
if (!(result = PML_GetPageFromXMS(pagenum,mainonly)))
@@ -931,7 +931,7 @@
// specified when returning the address. For sound stuff.
//
void
-PM_SetPageLock(int pagenum,PMLockType lock)
+PM_SetPageLock(s16int pagenum,PMLockType lock)
{
if (pagenum < PMSoundStart)
Quit("PM_SetPageLock: Locking/unlocking non-sound page");
@@ -945,16 +945,16 @@
// page, and the total pages that need to be loaded (for thermometer).
//
void
-PM_Preload(boolean (*update)(word current,word total))
+PM_Preload(int (*update)(u16int current,u16int total))
{
- int i,j,
+ s16int i,j,
page,oogypage;
- word current,total,
+ u16int current,total,
totalnonxms,totalxms,
mainfree,maintotal,
emsfree,emstotal,
xmsfree,xmstotal;
- memptr addr;
+ uchar *addr;
PageListStruct far *p;
mainfree = (MainPagesAvail - MainPagesUsed) + (EMSPagesAvail - EMSPagesUsed);
@@ -1038,8 +1038,8 @@
if (p->length > PMPageSize)
Quit("PM_Preload: Page too long");
- PML_ReadFromFile((byte far *)addr,p->offset,p->length);
- PML_CopyToXMS((byte far *)addr,p->xmsPage,p->length);
+ PML_ReadFromFile((u8int far *)addr,p->offset,p->length);
+ PML_CopyToXMS((u8int far *)addr,p->xmsPage,p->length);
page++;
current++;
@@ -1048,7 +1048,7 @@
}
p = &PMPages[oogypage];
- PML_ReadFromFile((byte far *)addr,p->offset,p->length);
+ PML_ReadFromFile((u8int far *)addr,p->offset,p->length);
}
update(total,total);
@@ -1072,7 +1072,7 @@
void
PM_NextFrame(void)
{
- int i;
+ s16int i;
// Frame count overrun - kill the LRU hit entries & reset frame count
if (++PMFrameCount >= MAXLONG - 4)
@@ -1113,7 +1113,7 @@
void
PM_Reset(void)
{
- int i;
+ s16int i;
PageListStruct far *page;
XMSPagesAvail = XMSAvail / PMPageSizeKB;
@@ -1141,8 +1141,8 @@
void
PM_Startup(void)
{
- boolean nomain,noems,noxms;
- int i;
+ int nomain,noems,noxms;
+ s16int i;
if (PMStarted)
return;
--- a/pm.h
+++ b/pm.h
@@ -34,28 +34,28 @@
typedef struct
{
- longword offset; // Offset of chunk into file
- word length; // Length of the chunk
+ u32int offset; // Offset of chunk into file
+ u16int length; // Length of the chunk
- int xmsPage; // If in XMS, (xmsPage * PMPageSize) gives offset into XMS handle
+ s16int xmsPage; // If in XMS, (xmsPage * PMPageSize) gives offset into XMS handle
PMLockType locked; // If set, this page can't be purged
- int emsPage; // If in EMS, logical page/offset into page
- int mainPage; // If in Main, index into handle array
+ s16int emsPage; // If in EMS, logical page/offset into page
+ s16int mainPage; // If in Main, index into handle array
- longword lastHit; // Last frame number of hit
+ u32int lastHit; // Last frame number of hit
} PageListStruct;
typedef struct
{
- int baseEMSPage; // Base EMS page for this phys frame
- longword lastHit; // Last frame number of hit
+ s16int baseEMSPage; // Base EMS page for this phys frame
+ u32int lastHit; // Last frame number of hit
} EMSListStruct;
-extern boolean XMSPresent,EMSPresent;
-extern word XMSPagesAvail,EMSPagesAvail;
+extern int XMSPresent,EMSPresent;
+extern u16int XMSPagesAvail,EMSPagesAvail;
-extern word ChunksInFile,
+extern u16int ChunksInFile,
PMSpriteStart,PMSoundStart;
extern PageListStruct far *PMPages;
@@ -72,12 +72,12 @@
extern void PM_Startup(void),
PM_Shutdown(void),
PM_Reset(void),
- PM_Preload(boolean (*update)(word current,word total)),
+ PM_Preload(int (*update)(u16int current,u16int total)),
PM_NextFrame(void),
- PM_SetPageLock(int pagenum,PMLockType lock),
- PM_SetMainPurge(int level),
+ PM_SetPageLock(s16int pagenum,PMLockType lock),
+ PM_SetMainPurge(s16int level),
PM_CheckMainMem(void);
-extern memptr PM_GetPageAddress(int pagenum),
- PM_GetPage(int pagenum); // Use this one to cache page
+extern uchar *PM_GetPageAddress(s16int pagenum),
+ PM_GetPage(s16int pagenum); // Use this one to cache page
-void PM_SetMainMemPurge(int level);
+void PM_SetMainMemPurge(s16int level);
--- a/scale.c
+++ b/scale.c
@@ -14,11 +14,11 @@
*/
t_compscale _seg *scaledirectory[MAXSCALEHEIGHT+1];
-long fullscalefarcall[MAXSCALEHEIGHT+1];
+s32int fullscalefarcall[MAXSCALEHEIGHT+1];
-int maxscale,maxscaleshl2;
+s16int maxscale,maxscaleshl2;
-boolean insetupscaling;
+int insetupscaling;
/*
=============================================================================
@@ -29,9 +29,9 @@
*/
t_compscale _seg *work;
-unsigned BuildCompScale (int height, memptr *finalspot);
+u16int BuildCompScale (s16int height, uchar **finalspot);
-int stepbytwo;
+s16int stepbytwo;
//===========================================================================
@@ -57,10 +57,10 @@
==========================
*/
-void SetupScaling (int maxscaleheight)
+void SetupScaling (s16int maxscaleheight)
{
- int i,x,y;
- byte far *dest;
+ s16int i,x,y;
+ u8int far *dest;
insetupscaling = true;
@@ -75,7 +75,7 @@
for (i=1;i<MAXSCALEHEIGHT;i++)
{
if (scaledirectory[i])
- MM_FreePtr (&(memptr)scaledirectory[i]);
+ MM_FreePtr (&(uchar *)scaledirectory[i]);
if (i>=stepbytwo)
i += 2;
}
@@ -87,15 +87,15 @@
// build the compiled scalers
//
stepbytwo = viewheight/2; // save space by double stepping
- MM_GetPtr (&(memptr)work,20000);
+ MM_GetPtr (&(uchar *)work,20000);
for (i=1;i<=maxscaleheight;i++)
{
- BuildCompScale (i*2,&(memptr)scaledirectory[i]);
+ BuildCompScale (i*2,&(uchar *)scaledirectory[i]);
if (i>=stepbytwo)
i+= 2;
}
- MM_FreePtr (&(memptr)work);
+ MM_FreePtr (&(uchar *)work);
//
// compact memory and lock down scalers
@@ -103,8 +103,8 @@
MM_SortMem ();
for (i=1;i<=maxscaleheight;i++)
{
- MM_SetLock (&(memptr)scaledirectory[i],true);
- fullscalefarcall[i] = (unsigned)scaledirectory[i];
+ MM_SetLock (&(uchar *)scaledirectory[i],true);
+ fullscalefarcall[i] = (u16int)scaledirectory[i];
fullscalefarcall[i] <<=16;
fullscalefarcall[i] += scaledirectory[i]->codeofs[0];
if (i>=stepbytwo)
@@ -123,7 +123,7 @@
// check for oversize wall drawing
//
for (i=maxscaleheight;i<MAXSCALEHEIGHT;i++)
- fullscalefarcall[i] = (long)BadScale;
+ fullscalefarcall[i] = (s32int)BadScale;
insetupscaling = false;
}
@@ -150,17 +150,17 @@
========================
*/
-unsigned BuildCompScale (int height, memptr *finalspot)
+u16int BuildCompScale (s16int height, uchar **finalspot)
{
- byte far *code;
+ u8int far *code;
- int i;
- long fix,step;
- unsigned src,totalscaled,totalsize;
- int startpix,endpix,toppix;
+ s16int i;
+ s32int fix,step;
+ u16int src,totalscaled,totalsize;
+ s16int startpix,endpix,toppix;
- step = ((long)height<<16) / 64;
+ step = ((s32int)height<<16) / 64;
code = &work->code[0];
toppix = (viewheight-height)/2;
fix = 0;
@@ -210,7 +210,7 @@
*code++ = 0x26;
*code++ = 0x88;
*code++ = 0x85;
- *((unsigned far *)code)++ = startpix*SCREENBWIDE;
+ *((u16int far *)code)++ = startpix*SCREENBWIDE;
}
}
@@ -222,7 +222,7 @@
totalsize = FP_OFF(code);
MM_GetPtr (finalspot,totalsize);
- _fmemcpy ((byte _seg *)(*finalspot),(byte _seg *)work,totalsize);
+ _fmemcpy ((u8int _seg *)(*finalspot),(u8int _seg *)work,totalsize);
return totalsize;
}
@@ -238,12 +238,12 @@
=======================
*/
-extern int slinex,slinewidth;
-extern unsigned far *linecmds;
-extern long linescale;
-extern unsigned maskword;
+extern s16int slinex,slinewidth;
+extern u16int far *linecmds;
+extern s32int linescale;
+extern u16int maskword;
-byte mask1,mask2,mask3;
+u8int mask1,mask2,mask3;
void near ScaleLine (void)
@@ -416,16 +416,16 @@
=======================
*/
-static long longtemp;
+static s32int longtemp;
-void ScaleShape (int xcenter, int shapenum, unsigned height)
+void ScaleShape (s16int xcenter, s16int shapenum, u16int height)
{
t_compshape _seg *shape;
t_compscale _seg *comptable;
- unsigned scale,srcx,stopx,tempx;
- int t;
- unsigned far *cmdptr;
- boolean leftvis,rightvis;
+ u16int scale,srcx,stopx,tempx;
+ s16int t;
+ u16int far *cmdptr;
+ int leftvis,rightvis;
shape = PM_GetSpritePage (shapenum);
@@ -435,8 +435,8 @@
return; // too close or far away
comptable = scaledirectory[scale];
- *(((unsigned *)&linescale)+1)=(unsigned)comptable; // seg of far call
- *(((unsigned *)&linecmds)+1)=(unsigned)shape; // seg of shape
+ *(((u16int *)&linescale)+1)=(u16int)comptable; // seg of far call
+ *(((u16int *)&linecmds)+1)=(u16int)shape; // seg of shape
//
// scale to the left (from pixel 31 to shape->leftpix)
@@ -448,7 +448,7 @@
while ( --srcx >=stopx && slinex>0)
{
- (unsigned)linecmds = *cmdptr--;
+ (u16int)linecmds = *cmdptr--;
if ( !(slinewidth = comptable->width[srcx]) )
continue;
@@ -531,7 +531,7 @@
while ( ++srcx <= stopx && (slinex+=slinewidth)<viewwidth)
{
- (unsigned)linecmds = *cmdptr++;
+ (u16int)linecmds = *cmdptr++;
if ( !(slinewidth = comptable->width[srcx]) )
continue;
@@ -622,14 +622,14 @@
=======================
*/
-void SimpleScaleShape (int xcenter, int shapenum, unsigned height)
+void SimpleScaleShape (s16int xcenter, s16int shapenum, u16int height)
{
t_compshape _seg *shape;
t_compscale _seg *comptable;
- unsigned scale,srcx,stopx,tempx;
- int t;
- unsigned far *cmdptr;
- boolean leftvis,rightvis;
+ u16int scale,srcx,stopx,tempx;
+ s16int t;
+ u16int far *cmdptr;
+ int leftvis,rightvis;
shape = PM_GetSpritePage (shapenum);
@@ -637,8 +637,8 @@
scale = height>>1;
comptable = scaledirectory[scale];
- *(((unsigned *)&linescale)+1)=(unsigned)comptable; // seg of far call
- *(((unsigned *)&linecmds)+1)=(unsigned)shape; // seg of shape
+ *(((u16int *)&linescale)+1)=(u16int)comptable; // seg of far call
+ *(((u16int *)&linecmds)+1)=(u16int)shape; // seg of shape
//
// scale to the left (from pixel 31 to shape->leftpix)
@@ -650,7 +650,7 @@
while ( --srcx >=stopx )
{
- (unsigned)linecmds = *cmdptr--;
+ (u16int)linecmds = *cmdptr--;
if ( !(slinewidth = comptable->width[srcx]) )
continue;
@@ -678,7 +678,7 @@
while ( ++srcx <= stopx )
{
- (unsigned)linecmds = *cmdptr++;
+ (u16int)linecmds = *cmdptr++;
if ( !(slinewidth = comptable->width[srcx]) )
continue;
@@ -697,19 +697,19 @@
//
-byte mapmasks1[4][8] = {
+u8int mapmasks1[4][8] = {
{1 ,3 ,7 ,15,15,15,15,15},
{2 ,6 ,14,14,14,14,14,14},
{4 ,12,12,12,12,12,12,12},
{8 ,8 ,8 ,8 ,8 ,8 ,8 ,8} };
-byte mapmasks2[4][8] = {
+u8int mapmasks2[4][8] = {
{0 ,0 ,0 ,0 ,1 ,3 ,7 ,15},
{0 ,0 ,0 ,1 ,3 ,7 ,15,15},
{0 ,0 ,1 ,3 ,7 ,15,15,15},
{0 ,1 ,3 ,7 ,15,15,15,15} };
-byte mapmasks3[4][8] = {
+u8int mapmasks3[4][8] = {
{0 ,0 ,0 ,0 ,0 ,0 ,0 ,0},
{0 ,0 ,0 ,0 ,0 ,0 ,0 ,1},
{0 ,0 ,0 ,0 ,0 ,0 ,1 ,3},
@@ -716,7 +716,7 @@
{0 ,0 ,0 ,0 ,0 ,1 ,3 ,7} };
-unsigned wordmasks[8][8] = {
+u16int wordmasks[8][8] = {
{0x0080,0x00c0,0x00e0,0x00f0,0x00f8,0x00fc,0x00fe,0x00ff},
{0x0040,0x0060,0x0070,0x0078,0x007c,0x007e,0x007f,0x807f},
{0x0020,0x0030,0x0038,0x003c,0x003e,0x003f,0x803f,0xc03f},
@@ -726,8 +726,8 @@
{0x0002,0x0003,0x8003,0xc003,0xe003,0xf003,0xf803,0xfc03},
{0x0001,0x8001,0xc001,0xe001,0xf001,0xf801,0xfc01,0xfe01} };
-int slinex,slinewidth;
-unsigned far *linecmds;
-long linescale;
-unsigned maskword;
+s16int slinex,slinewidth;
+u16int far *linecmds;
+s32int linescale;
+u16int maskword;
--- a/sd.c
+++ b/sd.c
@@ -60,13 +60,13 @@
// Imports from ID_SD_A.ASM
extern void SDL_SetDS(void),
- SDL_IndicatePC(boolean on);
+ SDL_IndicatePC(int on);
extern void interrupt SDL_t0ExtremeAsmService(void),
SDL_t0FastAsmService(void),
SDL_t0SlowAsmService(void);
// Global variables
- boolean SoundSourcePresent,
+ int SoundSourcePresent,
AdLibPresent,
SoundBlasterPresent,SBProPresent,
NeedsDigitized,NeedsMusic,
@@ -74,17 +74,17 @@
SDMode SoundMode;
SMMode MusicMode;
SDSMode DigiMode;
- longword TimeCount;
- word HackCount;
- word *SoundTable; // Really * _seg *SoundTable, but that don't work
- boolean ssIsTandy;
- word ssPort = 2;
- int DigiMap[LASTSOUND];
+ u32int TimeCount;
+ u16int HackCount;
+ u16int *SoundTable; // Really * _seg *SoundTable, but that don't work
+ int ssIsTandy;
+ u16int ssPort = 2;
+ s16int DigiMap[LASTSOUND];
// Internal variables
-static boolean SD_Started;
- boolean nextsoundpos;
- longword TimerDivisor,TimerCount;
+static int SD_Started;
+ int nextsoundpos;
+ u32int TimerDivisor,TimerCount;
static char *ParmStrings[] =
{
"noal",
@@ -99,60 +99,60 @@
};
static void (*SoundUserHook)(void);
soundnames SoundNumber,DigiNumber;
- word SoundPriority,DigiPriority;
- int LeftPosition,RightPosition;
+ u16int SoundPriority,DigiPriority;
+ s16int LeftPosition,RightPosition;
void interrupt (*t0OldService)(void);
- long LocalTime;
- word TimerRate;
+ s32int LocalTime;
+ u16int TimerRate;
- word NumDigi,DigiLeft,DigiPage;
- word _seg *DigiList;
- word DigiLastStart,DigiLastEnd;
- boolean DigiPlaying;
-static boolean DigiMissed,DigiLastSegment;
-static memptr DigiNextAddr;
-static word DigiNextLen;
+ u16int NumDigi,DigiLeft,DigiPage;
+ u16int _seg *DigiList;
+ u16int DigiLastStart,DigiLastEnd;
+ int DigiPlaying;
+static int DigiMissed,DigiLastSegment;
+static uchar *DigiNextAddr;
+static u16int DigiNextLen;
// SoundBlaster variables
-static boolean sbNoCheck,sbNoProCheck;
-static volatile boolean sbSamplePlaying;
-static byte sbOldIntMask = -1;
-static volatile byte huge *sbNextSegPtr;
-static byte sbDMA = 1,
+static int sbNoCheck,sbNoProCheck;
+static volatile int sbSamplePlaying;
+static u8int sbOldIntMask = -1;
+static volatile u8int huge *sbNextSegPtr;
+static u8int sbDMA = 1,
sbDMAa1 = 0x83,sbDMAa2 = 2,sbDMAa3 = 3,
sba1Vals[] = {0x87,0x83,0,0x82},
sba2Vals[] = {0,2,0,6},
sba3Vals[] = {1,3,0,7};
-static int sbLocation = -1,sbInterrupt = 7,sbIntVec = 0xf,
+static s16int sbLocation = -1,sbInterrupt = 7,sbIntVec = 0xf,
sbIntVectors[] = {-1,-1,0xa,0xb,-1,0xd,-1,0xf,-1,-1,-1};
-static volatile longword sbNextSegLen;
+static volatile u32int sbNextSegLen;
static volatile SampledSound huge *sbSamples;
static void interrupt (*sbOldIntHand)(void);
-static byte sbpOldFMMix,sbpOldVOCMix;
+static u8int sbpOldFMMix,sbpOldVOCMix;
// SoundSource variables
- boolean ssNoCheck;
- boolean ssActive;
- word ssControl,ssStatus,ssData;
- byte ssOn,ssOff;
- volatile byte far *ssSample;
- volatile longword ssLengthLeft;
+ int ssNoCheck;
+ int ssActive;
+ u16int ssControl,ssStatus,ssData;
+ u8int ssOn,ssOff;
+ volatile u8int far *ssSample;
+ volatile u32int ssLengthLeft;
// PC Sound variables
- volatile byte pcLastSample,far *pcSound;
- longword pcLengthLeft;
- word pcSoundLookup[255];
+ volatile u8int pcLastSample,far *pcSound;
+ u32int pcLengthLeft;
+ u16int pcSoundLookup[255];
// AdLib variables
- boolean alNoCheck;
- byte far *alSound;
- word alBlock;
- longword alLengthLeft;
- longword alTimeCount;
+ int alNoCheck;
+ u8int far *alSound;
+ u16int alBlock;
+ u32int alLengthLeft;
+ u32int alTimeCount;
Instrument alZeroInst;
// This table maps channel numbers to carrier and modulator op cells
-static byte carriers[9] = { 3, 4, 5,11,12,13,19,20,21},
+static u8int carriers[9] = { 3, 4, 5,11,12,13,19,20,21},
modifiers[9] = { 0, 1, 2, 8, 9,10,16,17,18},
// This table maps percussive voice numbers to op cells
pcarriers[5] = {19,0xff,0xff,0xff,0xff},
@@ -159,13 +159,13 @@
pmodifiers[5] = {16,17,18,20,21};
// Sequencer variables
- boolean sqActive;
-static word alFXReg;
+ int sqActive;
+static u16int alFXReg;
static ActiveTrack *tracks[sqMaxTracks],
mytracks[sqMaxTracks];
-static word sqMode,sqFadeStep;
- word far *sqHack,far *sqHackPtr,sqHackLen,sqHackSeqLen;
- long sqHackTime;
+static u16int sqMode,sqFadeStep;
+ u16int far *sqHack,far *sqHackPtr,sqHackLen,sqHackSeqLen;
+ s32int sqHackTime;
// Internal routines
void SDL_DigitizedDone(void);
@@ -177,7 +177,7 @@
///////////////////////////////////////////////////////////////////////////
#pragma argsused
static void
-SDL_SetTimer0(word speed)
+SDL_SetTimer0(u16int speed)
{
#ifndef TPROF // If using Borland's profiling, don't screw with the timer
asm pushf
@@ -205,7 +205,7 @@
//
///////////////////////////////////////////////////////////////////////////
static void
-SDL_SetIntsPerSec(word ints)
+SDL_SetIntsPerSec(u16int ints)
{
TimerRate = ints;
SDL_SetTimer0(1192030 / ints);
@@ -214,7 +214,7 @@
static void
SDL_SetTimerSpeed(void)
{
- word rate;
+ u16int rate;
void interrupt (*isr)(void);
if ((DigiMode == sds_PC) && DigiPlaying)
@@ -262,7 +262,7 @@
#endif
SDL_SBStopSample(void)
{
- byte is;
+ u8int is;
asm pushf
asm cli
@@ -292,11 +292,11 @@
// controller, and tells the SB to start doing DMA requests for DAC
//
///////////////////////////////////////////////////////////////////////////
-static longword
-SDL_SBPlaySeg(volatile byte huge *data,longword length)
+static u32int
+SDL_SBPlaySeg(volatile u8int huge *data,u32int length)
{
- unsigned datapage;
- longword dataofs,uselen;
+ u16int datapage;
+ u32int dataofs,uselen;
uselen = length;
datapage = FP_SEG(data) >> 12;
@@ -318,11 +318,11 @@
outportb(0x0a,sbDMA | 4); // Mask off DMA on channel sbDMA
outportb(0x0c,0); // Clear byte ptr flip-flop to lower byte
outportb(0x0b,0x49); // Set transfer mode for D/A conv
- outportb(sbDMAa2,(byte)dataofs); // Give LSB of address
- outportb(sbDMAa2,(byte)(dataofs >> 8)); // Give MSB of address
- outportb(sbDMAa1,(byte)datapage); // Give page of address
- outportb(sbDMAa3,(byte)uselen); // Give LSB of length
- outportb(sbDMAa3,(byte)(uselen >> 8)); // Give MSB of length
+ outportb(sbDMAa2,(u8int)dataofs); // Give LSB of address
+ outportb(sbDMAa2,(u8int)(dataofs >> 8)); // Give MSB of address
+ outportb(sbDMAa1,(u8int)datapage); // Give page of address
+ outportb(sbDMAa3,(u8int)uselen); // Give LSB of length
+ outportb(sbDMAa3,(u8int)(uselen >> 8)); // Give MSB of length
outportb(0x0a,sbDMA); // Re-enable DMA on channel sbDMA
// Start playing the thing
@@ -329,9 +329,9 @@
sbWriteDelay();
sbOut(sbWriteCmd,0x14);
sbWriteDelay();
- sbOut(sbWriteData,(byte)uselen);
+ sbOut(sbWriteData,(u8int)uselen);
sbWriteDelay();
- sbOut(sbWriteData,(byte)(uselen >> 8));
+ sbOut(sbWriteData,(u8int)(uselen >> 8));
asm popf
return(uselen + 1);
@@ -345,7 +345,7 @@
static void interrupt
SDL_SBService(void)
{
- longword used;
+ u32int used;
sbIn(sbDataAvail); // Ack interrupt to SB
@@ -380,9 +380,9 @@
#else
static void
#endif
-SDL_SBPlaySample(byte huge *data,longword len)
+SDL_SBPlaySample(u8int huge *data,u32int len)
{
- longword used;
+ u32int used;
SDL_SBStopSample();
@@ -418,9 +418,9 @@
//
///////////////////////////////////////////////////////////////////////////
static void
-SDL_PositionSBP(int leftpos,int rightpos)
+SDL_PositionSBP(s16int leftpos,s16int rightpos)
{
- byte v;
+ u8int v;
if (!SBProPresent)
return;
@@ -444,10 +444,10 @@
// particular I/O location
//
///////////////////////////////////////////////////////////////////////////
-static boolean
-SDL_CheckSB(int port)
+static int
+SDL_CheckSB(s16int port)
{
- int i;
+ s16int i;
sbLocation = port << 4; // Initialize stuff for later use
@@ -495,10 +495,10 @@
// it just passes it directly to SDL_CheckSB()
//
///////////////////////////////////////////////////////////////////////////
-static boolean
-SDL_DetectSoundBlaster(int port)
+static int
+SDL_DetectSoundBlaster(s16int port)
{
- int i;
+ s16int i;
if (port == 0) // If user specifies default, use 2
port = 2;
@@ -531,7 +531,7 @@
//
///////////////////////////////////////////////////////////////////////////
void
-SDL_SBSetDMA(byte channel)
+SDL_SBSetDMA(u8int channel)
{
if (channel > 3)
Quit("SDL_SBSetDMA() - invalid SoundBlaster DMA channel");
@@ -550,7 +550,7 @@
static void
SDL_StartSB(void)
{
- byte timevalue,test;
+ u8int timevalue,test;
sbIntVec = sbIntVectors[sbInterrupt];
if (sbIntVec < 0)
@@ -639,7 +639,7 @@
asm pushf
asm cli
- (long)ssSample = 0;
+ (s32int)ssSample = 0;
asm popf
}
@@ -652,8 +652,8 @@
static void
SDL_SSService(void)
{
- boolean gotit;
- byte v;
+ int gotit;
+ u8int v;
while (ssSample)
{
@@ -665,7 +665,7 @@
v = *ssSample++;
if (!(--ssLengthLeft))
{
- (long)ssSample = 0;
+ (s32int)ssSample = 0;
SDL_DigitizedDone();
}
@@ -699,13 +699,13 @@
#else
static void
#endif
-SDL_SSPlaySample(byte huge *data,longword len)
+SDL_SSPlaySample(u8int huge *data,u32int len)
{
asm pushf
asm cli
ssLengthLeft = len;
- ssSample = (volatile byte far *)data;
+ ssSample = (volatile u8int far *)data;
asm popf
}
@@ -753,11 +753,11 @@
// location specified by the sound source variables
//
///////////////////////////////////////////////////////////////////////////
-static boolean
+static int
SDL_CheckSS(void)
{
- boolean present = false;
- longword lasttime;
+ int present = false;
+ u32int lasttime;
// Turn the Sound Source on and wait awhile (4 ticks)
SDL_StartSS();
@@ -804,7 +804,7 @@
return(present);
}
-static boolean
+static int
SDL_DetectSoundSource(void)
{
for (ssPort = 1;ssPort <= 3;ssPort++)
@@ -827,7 +827,7 @@
#else
static void
#endif
-SDL_PCPlaySample(byte huge *data,longword len)
+SDL_PCPlaySample(u8int huge *data,u32int len)
{
asm pushf
asm cli
@@ -835,7 +835,7 @@
SDL_IndicatePC(true);
pcLengthLeft = len;
- pcSound = (volatile byte far *)data;
+ pcSound = (volatile u8int far *)data;
asm popf
}
@@ -855,7 +855,7 @@
asm pushf
asm cli
- (long)pcSound = 0;
+ (s32int)pcSound = 0;
SDL_IndicatePC(false);
@@ -903,7 +903,7 @@
asm pushf
asm cli
- (long)pcSound = 0;
+ (s32int)pcSound = 0;
asm in al,0x61 // Turn the speaker off
asm and al,0xfd // ~2
@@ -921,8 +921,8 @@
static void
SDL_PCService(void)
{
- byte s;
- word t;
+ u8int s;
+ u16int t;
if (pcSound)
{
@@ -991,10 +991,10 @@
//
// Stuff for digitized sounds
//
-memptr
-SDL_LoadDigiSegment(word page)
+uchar *
+SDL_LoadDigiSegment(u16int page)
{
- memptr addr;
+ uchar *addr;
#if 0 // for debugging
asm mov dx,STATUS_REGISTER_1
@@ -1025,7 +1025,7 @@
}
void
-SDL_PlayDigiSegment(memptr addr,word len)
+SDL_PlayDigiSegment(uchar *addr,u16int len)
{
switch (DigiMode)
{
@@ -1044,7 +1044,7 @@
void
SD_StopDigitized(void)
{
- int i;
+ s16int i;
asm pushf
asm cli
@@ -1106,7 +1106,7 @@
}
void
-SD_SetPosition(int leftpos,int rightpos)
+SD_SetPosition(s16int leftpos,s16int rightpos)
{
if
(
@@ -1127,10 +1127,10 @@
}
void
-SD_PlayDigitized(word which,int leftpos,int rightpos)
+SD_PlayDigitized(u16int which,s16int leftpos,s16int rightpos)
{
- word len;
- memptr addr;
+ u16int len;
+ uchar *addr;
if (!DigiMode)
return;
@@ -1192,7 +1192,7 @@
void
SD_SetDigiDevice(SDSMode mode)
{
- boolean devicenotpresent;
+ int devicenotpresent;
if (mode == DigiMode)
return;
@@ -1234,18 +1234,18 @@
void
SDL_SetupDigi(void)
{
- memptr list;
- word far *p,
+ uchar *list;
+ u16int far *p,
pg;
- int i;
+ s16int i;
PM_UnlockMainMem();
MM_GetPtr(&list,PMPageSize);
PM_CheckMainMem();
- p = (word far *)MK_FP(PM_GetPage(ChunksInFile - 1),0);
+ p = (u16int far *)MK_FP(PM_GetPage(ChunksInFile - 1),0);
_fmemcpy((void far *)list,(void far *)p,PMPageSize);
pg = PMSoundStart;
- for (i = 0;i < PMPageSize / (sizeof(word) * 2);i++,p += 2)
+ for (i = 0;i < PMPageSize / (sizeof(u16int) * 2);i++,p += 2)
{
if (pg >= ChunksInFile - 1)
break;
@@ -1252,8 +1252,8 @@
pg += (p[1] + (PMPageSize - 1)) / PMPageSize;
}
PM_UnlockMainMem();
- MM_GetPtr((memptr *)&DigiList,i * sizeof(word) * 2);
- _fmemcpy((void far *)DigiList,(void far *)list,i * sizeof(word) * 2);
+ MM_GetPtr((uchar **)&DigiList,i * sizeof(u16int) * 2);
+ _fmemcpy((void far *)DigiList,(void far *)list,i * sizeof(u16int) * 2);
MM_FreePtr(&list);
NumDigi = i;
@@ -1269,7 +1269,7 @@
//
///////////////////////////////////////////////////////////////////////////
void
-alOut(byte n,byte b)
+alOut(u8int n,u8int b)
{
asm pushf
asm cli
@@ -1337,9 +1337,9 @@
//
///////////////////////////////////////////////////////////////////////////
static void
-SDL_SetInstrument(int track,int which,Instrument far *inst,boolean percussive)
+SDL_SetInstrument(s16int track,s16int which,Instrument far *inst,int percussive)
{
- byte c,m;
+ u8int c,m;
if (percussive)
{
@@ -1391,7 +1391,7 @@
asm pushf
asm cli
- (long)alSound = 0;
+ (s32int)alSound = 0;
alOut(alFreqH + 0,0);
asm popf
@@ -1400,7 +1400,7 @@
static void
SDL_AlSetFXInst(Instrument far *inst)
{
- byte c,m;
+ u8int c,m;
m = modifiers[0];
c = carriers[0];
@@ -1433,7 +1433,7 @@
SDL_ALPlaySound(AdLibSound far *sound)
{
Instrument far *inst;
- byte huge *data;
+ u8int huge *data;
SDL_ALStopSound();
@@ -1444,7 +1444,7 @@
data = sound->data;
data++;
data--;
- alSound = (byte far *)data;
+ alSound = (u8int far *)data;
alBlock = ((sound->block & 7) << 2) | 0x20;
inst = &sound->inst;
@@ -1470,7 +1470,7 @@
void
SDL_ALSoundService(void)
{
- byte s;
+ u8int s;
if (alSound)
{
@@ -1485,7 +1485,7 @@
if (!(--alLengthLeft))
{
- (long)alSound = 0;
+ (s32int)alSound = 0;
alOut(alFreqH + 0,0);
SDL_SoundFinished();
}
@@ -1497,8 +1497,8 @@
void
SDL_ALService(void)
{
- byte a,v;
- word w;
+ u8int a,v;
+ u16int w;
if (!sqActive)
return;
@@ -1516,7 +1516,7 @@
alTimeCount++;
if (!sqHackLen)
{
- sqHackPtr = (word far *)sqHack;
+ sqHackPtr = (u16int far *)sqHack;
sqHackLen = sqHackSeqLen;
alTimeCount = sqHackTime = 0;
}
@@ -1550,7 +1550,7 @@
static void
SDL_CleanAL(void)
{
- int i;
+ s16int i;
asm pushf
asm cli
@@ -1581,11 +1581,11 @@
// emulating an AdLib) present
//
///////////////////////////////////////////////////////////////////////////
-static boolean
+static int
SDL_DetectAdLib(void)
{
- byte status1,status2;
- int i;
+ u8int status1,status2;
+ s16int i;
alOut(4,0x60); // Reset T1 & T2
alOut(4,0x80); // Reset IRQ
@@ -1630,7 +1630,7 @@
static void interrupt
SDL_t0Service(void)
{
-static word count = 1;
+static u16int count = 1;
#if 1 // for debugging
asm mov dx,STATUS_REGISTER_1
@@ -1694,7 +1694,7 @@
asm add ax,[WORD PTR TimerDivisor]
asm mov [WORD PTR TimerCount],ax
asm jnc myack
- t0OldService(); // If we overflow a word, time to call old int handler
+ t0OldService(); // If we overflow a u16int, time to call old long handler
asm jmp olddone
myack:;
outportb(0x20,0x20); // Ack the interrupt
@@ -1770,11 +1770,11 @@
// SD_SetSoundMode() - Sets which sound hardware to use for sound effects
//
///////////////////////////////////////////////////////////////////////////
-boolean
+int
SD_SetSoundMode(SDMode mode)
{
- boolean result = false;
- word tableoffset;
+ int result = false;
+ u16int tableoffset;
SD_StopSound();
@@ -1811,7 +1811,7 @@
SDL_ShutDevice();
SoundMode = mode;
#ifndef _MUSE_
- SoundTable = (word *)(&audiosegs[tableoffset]);
+ SoundTable = (u16int *)(&audiosegs[tableoffset]);
#endif
SDL_StartDevice();
}
@@ -1826,10 +1826,10 @@
// SD_SetMusicMode() - sets the device to use for background music
//
///////////////////////////////////////////////////////////////////////////
-boolean
+int
SD_SetMusicMode(SMMode mode)
{
- boolean result = false;
+ int result = false;
SD_FadeOutMusic();
while (SD_MusicPlaying())
@@ -1867,7 +1867,7 @@
void
SD_Startup(void)
{
- int i;
+ s16int i;
if (SD_Started)
return;
@@ -1932,11 +1932,11 @@
AdLibPresent = SDL_DetectAdLib();
if (AdLibPresent && !sbNoCheck)
{
- int port = -1;
+ s16int port = -1;
char *env = getenv("BLASTER");
if (env)
{
- long temp;
+ s32int temp;
while (*env)
{
while (isspace(*env))
@@ -2009,9 +2009,9 @@
//
///////////////////////////////////////////////////////////////////////////
void
-SD_Default(boolean gotit,SDMode sd,SMMode sm)
+SD_Default(int gotit,SDMode sd,SMMode sm)
{
- boolean gotsd,gotsm;
+ int gotsd,gotsm;
gotsd = gotsm = gotit;
@@ -2107,7 +2107,7 @@
//
///////////////////////////////////////////////////////////////////////////
void
-SD_PositionSound(int leftvol,int rightvol)
+SD_PositionSound(s16int leftvol,s16int rightvol)
{
LeftPosition = leftvol;
RightPosition = rightvol;
@@ -2119,12 +2119,12 @@
// SD_PlaySound() - plays the specified sound on the appropriate hardware
//
///////////////////////////////////////////////////////////////////////////
-boolean
+int
SD_PlaySound(soundnames sound)
{
- boolean ispos;
+ int ispos;
SoundCommon far *s;
- int lp,rp;
+ s16int lp,rp;
lp = LeftPosition;
rp = RightPosition;
@@ -2207,10 +2207,10 @@
// no sound is playing
//
///////////////////////////////////////////////////////////////////////////
-word
+u16int
SD_SoundPlaying(void)
{
- boolean result = false;
+ int result = false;
switch (SoundMode)
{
@@ -2285,7 +2285,7 @@
void
SD_MusicOff(void)
{
- word i;
+ u16int i;
switch (MusicMode)
@@ -2348,10 +2348,10 @@
// not
//
///////////////////////////////////////////////////////////////////////////
-boolean
+int
SD_MusicPlaying(void)
{
- boolean result;
+ int result;
switch (MusicMode)
{
--- a/sd.h
+++ b/sd.h
@@ -8,7 +8,7 @@
#ifndef __ID_SD__
#define __ID_SD__
-void alOut(byte n,byte b);
+void alOut(u8int n,u8int b);
#ifdef __DEBUG__
#define __DEBUG_SoundMgr__
@@ -28,8 +28,8 @@
} SDSMode;
typedef struct
{
- longword length;
- word priority;
+ u32int length;
+ u16int priority;
} SoundCommon;
// PC Sound stuff
@@ -42,7 +42,7 @@
typedef struct
{
SoundCommon common;
- byte data[1];
+ u8int data[1];
} PCSound;
// Registers for the Sound Blaster card - needs to be offset by n0 (0x10,0x20,0x30,0x40,0x50,0x60)
@@ -84,8 +84,8 @@
typedef struct
{
SoundCommon common;
- word hertz;
- byte bits,
+ u16int hertz;
+ u8int bits,
reference,
data[1];
} SampledSound;
@@ -111,7 +111,7 @@
typedef struct
{
- byte mChar,cChar,
+ u8int mChar,cChar,
mScale,cScale,
mAttack,cAttack,
mSus,cSus,
@@ -128,7 +128,7 @@
{
SoundCommon common;
Instrument inst;
- byte block,
+ u8int block,
data[1];
} AdLibSound;
@@ -155,13 +155,13 @@
#if 1
typedef struct
{
- word length,
+ u16int length,
values[1];
} MusicGroup;
#else
typedef struct
{
- word flags,
+ u16int flags,
count,
offsets[1];
} MusicGroup;
@@ -170,13 +170,13 @@
typedef struct
{
/* This part needs to be set up by the user */
- word mood,far *moods[sqMaxMoods];
+ u16int mood,far *moods[sqMaxMoods];
/* The rest is set up by the code */
Instrument inst;
- boolean percussive;
- word far *seq;
- longword nextevent;
+ int percussive;
+ u16int far *seq;
+ u32int nextevent;
} ActiveTrack;
#define sqmode_Normal 0
@@ -187,7 +187,7 @@
// Global variables
-extern boolean AdLibPresent,
+extern int AdLibPresent,
SoundSourcePresent,
SoundBlasterPresent,
NeedsMusic, // For Caching Mgr
@@ -195,17 +195,17 @@
extern SDMode SoundMode;
extern SDSMode DigiMode;
extern SMMode MusicMode;
-extern boolean DigiPlaying;
+extern int DigiPlaying;
extern int DigiMap[];
-extern longword TimeCount; // Global time in ticks
+extern u32int TimeCount; // Global time in ticks
// Function prototypes
extern void SD_Startup(void),
SD_Shutdown(void),
- SD_Default(boolean gotit,SDMode sd,SMMode sm),
+ SD_Default(int gotit,SDMode sd,SMMode sm),
SD_PositionSound(int leftvol,int rightvol);
-extern boolean SD_PlaySound(soundnames sound);
+extern int SD_PlaySound(soundnames sound);
extern void SD_SetPosition(int leftvol,int rightvol),
SD_StopSound(void),
SD_WaitSoundDone(void),
@@ -216,13 +216,13 @@
SD_FadeOutMusic(void),
SD_SetUserHook(void (*hook)(void));
-extern boolean SD_MusicPlaying(void),
+extern int SD_MusicPlaying(void),
SD_SetSoundMode(SDMode mode),
SD_SetMusicMode(SMMode mode);
-extern word SD_SoundPlaying(void);
+extern u16int SD_SoundPlaying(void);
extern void SD_SetDigiDevice(SDSMode),
- SD_PlayDigitized(word which,int leftpos,int rightpos),
+ SD_PlayDigitized(u16int which,int leftpos,int rightpos),
SD_StopDigitized(void),
SD_Poll(void);
--- a/spanish.h
+++ b/spanish.h
@@ -54,7 +54,7 @@
#define STR_CUSTOM "Modificar controles"
#define STR_DADDY "Papi puedo jugar?"
#define STR_HURTME "No me hieras."
-#define STR_BRINGEM "�Echamelos!"
+#define STR_BRINGEM "�Echamelos!"
#define STR_DEATH "La muerte encarnada"
#define STR_MOUSEADJ "Raton ajustar sensibilidad"
--- a/state.c
+++ b/state.c
@@ -39,18 +39,18 @@
-void SpawnNewObj (unsigned tilex, unsigned tiley, statetype *state);
+void SpawnNewObj (u16int tilex, u16int tiley, statetype *state);
void NewState (objtype *ob, statetype *state);
-boolean TryWalk (objtype *ob);
-void MoveObj (objtype *ob, long move);
+int TryWalk (objtype *ob);
+void MoveObj (objtype *ob, s32int move);
void KillActor (objtype *ob);
-void DamageActor (objtype *ob, unsigned damage);
+void DamageActor (objtype *ob, u16int damage);
-boolean CheckLine (objtype *ob);
+int CheckLine (objtype *ob);
void FirstSighting (objtype *ob);
-boolean CheckSight (objtype *ob);
+int CheckSight (objtype *ob);
/*
=============================================================================
@@ -78,7 +78,7 @@
===================
*/
-void SpawnNewObj (unsigned tilex, unsigned tiley, statetype *state)
+void SpawnNewObj (u16int tilex, u16int tiley, statetype *state)
{
GetNewActor ();
new->state = state;
@@ -89,8 +89,8 @@
new->tilex = tilex;
new->tiley = tiley;
- new->x = ((long)tilex<<TILESHIFT)+TILEGLOBAL/2;
- new->y = ((long)tiley<<TILESHIFT)+TILEGLOBAL/2;
+ new->x = ((s32int)tilex<<TILESHIFT)+TILEGLOBAL/2;
+ new->y = ((s32int)tiley<<TILESHIFT)+TILEGLOBAL/2;
new->dir = nodir;
actorat[tilex][tiley] = new;
@@ -153,7 +153,7 @@
#define CHECKDIAG(x,y) \
{ \
- temp=(unsigned)actorat[x][y]; \
+ temp=(u16int)actorat[x][y]; \
if (temp) \
{ \
if (temp<256) \
@@ -165,7 +165,7 @@
#define CHECKSIDE(x,y) \
{ \
- temp=(unsigned)actorat[x][y]; \
+ temp=(u16int)actorat[x][y]; \
if (temp) \
{ \
if (temp<128) \
@@ -178,10 +178,10 @@
}
-boolean TryWalk (objtype *ob)
+int TryWalk (objtype *ob)
{
- int doornum;
- unsigned temp;
+ s16int doornum;
+ u16int temp;
doornum = -1;
@@ -358,8 +358,8 @@
void SelectDodgeDir (objtype *ob)
{
- int deltax,deltay,i;
- unsigned absdx,absdy;
+ s16int deltax,deltay,i;
+ u16int absdx,absdy;
dirtype dirtry[5];
dirtype turnaround,tdir;
@@ -474,7 +474,7 @@
void SelectChaseDir (objtype *ob)
{
- int deltax,deltay,i;
+ s16int deltax,deltay,i;
dirtype d[3];
dirtype tdir, olddir, turnaround;
@@ -584,7 +584,7 @@
void SelectRunDir (objtype *ob)
{
- int deltax,deltay,i;
+ s16int deltax,deltay,i;
dirtype d[3];
dirtype tdir, olddir, turnaround;
@@ -656,9 +656,9 @@
=================
*/
-void MoveObj (objtype *ob, long move)
+void MoveObj (objtype *ob, s32int move)
{
- long deltax,deltay;
+ s32int deltax,deltay;
switch (ob->dir)
{
@@ -775,9 +775,9 @@
===============
*/
-void DropItem (stat_t itemtype, int tilex, int tiley)
+void DropItem (stat_t itemtype, s16int tilex, s16int tiley)
{
- int x,y,xl,xh,yl,yh;
+ s16int x,y,xl,xh,yl,yh;
//
// find a free spot to put it in
@@ -814,7 +814,7 @@
void KillActor (objtype *ob)
{
- int tilex,tiley;
+ s16int tilex,tiley;
tilex = ob->tilex = ob->x >> TILESHIFT; // drop item on center
tiley = ob->tiley = ob->y >> TILESHIFT;
@@ -961,7 +961,7 @@
===================
*/
-void DamageActor (objtype *ob, unsigned damage)
+void DamageActor (objtype *ob, u16int damage)
{
madenoise = true;
@@ -1034,16 +1034,16 @@
=====================
*/
-boolean CheckLine (objtype *ob)
+int CheckLine (objtype *ob)
{
- int x1,y1,xt1,yt1,x2,y2,xt2,yt2;
- int x,y;
- int xdist,ydist,xstep,ystep;
- int temp;
- int partial,delta;
- long ltemp;
- int xfrac,yfrac,deltafrac;
- unsigned value,intercept;
+ s16int x1,y1,xt1,yt1,x2,y2,xt2,yt2;
+ s16int x,y;
+ s16int xdist,ydist,xstep,ystep;
+ s16int temp;
+ s16int partial,delta;
+ s32int ltemp;
+ s16int xfrac,yfrac,deltafrac;
+ u16int value,intercept;
x1 = ob->x >> UNSIGNEDSHIFT; // 1/256 tile precision
y1 = ob->y >> UNSIGNEDSHIFT;
@@ -1073,7 +1073,7 @@
deltafrac = abs(x2-x1);
delta = y2-y1;
- ltemp = ((long)delta<<8)/deltafrac;
+ ltemp = ((s32int)delta<<8)/deltafrac;
if (ltemp > 0x7fffl)
ystep = 0x7fff;
else if (ltemp < -0x7fffl)
@@ -1080,7 +1080,7 @@
ystep = -0x7fff;
else
ystep = ltemp;
- yfrac = y1 + (((long)ystep*partial) >>8);
+ yfrac = y1 + (((s32int)ystep*partial) >>8);
x = xt1+xstep;
xt2 += xstep;
@@ -1089,7 +1089,7 @@
y = yfrac>>8;
yfrac += ystep;
- value = (unsigned)tilemap[x][y];
+ value = (u16int)tilemap[x][y];
x += xstep;
if (!value)
@@ -1127,7 +1127,7 @@
deltafrac = abs(y2-y1);
delta = x2-x1;
- ltemp = ((long)delta<<8)/deltafrac;
+ ltemp = ((s32int)delta<<8)/deltafrac;
if (ltemp > 0x7fffl)
xstep = 0x7fff;
else if (ltemp < -0x7fffl)
@@ -1134,7 +1134,7 @@
xstep = -0x7fff;
else
xstep = ltemp;
- xfrac = x1 + (((long)xstep*partial) >>8);
+ xfrac = x1 + (((s32int)xstep*partial) >>8);
y = yt1 + ystep;
yt2 += ystep;
@@ -1143,7 +1143,7 @@
x = xfrac>>8;
xfrac += xstep;
- value = (unsigned)tilemap[x][y];
+ value = (u16int)tilemap[x][y];
y += ystep;
if (!value)
@@ -1184,9 +1184,9 @@
#define MINSIGHT 0x18000l
-boolean CheckSight (objtype *ob)
+int CheckSight (objtype *ob)
{
- long deltax,deltay;
+ s32int deltax,deltay;
//
// don't bother tracing a line if the area isn't connected to the player's
@@ -1401,7 +1401,7 @@
===============
*/
-boolean SightPlayer (objtype *ob)
+int SightPlayer (objtype *ob)
{
if (ob->flags & FL_ATTACKMODE)
Quit ("An actor in ATTACKMODE called SightPlayer!");
--- a/text.c
+++ b/text.c
@@ -48,14 +48,14 @@
=============================================================================
*/
-int pagenum,numpages;
+s16int pagenum,numpages;
-unsigned leftmargin[TEXTROWS],rightmargin[TEXTROWS];
+u16int leftmargin[TEXTROWS],rightmargin[TEXTROWS];
char far *text;
-unsigned rowon;
+u16int rowon;
-int picx,picy,picnum,picdelay;
-boolean layoutdone;
+s16int picx,picy,picnum,picdelay;
+int layoutdone;
//===========================================================================
@@ -83,7 +83,7 @@
=====================
*/
-int ParseNumber (void)
+s16int ParseNumber (void)
{
char ch;
char num[80],*numptr;
@@ -185,8 +185,8 @@
void HandleCommand (void)
{
- int i,margin,top,bottom;
- int picwidth,picheight,picmid;
+ s16int i,margin,top,bottom;
+ s16int picwidth,picheight,picmid;
switch (toupper(*++text))
{
@@ -352,8 +352,8 @@
void HandleWord (void)
{
char word[WORDLIMIT];
- int i,wordindex;
- unsigned wwidth,wheight,newpos;
+ s16int i,wordindex;
+ u16int wwidth,wheight,newpos;
//
@@ -409,9 +409,9 @@
=====================
*/
-void PageLayout (boolean shownumber)
+void PageLayout (int shownumber)
{
- int i,oldfontcolor;
+ s16int i,oldfontcolor;
char ch;
oldfontcolor = fontcolor;
@@ -596,13 +596,13 @@
*/
#ifdef JAPAN
-void ShowArticle (int which)
+void ShowArticle (s16int which)
#else
void ShowArticle (char far *article)
#endif
{
#ifdef JAPAN
- int snames[10] = { H_HELP1PIC,
+ s16int snames[10] = { H_HELP1PIC,
H_HELP2PIC,
H_HELP3PIC,
H_HELP4PIC,
@@ -612,7 +612,7 @@
H_HELP8PIC,
H_HELP9PIC,
H_HELP10PIC};
- int enames[14] = {
+ s16int enames[14] = {
0,0,
#ifndef JAPDEMO
C_ENDGAME1APIC,
@@ -630,9 +630,9 @@
#endif
};
#endif
- unsigned oldfontnumber;
- unsigned temp;
- boolean newpage,firstpage;
+ u16int oldfontnumber;
+ u16int temp;
+ int newpage,firstpage;
#ifdef JAPAN
pagenum = 1;
@@ -727,9 +727,9 @@
#ifndef JAPAN
#ifdef ARTSEXTERN
-int endextern = T_ENDART1;
+s16int endextern = T_ENDART1;
#ifndef SPEAR
-int helpextern = T_HELPART;
+s16int helpextern = T_HELPART;
#endif
#endif
char helpfilename[13] = "HELPART.",
@@ -746,9 +746,9 @@
#ifndef SPEAR
void HelpScreens (void)
{
- int artnum;
+ s16int artnum;
char far *text;
- memptr layout;
+ uchar *layout;
CA_UpLevel ();
@@ -799,9 +799,9 @@
//
void EndText (void)
{
- int artnum;
+ s16int artnum;
char far *text;
- memptr layout;
+ uchar *layout;
ClearMemory ();
--- a/us.asm
+++ b/us.asm
@@ -44,7 +44,7 @@
;=================================================
;
-; void US_InitRndT (boolean randomize)
+; void US_InitRndT (int randomize)
; Init table based RND generator
; if randomize is false, the counter is set to 0
;
--- a/us.h
+++ b/us.h
@@ -24,8 +24,8 @@
typedef struct
{
char name[MaxHighName + 1];
- long score;
- word completed,episode;
+ s32int score;
+ u16int completed,episode;
} HighScore;
#define MaxGameName 32
@@ -33,8 +33,8 @@
typedef struct
{
char signature[4];
- word *oldtest;
- boolean present;
+ u16int *oldtest;
+ int present;
char name[MaxGameName + 1];
} SaveGame;
@@ -42,7 +42,7 @@
typedef struct
{
- int x,y,
+ s16int x,y,
w,h,
px,py;
} WindowRec; // Record used to save & restore screen windows
@@ -56,11 +56,11 @@
} GameDiff;
// Hack import for TED launch support
-extern boolean tedlevel;
-extern int tedlevelnum;
+extern int tedlevel;
+extern s16int tedlevelnum;
extern void TEDDeath(void);
-extern boolean ingame, // Set by game code if a game is in progress
+extern int ingame, // Set by game code if a game is in progress
abortgame, // Set if a game load failed
loadedgame, // Set if the current game was loaded
NoWait,
@@ -67,18 +67,18 @@
HighScoresDirty;
extern char *abortprogram; // Set to error msg if program is dying
extern GameDiff restartgame; // Normally gd_Continue, else starts game
-extern word PrintX,PrintY; // Current printing location in the window
-extern word WindowX,WindowY,// Current location of window
+extern u16int PrintX,PrintY; // Current printing location in the window
+extern u16int WindowX,WindowY,// Current location of window
WindowW,WindowH;// Current size of window
-extern boolean Button0,Button1,
+extern int Button0,Button1,
CursorBad;
-extern int CursorX,CursorY;
+extern s16int CursorX,CursorY;
-extern void (*USL_MeasureString)(char far *,word *,word *),
+extern void (*USL_MeasureString)(char far *,u16int *,u16int *),
(*USL_DrawString)(char far *);
-extern boolean (*USL_SaveGame)(int),(*USL_LoadGame)(int);
+extern int (*USL_SaveGame)(s16int),(*USL_LoadGame)(s16int);
extern void (*USL_ResetGame)(void);
extern SaveGame Games[MaxSaveGames];
extern HighScore Scores[];
@@ -88,36 +88,36 @@
extern void US_Startup(void),
US_Setup(void),
US_Shutdown(void),
- US_InitRndT(boolean randomize),
- US_SetLoadSaveHooks(boolean (*load)(int),
- boolean (*save)(int),
+ US_InitRndT(int randomize),
+ US_SetLoadSaveHooks(int (*load)(s16int),
+ int (*save)(s16int),
void (*reset)(void)),
US_TextScreen(void),
US_UpdateTextScreen(void),
US_FinishTextScreen(void),
- US_DrawWindow(word x,word y,word w,word h),
- US_CenterWindow(word,word),
+ US_DrawWindow(u16int x,u16int y,u16int w,u16int h),
+ US_CenterWindow(u16int,u16int),
US_SaveWindow(WindowRec *win),
US_RestoreWindow(WindowRec *win),
US_ClearWindow(void),
- US_SetPrintRoutines(void (*measure)(char far *,word *,word *),
+ US_SetPrintRoutines(void (*measure)(char far *,u16int *,u16int *),
void (*print)(char far *)),
US_PrintCentered(char far *s),
US_CPrint(char far *s),
US_CPrintLine(char far *s),
US_Print(char far *s),
- US_PrintUnsigned(longword n),
- US_PrintSigned(long n),
+ US_PrintUnsigned(u32int n),
+ US_PrintSigned(s32int n),
US_StartCursor(void),
US_ShutCursor(void),
- US_CheckHighScore(long score,word other),
- US_DisplayHighScores(int which);
-extern boolean US_UpdateCursor(void),
- US_LineInput(int x,int y,char *buf,char *def,boolean escok,
- int maxchars,int maxwidth);
-extern int US_CheckParm(char *parm,char **strings),
+ US_CheckHighScore(s32int score,u16int other),
+ US_DisplayHighScores(s16int which);
+extern int US_UpdateCursor(void),
+ US_LineInput(s16int x,s16int y,char *buf,char *def,int escok,
+ s16int maxchars,s16int maxwidth);
+extern s16int US_CheckParm(char *parm,char **strings),
US_RndT(void);
void USL_PrintInCenter(char far *s,Rct r);
- char *USL_GiveSaveName(word game);
+ char *USL_GiveSaveName(u16int game);
#endif
--- a/us1.c
+++ b/us1.c
@@ -35,9 +35,9 @@
// Global variables
char *abortprogram;
- boolean NoWait;
- word PrintX,PrintY;
- word WindowX,WindowY,WindowW,WindowH;
+ int NoWait;
+ u16int PrintX,PrintY;
+ u16int WindowX,WindowY,WindowW,WindowH;
// Internal variables
#define ConfigVersion 1
@@ -44,13 +44,13 @@
static char *ParmStrings[] = {"TEDLEVEL","NOWAIT"},
*ParmStrings2[] = {"COMP","NOCOMP"};
-static boolean US_Started;
+static int US_Started;
- boolean Button0,Button1,
+ int Button0,Button1,
CursorBad;
- int CursorX,CursorY;
+ s16int CursorX,CursorY;
- void (*USL_MeasureString)(char far *,word *,word *) = VW_MeasurePropString,
+ void (*USL_MeasureString)(char far *,u16int *,u16int *) = VW_MeasurePropString,
(*USL_DrawString)(char far *) = VWB_DrawPropString;
SaveGame Games[MaxSaveGames];
@@ -78,7 +78,7 @@
#pragma warn -par
#pragma warn -rch
int
-USL_HardError(word errval,int ax,int bp,int si)
+USL_HardError(u16int errval,s16int ax,s16int bp,s16int si)
{
#define IGNORE 0
#define RETRY 1
@@ -87,7 +87,7 @@
static char buf[32];
static WindowRec wr;
- int di;
+ s16int di;
char c,*s,*t;
@@ -168,7 +168,7 @@
void
US_Startup(void)
{
- int i,n;
+ s16int i,n;
if (US_Started)
return;
@@ -238,7 +238,7 @@
{
char cp,cs,
*p,*s;
- int i;
+ s16int i;
while (!isalpha(*parm)) // Skip non-alphas
parm++;
@@ -272,7 +272,7 @@
//
///////////////////////////////////////////////////////////////////////////
void
-US_SetPrintRoutines(void (*measure)(char far *,word *,word *),void (*print)(char far *))
+US_SetPrintRoutines(void (*measure)(char far *,u16int *,u16int *),void (*print)(char far *))
{
USL_MeasureString = measure;
USL_DrawString = print;
@@ -288,7 +288,7 @@
US_Print(char far *s)
{
char c,far *se;
- word w,h;
+ u16int w,h;
while (*s)
{
@@ -318,11 +318,11 @@
///////////////////////////////////////////////////////////////////////////
//
-// US_PrintUnsigned() - Prints an unsigned long
+// US_PrintUnsigned() - Prints an u32int
//
///////////////////////////////////////////////////////////////////////////
void
-US_PrintUnsigned(longword n)
+US_PrintUnsigned(u32int n)
{
char buffer[32];
@@ -331,11 +331,11 @@
///////////////////////////////////////////////////////////////////////////
//
-// US_PrintSigned() - Prints a signed long
+// US_PrintSigned() - Prints a s32int
//
///////////////////////////////////////////////////////////////////////////
void
-US_PrintSigned(long n)
+US_PrintSigned(s32int n)
{
char buffer[32];
@@ -350,7 +350,7 @@
void
USL_PrintInCenter(char far *s,Rectangle r)
{
- word w,h;
+ u16int w,h;
USL_MeasureString(s,&w,&h);
@@ -379,7 +379,7 @@
void
US_CPrintLine(char far *s)
{
- word w,h;
+ u16int w,h;
USL_MeasureString(s,&w,&h);
@@ -440,9 +440,9 @@
//
///////////////////////////////////////////////////////////////////////////
void
-US_DrawWindow(word x,word y,word w,word h)
+US_DrawWindow(u16int x,u16int y,u16int w,u16int h)
{
- word i,
+ u16int i,
sx,sy,sw,sh;
WindowX = x * 8;
@@ -476,7 +476,7 @@
//
///////////////////////////////////////////////////////////////////////////
void
-US_CenterWindow(word w,word h)
+US_CenterWindow(u16int w,u16int h)
{
US_DrawWindow(((MaxX / 8) - w) / 2,((MaxY / 8) - h) / 2,w,h);
}
@@ -525,12 +525,12 @@
//
///////////////////////////////////////////////////////////////////////////
static void
-USL_XORICursor(int x,int y,char *s,word cursor)
+USL_XORICursor(s16int x,s16int y,char *s,u16int cursor)
{
- static boolean status; // VGA doesn't XOR...
+ static int status; // VGA doesn't XOR...
char buf[MaxString];
- int temp;
- word w,h;
+ s16int temp;
+ u16int w,h;
strcpy(buf,s);
buf[cursor] = '\0';
@@ -560,21 +560,21 @@
// returned
//
///////////////////////////////////////////////////////////////////////////
-boolean
-US_LineInput(int x,int y,char *buf,char *def,boolean escok,
- int maxchars,int maxwidth)
+int
+US_LineInput(s16int x,s16int y,char *buf,char *def,int escok,
+ s16int maxchars,s16int maxwidth)
{
- boolean redraw,
+ int redraw,
cursorvis,cursormoved,
done,result;
- ScanCode sc;
+ u8int sc;
char c,
s[MaxString],olds[MaxString];
- word i,
+ u16int i,
cursor,
w,h,
len,temp;
- longword lasttime;
+ u32int lasttime;
if (def)
strcpy(s,def);
--- a/vh.c
+++ b/vh.c
@@ -18,7 +18,7 @@
#define UNCACHEGRCHUNK(chunk) {MM_FreePtr(&grsegs[chunk]);grneeded[chunk]&=~ca_levelbit;}
-byte update[UPDATEHIGH][UPDATEWIDE];
+u8int update[UPDATEHIGH][UPDATEWIDE];
//==========================================================================
@@ -25,10 +25,10 @@
pictabletype _seg *pictable;
-int px,py;
-byte fontcolor,backcolor;
-int fontnumber;
-int bufferwidth,bufferheight;
+s16int px,py;
+u8int fontcolor,backcolor;
+s16int fontnumber;
+s16int bufferwidth,bufferheight;
//==========================================================================
@@ -40,9 +40,9 @@
void VW_DrawPropString (char far *string)
{
fontstruct far *font;
- int width,step,height,i;
- byte far *source, far *dest, far *origdest;
- byte ch,mask;
+ s16int width,step,height,i;
+ u8int far *source, far *dest, far *origdest;
+ u8int ch,mask;
font = (fontstruct far *)grsegs[STARTFONT+fontnumber];
height = bufferheight = font->height;
@@ -53,7 +53,7 @@
while ((ch = *string++)!=0)
{
width = step = font->width[ch];
- source = ((byte far *)font)+font->location[ch];
+ source = ((u8int far *)font)+font->location[ch];
while (width--)
{
VGAMAPMASK(mask);
@@ -96,9 +96,9 @@
void VW_DrawColorPropString (char far *string)
{
fontstruct far *font;
- int width,step,height,i;
- byte far *source, far *dest, far *origdest;
- byte ch,mask;
+ s16int width,step,height,i;
+ u8int far *source, far *dest, far *origdest;
+ u8int ch,mask;
font = (fontstruct far *)grsegs[STARTFONT+fontnumber];
height = bufferheight = font->height;
@@ -109,7 +109,7 @@
while ((ch = *string++)!=0)
{
width = step = font->width[ch];
- source = ((byte far *)font)+font->location[ch];
+ source = ((u8int far *)font)+font->location[ch];
while (width--)
{
VGAMAPMASK(mask);
@@ -167,10 +167,10 @@
=================
*/
-void VL_MungePic (byte far *source, unsigned width, unsigned height)
+void VL_MungePic (u8int far *source, u16int width, u16int height)
{
- unsigned x,y,plane,size,pwidth;
- byte _seg *temp, far *dest, far *srcline;
+ u16int x,y,plane,size,pwidth;
+ u8int _seg *temp, far *dest, far *srcline;
size = width*height;
@@ -180,7 +180,7 @@
//
// copy the pic to a temp buffer
//
- MM_GetPtr (&(memptr)temp,size);
+ MM_GetPtr (&(uchar *)temp,size);
_fmemcpy (temp,source,size);
//
@@ -200,23 +200,23 @@
}
}
- MM_FreePtr (&(memptr)temp);
+ MM_FreePtr (&(uchar *)temp);
}
-void VWL_MeasureString (char far *string, word *width, word *height
+void VWL_MeasureString (char far *string, u16int *width, u16int *height
, fontstruct _seg *font)
{
*height = font->height;
for (*width = 0;*string;string++)
- *width += font->width[*((byte far *)string)]; // proportional width
+ *width += font->width[*((u8int far *)string)]; // proportional width
}
-void VW_MeasurePropString (char far *string, word *width, word *height)
+void VW_MeasurePropString (char far *string, u16int *width, u16int *height)
{
VWL_MeasureString(string,width,height,(fontstruct _seg *)grsegs[STARTFONT+fontnumber]);
}
-void VW_MeasureMPropString (char far *string, word *width, word *height)
+void VW_MeasureMPropString (char far *string, u16int *width, u16int *height)
{
VWL_MeasureString(string,width,height,(fontstruct _seg *)grsegs[STARTFONTM+fontnumber]);
}
@@ -243,10 +243,10 @@
=======================
*/
-int VW_MarkUpdateBlock (int x1, int y1, int x2, int y2)
+s16int VW_MarkUpdateBlock (s16int x1, s16int y1, s16int x2, s16int y2)
{
- int x,y,xt1,yt1,xt2,yt2,nextline;
- byte *mark;
+ s16int x,y,xt1,yt1,xt2,yt2,nextline;
+ u8int *mark;
xt1 = x1>>PIXTOBLOCK;
yt1 = y1>>PIXTOBLOCK;
@@ -288,23 +288,23 @@
return 1;
}
-void VWB_DrawTile8 (int x, int y, int tile)
+void VWB_DrawTile8 (s16int x, s16int y, s16int tile)
{
if (VW_MarkUpdateBlock (x,y,x+7,y+7))
LatchDrawChar(x,y,tile);
}
-void VWB_DrawTile8M (int x, int y, int tile)
+void VWB_DrawTile8M (s16int x, s16int y, s16int tile)
{
if (VW_MarkUpdateBlock (x,y,x+7,y+7))
- VL_MemToScreen (((byte far *)grsegs[STARTTILE8M])+tile*64,8,8,x,y);
+ VL_MemToScreen (((u8int far *)grsegs[STARTTILE8M])+tile*64,8,8,x,y);
}
-void VWB_DrawPic (int x, int y, int chunknum)
+void VWB_DrawPic (s16int x, s16int y, s16int chunknum)
{
- int picnum = chunknum - STARTPICS;
- unsigned width,height;
+ s16int picnum = chunknum - STARTPICS;
+ u16int width,height;
x &= ~7;
@@ -319,7 +319,7 @@
void VWB_DrawPropString (char far *string)
{
- int x;
+ s16int x;
x=px;
VW_DrawPropString (string);
VW_MarkUpdateBlock(x,py,px-1,py+bufferheight-1);
@@ -326,25 +326,25 @@
}
-void VWB_Bar (int x, int y, int width, int height, int color)
+void VWB_Bar (s16int x, s16int y, s16int width, s16int height, s16int color)
{
if (VW_MarkUpdateBlock (x,y,x+width,y+height-1) )
VW_Bar (x,y,width,height,color);
}
-void VWB_Plot (int x, int y, int color)
+void VWB_Plot (s16int x, s16int y, s16int color)
{
if (VW_MarkUpdateBlock (x,y,x,y))
VW_Plot(x,y,color);
}
-void VWB_Hlin (int x1, int x2, int y, int color)
+void VWB_Hlin (s16int x1, s16int x2, s16int y, s16int color)
{
if (VW_MarkUpdateBlock (x1,y,x2,y))
VW_Hlin(x1,x2,y,color);
}
-void VWB_Vlin (int y1, int y2, int x, int color)
+void VWB_Vlin (s16int y1, s16int y2, s16int x, s16int color)
{
if (VW_MarkUpdateBlock (x,y1,x,y2))
VW_Vlin(y1,y2,x,color);
@@ -372,9 +372,9 @@
=====================
*/
-void LatchDrawPic (unsigned x, unsigned y, unsigned picnum)
+void LatchDrawPic (u16int x, u16int y, u16int picnum)
{
- unsigned wide, height, source;
+ u16int wide, height, source;
wide = pictable[picnum-STARTPICS].width;
height = pictable[picnum-STARTPICS].height;
@@ -396,9 +396,9 @@
void LoadLatchMem (void)
{
- int i,j,p,m,width,height,start,end;
- byte far *src;
- unsigned destoff;
+ s16int i,j,p,m,width,height,start,end;
+ u8int far *src;
+ u16int destoff;
//
// tile 8s
@@ -405,7 +405,7 @@
//
latchpics[0] = freelatch;
CA_CacheGrChunk (STARTTILE8);
- src = (byte _seg *)grsegs[STARTTILE8];
+ src = (u8int _seg *)grsegs[STARTTILE8];
destoff = freelatch;
for (i=0;i<NUMTILE8;i++)
@@ -420,13 +420,13 @@
//
// tile 16s
//
- src = (byte _seg *)grsegs[STARTTILE16];
+ src = (u8int _seg *)grsegs[STARTTILE16];
latchpics[1] = destoff;
for (i=0;i<NUMTILE16;i++)
{
CA_CacheGrChunk (STARTTILE16+i);
- src = (byte _seg *)grsegs[STARTTILE16+i];
+ src = (u8int _seg *)grsegs[STARTTILE16+i];
VL_MemToLatch (src,16,16,destoff);
destoff+=64;
if (src)
@@ -468,14 +468,14 @@
extern ControlInfo c;
-boolean FizzleFade (unsigned source, unsigned dest,
- unsigned width,unsigned height, unsigned frames, boolean abortable)
+int FizzleFade (u16int source, u16int dest,
+ u16int width,u16int height, u16int frames, int abortable)
{
- int pixperframe;
- unsigned drawofs,pagedelta;
- byte mask,maskb[8] = {1,2,4,8};
- unsigned x,y,p,frame;
- long rndval;
+ s16int pixperframe;
+ u16int drawofs,pagedelta;
+ u8int mask,maskb[8] = {1,2,4,8};
+ u16int x,y,p,frame;
+ s32int rndval;
pagedelta = dest-source;
rndval = 1;
--- a/vh.h
+++ b/vh.h
@@ -16,7 +16,7 @@
typedef struct
{
- int width,
+ s16int width,
height,
orgx,orgy,
xl,yl,xh,yh,
@@ -25,22 +25,22 @@
typedef struct
{
- unsigned sourceoffset[MAXSHIFTS];
- unsigned planesize[MAXSHIFTS];
- unsigned width[MAXSHIFTS];
- byte data[];
-} spritetype; // the memptr for each sprite points to this
+ u16int sourceoffset[MAXSHIFTS];
+ u16int planesize[MAXSHIFTS];
+ u16int width[MAXSHIFTS];
+ u8int data[];
+} spritetype; // the uchar* for each sprite points to this
typedef struct
{
- int width,height;
+ s16int width,height;
} pictabletype;
typedef struct
{
- int height;
- int location[256];
+ s16int height;
+ s16int location[256];
char width[256];
} fontstruct;
@@ -52,9 +52,9 @@
extern pictabletype _seg *picmtable;
extern spritetabletype _seg *spritetable;
-extern byte fontcolor;
-extern int fontnumber;
-extern int px,py;
+extern u8int fontcolor;
+extern s16int fontnumber;
+extern s16int px,py;
//
// Double buffer management routines
@@ -61,7 +61,7 @@
//
void VW_InitDoubleBuffer (void);
-int VW_MarkUpdateBlock (int x1, int y1, int x2, int y2);
+s16int VW_MarkUpdateBlock (s16int x1, s16int y1, s16int x2, s16int y2);
void VW_UpdateScreen (void);
//
@@ -70,26 +70,26 @@
// regions marked in double buffer
//
-void VWB_DrawTile8 (int x, int y, int tile);
-void VWB_DrawTile8M (int x, int y, int tile);
-void VWB_DrawTile16 (int x, int y, int tile);
-void VWB_DrawTile16M (int x, int y, int tile);
-void VWB_DrawPic (int x, int y, int chunknum);
-void VWB_DrawMPic(int x, int y, int chunknum);
-void VWB_Bar (int x, int y, int width, int height, int color);
+void VWB_DrawTile8 (s16int x, s16int y, s16int tile);
+void VWB_DrawTile8M (s16int x, s16int y, s16int tile);
+void VWB_DrawTile16 (s16int x, s16int y, s16int tile);
+void VWB_DrawTile16M (s16int x, s16int y, s16int tile);
+void VWB_DrawPic (s16int x, s16int y, s16int chunknum);
+void VWB_DrawMPic(s16int x, s16int y, s16int chunknum);
+void VWB_Bar (s16int x, s16int y, s16int width, s16int height, s16int color);
void VWB_DrawPropString (char far *string);
void VWB_DrawMPropString (char far *string);
-void VWB_DrawSprite (int x, int y, int chunknum);
-void VWB_Plot (int x, int y, int color);
-void VWB_Hlin (int x1, int x2, int y, int color);
-void VWB_Vlin (int y1, int y2, int x, int color);
+void VWB_DrawSprite (s16int x, s16int y, s16int chunknum);
+void VWB_Plot (s16int x, s16int y, s16int color);
+void VWB_Hlin (s16int x1, s16int x2, s16int y, s16int color);
+void VWB_Vlin (s16int y1, s16int y2, s16int x, s16int color);
//
// wolfenstein EGA compatability stuff
//
-extern byte far gamepal;
+extern u8int far gamepal;
void VH_SetDefaultColors (void);
@@ -110,7 +110,7 @@
#define VW_FadeOut() VL_FadeOut(0,255,0,0,0,30);
#define VW_ScreenToScreen VL_ScreenToScreen
#define VW_SetDefaultColors VH_SetDefaultColors
-void VW_MeasurePropString (char far *string, word *width, word *height);
+void VW_MeasurePropString (char far *string, u16int *width, u16int *height);
#define EGAMAPMASK(x) VGAMAPMASK(x)
#define EGAWRITEMODE(x) VGAWRITEMODE(x)
@@ -122,13 +122,13 @@
#define LatchDrawChar(x,y,p) VL_LatchToScreen(latchpics[0]+(p)*16,2,8,x,y)
#define LatchDrawTile(x,y,p) VL_LatchToScreen(latchpics[1]+(p)*64,4,16,x,y)
-void LatchDrawPic (unsigned x, unsigned y, unsigned picnum);
+void LatchDrawPic (u16int x, u16int y, u16int picnum);
void LoadLatchMem (void);
-boolean FizzleFade (unsigned source, unsigned dest,
- unsigned width,unsigned height, unsigned frames,boolean abortable);
+int FizzleFade (u16int source, u16int dest,
+ u16int width,u16int height, u16int frames,int abortable);
#define NUMLATCHPICS 100
-extern unsigned latchpics[NUMLATCHPICS];
-extern unsigned freelatch;
+extern u16int latchpics[NUMLATCHPICS];
+extern u16int freelatch;
--- a/vl.c
+++ b/vl.c
@@ -12,29 +12,29 @@
// SC_INDEX is expected to stay at SC_MAPMASK for proper operation
//
-unsigned bufferofs;
-unsigned displayofs,pelpan;
+u16int bufferofs;
+u16int displayofs,pelpan;
-unsigned screenseg=SCREENSEG; // set to 0xa000 for asm convenience
+u16int screenseg=SCREENSEG; // set to 0xa000 for asm convenience
-unsigned linewidth;
-unsigned ylookup[MAXSCANLINES];
+u16int linewidth;
+u16int ylookup[MAXSCANLINES];
-boolean screenfaded;
-unsigned bordercolor;
+int screenfaded;
+u16int bordercolor;
-boolean fastpalette; // if true, use outsb to set
+int fastpalette; // if true, use outsb to set
-byte far palette1[256][3],far palette2[256][3];
+u8int far palette1[256][3],far palette2[256][3];
//===========================================================================
// asm
-int VL_VideoID (void);
-void VL_SetCRTC (int crtc);
-void VL_SetScreen (int crtc, int pelpan);
-void VL_WaitVBL (int vbls);
+s16int VL_VideoID (void);
+void VL_SetCRTC (s16int crtc);
+void VL_SetScreen (s16int crtc, s16int pelpan);
+void VL_WaitVBL (s16int vbls);
//===========================================================================
@@ -70,7 +70,7 @@
void VL_Startup (void)
{
- int i,videocard;
+ s16int i,videocard;
asm cld;
@@ -148,7 +148,7 @@
=================
*/
-void VL_ClearVideo (byte color)
+void VL_ClearVideo (u8int color)
{
asm mov dx,GC_INDEX
asm mov al,GC_MODE
@@ -243,9 +243,9 @@
====================
*/
-void VL_SetLineWidth (unsigned width)
+void VL_SetLineWidth (u16int width)
{
- int i,offset;
+ s16int i,offset;
//
// set wide virtual screen
@@ -274,7 +274,7 @@
====================
*/
-void VL_SetSplitScreen (int linenum)
+void VL_SetSplitScreen (s16int linenum)
{
VL_WaitVBL (1);
linenum=linenum*2-1;
@@ -306,9 +306,9 @@
=================
*/
-void VL_FillPalette (int red, int green, int blue)
+void VL_FillPalette (s16int red, s16int green, s16int blue)
{
- int i;
+ s16int i;
outportb (PEL_WRITE_ADR,0);
for (i=0;i<256;i++)
@@ -329,7 +329,7 @@
=================
*/
-void VL_SetColor (int color, int red, int green, int blue)
+void VL_SetColor (s16int color, s16int red, s16int green, s16int blue)
{
outportb (PEL_WRITE_ADR,color);
outportb (PEL_DATA,red);
@@ -347,7 +347,7 @@
=================
*/
-void VL_GetColor (int color, int *red, int *green, int *blue)
+void VL_GetColor (s16int color, s16int *red, s16int *green, s16int *blue)
{
outportb (PEL_READ_ADR,color);
*red = inportb (PEL_DATA);
@@ -368,9 +368,9 @@
=================
*/
-void VL_SetPalette (byte far *palette)
+void VL_SetPalette (u8int far *palette)
{
- int i;
+ s16int i;
// outportb (PEL_WRITE_ADR,0);
// for (i=0;i<768;i++)
@@ -425,9 +425,9 @@
=================
*/
-void VL_GetPalette (byte far *palette)
+void VL_GetPalette (u8int far *palette)
{
- int i;
+ s16int i;
outportb (PEL_READ_ADR,0);
for (i=0;i<768;i++)
@@ -447,10 +447,10 @@
=================
*/
-void VL_FadeOut (int start, int end, int red, int green, int blue, int steps)
+void VL_FadeOut (s16int start, s16int end, s16int red, s16int green, s16int blue, s16int steps)
{
- int i,j,orig,delta;
- byte far *origptr, far *newptr;
+ s16int i,j,orig,delta;
+ u8int far *origptr, far *newptr;
VL_WaitVBL(1);
VL_GetPalette (&palette1[0][0]);
@@ -497,9 +497,9 @@
=================
*/
-void VL_FadeIn (int start, int end, byte far *palette, int steps)
+void VL_FadeIn (s16int start, s16int end, u8int far *palette, s16int steps)
{
- int i,j,delta;
+ s16int i,j,delta;
VL_WaitVBL(1);
VL_GetPalette (&palette1[0][0]);
@@ -545,7 +545,7 @@
void VL_TestPaletteSet (void)
{
- int i;
+ s16int i;
for (i=0;i<768;i++)
palette1[0][i] = i;
@@ -566,7 +566,7 @@
==================
*/
-void VL_ColorBorder (int color)
+void VL_ColorBorder (s16int color)
{
_AH=0x10;
_AL=1;
@@ -585,9 +585,9 @@
=============================================================================
*/
-byte pixmasks[4] = {1,2,4,8};
-byte leftmasks[4] = {15,14,12,8};
-byte rightmasks[4] = {1,3,7,15};
+u8int pixmasks[4] = {1,2,4,8};
+u8int leftmasks[4] = {15,14,12,8};
+u8int rightmasks[4] = {1,3,7,15};
/*
@@ -598,13 +598,13 @@
=================
*/
-void VL_Plot (int x, int y, int color)
+void VL_Plot (s16int x, s16int y, s16int color)
{
- byte mask;
+ u8int mask;
mask = pixmasks[x&3];
VGAMAPMASK(mask);
- *(byte far *)MK_FP(SCREENSEG,bufferofs+(ylookup[y]+(x>>2))) = color;
+ *(u8int far *)MK_FP(SCREENSEG,bufferofs+(ylookup[y]+(x>>2))) = color;
VGAMAPMASK(15);
}
@@ -617,12 +617,12 @@
=================
*/
-void VL_Hlin (unsigned x, unsigned y, unsigned width, unsigned color)
+void VL_Hlin (u16int x, u16int y, u16int width, u16int color)
{
- unsigned xbyte;
- byte far *dest;
- byte leftmask,rightmask;
- int midbytes;
+ u16int xbyte;
+ u8int far *dest;
+ u8int leftmask,rightmask;
+ s16int midbytes;
xbyte = x>>2;
leftmask = leftmasks[x&3];
@@ -662,9 +662,9 @@
=================
*/
-void VL_Vlin (int x, int y, int height, int color)
+void VL_Vlin (s16int x, s16int y, s16int height, s16int color)
{
- byte far *dest,mask;
+ u8int far *dest,mask;
mask = pixmasks[x&3];
VGAMAPMASK(mask);
@@ -689,11 +689,11 @@
=================
*/
-void VL_Bar (int x, int y, int width, int height, int color)
+void VL_Bar (s16int x, s16int y, s16int width, s16int height, s16int color)
{
- byte far *dest;
- byte leftmask,rightmask;
- int midbytes,linedelta;
+ u8int far *dest;
+ u8int leftmask,rightmask;
+ s16int midbytes,linedelta;
leftmask = leftmasks[x&3];
rightmask = rightmasks[(x+width-1)&3];
@@ -749,10 +749,10 @@
=================
*/
-void VL_MemToLatch (byte far *source, int width, int height, unsigned dest)
+void VL_MemToLatch (u8int far *source, s16int width, s16int height, u16int dest)
{
- unsigned count;
- byte plane,mask;
+ u16int count;
+ u8int plane,mask;
count = ((width+3)/4)*height;
mask = 1;
@@ -788,10 +788,10 @@
=================
*/
-void VL_MemToScreen (byte far *source, int width, int height, int x, int y)
+void VL_MemToScreen (u8int far *source, s16int width, s16int height, s16int x, s16int y)
{
- byte far *screen,far *dest,mask;
- int plane;
+ u8int far *screen,far *dest,mask;
+ s16int plane;
width>>=2;
dest = MK_FP(SCREENSEG,bufferofs+ylookup[y]+(x>>2) );
@@ -823,11 +823,11 @@
=================
*/
-void VL_MaskedToScreen (byte far *source, int width, int height, int x, int y)
+void VL_MaskedToScreen (u8int far *source, s16int width, s16int height, s16int x, s16int y)
{
- byte far *screen,far *dest,mask;
- byte far *maskptr;
- int plane;
+ u8int far *screen,far *dest,mask;
+ u8int far *maskptr;
+ s16int plane;
width>>=2;
dest = MK_FP(SCREENSEG,bufferofs+ylookup[y]+(x>>2) );
@@ -858,7 +858,7 @@
=================
*/
-void VL_LatchToScreen (unsigned source, int width, int height, int x, int y)
+void VL_LatchToScreen (u16int source, s16int width, s16int height, s16int x, s16int y)
{
VGAWRITEMODE(1);
VGAMAPMASK(15);
@@ -906,7 +906,7 @@
=================
*/
-void VL_ScreenToScreen (unsigned source, unsigned dest,int width, int height)
+void VL_ScreenToScreen (u16int source, u16int dest,s16int width, s16int height)
{
VGAWRITEMODE(1);
VGAMAPMASK(15);
@@ -957,16 +957,16 @@
===================
*/
-void VL_DrawTile8String (char *str, char far *tile8ptr, int printx, int printy)
+void VL_DrawTile8String (char *str, char far *tile8ptr, s16int printx, s16int printy)
{
- int i;
- unsigned far *dest,far *screen,far *src;
+ s16int i;
+ u16int far *dest,far *screen,far *src;
dest = MK_FP(SCREENSEG,bufferofs+ylookup[printy]+(printx>>2));
while (*str)
{
- src = (unsigned far *)(tile8ptr + (*str<<6));
+ src = (u16int far *)(tile8ptr + (*str<<6));
// each character is 64 bytes
VGAMAPMASK(1);
@@ -1002,10 +1002,10 @@
===================
*/
-void VL_DrawLatch8String (char *str, unsigned tile8ptr, int printx, int printy)
+void VL_DrawLatch8String (char *str, u16int tile8ptr, s16int printx, s16int printy)
{
- int i;
- unsigned src,dest;
+ s16int i;
+ u16int src,dest;
dest = bufferofs+ylookup[printy]+(printx>>2);
@@ -1068,7 +1068,7 @@
===================
*/
-void VL_SizeTile8String (char *str, int *width, int *height)
+void VL_SizeTile8String (char *str, s16int *width, s16int *height)
{
*height = 8;
*width = 8*strlen(str);
--- a/vl.h
+++ b/vl.h
@@ -81,16 +81,16 @@
//===========================================================================
-extern unsigned bufferofs; // all drawing is reletive to this
-extern unsigned displayofs,pelpan; // last setscreen coordinates
+extern u16int bufferofs; // all drawing is reletive to this
+extern u16int displayofs,pelpan; // last setscreen coordinates
-extern unsigned screenseg; // set to 0xa000 for asm convenience
+extern u16int screenseg; // set to 0xa000 for asm convenience
-extern unsigned linewidth;
-extern unsigned ylookup[MAXSCANLINES];
+extern u16int linewidth;
+extern u16int ylookup[MAXSCANLINES];
-extern boolean screenfaded;
-extern unsigned bordercolor;
+extern int screenfaded;
+extern u16int bordercolor;
//===========================================================================
@@ -121,41 +121,41 @@
void VL_SetTextMode (void);
void VL_DePlaneVGA (void);
void VL_SetVGAPlaneMode (void);
-void VL_ClearVideo (byte color);
+void VL_ClearVideo (u8int color);
-void VL_SetLineWidth (unsigned width);
-void VL_SetSplitScreen (int linenum);
+void VL_SetLineWidth (u16int width);
+void VL_SetSplitScreen (s16int linenum);
-void VL_WaitVBL (int vbls);
-void VL_CrtcStart (int crtc);
-void VL_SetScreen (int crtc, int pelpan);
+void VL_WaitVBL (s16int vbls);
+void VL_CrtcStart (s16int crtc);
+void VL_SetScreen (s16int crtc, s16int pelpan);
-void VL_FillPalette (int red, int green, int blue);
-void VL_SetColor (int color, int red, int green, int blue);
-void VL_GetColor (int color, int *red, int *green, int *blue);
-void VL_SetPalette (byte far *palette);
-void VL_GetPalette (byte far *palette);
-void VL_FadeOut (int start, int end, int red, int green, int blue, int steps);
-void VL_FadeIn (int start, int end, byte far *palette, int steps);
-void VL_ColorBorder (int color);
+void VL_FillPalette (s16int red, s16int green, s16int blue);
+void VL_SetColor (s16int color, s16int red, s16int green, s16int blue);
+void VL_GetColor (s16int color, s16int *red, s16int *green, s16int *blue);
+void VL_SetPalette (u8int far *palette);
+void VL_GetPalette (u8int far *palette);
+void VL_FadeOut (s16int start, s16int end, s16int red, s16int green, s16int blue, s16int steps);
+void VL_FadeIn (s16int start, s16int end, u8int far *palette, s16int steps);
+void VL_ColorBorder (s16int color);
-void VL_Plot (int x, int y, int color);
-void VL_Hlin (unsigned x, unsigned y, unsigned width, unsigned color);
-void VL_Vlin (int x, int y, int height, int color);
-void VL_Bar (int x, int y, int width, int height, int color);
+void VL_Plot (s16int x, s16int y, s16int color);
+void VL_Hlin (u16int x, u16int y, u16int width, u16int color);
+void VL_Vlin (s16int x, s16int y, s16int height, s16int color);
+void VL_Bar (s16int x, s16int y, s16int width, s16int height, s16int color);
-void VL_MungePic (byte far *source, unsigned width, unsigned height);
-void VL_DrawPicBare (int x, int y, byte far *pic, int width, int height);
-void VL_MemToLatch (byte far *source, int width, int height, unsigned dest);
-void VL_ScreenToScreen (unsigned source, unsigned dest,int width, int height);
-void VL_MemToScreen (byte far *source, int width, int height, int x, int y);
-void VL_MaskedToScreen (byte far *source, int width, int height, int x, int y);
+void VL_MungePic (u8int far *source, u16int width, u16int height);
+void VL_DrawPicBare (s16int x, s16int y, u8int far *pic, s16int width, s16int height);
+void VL_MemToLatch (u8int far *source, s16int width, s16int height, u16int dest);
+void VL_ScreenToScreen (u16int source, u16int dest,s16int width, s16int height);
+void VL_MemToScreen (u8int far *source, s16int width, s16int height, s16int x, s16int y);
+void VL_MaskedToScreen (u8int far *source, s16int width, s16int height, s16int x, s16int y);
-void VL_DrawTile8String (char *str, char far *tile8ptr, int printx, int printy);
-void VL_DrawLatch8String (char *str, unsigned tile8ptr, int printx, int printy);
-void VL_SizeTile8String (char *str, int *width, int *height);
-void VL_DrawPropString (char *str, unsigned tile8ptr, int printx, int printy);
-void VL_SizePropString (char *str, int *width, int *height, char far *font);
+void VL_DrawTile8String (char *str, char far *tile8ptr, s16int printx, s16int printy);
+void VL_DrawLatch8String (char *str, u16int tile8ptr, s16int printx, s16int printy);
+void VL_SizeTile8String (char *str, s16int *width, s16int *height);
+void VL_DrawPropString (char *str, u16int tile8ptr, s16int printx, s16int printy);
+void VL_SizePropString (char *str, s16int *width, s16int *height, char far *font);
void VL_TestPaletteSet (void);
--- a/wolfhack.c
+++ b/wolfhack.c
@@ -4,33 +4,33 @@
#define MAXVIEWHEIGHT 200
-int spanstart[MAXVIEWHEIGHT/2];
+s16int spanstart[MAXVIEWHEIGHT/2];
-fixed stepscale[MAXVIEWHEIGHT/2];
-fixed basedist[MAXVIEWHEIGHT/2];
+s32int stepscale[MAXVIEWHEIGHT/2];
+s32int basedist[MAXVIEWHEIGHT/2];
extern char far planepics[8192]; // 4k of ceiling, 4k of floor
-int halfheight = 0;
+s16int halfheight = 0;
-byte far *planeylookup[MAXVIEWHEIGHT/2];
-unsigned mirrorofs[MAXVIEWHEIGHT/2];
+u8int far *planeylookup[MAXVIEWHEIGHT/2];
+u16int mirrorofs[MAXVIEWHEIGHT/2];
-fixed psin, pcos;
+s32int psin, pcos;
-fixed FixedMul (fixed a, fixed b)
+s32int FixedMul (s32int a, s32int b)
{
return (a>>8)*(b>>8);
}
-int mr_rowofs;
-int mr_count;
-int mr_xstep;
-int mr_ystep;
-int mr_xfrac;
-int mr_yfrac;
-int mr_dest;
+s16int mr_rowofs;
+s16int mr_count;
+s16int mr_xstep;
+s16int mr_ystep;
+s16int mr_xfrac;
+s16int mr_yfrac;
+s16int mr_dest;
/*
@@ -42,15 +42,15 @@
==============
*/
-void DrawSpans (int x1, int x2, int height)
+void DrawSpans (s16int x1, s16int x2, s16int height)
{
- fixed length;
- int ofs;
- int prestep;
- fixed startxfrac, startyfrac;
+ s32int length;
+ s16int ofs;
+ s16int prestep;
+ s32int startxfrac, startyfrac;
- int x, startx, count, plane, startplane;
- byte far *toprow, far *dest;
+ s16int x, startx, count, plane, startplane;
+ u8int far *toprow, far *dest;
toprow = planeylookup[height]+bufferofs;
mr_rowofs = mirrorofs[height];
@@ -73,7 +73,7 @@
mr_yfrac = startyfrac - (mr_ystep>>2)*prestep;
startx = x1>>2;
- mr_dest = (unsigned)toprow + startx;
+ mr_dest = (u16int)toprow + startx;
mr_count = ((x2-plane)>>2) - startx + 1;
x1++;
prestep--;
@@ -97,8 +97,8 @@
void SetPlaneViewSize (void)
{
- int x,y;
- byte far *dest, far *src;
+ s16int x,y;
+ u8int far *dest, far *src;
halfheight = viewheight>>1;
@@ -105,7 +105,7 @@
for (y=0 ; y<halfheight ; y++)
{
- planeylookup[y] = (byte far *)0xa0000000l + (halfheight-1-y)*SCREENBWIDE;;
+ planeylookup[y] = (u8int far *)0xa0000000l + (halfheight-1-y)*SCREENBWIDE;
mirrorofs[y] = (y*2+1)*SCREENBWIDE;
stepscale[y] = y*GLOBAL1/32;
@@ -141,8 +141,8 @@
void DrawPlanes (void)
{
- int height, lastheight;
- int x;
+ s16int height, lastheight;
+ s16int x;
if (viewheight>>1 != halfheight)
SetPlaneViewSize (); // screen size has changed