foxygit / doom Log in
commit 20cb00076d39bcb8a5c2e82912af8200c97034cb
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Mon Mar 9 22:53:24 2009 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Mon Mar 9 22:53:24 2009 +0000

    Remove WATCOMC usage (thanks Quasar)

    Subversion-branch: /branches/raven-branch
    Subversion-revision: 1453
---
 src/heretic/d_main.c  |  51 +++++-------
 src/heretic/doomdef.h |  10 +--
 src/heretic/g_game.c  | 221 ++------------------------------------------------
 src/heretic/p_mobj.c  |   8 +-
 src/heretic/p_user.c  |   8 +-
 src/heretic/r_main.c  |   9 +-
 src/hexen/d_net.c     |   2 +
 src/hexen/g_game.c    | 209 ++---------------------------------------------
 src/hexen/h2_main.c   |  14 +---
 src/hexen/h2def.h     |   9 +-
 src/hexen/p_mobj.c    |  16 +---
 src/hexen/p_setup.c   |   5 +-
 src/hexen/p_user.c    |   8 +-
 src/hexen/r_main.c    |  12 +--
 src/hexen/sb_bar.c    |   4 +
 src/hexen/st_start.c  |   1 +
 16 files changed, 66 insertions(+), 521 deletions(-)

diff --git a/src/heretic/d_main.c b/src/heretic/d_main.c
index 273b3f26..a8f8bbe1 100644
--- a/src/heretic/d_main.c
+++ b/src/heretic/d_main.c
@@ -465,6 +465,7 @@ void wadprintf(void)
     {
         return;
     }
+    // haleyjd FIXME: convert to textscreen code?
 #ifdef __WATCOMC__
     _settextposition(23, 2);
     _setbkcolor(1);
@@ -519,13 +520,9 @@ void hprintf(char *string)
         TXT_UpdateScreen();
     }

-#ifdef __WATCOMC__
+    // haleyjd: shouldn't be WATCOMC-only
     if (debugmode)
-    {
         puts(string);
-        return;
-    }
-#endif
 }

 void drawstatus(void)
@@ -664,6 +661,7 @@ static void finishStartup(void)
 char tmsg[300];
 void tprintf(char *msg, int initflag)
 {
+    // haleyjd FIXME: convert to textscreen code?
 #ifdef __WATCOMC__
     char temp[80];
     int start;
@@ -694,16 +692,23 @@ void tprintf(char *msg, int initflag)
 #endif
 }

-void CheckAbortStartup(void)
+// haleyjd: moved up, removed WATCOMC code
+void CleanExit(void)
 {
-#ifdef __WATCOMC__
-    extern int lastpress;
+    printf("Exited from HERETIC.\n");
+    exit(1);
+}

-    if (lastpress == 1)
-    {                           // Abort if escape pressed
-        CleanExit();
+void CheckAbortStartup(void)
+{
+    // haleyjd: removed WATCOMC
+    // haleyjd FIXME: this should actually work in text mode too, but how to
+    // get input before SDL video init?
+    if(using_graphical_startup)
+    {
+        if(TXT_GetChar() == 27)
+            CleanExit();
     }
-#endif
 }

 void IncThermo(void)
@@ -719,19 +724,6 @@ void InitThermo(int max)
     thermCurrent = 0;
 }

-#ifdef __WATCOMC__
-void CleanExit(void)
-{
-    union REGS regs;
-
-    I_ShutdownKeyboard();
-    regs.x.eax = 0x3;
-    int386(0x10, &regs, &regs);
-    printf("Exited from HERETIC.\n");
-    exit(1);
-}
-#endif
-
 //
 // Add configuration file variable bindings.
 //
@@ -951,10 +943,7 @@ void D_DoomMain(void)

     I_PrintStartupBanner(gamedescription);

-#ifdef __WATCOMC__
-    I_StartupKeyboard();
-    I_StartupJoystick();
-#endif
+    // haleyjd: removed WATCOMC
     initStartup();

     //
@@ -1007,9 +996,7 @@ void D_DoomMain(void)
     D_CheckNetGame();
     IncThermo();

-#ifdef __WATCOMC__
-    I_CheckExternDriver();      // Check for an external device driver
-#endif
+    // haleyjd: removed WATCOMC

     tprintf("SB_Init: Loading patches.\n", 1);
     SB_Init();
diff --git a/src/heretic/doomdef.h b/src/heretic/doomdef.h
index 02797f92..0580f9b0 100644
--- a/src/heretic/doomdef.h
+++ b/src/heretic/doomdef.h
@@ -28,11 +28,7 @@
 #define __DOOMDEF__
 #include <stdio.h>
 #include <string.h>
-#ifdef __WATCOMC__
-#include <malloc.h>
-#define	strcasecmp strcmpi
-#define	strncasecmp strnicmp
-#endif
+//haleyjd: removed WATCOMC
 #include <limits.h>

 #define HERETIC_VERSION 130
@@ -688,7 +684,9 @@ byte *I_ZoneBase(int *size);
 byte *I_AllocLow(int length);
 // allocates from low memory under dos, just mallocs under unix

-#ifdef __WATCOMC__
+// haleyjd: was WATCOMC, preserved for historical interest.
+// This is similar to the -control structure in DOOM v1.4 and Strife.
+#if 0
 extern boolean useexterndriver;

 #define EBT_FIRE			1
diff --git a/src/heretic/g_game.c b/src/heretic/g_game.c
index 30fdc0cd..22c17f13 100644
--- a/src/heretic/g_game.c
+++ b/src/heretic/g_game.c
@@ -173,9 +173,7 @@ char savedescription[32];

 int inventoryTics;

-#ifdef __WATCOMC__
-extern externdata_t *i_ExternData;
-#endif
+// haleyjd: removed WATCOMC

 //=============================================================================
 // Not used - ripped out for Heretic
@@ -222,15 +220,7 @@ void G_BuildTiccmd(ticcmd_t * cmd)

     extern boolean noartiskip;

-#ifdef __WATCOMC__
-    int angleDelta;
-    static int oldAngle;
-    extern int newViewAngleOff;
-    static int externInvKey;
-    extern boolean automapactive;
-    event_t ev;
-#endif
-
+    // haleyjd: removed externdriver crap

     memset(cmd, 0, sizeof(*cmd));
     //cmd->consistancy =
@@ -244,14 +234,9 @@ void G_BuildTiccmd(ticcmd_t * cmd)
     speed = joybspeed >= MAX_JOY_BUTTONS
          || gamekeydown[key_speed]
          || joybuttons[joybspeed];
-#ifdef __WATCOMC__
-    if (useexterndriver)
-    {
-        speed |= (i_ExternData->buttons & EBT_SPEED);
-        strafe |= (i_ExternData->buttons & EBT_STRAFE);
-    }
-#endif

+    // haleyjd: removed externdriver crap
+
     forward = side = look = arti = flyheight = 0;

 //
@@ -334,198 +319,14 @@ void G_BuildTiccmd(ticcmd_t * cmd)
     {
         look = -lspeed;
     }
-#ifdef __WATCOMC__
-    if (gamekeydown[key_lookcenter] && !useexterndriver)
-    {
-        look = TOCENTER;
-    }
-#else
+    // haleyjd: removed externdriver crap
     if (gamekeydown[key_lookcenter])
     {
         look = TOCENTER;
     }
-#endif
-
-#ifdef __WATCOMC__
-    if (useexterndriver && look != TOCENTER && (gamestate == GS_LEVEL ||
-                                                gamestate == GS_INTERMISSION))
-    {
-        if (i_ExternData->moveForward)
-        {
-            forward += i_ExternData->moveForward;
-            if (speed)
-            {
-                forward <<= 1;
-            }
-        }
-        if (i_ExternData->angleTurn)
-        {
-            if (strafe)
-            {
-                side += i_ExternData->angleTurn;
-            }
-            else
-            {
-                cmd->angleturn += i_ExternData->angleTurn;
-            }
-        }
-        if (i_ExternData->moveSideways)
-        {
-            side += i_ExternData->moveSideways;
-            if (speed)
-            {
-                side <<= 1;
-            }
-        }
-        if (i_ExternData->buttons & EBT_CENTERVIEW)
-        {
-            look = TOCENTER;
-            oldAngle = 0;
-        }
-        else if (i_ExternData->pitch)
-        {
-            angleDelta = i_ExternData->pitch - oldAngle;
-            if (abs(angleDelta) < 35)
-            {
-                look = angleDelta / 5;
-            }
-            else
-            {
-                look = 7 * (angleDelta > 0 ? 1 : -1);
-            }
-            if (look == TOCENTER)
-            {
-                look++;
-            }
-            oldAngle += look * 5;
-        }
-        if (i_ExternData->flyDirection)
-        {
-            if (i_ExternData->flyDirection > 0)
-            {
-                flyheight = 5;
-            }
-            else
-            {
-                flyheight = -5;
-            }
-        }
-        if (abs(newViewAngleOff - i_ExternData->angleHead) < 3000)
-        {
-            newViewAngleOff = i_ExternData->angleHead;
-        }
-        if (i_ExternData->buttons & EBT_FIRE)
-        {
-            cmd->buttons |= BT_ATTACK;
-        }
-        if (i_ExternData->buttons & EBT_OPENDOOR)
-        {
-            cmd->buttons |= BT_USE;
-        }
-        if (i_ExternData->buttons & EBT_PAUSE)
-        {
-            cmd->buttons = BT_SPECIAL | BTS_PAUSE;
-            i_ExternData->buttons &= ~EBT_PAUSE;
-        }
-        if (externInvKey & EBT_USEARTIFACT)
-        {
-            ev.type = ev_keyup;
-            ev.data1 = key_useartifact;
-            D_PostEvent(&ev);
-            externInvKey &= ~EBT_USEARTIFACT;
-        }
-        else if (i_ExternData->buttons & EBT_USEARTIFACT)
-        {
-            externInvKey |= EBT_USEARTIFACT;
-            ev.type = ev_keydown;
-            ev.data1 = key_useartifact;
-            D_PostEvent(&ev);
-        }
-        if (externInvKey & EBT_INVENTORYRIGHT)
-        {
-            ev.type = ev_keyup;
-            ev.data1 = key_invright;
-            D_PostEvent(&ev);
-            externInvKey &= ~EBT_INVENTORYRIGHT;
-        }
-        else if (i_ExternData->buttons & EBT_INVENTORYRIGHT)
-        {
-            externInvKey |= EBT_INVENTORYRIGHT;
-            ev.type = ev_keydown;
-            ev.data1 = key_invright;
-            D_PostEvent(&ev);
-        }
-        if (externInvKey & EBT_INVENTORYLEFT)
-        {
-            ev.type = ev_keyup;
-            ev.data1 = key_invleft;
-            D_PostEvent(&ev);
-            externInvKey &= ~EBT_INVENTORYLEFT;
-        }
-        else if (i_ExternData->buttons & EBT_INVENTORYLEFT)
-        {
-            externInvKey |= EBT_INVENTORYLEFT;
-            ev.type = ev_keydown;
-            ev.data1 = key_invleft;
-            D_PostEvent(&ev);
-        }
-        if (i_ExternData->buttons & EBT_FLYDROP)
-        {
-            flyheight = TOCENTER;
-        }
-        if (gamestate == GS_LEVEL)
-        {
-            if (externInvKey & EBT_MAP)
-            {                   // AutoMap
-                ev.type = ev_keyup;
-                ev.data1 = AM_STARTKEY;
-                D_PostEvent(&ev);
-                externInvKey &= ~EBT_MAP;
-            }
-            else if (i_ExternData->buttons & EBT_MAP)
-            {
-                externInvKey |= EBT_MAP;
-                ev.type = ev_keydown;
-                ev.data1 = AM_STARTKEY;
-                D_PostEvent(&ev);
-            }
-        }
-#if 0
-        if ((i =
-             (i_ExternData->buttons >> EBT_WEAPONSHIFT) & EBT_WEAPONMASK) !=
-            0)
-        {
-            cmd->buttons |= BT_CHANGE;
-            cmd->buttons |= (i - 1) << BT_WEAPONSHIFT;
-        }
-#endif
-        if (i_ExternData->buttons & EBT_WEAPONCYCLE)
-        {
-            int curWeapon;
-            player_t *pl;
-
-            pl = &players[consoleplayer];
-            curWeapon = pl->readyweapon;
-            for (curWeapon = (curWeapon + 1) & 7;
-                 curWeapon != pl->readyweapon;
-                 curWeapon = (curWeapon + 1) & 7)
-            {
-                if (pl->weaponowned[curWeapon])
-                {
-                    if (curWeapon >= wp_goldwand && curWeapon <= wp_mace &&
-                        !pl->ammo[wpnlev1info[curWeapon].ammo])
-                    {           // weapon that requires ammo is empty
-                        continue;
-                    }
-                    break;
-                }
-            }
-            cmd->buttons |= BT_CHANGE;
-            cmd->buttons |= curWeapon << BT_WEAPONSHIFT;
-        }
-    }
-#endif

+    // haleyjd: removed externdriver crap
+
     // Fly up/down/drop keys
     if (gamekeydown[key_flyup])
     {
@@ -538,14 +339,8 @@ void G_BuildTiccmd(ticcmd_t * cmd)
     if (gamekeydown[key_flycenter])
     {
         flyheight = TOCENTER;
-#ifdef __WATCOMC__
-        if (!useexterndriver)
-        {
-            look = TOCENTER;
-        }
-#else
+        // haleyjd: removed externdriver crap
         look = TOCENTER;
-#endif
     }

     // Use artifact key
diff --git a/src/heretic/p_mobj.c b/src/heretic/p_mobj.c
index 73698263..b5366501 100644
--- a/src/heretic/p_mobj.c
+++ b/src/heretic/p_mobj.c
@@ -553,14 +553,8 @@ void P_ZMovement(mobj_t * mo)
             {
                 mo->player->deltaviewheight = mo->momz >> 3;
                 S_StartSound(mo, sfx_plroof);
-#ifdef __WATCOMC__
-                if (!useexterndriver)
-                {
-                    mo->player->centering = true;
-                }
-#else
+                // haleyjd: removed externdriver crap
                 mo->player->centering = true;
-#endif
             }
             mo->momz = 0;
         }
diff --git a/src/heretic/p_user.c b/src/heretic/p_user.c
index 4b8f38f7..63368bab 100644
--- a/src/heretic/p_user.c
+++ b/src/heretic/p_user.c
@@ -675,17 +675,11 @@ void P_PlayerThink(player_t * player)
     {
         if (!--player->powers[pw_flight])
         {
-#ifdef __WATCOMC__
-            if (player->mo->z != player->mo->floorz && !useexterndriver)
-            {
-                player->centering = true;
-            }
-#else
+            // haleyjd: removed externdriver crap
             if (player->mo->z != player->mo->floorz)
             {
                 player->centering = true;
             }
-#endif

             player->mo->flags2 &= ~MF2_FLY;
             player->mo->flags &= ~MF_NOGRAVITY;
diff --git a/src/heretic/r_main.c b/src/heretic/r_main.c
index 69b18e1f..1101c234 100644
--- a/src/heretic/r_main.c
+++ b/src/heretic/r_main.c
@@ -32,9 +32,7 @@

 int viewangleoffset;

-#ifdef __WATCOMC__
-int newViewAngleOff;
-#endif
+// haleyjd: removed WATCOMC

 int validcount = 1;             // increment every time a check is made

@@ -735,9 +733,8 @@ void R_SetupFrame(player_t * player)

     //drawbsp = 1;
     viewplayer = player;
-#ifdef __WATCOMC__
-    viewangleoffset = newViewAngleOff << ANGLETOFINESHIFT;
-#endif
+    // haleyjd: removed WATCOMC
+    // haleyjd FIXME: viewangleoffset handling?
     viewangle = player->mo->angle + viewangleoffset;
     tableAngle = viewangle >> ANGLETOFINESHIFT;
     if (player->chickenTics && player->chickenPeck)
diff --git a/src/hexen/d_net.c b/src/hexen/d_net.c
index f199cd38..87afd626 100644
--- a/src/hexen/d_net.c
+++ b/src/hexen/d_net.c
@@ -556,6 +556,7 @@ void D_ArbitrateNetStart(void)
     int i;
     boolean gotinfo[MAXNETNODES];
     boolean gotClass[MAXNETNODES];
+    // haleyjd FIXME: important somehow?
 #ifdef __WATCOMC__
     int nextTic;
     extern volatile int ticcount;
@@ -591,6 +592,7 @@ void D_ArbitrateNetStart(void)
                 }
             }
         }
+        // haleyjd FIXME: important somehow?
 #ifdef __WATCOMC__
         if (ticcount <= nextTic)
         {                       // only send packets every half second
diff --git a/src/hexen/g_game.c b/src/hexen/g_game.c
index 931ba1bb..9684eb17 100644
--- a/src/hexen/g_game.c
+++ b/src/hexen/g_game.c
@@ -161,9 +161,7 @@ char savedescription[32];

 int inventoryTics;

-#ifdef __WATCOMC__
-extern externdata_t *i_ExternData;
-#endif
+// haleyjd: removed externdriver crap

 static skill_t TempSkill;
 static int TempEpisode;
@@ -200,14 +198,7 @@ void G_BuildTiccmd(ticcmd_t * cmd)

     extern boolean artiskip;

-#ifdef __WATCOMC__
-    int angleDelta;
-    static int oldAngle;
-    extern int newViewAngleOff;
-    static int externInvKey;
-    extern boolean automapactive;
-    event_t ev;
-#endif
+    // haleyjd: removed externdriver crap

     pClass = players[consoleplayer].class;
     memset(cmd, 0, sizeof(*cmd));
@@ -230,14 +221,8 @@ void G_BuildTiccmd(ticcmd_t * cmd)
         || gamekeydown[key_speed]
         || joybuttons[joybspeed];

-#ifdef __WATCOMC__
-    if (useexterndriver)
-    {
-        speed |= (i_ExternData->buttons & EBT_SPEED);
-        strafe |= (i_ExternData->buttons & EBT_STRAFE);
-    }
-#endif
-
+    // haleyjd: removed externdriver crap
+
     forward = side = look = arti = flyheight = 0;

 //
@@ -338,187 +323,13 @@ void G_BuildTiccmd(ticcmd_t * cmd)
     {
         look = -lspeed;
     }
-#ifdef __WATCOMC__
-    if (gamekeydown[key_lookcenter] && !useexterndriver)
-    {
-        look = TOCENTER;
-    }
-#else
+    // haleyjd: removed externdriver crap
     if (gamekeydown[key_lookcenter])
     {
         look = TOCENTER;
     }
-#endif

-#ifdef __WATCOMC__
-    if (useexterndriver && look != TOCENTER && (gamestate == GS_LEVEL ||
-                                                gamestate == GS_INTERMISSION))
-    {
-        if (i_ExternData->moveForward)
-        {
-            forward += i_ExternData->moveForward;
-            if (speed)
-            {
-                forward <<= 1;
-            }
-        }
-        if (i_ExternData->angleTurn)
-        {
-            if (strafe)
-            {
-                side += i_ExternData->angleTurn;
-            }
-            else
-            {
-                cmd->angleturn += i_ExternData->angleTurn;
-            }
-        }
-        if (i_ExternData->moveSideways)
-        {
-            side += i_ExternData->moveSideways;
-            if (speed)
-            {
-                side <<= 1;
-            }
-        }
-        if (i_ExternData->buttons & EBT_CENTERVIEW)
-        {
-            look = TOCENTER;
-            oldAngle = 0;
-        }
-        else if (i_ExternData->pitch)
-        {
-            angleDelta = i_ExternData->pitch - oldAngle;
-            if (abs(angleDelta) < 35)
-            {
-                look = angleDelta / 5;
-            }
-            else
-            {
-                look = 7 * (angleDelta > 0 ? 1 : -1);
-            }
-            if (look == TOCENTER)
-            {
-                look++;
-            }
-            oldAngle += look * 5;
-        }
-        if (i_ExternData->flyDirection)
-        {
-            if (i_ExternData->flyDirection > 0)
-            {
-                flyheight = 5;
-            }
-            else
-            {
-                flyheight = -5;
-            }
-        }
-        if (abs(newViewAngleOff - i_ExternData->angleHead) < 3000)
-        {
-            newViewAngleOff = i_ExternData->angleHead;
-        }
-        if (i_ExternData->buttons & EBT_FIRE)
-        {
-            cmd->buttons |= BT_ATTACK;
-        }
-        if (i_ExternData->buttons & EBT_OPENDOOR)
-        {
-            cmd->buttons |= BT_USE;
-        }
-        if (i_ExternData->buttons & EBT_PAUSE)
-        {
-            cmd->buttons = BT_SPECIAL | BTS_PAUSE;
-            i_ExternData->buttons &= ~EBT_PAUSE;
-        }
-        if (externInvKey & EBT_USEARTIFACT)
-        {
-            ev.type = ev_keyup;
-            ev.data1 = key_useartifact;
-            H2_PostEvent(&ev);
-            externInvKey &= ~EBT_USEARTIFACT;
-        }
-        else if (i_ExternData->buttons & EBT_USEARTIFACT)
-        {
-            externInvKey |= EBT_USEARTIFACT;
-            ev.type = ev_keydown;
-            ev.data1 = key_useartifact;
-            H2_PostEvent(&ev);
-        }
-        if (externInvKey & EBT_INVENTORYRIGHT)
-        {
-            ev.type = ev_keyup;
-            ev.data1 = key_invright;
-            H2_PostEvent(&ev);
-            externInvKey &= ~EBT_INVENTORYRIGHT;
-        }
-        else if (i_ExternData->buttons & EBT_INVENTORYRIGHT)
-        {
-            externInvKey |= EBT_INVENTORYRIGHT;
-            ev.type = ev_keydown;
-            ev.data1 = key_invright;
-            H2_PostEvent(&ev);
-        }
-        if (externInvKey & EBT_INVENTORYLEFT)
-        {
-            ev.type = ev_keyup;
-            ev.data1 = key_invleft;
-            H2_PostEvent(&ev);
-            externInvKey &= ~EBT_INVENTORYLEFT;
-        }
-        else if (i_ExternData->buttons & EBT_INVENTORYLEFT)
-        {
-            externInvKey |= EBT_INVENTORYLEFT;
-            ev.type = ev_keydown;
-            ev.data1 = key_invleft;
-            H2_PostEvent(&ev);
-        }
-        if (i_ExternData->buttons & EBT_FLYDROP)
-        {
-            flyheight = TOCENTER;
-        }
-        if (gamestate == GS_LEVEL)
-        {
-            if (externInvKey & EBT_MAP)
-            {                   // automap
-                ev.type = ev_keyup;
-                ev.data1 = AM_STARTKEY;
-                H2_PostEvent(&ev);
-                externInvKey &= ~EBT_MAP;
-            }
-            else if (i_ExternData->buttons & EBT_MAP)
-            {
-                externInvKey |= EBT_MAP;
-                ev.type = ev_keydown;
-                ev.data1 = AM_STARTKEY;
-                H2_PostEvent(&ev);
-            }
-        }
-        if (i_ExternData->buttons & EBT_WEAPONCYCLE)
-        {
-            int curWeapon;
-            player_t *pl;
-
-            pl = &players[consoleplayer];
-            curWeapon = pl->readyweapon;
-            for (curWeapon = (curWeapon + 1) & 3;
-                 curWeapon != pl->readyweapon;
-                 curWeapon = (curWeapon + 1) & 3)
-            {
-                if (pl->weaponowned[curWeapon])
-                {
-                    cmd->buttons |= BT_CHANGE;
-                    cmd->buttons |= curWeapon << BT_WEAPONSHIFT;
-                    break;
-                }
-            }
-        }
-        if (i_ExternData->buttons & EBT_JUMP)
-        {
-            cmd->arti |= AFLAG_JUMP;
-        }
-    }
-#endif
+    // haleyjd: removed externdriver crap

     // Fly up/down/drop keys
     if (gamekeydown[key_flyup])
@@ -532,14 +343,8 @@ void G_BuildTiccmd(ticcmd_t * cmd)
     if (gamekeydown[key_flycenter])
     {
         flyheight = TOCENTER;
-#ifdef __WATCOMC__
-        if (!useexterndriver)
-        {
-            look = TOCENTER;
-        }
-#else
+        // haleyjd: removed externdriver crap
         look = TOCENTER;
-#endif
     }
     // Use artifact key
     if (gamekeydown[key_useartifact])
diff --git a/src/hexen/h2_main.c b/src/hexen/h2_main.c
index 042128db..3892b8d4 100644
--- a/src/hexen/h2_main.c
+++ b/src/hexen/h2_main.c
@@ -25,11 +25,7 @@

 // HEADER FILES ------------------------------------------------------------

-#ifdef __WATCOMC__
-#include <dos.h>
-#include <sys\types.h>
-#include <direct.h>
-#endif
+// haleyjd: removed WATCOMC
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
@@ -282,10 +278,7 @@ void D_DoomMain(void)
     ST_Message("Z_Init: Init zone memory allocation daemon.\n");
     Z_Init();

-#ifdef __WATCOMC__
-    I_StartupKeyboard();
-    I_StartupJoystick();
-#endif
+    // haleyjd: removed WATCOMC

     ST_Message("W_Init: Init WADfiles.\n");

@@ -856,7 +849,7 @@ static void CheckRecordFrom(void)
     H2_GameLoop();              // Never returns
 }

-#ifdef __WATCOMC__
+// haleyjd: removed WATCOMC
 /*
 void CleanExit(void)
 {
@@ -869,7 +862,6 @@ void CleanExit(void)
 	exit(1);
 }
 */
-#endif

 //==========================================================================
 //
diff --git a/src/hexen/h2def.h b/src/hexen/h2def.h
index a168ed15..5993fe55 100644
--- a/src/hexen/h2def.h
+++ b/src/hexen/h2def.h
@@ -31,11 +31,7 @@
 //#include <values.h>

 #include "st_start.h"
-#ifdef __WATCOMC__
-#include <malloc.h>
-#define	strcasecmp strcmpi
-#define	strncasecmp strnicmp
-#endif
+// haleyjd: removed WATCOMC

 // ticcmd:

@@ -786,7 +782,8 @@ byte *I_AllocLow(int length);

 void I_Tactile(int on, int off, int total);

-#ifdef __WATCOMC__
+// haleyjd: was WATCOMC, again preserved for historical interest as in Heretic
+#if 0
 extern boolean useexterndriver;

 #define EBT_FIRE			1
diff --git a/src/hexen/p_mobj.c b/src/hexen/p_mobj.c
index 66097170..5d6f7097 100644
--- a/src/hexen/p_mobj.c
+++ b/src/hexen/p_mobj.c
@@ -832,14 +832,8 @@ void P_ZMovement(mobj_t * mo)
                     {
                         S_StartSound(mo, SFX_PLAYER_LAND);
                     }
-#ifdef __WATCOMC__
-                    if (!useexterndriver)
-                    {
-                        mo->player->centering = true;
-                    }
-#else
+                    // haleyjd: removed externdriver crap
                     mo->player->centering = true;
-#endif
                 }
             }
             else if (mo->type >= MT_POTTERY1 && mo->type <= MT_POTTERY3)
@@ -1056,14 +1050,8 @@ static void PlayerLandedOnThing(mobj_t * mo, mobj_t * onmobj)
     {
         S_StartSound(mo, SFX_PLAYER_LAND);
     }
-#ifdef __WATCOMC__
-    if (!useexterndriver)
-    {
-        mo->player->centering = true;
-    }
-#else
+    // haleyjd: removed externdriver crap
     mo->player->centering = true;
-#endif
 }

 //----------------------------------------------------------------------------
diff --git a/src/hexen/p_setup.c b/src/hexen/p_setup.c
index 77b7eb5c..1d7c943a 100644
--- a/src/hexen/p_setup.c
+++ b/src/hexen/p_setup.c
@@ -671,6 +671,7 @@ void P_GroupLines(void)
 =================
 */

+// haleyjd FIXME: CDMUSIC
 #ifdef __WATCOMC__
 extern boolean i_CDMusic;
 #endif
@@ -689,7 +690,9 @@ void P_SetupLevel(int episode, int map, int playermask, skill_t skill)
             = players[i].itemcount = 0;
     }
     players[consoleplayer].viewz = 1;   // will be set by player think
-
+
+
+    // haleyjd FIXME: CDMUSIC
 #ifdef __WATCOMC__
     if (i_CDMusic == false)
     {
diff --git a/src/hexen/p_user.c b/src/hexen/p_user.c
index 9569d3f1..9f4e285c 100644
--- a/src/hexen/p_user.c
+++ b/src/hexen/p_user.c
@@ -881,14 +881,8 @@ void P_PlayerThink(player_t * player)
         {
             if (player->mo->z != player->mo->floorz)
             {
-#ifdef __WATCOMC__
-                if (!useexterndriver)
-                {
-                    player->centering = true;
-                }
-#else
+                // haleyjd: removed externdriver crap
                 player->centering = true;
-#endif
             }
             player->mo->flags2 &= ~MF2_FLY;
             player->mo->flags &= ~MF_NOGRAVITY;
diff --git a/src/hexen/r_main.c b/src/hexen/r_main.c
index 30d7afb0..48e21ab2 100644
--- a/src/hexen/r_main.c
+++ b/src/hexen/r_main.c
@@ -31,9 +31,7 @@

 int viewangleoffset;

-#ifdef __WATCOMC__
-int newViewAngleOff;
-#endif
+// haleyjd: removed WATCOMC

 int validcount = 1;             // increment every time a check is made

@@ -725,12 +723,8 @@ void R_SetupFrame(player_t * player)

     //drawbsp = 1;
     viewplayer = player;
-#ifdef __WATCOMC__
-    if (newViewAngleOff)
-    {
-        viewangleoffset = newViewAngleOff << ANGLETOFINESHIFT;
-    }
-#endif
+    // haleyjd: removed WATCOMC
+    // haleyjd FIXME: viewangleoffset handling?
     viewangle = player->mo->angle + viewangleoffset;
     tableAngle = viewangle >> ANGLETOFINESHIFT;
     viewx = player->mo->x;
diff --git a/src/hexen/sb_bar.c b/src/hexen/sb_bar.c
index 4a9e4dd8..13b41ae3 100644
--- a/src/hexen/sb_bar.c
+++ b/src/hexen/sb_bar.c
@@ -99,6 +99,7 @@ static void CheatTrackFunc2(player_t * player, Cheat_t * cheat);
 extern int ArmorIncrement[NUMCLASSES][NUMARMOR];
 extern int AutoArmorSave[NUMCLASSES];

+// haleyjd FIXME: CDMUSIC
 #ifdef __WATCOMC__
 extern boolean i_CDMusic;
 extern int i_CDMusicLength;
@@ -115,6 +116,7 @@ int curpos;
 int inv_ptr;
 int ArtifactFlash;

+// haleyjd FIXME: CDMUSIC
 #ifndef __WATCOMC__
 boolean i_CDMusic;              // in Watcom, defined in i_ibm
 #endif
@@ -1922,6 +1924,7 @@ static void CheatRevealFunc(player_t * player, Cheat_t * cheat)

 static void CheatTrackFunc1(player_t * player, Cheat_t * cheat)
 {
+    // haleyjd FIXME: CDMUSIC
 #ifdef __WATCOMC__
     char buffer[80];

@@ -1947,6 +1950,7 @@ static void CheatTrackFunc1(player_t * player, Cheat_t * cheat)

 static void CheatTrackFunc2(player_t * player, Cheat_t * cheat)
 {
+    // haleyjd FIXME: CDMUSIC
 #ifdef __WATCOMC__
     char buffer[80];
     int track;
diff --git a/src/hexen/st_start.c b/src/hexen/st_start.c
index 1f3cca1f..897c1810 100644
--- a/src/hexen/st_start.c
+++ b/src/hexen/st_start.c
@@ -202,6 +202,7 @@ void ST_UpdateNetNotches(int notchPosition)

 void ST_Progress(void)
 {
+    // haleyjd FIXME: any way to get input here? SDL event loop?
 #ifdef __WATCOMC__
     // Check for ESC press -- during startup all events eaten here
     I_StartupReadKeys();