shithub: rott

Download patch

ref: 19f201750768e69d3533e2bc09b7543cae50b3d2
parent: b9f3d1b0c5f0b281660c2cc8ec08cf6999732dec
author: Marc-Alexandre Espiaut <marcalexandre@member.fsf.org>
date: Tue Jun 5 10:22:05 EDT 2018

Removing dead code

--- a/rott/dosutil.c
+++ b/rott/dosutil.c
@@ -241,154 +241,3 @@
     exit (1);
 }
 
-#if 0
-/* ** */
-
-uint16_t SwapInt16L(uint16_t i)
-{
-#if BYTE_ORDER == BIG_ENDIAN
-    return ((uint16_t)i >> 8) | ((uint16_t)i << 8);
-#else
-    return i;
-#endif
-}
-
-uint32_t SwapInt32L(uint32_t i)
-{
-#if BYTE_ORDER == BIG_ENDIAN
-    return	((uint32_t)(i & 0xFF000000) >> 24) |
-            ((uint32_t)(i & 0x00FF0000) >>  8) |
-            ((uint32_t)(i & 0x0000FF00) <<  8) |
-            ((uint32_t)(i & 0x000000FF) << 24);
-#else
-    return i;
-#endif
-}
-
-/* ** */
-
-int OpenWrite(char *_fn)
-{
-    int fp;
-    char fn[MAX_PATH];
-    strncpy(fn, _fn, sizeof (fn));
-    fn[sizeof (fn) - 1] = '\0';
-    FixFilePath(fn);
-
-    fp = open(fn, O_CREAT|O_WRONLY|O_TRUNC|O_BINARY, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
-    return fp;
-}
-
-int OpenWriteAppend(char *_fn)
-{
-    int fp;
-    char fn[MAX_PATH];
-    strncpy(fn, _fn, sizeof (fn));
-    fn[sizeof (fn) - 1] = '\0';
-    FixFilePath(fn);
-
-    fp = open(fn, O_CREAT|O_WRONLY|O_BINARY, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
-    return fp;
-}
-
-void CloseWrite(int fp)
-{
-    close(fp);
-}
-
-int WriteSeek(int fp, int offset, int whence)
-{
-    return lseek(fp, offset, whence);
-}
-
-int WritePos(int fp)
-{
-    return lseek(fp, 0, SEEK_CUR);
-}
-
-int WriteInt8(int fp, int8_t d)
-{
-    return write(fp, &d, 1);
-}
-
-int WriteInt16(int fp, int16_t d)
-{
-    int16_t b = SwapInt16L(d);
-
-    return write(fp, &b, 2) / 2;
-}
-
-int WriteInt32(int fp, int32_t d)
-{
-    int32_t b = SwapInt32L(d);
-
-    return write(fp, &b, 4) / 4;
-}
-
-int WriteBytes(int fp, byte *d, int len)
-{
-    return write(fp, d, len);
-}
-
-
-int OpenRead(char *_fn)
-{
-    int fp;
-    char fn[MAX_PATH];
-    strncpy(fn, _fn, sizeof (fn));
-    fn[sizeof (fn) - 1] = '\0';
-    FixFilePath(fn);
-
-    fp = open(fn, O_RDONLY | O_BINARY);
-
-    return fp;
-}
-
-void CloseRead(int fp)
-{
-    close(fp);
-}
-
-int ReadSeek(int fp, int offset, int whence)
-{
-    return lseek(fp, offset, whence);
-}
-
-int ReadLength(int fp)
-{
-    return filelength(fp);
-}
-
-int8_t ReadInt8(int fp)
-{
-    byte d[1];
-
-    read(fp, d, 1);
-
-    return d[0];
-}
-
-int16_t ReadInt16(int fp)
-{
-    byte d[2];
-
-    read(fp, d, 2);
-
-    return (d[0]) | (d[1] << 8);
-}
-
-int32_t ReadInt32(int fp)
-{
-    byte d[4];
-
-    read(fp, d, 4);
-
-    return (d[0]) | (d[1] << 8) | (d[2] << 16) | (d[3] << 24);
-}
-
-int ReadBytes(int fp, byte *d, int len)
-{
-    return read(fp, d, len);
-}
-
-#endif
--- a/rott/fli_util.c
+++ b/rott/fli_util.c
@@ -255,103 +255,6 @@
     }
 }
 
-#if 0
-/** Clock oriented stuff. **/
-
-#define CMODE	0x43
-#define CDATA	0x40
-
-ErrCode clock_open(Clock *c)
-/* Set up clock and store speed of clock.  */
-{
-    c->speed = 4608;        /* Our peculiar speed.  */
-    outportb(CMODE, 0x34);  /* Change from divide by two to linear. */
-    outportb(CDATA, 0);     /* Set period to highest available. */
-    outportb(CDATA, 0);
-    return Success;
-}
-
-void clock_close(Clock *c)
-/* Return clock to normal. */
-{
-    outportb(CMODE, 0x36);  /* Change from linear to divide by two. */
-    outportb(CDATA, 0);     /* Set period to highest available. */
-    outportb(CDATA, 0);
-}
-
-Ulong clock_ticks(Clock *c)
-/* Get current clock tick. */
-{
-    /* This routine returns a clock with occassional spikes where time will
-     * look like its running backwards 1/18th of a second.  The resolution
-     * of the clock is 1/(18*256) = 1/4608 second.  The spikes are ok for
-     * our purposes since the wait loop will just ignore them. */
-    union REGS regs;
-    Uchar chip_time;
-    Ulong time;
-
-    regs.h.ah = 0;				/* Go ask BIOS timer services */
-    int86(0x1A, &regs, &regs);	/* for time in 1/18ths second. */
-    outportb(CMODE,0);			/* Latch time at timer chip. */
-    inportb(CDATA);				/* Read in LSB of chip time and discard. */
-    chip_time = inportb(CDATA);	/* Read in MSB of chip time and save. */
-    chip_time = -(signed char)chip_time;
-    /* We calculate the time using 3 bytes from the BIOS 18hz counter
-     * and one byte from the timer chip itself.  We discard the hi
-     * byte of the BIOS time,  shift the rest left by 8, and
-     * fill in the low byte with the MSB from the chip timer.
-     * This looks a little more complicated than this because
-     * the bios time is in various registers - cx for the hi word
-     * and dx for the low word. */
-    time = (Ulong)regs.h.cl << 24L;		/* Get MSB of our final time. */
-    time += (Ulong)regs.w.dx << 8L;     /* Fold in middle two bytes. */
-    time += (Ulong)chip_time;			/* Add in LSB from chip. */
-    return time;
-}
-
-
-/** Keyboard oriented stuff. **/
-
-ErrCode key_open(Key *key)
-/* Set up keyboard. */
-{
-    return Success;		/* Pretty easy on a PC. */
-}
-
-void key_close(Key *key)
-/* Close keyboard. */
-{
-    return;				/* Also very easy under DOS. */
-}
-
-Boolean key_ready(Key *key)
-/* See if a key is ready. */
-{
-    unsigned val;
-
-    if ((val = _bios_keybrd(_KEYBRD_READY)) == 0)
-        return FALSE;
-    else
-    {
-        key->ascii = val;
-        key->scancode = val;
-        return TRUE;
-    }
-}
-
-Uchar key_read(Key *key)
-/* Get next key. */
-{
-    unsigned val;
-
-    val = _bios_keybrd(_KEYBRD_READ);
-    key->ascii = val;
-    key->scancode = val;
-    return key->ascii;
-}
-
-#endif
-
 /** MemPtr stuff - to allocate and free blocks of memory > 64K. */
 
 ErrCode big_alloc(MemPtr *bb, Ulong size)
--- a/rott/rt_actor.c
+++ b/rott/rt_actor.c
@@ -1745,12 +1745,6 @@
         if (ambush)
             new->flags |= FL_AMBUSH;
 
-
-#if 0
-        if (gamestate.Product == ROTT_SUPERCD)
-            ConsiderAlternateActor(new,which);
-#endif
-
         StandardEnemyInit(new,dir);
 
         if (which == b_darkmonkobj)
@@ -1793,13 +1787,7 @@
 void SpawnPatrol (classtype which, int tilex, int tiley, int dir)
 {   statetype *temp;
     int path=PATH;
-#if 0
-    if (gamestate.Product == ROTT_SUPERCD)
-        char *altstartlabel;
-#endif
 
-
-
 #if (SHAREWARE==1)
     switch(which)
     {
@@ -1831,12 +1819,6 @@
         if (!loadedgame)
             gamestate.killtotal++;
 
-
-#if 0
-        if (gamestate.Product == ROTT_SUPERCD)
-            ConsiderAlternateActor(new,which);
-#endif
-
         StandardEnemyInit(new,dir);
 
         if ((which == wallopobj) || (which == roboguardobj))
@@ -3270,14 +3252,6 @@
             check->flags &= ~FL_SHOOTABLE;
             return;
         }
-#if 0
-        dist = FindDistance(dx,dy);
-        scalefactor = (blastradius-dist)>>4;
-        if (scalefactor > 0xffff)
-            scalefactor = 0xffff;
-        pdamage = FixedMul(damage,scalefactor);
-#endif
-//#if 0
         //magdx = abs(dx);
         //magdy = abs(dy);
 
@@ -3295,7 +3269,6 @@
             scalefactor = 0x12000;
         pdamage = FixedMul(damage,scalefactor);
         SoftError("\ndamage: %d, scalefactor: %x\n",pdamage,scalefactor);
-//#endif
         impulse = FixedMul(EXPLOSION_IMPULSE,scalefactor);
         if (check->obclass == playerobj)
         {
@@ -3853,14 +3826,6 @@
     ob->flags |= FL_DYING;
     ob->soundhandle = -1;
 
-#if 0
-    if ((ob->obclass == blitzguardobj) &&
-            (ob->state->condition & SF_DOWN)
-       )
-
-        SD_Play(PlayerSnds[locplayerstate->player]);
-#endif
-
     if (Vicious_Annihilation(ob,attacker))
         return;
     else if (enableZomROTT)
@@ -9654,16 +9619,6 @@
             prevdir = ((prevdir+2) & 0xf);
 
         }
-#if 0
-        SoftError("\n straight dir: %d\n queue dirs ",tdir);
-        for(count = 0; count < MISCVARS->NMEqueuesize; count++)
-        {
-            SoftError("\n dir %d: %d",MISCVARS->NMEqueuesize-count,
-                      ((ob->temp1 >> (4*count)) &0xf)
-                     );
-
-        }
-#endif
     }
     else             // else goto next queue dir;
     {
@@ -10083,10 +10038,6 @@
             //ob->tiley = ob->y >> TILESHIFT;
             ob->targettilex = ob->temp1;
             ob->targettiley = ob->temp2;
-#if (0)
-            Debug("\nfollower %d's new targetx %4x, targety %4x",
-                  ob-SNAKEHEAD,ob->temp1,ob->temp2);
-#endif
             ob->angle = atan2_appx(dx,dy);
             ob->dir = angletodir[ob->angle];
             ParseMomentum(ob,ob->angle);
@@ -13270,9 +13221,6 @@
 
     if ((yzangle>MAXYZANGLE) && (yzangle<FINEANGLES-MAXYZANGLE))
     {
-#if (0)
-        Debug("\nfailed from yzangle");
-#endif
         return false;
     }
 
@@ -13373,16 +13321,10 @@
                     {
                         if ( maskobjlist[value&0x3ff]->flags & MW_SHOOTABLE )
                         {
-#if (0)
-                            SoftError("\nfailed from shootable mask");
-#endif
                             return false;
                         }
                         else if ( maskobjlist[value&0x3ff]->flags & MW_WEAPONBLOCKING )
                         {
-#if (0)
-                            SoftError("\nfailed from block mask");
-#endif
                             return false;
                         }
                     }
@@ -13394,13 +13336,6 @@
             }
             else
             {
-#if (0)
-                SoftError("\n obx %d, oby %d, origx %d, origy %d"
-                          "\n xydist %d, vx %d, vy %d",ob->x,ob->y,orig->x,
-                          orig->y,xydist,vx,vy);
-
-                SoftError("\nfailed from normal wall");
-#endif
                 return false;
             }
         }
@@ -13413,9 +13348,6 @@
 //             FindDistance(orig->x-tempactor->x,orig->y-tempactor->y) )
 //             ==true) )
             {
-#if (0)
-                SoftError("\nfailed from actor");
-#endif
                 return false;
             }
         }
@@ -13428,17 +13360,11 @@
                  ==true) )
 
         {
-#if (0)
-            SoftError("\nfailed from sprite");
-#endif
             return false;
         }
 
         if (tempactor && (tempactor->which == PWALL))
         {
-#if (0)
-            SoftError("\nfailed from pushwall");
-#endif
             return false;
         }
         index=(cnt>=0);
--- a/rott/rt_com.c
+++ b/rott/rt_com.c
@@ -238,14 +238,6 @@
 
 //      SoftError( "ReadPacket: time=%ld size=%ld src=%ld type=%d\n",GetTicCount(), rottcom->datalength,rottcom->remotenode,rottcom->data[0]);
 
-#if 0
-        rottcom->command=CMD_OUTQUEBUFFERSIZE;
-        int386(rottcom->intnum,&comregs,&comregs);
-        SoftError( "outque size=%ld\n",*((short *)&(rottcom->data[0])));
-        rottcom->command=CMD_INQUEBUFFERSIZE;
-        int386(rottcom->intnum,&comregs,&comregs);
-        SoftError( "inque size=%ld\n",*((short *)&(rottcom->data[0])));
-#endif
         return true;
     }
     else // Not ready yet....
@@ -301,15 +293,6 @@
     // Send It !
 #ifdef PLATFORM_UNIX
     WriteUDPPacket();
-#endif
-
-#if 0
-    rottcom->command=CMD_OUTQUEBUFFERSIZE;
-    int386(rottcom->intnum,&comregs,&comregs);
-    SoftError( "outque size=%ld\n",*((short *)&(rottcom->data[0])));
-    rottcom->command=CMD_INQUEBUFFERSIZE;
-    int386(rottcom->intnum,&comregs,&comregs);
-    SoftError( "inque size=%ld\n",*((short *)&(rottcom->data[0])));
 #endif
 }
 
--- a/rott/rt_crc.c
+++ b/rott/rt_crc.c
@@ -63,35 +63,6 @@
     0x8201, 0x42C0, 0x4380, 0x8341, 0x4100, 0x81C1, 0x8081, 0x4040
 };
 
-/* driver */
-#if 0
-main(argc,argv)
-int argc;
-char **argv;
-{
-    if(argc>2) perr("Usage:  crcfast [filename]");
-    if(argc==2) strcpy(filename,argv[1]);
-    else
-    {
-        printf("\nEnter filename:  ");
-        gets(filename);
-    }
-    if((fp=fopen(filename,"rb"))==NULL) perr("Can't open file");
-    num=0L;
-    crc16=crctt=0;
-    while((ch=fgetc(fp))!=EOF)
-    {
-        num++;
-        crc16=updatecrc(crc16,ch);
-//		crctt=updcrc(crctt,ch);
-    }
-    fclose(fp);
-    printf("\nNumber of bytes = %lu\nCRC16 = %04X\nCRCTT = %04X",
-           num,crc16,crctt);
-}
-
-#endif
-
 /* update crc reverse */
 int updatecrc(int crc, int c)
 {
--- a/rott/rt_door.c
+++ b/rott/rt_door.c
@@ -3897,19 +3897,6 @@
             tilemap[pw->tilex][pw->tiley] = 0;
             if (pw->state!=pw_moving)
             {
-#if 0
-                if (pw->dir==nodir)
-                {
-                    if (tilemap[pw->tilex+1][pw->tiley]==0)
-                        pw->dir=east;
-                    else if (tilemap[pw->tilex-1][pw->tiley]==0)
-                        pw->dir=west;
-                    else if (tilemap[pw->tilex][pw->tiley+1]==0)
-                        pw->dir=south;
-                    else
-                        pw->dir=north;
-                }
-#endif
                 ConnectPushWall(i);
             }
         }
--- a/rott/rt_draw.c
+++ b/rott/rt_draw.c
@@ -638,63 +638,10 @@
     return (heightnumerator/nx);
 }
 
-
-
-#if 0
 //==========================================================================
 
-//******************************************************************************
-//
-// NextPlaneptr
-//
-//******************************************************************************
 
-void NextPlaneptr ( void )
-{
-    if (planeptr < &planelist[MAXPLANES-1]) // don't let it overflo'
-        planeptr++;
-}
 
-//******************************************************************************
-//
-// RestPlaneptr
-//
-//******************************************************************************
-
-void ResetPlaneptr ( void )
-{
-    planeptr = &planelist[0];
-}
-
-//******************************************************************************
-//
-// NextVisptr
-//
-//******************************************************************************
-
-void NextVisptr ( void )
-{
-    if (visptr < &vislist[MAXVISIBLE-1]) // don't let it overflo'
-        visptr++;
-}
-
-//******************************************************************************
-//
-// ResetVisptr
-//
-//******************************************************************************
-
-void ResetVisptr ( void )
-{
-    visptr = &vislist[0];
-}
-
-#endif
-
-//==========================================================================
-
-
-
 /*
 =====================
 =
@@ -757,9 +704,6 @@
 
     if ((ob->obclass >= p_bazookaobj) || (ob->obclass == missileobj))
     {   angle = viewangle - ob->angle;
-#if (0)
-        Debug("\nviewangle: %d, angle: %d",viewangle,angle);
-#endif
     }
     else if ((ob->obclass > wallopobj) && (ob->obclass != b_darksnakeobj))
         angle =  (viewangle-ANG180)- ob->angle;
@@ -785,9 +729,6 @@
 
     if (ob->state->rotate == 16)
     {   rotation = angle/(ANGLES/16);
-#if (0)
-        Debug("\nrotation: %d", rotation);
-#endif
         return rotation;
     }
     rotation = angle/(ANGLES/8);
@@ -795,90 +736,7 @@
 
 }
 
-
-
-#if 0
 /*
-=====================
-=
-= DrawMaskedWalls
-=
-=====================
-*/
-
-void DrawMaskedWalls (void)
-{
-
-
-    int   i,numvisible;
-    int   gx,gy;
-    unsigned short int  *tilespot;
-    byte   *visspot;
-    boolean result;
-    statobj_t *statptr;
-    objtype   *obj;
-    maskedwallobj_t* tmwall;
-
-    whereami=6;
-
-//
-// place maskwall objects
-//
-    for(tmwall=FIRSTMASKEDWALL; tmwall; tmwall=tmwall->next)
-    {
-        if (spotvis[tmwall->tilex][tmwall->tiley])
-        {
-            mapseen[tmwall->tilex][tmwall->tiley]=1;
-            if (tmwall->vertical)
-            {
-                gx=(tmwall->tilex<<16)+0x8000;
-                gy=(tmwall->tiley<<16);
-                visptr->texturestart=0;
-                visptr->textureend=0;
-                if (viewx<gx)
-                    result=TransformPlane(gx,gy,gx,gy+0xffff,visptr);
-                else
-                    result=TransformPlane(gx,gy+0xffff,gx,gy,visptr);
-                visptr->shapenum=tmwall->bottomtexture;
-                visptr->altshapenum=tmwall->midtexture;
-                visptr->viewx=tmwall->toptexture;
-                visptr->shapesize=2;
-            }
-            else
-            {
-                gx=(tmwall->tilex<<16);
-                gy=(tmwall->tiley<<16)+0x8000;
-                visptr->texturestart=0;
-                visptr->textureend=0;
-                if (viewy<gy)
-                    result=TransformPlane(gx+0xffff,gy,gx,gy,visptr);
-                else
-                    result=TransformPlane(gx,gy,gx+0xffff,gy,visptr);
-                visptr->shapenum=tmwall->bottomtexture;
-                visptr->altshapenum=tmwall->midtexture;
-                visptr->viewx=tmwall->toptexture;
-                visptr->shapesize=2;
-            }
-            if ((tmwall->flags&MW_TOPFLIPPING) &&
-                    (nonbobpheight>64)
-               )
-            {
-                visptr->viewx++;
-            }
-            else if ((tmwall->flags&MW_BOTTOMFLIPPING) &&
-                     (nonbobpheight>maxheight-32)
-                    )
-            {
-                visptr->shapenum++;
-            }
-            if ((visptr < &vislist[MAXVISIBLE-1]) && (result==true)) // don't let it overflo'
-                visptr++;
-        }
-    }
-}
-#endif
-
-/*
 ======================
 =
 = SortScaleds
@@ -3830,267 +3688,9 @@
 
     FlipPage();
 }
-#if 0
 
-//******************************************************************************
-//
-// DoLaserShoot
-//
-//******************************************************************************
-void DoLaserShoot (char * name)
-{
 
-    int sourcex;
-    int lastx;
-    int sourceheight;
-    int destheight;
-    int sourcestep;
-    int xstep;
-    int hstep;
-    int midx;
-    int startx;
-    int dx;
-    int f;
-    int s;
-    int height;
-    int x;
-    int sx;
-    int size;
-    patch_t *p;
-    byte * shape;
 
-    DrawWorld();
-    midx=160;
-    shape=W_CacheLumpName(name,PU_CACHE);
-    p=(patch_t *)shape;
-    size=p->origsize;
-
-    startx=midx-(size>>1)-(p->leftoffset);
-
-    sourcex=0;
-    lastx=startx+p->width;
-    sourcestep=(320*65536)/p->width;
-    sourceheight=p->origsize<<3;
-    destheight=p->origsize;
-    CalcTics();
-    CalcTics();
-
-
-    for (x=startx; x<lastx; x+=tics,sourcex+=(sourcestep*tics))
-    {
-        for (f=startx; f<=x; f++)
-            DrawScaledPost(destheight,shape,f-startx,f);
-        height=sourceheight<<16;
-        if (x<=midx)
-        {
-            dx=x-(sourcex>>16);
-            xstep=1;
-        }
-        else
-        {
-            dx=(sourcex>>16)-x;
-            xstep=-1;
-        }
-        sx=sourcex>>16;
-        if (dx)
-            hstep=((-destheight+sourceheight)<<16)/dx;
-        else
-            hstep=0;
-        for (s=0; s<dx; s++,height-=hstep,sx+=xstep)
-            DrawScaledPost(height>>16,shape,x-startx,sx);
-        FlipPage();
-        CalcTics();
-        DrawWorld();
-        break;
-    }
-
-    // Write out one more time so that the rest of the screen is clear
-
-    for (f=startx; f<lastx; f++)
-        DrawScaledPost(destheight,shape,f-startx,f);
-    FlipPage();
-}
-
-//******************************************************************************
-//
-// DoIntro
-//
-//******************************************************************************
-
-#define MAXMAG (80)
-#define OSCTIME (5*VBLCOUNTER)
-#define OSCXSHIFT (4)
-#define OSCTSHIFT (4)
-
-void DoIntro (void)
-{
-    byte * shape;
-    byte * origshape;
-    int mag;
-    int currentmag;
-    int magstep;
-    int time;
-    int x;
-    int t;
-
-    shadingtable=colormap+(1<<12);
-
-    origshape=W_CacheLumpName("ap_wrld",PU_CACHE);
-
-    mag=MAXMAG<<16;
-    magstep = (MAXMAG<<16)/OSCTIME;
-    time = OSCTIME;
-    t=0;
-
-    CalcTics();
-
-    while (time>0)
-    {
-        int yoffset;
-        int ylow;
-        int yhigh;
-        int offset;
-        int postheight;
-        byte * src;
-
-        shape=origshape;
-        VL_ClearBuffer (bufferofs, 0);
-        currentmag=mag>>16;
-        for (x=0; x<320; x++,shape+=200)
-        {
-            src=shape;
-            offset=(t+(x<<OSCXSHIFT))&(FINEANGLES-1);
-            yoffset=FixedMul(currentmag,sintable[offset]);
-            ylow=yoffset;
-            if (ylow<0)
-            {
-                src-=ylow;
-                ylow=0;
-            }
-            if (ylow>199)
-                ylow=199;
-            yhigh=yoffset+200;
-            if (yhigh>199)
-            {
-                yhigh=199;
-            }
-            if (yhigh<0)
-                yhigh=0;
-            postheight=yhigh-ylow+1;
-            if (postheight>0)
-                DrawSkyPost((byte *)bufferofs + x + ylookup[ylow],src,postheight);
-        }
-        FlipPage();
-        CalcTics();
-        mag  -= (magstep * tics);
-        time -= tics;
-        t    += (tics<<OSCTSHIFT);
-        if (mag<0) mag = 0;
-    }
-}
-
-
-//******************************************************************************
-//
-// DoZIntro
-//
-//******************************************************************************
-
-#define ZMAXMAG (199)
-#define ZOSCTIME (3*VBLCOUNTER)
-#define ZOSCXSHIFT (2)
-#define ZOSCXSTEP ( (FINEANGLES<<(ZOSCXSHIFT+16))/320 )
-#define ZOSCTSHIFT (2)
-
-void DoZIntro (void)
-{
-    byte * shape;
-    int mag;
-    int currentmag;
-    int magstep;
-    int time;
-    int x;
-    int t;
-
-    SetViewSize (MAXVIEWSIZES-1);
-
-    shadingtable=colormap+(1<<12);
-
-    shape=W_CacheLumpName("ap_wrld",PU_CACHE);
-
-    mag=ZMAXMAG<<16;
-    magstep = (ZMAXMAG<<16)/ZOSCTIME;
-    time = ZOSCTIME;
-    t=0;
-
-    CalcTics();
-
-
-    while (time>0)
-    {
-        int zoffset;
-        int hoffset;
-        int offset;
-        int srcoffset;
-        int bottomscreen;
-        int src;
-//      int i;
-
-
-        VL_ClearBuffer (bufferofs, 0);
-        currentmag=mag>>16;
-
-        srcoffset=0;
-        for (x=0; x<320;)
-        {
-
-            offset=(t+(FixedMul(x,ZOSCXSTEP)))&(FINEANGLES-1);
-            zoffset=FixedMul(currentmag,sintable[offset]);
-//         hoffset=FixedMulShift(currentmag,sintable[offset],17);
-            hoffset=0;
-            dc_texturemid=((100+hoffset)<<SFRACBITS)+(SFRACUNIT>>1);
-
-            dc_invscale=((200+zoffset)<<16)/200;
-            dc_iscale=0xffffffffu/(unsigned)dc_invscale;
-
-            srcoffset+=dc_invscale;
-            sprtopoffset=centeryfrac -  FixedMul(dc_texturemid,dc_invscale);
-            bottomscreen = sprtopoffset + (dc_invscale*200);
-            dc_yl = (sprtopoffset+SFRACUNIT-1)>>SFRACBITS;
-            dc_yh = ((bottomscreen-1)>>SFRACBITS);
-            if (dc_yh >= viewheight)
-                dc_yh = viewheight-1;
-            if (dc_yl < 0)
-                dc_yl = 0;
-            if (dc_yl <= dc_yh)
-            {
-                src=srcoffset>>16;
-                if (src>319)
-                    src=319;
-                if (src<0)
-                    src=0;
-                dc_source=shape+(src * 200);
-//            if (RandomNumber("hello",0)<128)
-                R_DrawColumn ((byte *)bufferofs+x);
-            }
-//         srcoffset+=0x10000;
-            x++;
-            if ((LastScan) || IN_GetMouseButtons())
-                return;
-        }
-        FlipPage();
-        CalcTics();
-        mag  -= (magstep * tics);
-//      mag  += FixedMulShift((magstep * tics),sintable[time&(FINEANGLES-1)],19);
-        time -= tics;
-        t    += (tics<<ZOSCTSHIFT);
-        if (mag<0) mag = 0;
-    }
-}
-#endif
-
-
-
 // Old Stuff
 
 /*
@@ -4741,18 +4341,6 @@
     {"EXP1\0",20},
     {"GREXP1\0",25},
     {"PART1\0",12},
-#if 0
-    {"GUTS1\0",12},
-    {"ORGAN1\0",12},
-    {"RIB1\0",12},
-    {"GPINK1\0",12},
-    {"GHEAD1\0",12},
-    {"GARM1\0",12},
-    {"GLEG1\0",12},
-    {"GHUM1\0",12},
-    {"GHIP1\0",12},
-    {"GLIMB1\0",12},
-#endif
 };
 
 
@@ -6103,35 +5691,6 @@
 
 void DrawSkyPost (byte * buf, byte * src, int height)
 {
-#if 0
-// bna fix for missing sky by high res eg 800x600
-// when sky is >400 (max skyheight) then reverse mouintain to missing spot
-// there should be 200 line of mouintain (400+200) = 600 height lines
-// not the best solution but what it works
-
-    if (iGLOBAL_SCREENWIDTH > 320) {
-        // bna section start
-        //int n = 0;
-        int orgh = 0;//height;
-        if (height > 400) {
-            orgh=height;
-        }
-
-        while (height--) {
-            if ((orgh > 0)&&( height<(orgh-400))) {
-                src-=2;
-                *buf = shadingtable[*src];
-            } else {
-
-                *buf = shadingtable[*src];
-            }
-            buf += linewidth;
-            src++;
-        }
-        // bna section end
-    }
-    else
-#endif
     {
         int i = 0;
         const byte *orig_src = src;
@@ -6189,391 +5748,4 @@
         VL_Bar(0, base, iGLOBAL_SCREENHEIGHT, start, FLOORCOLOR);
     }
 }
-
-#if 0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-typedef struct {
-    int   x;
-    int   y;
-    int   angle;
-    int   speed;
-    int   color;
-    int   endx;
-    int   endy;
-    int   plane;
-    int   time;
-} ParticleType;
-
-#define NUMPARTICLES 300
-#define PARTICLETHINKTIME 5
-#define Fix(a)        (a &= (FINEANGLES-1))
-ParticleType * Particle;
-int numparticles;
-
-//******************************************************************************
-//
-// InitializeParticles
-//
-//******************************************************************************
-
-void InitializeParticles (void)
-{
-    int i;
-    ParticleType * part;
-
-    Particle=(ParticleType *)SafeMalloc ( sizeof(ParticleType) * numparticles );
-    memset ( Particle, 0, sizeof(ParticleType) * numparticles );
-
-    for (i=0; i<numparticles; i++)
-    {
-        part=&Particle[i];
-        part->x=((RandomNumber("hello",0)*RandomNumber("hello",0))%viewwidth)<<16;
-        part->y=((RandomNumber("hello",0)*RandomNumber("hello",0))%viewheight)<<16;
-//      part->x=(((RandomNumber("hello",0)*RandomNumber("hello",0))%(viewwidth-40)+20)<<16);
-//      part->y=(((RandomNumber("hello",0)*RandomNumber("hello",0))%(viewheight-40)+20)<<16);
-        part->angle=(RandomNumber("hello",0)*RandomNumber("hello",0))%FINEANGLES;
-//      part->speed=(RandomNumber("hello",0)%2)<<16;
-        part->speed=(1<<16)-1;
-        part->color=RandomNumber("hello",0);
-        part->endx=-1;
-        part->endy=-1;
-        part->plane=(part->x>>16)&3;
-        part->time=(RandomNumber("",0)%PARTICLETHINKTIME)+1;
-//      part->color=255;
-    }
-}
-
-//******************************************************************************
-//
-// ShutdownParticles
-//
-//******************************************************************************
-
-void ShutdownParticles (void)
-{
-    SafeFree(Particle);
-}
-
-
-void AdjustParticleAngle(int maxadjust, int *currangle,int targetangle)
-{
-    int dangle,i,magangle;
-
-    for(i=0; i<maxadjust; i++)
-    {
-        dangle = *currangle - targetangle;
-
-        if (dangle)
-        {
-            magangle = abs(dangle);
-            if (magangle > (ANGLES/2))
-            {
-                if (dangle > 0)
-                    (*currangle) ++;
-                else
-                    (*currangle) --;
-            }
-            else
-            {
-                if (dangle > 0)
-                    (*currangle) --;
-                else
-                    (*currangle) ++;
-            }
-            Fix(*currangle);
-        }
-    }
-}
-
-//******************************************************************************
-//
-// UpdateParticles
-//
-//******************************************************************************
-
-//#define MAXADJUST (FINEANGLES/40)
-#define MAXADJUST (FINEANGLES/20)
-void UpdateParticles (int type)
-{
-    int i;
-    int dx,dy;
-    ParticleType * target;
-    ParticleType * part;
-
-    if (type==0)
-    {
-        for (i=0; i<numparticles-1; i++)
-        {
-            int angle;
-
-            part=&Particle[i];
-//         target=&Particle[numparticles-1];
-//         target=&Particle[i+1];
-            target=&Particle[(RandomNumber("",0)*RandomNumber("",0))%numparticles];
-            part->x+=-FixedMul (part->speed, costable[part->angle]);
-            part->y+= FixedMul (part->speed, sintable[part->angle]);
-            part->plane=(part->x>>16)&3;
-
-            dx = part->x - target->x;
-            dy = target->y - part->y;
-            if (dx && dy)
-            {
-                angle = atan2_appx(dx,dy);
-                AdjustParticleAngle(MAXADJUST,&(part->angle),angle);
-            }
-        }
-        part=&Particle[numparticles-1];
-        part->x+=-FixedMul (part->speed, costable[part->angle]);
-        part->y+= FixedMul (part->speed, sintable[part->angle]);
-        part->plane=(part->x>>16)&3;
-
-        dx=part->x>>16;
-        dy=part->y>>16;
-
-        if ( (dx<20) || (dx>(viewwidth-20)) )
-        {
-            if ( part->angle < (FINEANGLES/2) )
-            {
-                part->angle=FINEANGLES/2-part->angle;
-                Fix(part->angle);
-            }
-            else
-            {
-                part->angle=FINEANGLES-part->angle;
-                Fix(part->angle);
-            }
-        }
-        if ( (dy<20) || (dy>(viewheight-20)) )
-        {
-            part->angle=FINEANGLES-part->angle;
-            Fix(part->angle);
-        }
-    }
-    else
-    {
-        for (i=0; i<numparticles; i++)
-        {
-            int angle;
-
-            part=&Particle[i];
-            if ((part->x>>16)!=part->endx)
-                part->x+=-FixedMul (part->speed, costable[part->angle]);
-            else
-                part->x=part->endx<<16;
-            if ((part->y>>16)!=part->endy)
-                part->y+= FixedMul (part->speed, sintable[part->angle]);
-            else
-                part->y=part->endy<<16;
-            part->plane=(part->x>>16)&3;
-
-            part->time--;
-            if (part->time==0)
-            {
-                part->time=PARTICLETHINKTIME;
-                dx = part->x - (part->endx<<16);
-                dy = (part->endy<<16) - part->y;
-                if (dx && dy)
-                {
-                    angle = atan2_appx(dx,dy);
-                    AdjustParticleAngle(MAXADJUST,&(part->angle),angle);
-                }
-            }
-        }
-    }
-}
-
-//******************************************************************************
-//
-// DrawParticles
-//
-//******************************************************************************
-
-void DrawParticles (void)
-{
-    int i;
-    int dx,dy;
-    int plane;
-    ParticleType * part;
-
-    VL_ClearBuffer (bufferofs, 0);
-    {
-        for (i=0; i<numparticles; i++)
-        {
-            part=&Particle[i];
-            if (part->plane!=plane)
-                continue;
-            dx=part->x>>16;
-            dy=part->y>>16;
-            if (dx<0) dx=0;
-            if (dx>=viewwidth) dx=viewwidth-1;
-            if (dy<0) dy=0;
-            if (dy>=viewheight) dy=viewheight-1;
-            *( (byte *) bufferofs + dx + ylookup[dy] ) = part->color;
-        }
-    }
-}
-
-void DrawParticleTemplate (void)
-{
-    byte pal[768];
-
-    viewwidth=320;
-    viewheight=200;
-    memcpy(&pal[0],W_CacheLumpName("ap_pal",PU_CACHE),768);
-    VL_NormalizePalette(&pal[0]);
-    SwitchPalette(&pal[0],35);
-    VL_ClearBuffer (bufferofs, 255);
-    DrawNormalSprite (0, 0, W_GetNumForName("ap_titl"));
-}
-
-void DrawAlternateParticleTemplate (void)
-{
-    viewwidth=320;
-    viewheight=200;
-    VL_ClearBuffer (bufferofs, 255);
-    DrawNormalSprite (0, 0, W_GetNumForName("LIFE_C1"));
-}
-
-int CountParticles (void)
-{
-    int plane,a,b;
-    int count;
-
-    count=0;
-    {
-        for (a=0; a<200; a++)
-        {
-            for (b=0; b<320; b++)
-            {
-                if (*((byte *)bufferofs+(a*linewidth)+b)!=255)
-                    count++;
-            }
-        }
-    }
-    return count;
-}
-
-void AssignParticles (void)
-{
-    int plane,a,b;
-    byte pixel;
-    ParticleType * part;
-
-    part=&Particle[0];
-    {
-        for (a=0; a<200; a++)
-        {
-            for (b=0; b<320; b++)
-            {
-                pixel = *((byte *)bufferofs+(a*linewidth)+b);
-                if (pixel!=255)
-                {
-                    part->endx=b;
-                    part->endy=a;
-                    part->color=pixel;
-                    part++;
-                }
-            }
-        }
-    }
-}
-
-//******************************************************************************
-//
-// ParticleIntro
-//
-//******************************************************************************
-
-void ParticleIntro (void)
-{
-    int i,j;
-
-
-    SetViewSize (MAXVIEWSIZES-1);
-    numparticles=NUMPARTICLES;
-    DrawAlternateParticleTemplate ();
-//   DrawParticleTemplate ();
-    numparticles=CountParticles ();
-    InitializeParticles ();
-    AssignParticles();
-//   numparticles>>=1;
-
-    CalcTics();
-    CalcTics();
-    LastScan=0;
-    for (i=0; i<VBLCOUNTER*15; i+=tics)
-    {
-        DrawParticles();
-        FlipPage();
-        for (j=0; j<tics; j++)
-        {
-            UpdateParticles(0);
-        }
-        CalcTics();
-        if ((LastScan) || IN_GetMouseButtons())
-            break;;
-    }
-    LastScan=0;
-    for (i=0; i<VBLCOUNTER*15; i+=tics)
-    {
-        DrawParticles();
-        FlipPage();
-        for (j=0; j<tics; j++)
-        {
-            UpdateParticles(1);
-        }
-        CalcTics();
-        if ((LastScan) || IN_GetMouseButtons())
-            break;;
-    }
-    ShutdownParticles ();
-}
-
-#endif
 
--- a/rott/rt_game.c
+++ b/rott/rt_game.c
@@ -5198,17 +5198,6 @@
     size=LoadBuffer(&altbuffer,&bufptr);
     LoadPushWalls(altbuffer,size);
     SafeFree(altbuffer);
-#if 0
-    // Animated Walls Tag
-
-    size=5;
-    LoadTag(&bufptr,"AWALL",size);
-
-    // Animated Walls
-    size=LoadBuffer(&altbuffer,&bufptr);
-    LoadAnimWalls(altbuffer,size);
-    SafeFree(altbuffer);
-#endif
 
     // MaskedWalls Tag
 
--- a/rott/rt_in.c
+++ b/rott/rt_in.c
@@ -133,22 +133,6 @@
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
 };
 
-#if 0
-const char ScanChars[128] =    // Scan code names with single chars
-{
-    '?','?','1','2','3','4','5','6','7','8','9','0','-','+','?','?',
-    'Q','W','E','R','T','Y','U','I','O','P','[',']','|','?','A','S',
-    'D','F','G','H','J','K','L',';','\'','?','?','?','Z','X','C','V',
-    'B','N','M',',','.','/','?','?','?',' ','?','?','?','?','?','?',
-    '?','?','?','?','?','?','?','?','?','?','-','?','5','?','+','?',
-    '?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?',
-    '?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?',
-    '?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?'
-};
-#endif
-
-
-
 //****************************************************************************
 //
 // LOCALS
@@ -229,13 +213,6 @@
         } /* else */
     } /* else */
 
-#if 0
-    if (mouse_x < 0) mouse_x = 0;
-    if (mouse_x > surface->w) mouse_x = surface->w;
-    if (mouse_y < 0) mouse_y = 0;
-    if (mouse_y > surface->h) mouse_y = surface->h;
-#endif
-
     /* set static vars... */
     sdl_mouse_delta_x += mouse_relative_x;
     sdl_mouse_delta_y += mouse_relative_y;
@@ -631,34 +608,8 @@
     return result;
 }
 
-#if 0
 //******************************************************************************
 //
-// IN_GetJoyButtonsDB () - Returns the de-bounced button status of the
-//                         specified joystick
-//
-//******************************************************************************
-
-word IN_GetJoyButtonsDB (word joy)
-{
-    longword lasttime;
-    word result1,result2;
-
-    do
-    {
-        result1 = INL_GetJoyButtons (joy);
-        lasttime = GetTicCount();
-        while (GetTicCount() == lasttime)
-            ;
-        result2 = INL_GetJoyButtons (joy);
-    } while (result1 != result2);
-
-    return(result1);
-}
-#endif
-
-//******************************************************************************
-//
 // INL_StartMouse () - Detects and sets up the mouse
 //
 //******************************************************************************
@@ -1025,30 +976,8 @@
     ClearHashTable(scancodes);
 }
 
-
-#if 0
 //******************************************************************************
 //
-// IN_Default() - Sets up default conditions for the Input Mgr
-//
-//******************************************************************************
-
-void IN_Default (boolean gotit, ControlType in)
-{
-    if
-    (
-        (!gotit)
-        ||    ((in == ctrl_Joystick1) && !JoysPresent[0])
-        ||    ((in == ctrl_Joystick2) && !JoysPresent[1])
-        ||    ((in == ctrl_Mouse) && !MousePresent)
-    )
-        in = ctrl_Keyboard1;
-    IN_SetControlType (0, in);
-}
-#endif
-
-//******************************************************************************
-//
 // IN_Shutdown() - Shuts down the Input Mgr
 //
 //******************************************************************************
@@ -1114,16 +1043,6 @@
     case ctrl_Keyboard:
         def = &KbdDefs;
 
-#if 0
-        if (Keyboard[def->upleft])
-            mx = motion_Left,my = motion_Up;
-        else if (Keyboard[def->upright])
-            mx = motion_Right,my = motion_Up;
-        else if (Keyboard[def->downleft])
-            mx = motion_Left,my = motion_Down;
-        else if (Keyboard[def->downright])
-            mx = motion_Right,my = motion_Down;
-#endif
         if (Keyboard[sc_UpArrow])
             my = motion_Up;
         else if (Keyboard[sc_DownArrow])
@@ -1141,21 +1060,6 @@
         realdelta = false;
         break;
 
-#if 0
-    case ctrl_Joystick1:
-    case ctrl_Joystick2:
-        INL_GetJoyDelta (type - ctrl_Joystick, &dx, &dy);
-        buttons = INL_GetJoyButtons (type - ctrl_Joystick);
-        realdelta = true;
-        break;
-
-    case ctrl_Mouse:
-        INL_GetMouseDelta (&dx,&dy);
-        buttons = IN_GetMouseButtons ();
-        realdelta = true;
-        break;
-
-#endif
     default:
         ;
     }
@@ -1457,56 +1361,6 @@
 //   I_SendKeyboardData(0xf6);
 //   I_SendKeyboardData(0xf4);
 }
-
-
-#if 0
-//******************************************************************************
-//
-// IN_DumpKeyboardQueue ()
-//
-//******************************************************************************
-
-void IN_DumpKeyboardQueue (void)
-{
-    int head = Keyhead;
-    int tail = Keytail;
-    int key;
-
-    if (tail != head)
-    {
-        SoftError( "START DUMP\n");
-
-        while (head != tail)
-        {
-            if (KeyboardQueue[head] & 0x80)        // Up event
-            {
-                key = KeyboardQueue[head] & 0x7F;   // AND off high bit
-
-//            if (keysdown[key])
-//            {
-//               SoftError( "%s - was put in next refresh\n",
-//                                 IN_GetScanName (key));
-//            }
-//            else
-//            {
-                if (Keyboard[key] == 0)
-                    SoftError( "%s %ld - was lost\n", IN_GetScanName (key), key);
-                else
-                    SoftError( "%s %ld - up\n", IN_GetScanName (key), key);
-//            }
-            }
-            else                                      // Down event
-                SoftError( "%s %ld - down\n", IN_GetScanName (KeyboardQueue[head]), KeyboardQueue[head]);
-
-            head = (head+1)&(KEYQMAX-1);
-        }        // while
-
-        SoftError( "END DUMP\n");
-
-    }           // if
-}
-#endif
-
 
 //******************************************************************************
 //
--- a/rott/rt_main.c
+++ b/rott/rt_main.c
@@ -312,21 +312,6 @@
     }
     I_StartupTimer();
     I_StartupKeyboard();
-#if 0
-#if (SHAREWARE == 1)
-    if ((!SOUNDSETUP) && (standalone==false))
-    {
-        byte * txtscn;
-        int i;
-
-        for (i=0; i<20; i++)
-            printf("\n");
-        txtscn = (byte *) W_CacheLumpNum (W_GetNumForName ("rotts10"), PU_CACHE);
-        memcpy ((byte *)0xB8000, txtscn, 4000);
-        I_Delay (600);
-    }
-#endif
-#endif
     locplayerstate = &PLAYERSTATE[consoleplayer];
 
     if (standalone==true)
@@ -2183,13 +2168,6 @@
         autopressed = false;
     }
 
-#if 0
-    if ( modemgame == false )
-    {
-        CheckDevelopmentKeys();
-    }
-#endif
-
     if ( ( MSG.messageon == false ) && ( !quitactive ) )
     {
         if ( ( Keyboard[ buttonscan[ bt_message ] ] ) && ( BATTLEMODE ) )
@@ -2338,7 +2316,6 @@
             }
         }
 
-//#if 0
         if ( ( Keyboard[ sc_F12 ] ) && ( !BATTLEMODE ) )
         {
             Keyboard[ sc_F12 ] = false;
@@ -2345,7 +2322,6 @@
             LastScan = 0;
             DoBossKey();
         }
-//#endif
 
         // Gamma correction
         if ( Keyboard[ sc_F11 ] )
@@ -2368,23 +2344,6 @@
                 IN_UpdateKeyboard();
             }
         }
-#if 0
-        if ( Keyboard[ sc_M ] )
-        {
-            char str[ 50 ] = "Mouse Y-Rotation Input Scale ";
-            char str2[ 10 ];
-
-            if ( Keyboard[ sc_RShift ] )
-                mouse_ry_input_scale += 50;
-            else
-                mouse_ry_input_scale -= 50;
-
-            itoa(mouse_ry_input_scale,str2,10);
-            strcat( str, str2 );
-            AddMessage( str, MSG_SYSTEM );
-
-        }
-#endif
         // Increase volume
         if ( Keyboard[ sc_CloseBracket ] )
         {
@@ -2478,225 +2437,6 @@
     }
 #endif
 }
-
-
-//******************************************************************************
-//
-// CheckDevelopmentKeys ()
-//
-//******************************************************************************
-#if 0
-void CheckDevelopmentKeys
-(
-    void
-)
-
-{
-    // Lower wall height
-    if ( Keyboard[ sc_5 ] )
-    {
-        if ( levelheight > 1 )
-        {
-            levelheight--;
-        }
-
-        while( Keyboard[ sc_5 ] )
-        {
-            IN_UpdateKeyboard ();
-        }
-
-        maxheight = ( levelheight << 6 ) - 32;
-        nominalheight = maxheight - 32;
-    }
-
-    // Raise wall height
-    if ( Keyboard[ sc_6 ] )
-    {
-        levelheight++;
-
-        while( Keyboard[ sc_6 ] )
-        {
-            IN_UpdateKeyboard();
-        }
-
-        maxheight = ( levelheight << 6 ) - 32;
-        nominalheight = maxheight - 32;
-    }
-
-    if ( Keyboard[ sc_8 ] )
-    {
-        char str[ 50 ] = "You are now player ";
-        char str2[ 10 ];
-
-        locplayerstate->player++;
-        if ( locplayerstate->player == 5 )
-        {
-            locplayerstate->player = 0;
-        }
-
-        while( Keyboard[ sc_8 ] )
-        {
-            IN_UpdateKeyboard ();
-        }
-
-        itoa( locplayerstate->player, str2, 10 );
-        strcat( str, str2 );
-        AddMessage( str, MSG_SYSTEM );
-    }
-
-#if 0
-    // Cycle forward through wall textures
-    if (Keyboard[sc_W] && (modemgame==false))
-    {   int i,j;
-
-        for(i=0; i<128; i++)
-            for(j=0; j<128; j++)
-            {   if (IsWall(i,j))
-                {   if (tilemap[i][j] ==
-                            (W_GetNumForName("WALLSTOP")-W_GetNumForName("WALLSTRT")-1))
-                        tilemap[i][j] = 1;
-                    else
-                        tilemap[i][j] ++;
-                }
-            }
-        while(Keyboard[sc_W])
-            IN_UpdateKeyboard ();
-
-    }
-
-
-
-    if (Keyboard[sc_Q] && (modemgame==false))
-    {   int i,j;
-
-        for(i=0; i<128; i++)
-            for(j=0; j<128; j++)
-            {   if (IsWall(i,j))
-                {   if (tilemap[i][j] == 1)
-                        tilemap[i][j] = 74;
-                    else
-                        tilemap[i][j] --;
-                }
-            }
-        while(Keyboard[sc_Q])
-            IN_UpdateKeyboard ();
-
-    }
-
-#endif
-    // Step through cieling/skies
-    if ( Keyboard[ sc_K ] )
-    {
-        if ( sky > 0 )
-        {
-            MAPSPOT( 1, 0, 0 )++;
-            if ( MAPSPOT( 1, 0, 0 ) > 239 )
-            {
-                MAPSPOT( 1, 0, 0 ) = 234;
-            }
-        }
-        else
-        {
-            MAPSPOT( 1, 0, 0 )++;
-            if ( MAPSPOT( 1, 0, 0 ) > 198 + 15 )
-            {
-                MAPSPOT( 1, 0, 0 ) = 198;
-            }
-        }
-
-        SetPlaneViewSize();
-
-        while( Keyboard[ sc_K ] )
-        {
-            IN_UpdateKeyboard();
-        }
-    }
-
-    // Step through floors
-    if ( Keyboard[ sc_L ] )
-    {
-        MAPSPOT( 0, 0, 0 )++;
-        if ( MAPSPOT( 0, 0, 0 ) > 180 + 15 )
-        {
-            MAPSPOT( 0, 0, 0 ) = 180;
-            SetPlaneViewSize();
-
-            while( Keyboard[ sc_L ] )
-            {
-                IN_UpdateKeyboard();
-            }
-        }
-    }
-
-    // Increase darkness level
-    if ( Keyboard[ sc_M ] )
-    {
-        if ( darknesslevel < 7 )
-        {
-            darknesslevel++;
-        }
-
-        SetLightLevels( darknesslevel );
-
-        while( Keyboard[ sc_M ] )
-        {
-            IN_UpdateKeyboard();
-        }
-    }
-
-    // Decrease darkness level
-    if ( Keyboard[ sc_N ] )
-    {
-        if ( darknesslevel > 0 )
-        {
-            darknesslevel--;
-        }
-
-        SetLightLevels( darknesslevel );
-
-        while( Keyboard[ sc_N ] )
-        {
-            IN_UpdateKeyboard();
-        }
-    }
-
-    // Increase light rate
-    if ( Keyboard[ sc_B ] )
-    {
-        SetLightRate( GetLightRate() + 1 );
-        myprintf( "normalshade = %ld\n", normalshade );
-
-        while( Keyboard[ sc_B ] )
-        {
-            IN_UpdateKeyboard();
-        }
-    }
-
-    // Decrease light rate
-    if ( Keyboard[ sc_V ] )
-    {
-        SetLightRate( GetLightRate() - 1 );
-        myprintf( "normalshade = %ld\n", normalshade );
-
-        while( Keyboard[ sc_V ] )
-        {
-            IN_UpdateKeyboard();
-        }
-    }
-
-    // Toggle light diminishing on/off
-    if ( Keyboard[ sc_T ] )
-    {
-        fulllight ^= 1;
-
-        while( Keyboard[ sc_T ] )
-        {
-            IN_UpdateKeyboard();
-        }
-    }
-}
-#endif
-
 
 #if SAVE_SCREEN
 
--- a/rott/rt_menu.c
+++ b/rott/rt_menu.c
@@ -4943,33 +4943,6 @@
                 ci->button2=ci->button3=false;
         }
     }
-
-
-#if 0
-    if (SpaceBallPresent && spaceballenabled)
-    {
-        SP_Get(&packet);
-
-        if (packet.button)
-        {
-            if (packet.button & SP_BTN_1)
-                ci->button0 = true;
-
-            if (packet.button & SP_BTN_2)
-                ci->button1 = true;
-        }
-
-        if (packet.ty >  MENU_AMT)
-            ci->dir = dir_North;
-        else if (packet.ty < -MENU_AMT)
-            ci->dir = dir_South;
-
-        if (packet.tx < (-MENU_AMT* 6))
-            ci->dir = dir_West;
-        else if (packet.tx > (MENU_AMT * 6))
-            ci->dir = dir_East;
-    }
-#endif
 }
 
 
--- a/rott/rt_net.c
+++ b/rott/rt_net.c
@@ -141,25 +141,7 @@
 //****************************************************************************
 
 #define ComError SoftError
-#if 0
-void ComError (char *error, ...)
-{
-#if 0
-    va_list	argptr;
-#endif
 
-    SoftError(error);
-#if 0
-    if (standalone==true)
-    {
-        va_start (argptr, error);
-        vprintf (error, argptr);
-        va_end (argptr);
-    }
-#endif
-}
-#endif
-
 //****************************************************************************
 //
 // ConsoleIsServer()
@@ -597,17 +579,6 @@
     else
         InUCC = true;
 
-#if 0
-
-    delta=GetTicCount()-lastcontrolupdatetime;
-    if (delta>largesttime)
-    {
-        if (delta>10)
-            largesttime=delta;
-        largesttime=delta;
-    }
-
-#endif
     lastcontrolupdatetime=GetTicCount();
 
     if (standalone==false)
@@ -1157,16 +1128,6 @@
 
     cmd = CommandAddress(time);
 
-#if 0
-    if (networkgame==false)
-    {
-        int nump;
-        nump=controlupdatetime-time;
-        if (nump>numpackets)
-            numpackets=nump;
-    }
-#endif
-
     if (controlupdatetime<=time)
         return;
 
@@ -1354,10 +1315,6 @@
     fix=(COM_FixupType *)pkt;
 
     ComError( "Fixup received at %d, time=%d numpackets=%d\n", GetTicCount(), fix->time, fix->numpackets);
-#if 0
-    if (networkgame==false)
-        FixingPackets=false;
-#endif
     time=fix->time;
     ptr=&(fix->data);
 
@@ -1530,66 +1487,8 @@
 }
 #endif
 
-#if 0
-
 //****************************************************************************
 //
-// CheckForSyncTime
-//
-//****************************************************************************
-
-void CheckForSyncTime ( void )
-{
-    if ((modemgame==true) && (networkgame==false) && (consoleplayer==0))
-    {
-        if (controlupdatetime>=syncservertime)
-        {
-            SendSyncTimePacket();
-            syncservertime+=MODEMSYNCSERVERTIME;
-        }
-    }
-}
-#endif
-
-#if 0
-//****************************************************************************
-//
-// SendSyncTimePacket
-//
-//****************************************************************************
-
-void SendSyncTimePacket ( void )
-{
-    int i;
-    COM_SyncType sync;
-
-    return;
-
-    sync.type=COM_SYNCTIME;
-
-    if (networkgame==true)
-    {
-        for (i=0; i<numplayers; i++)
-        {
-            if ((PlayerStatus[i]!=player_ingame) || ( (i==consoleplayer) && (standalone==false) ) )
-                continue;
-            sync.synctime=GetTicCount()+GetTransitTime(i);
-            WritePacket ( &sync.type, GetPacketSize(&sync.type), i);
-        }
-    }
-    else
-    {
-        if (PlayerStatus[server]==player_ingame)
-        {
-            sync.synctime=GetTicCount()+GetTransitTime(server);
-            WritePacket ( &sync.type, GetPacketSize(&sync.type), server);
-        }
-    }
-}
-#endif
-
-//****************************************************************************
-//
 // ProcessSoundAndDeltaPacket
 //
 //****************************************************************************
@@ -1649,17 +1548,6 @@
 //      SoftError("diff=%ld\n",diff);
 //      if (abs(diff)>1)
 //         ISR_SetTime(GetTicCount()-diff);
-#if 0
-    diff = controlupdatetime-LastCommandTime[0];
-    if (diff>3)
-    {
-        ISR_SetTime(GetTicCount()-1);
-    }
-    else if (diff<-3)
-    {
-        ISR_SetTime(GetTicCount()+1);
-    }
-#endif
 //      }
 //   else
 //      {
@@ -2214,13 +2102,6 @@
         if (restartgame==true)
             break;
         SendFullServerPacket();
-#if 0
-        if (serverupdatetime>=syncservertime)
-        {
-            SendSyncTimePacket();
-            syncservertime+=NETSYNCSERVERTIME;
-        }
-#endif
     }
 exitProcessServer:
     InProcessServer=false;
@@ -2542,21 +2423,6 @@
         if (ob->flags&FL_PUSHED)
         {
             ob->flags&=~FL_PUSHED;
-#if 0
-            if (abs(ob->momentumx)>0)
-            {
-                if (abs(ob->momentumx+pstate->dmomx)>=abs(ob->momentumx))
-                {
-                    ob->momentumx += pstate->dmomx;
-                    ob->momentumy += pstate->dmomy;
-                }
-            }
-            else if (abs(ob->momentumy+pstate->dmomy)>=abs(ob->momentumy))
-            {
-                ob->momentumx += pstate->dmomx;
-                ob->momentumy += pstate->dmomy;
-            }
-#endif
             if (abs(ob->momentumx+pstate->dmomx)>=abs(ob->momentumx))
             {
                 ob->momentumx += pstate->dmomx;
--- a/rott/rt_scale.c
+++ b/rott/rt_scale.c
@@ -577,14 +577,6 @@
         frac=0;
     x2 = x2 >= viewwidth ? viewwidth-1 : x2;
 
-#if 0
-    for (; x1<=x2 ; x1++, frac += dc_iscale)
-    {
-        if (posts[x1].wallheight>sprite->viewheight)
-            continue;
-        ScaleTransparentPost(((p->collumnofs[frac>>SFRACBITS])+shape),(byte *)bufferofs+(x1>>2),sprite->h2);
-    }
-#endif
     startx=x1;
     startfrac=frac;
 
@@ -1012,71 +1004,6 @@
         }
     }
 }
-
-#if 0
-byte *shape;
-int      frac;
-patch_t *p;
-int      x1,x2;
-int      tx;
-int      xdc_invscale;
-int      xdc_iscale;
-byte *   buf;
-byte *   b;
-int      plane;
-int      startx,startfrac;
-
-whereami=39;
-SetPlayerLightLevel();
-buf=(byte *)bufferofs;
-shape=W_CacheLumpNum(lump,PU_CACHE);
-p=(patch_t *)shape;
-dc_invscale=(viewheight<<16)/200;
-xdc_invscale=(viewwidth<<16)/320;
-
-tx=-p->leftoffset;
-centeryclipped=viewheight>>1;
-//
-// calculate edges of the shape
-//
-x1 = (tx*xdc_invscale)>>SFRACBITS;
-if (x1 >= viewwidth)
-    return;               // off the right side
-tx+=p->width;
-x2 = ((tx*xdc_invscale)>>SFRACBITS) - 1 ;
-if (x2 < 0)
-    return;         // off the left side
-
-dc_iscale=(200*65536)/viewheight;
-xdc_iscale=(320*65536)/viewwidth;
-dc_texturemid=(((p->height>>1)+p->topoffset)<<SFRACBITS)+(SFRACUNIT>>1);
-sprtopoffset=(centeryclipped<<16) - FixedMul(dc_texturemid,dc_invscale);
-
-//
-// store information in a vissprite
-//
-if (x1<0)
-{
-    frac=xdc_iscale*(-x1);
-    x1=0;
-}
-else
-    frac=0;
-x2 = x2 >= viewwidth ? viewwidth-1 : x2;
-
-startx=x1;
-startfrac=frac;
-for (plane=startx; plane<startx+4; plane++,startfrac+=xdc_iscale)
-{
-    frac=startfrac;
-    b=(byte *)bufferofs+(plane>>2);
-    for (x1=plane; x1<=x2 ; x1+=4, frac += xdc_iscale<<2,b++)
-        ScaleClippedPost(((p->collumnofs[frac>>SFRACBITS])+shape),b);
-}
-}
-#endif
-
-
 
 //******************************************************************************
 //
--- a/rott/rt_sound.c
+++ b/rott/rt_sound.c
@@ -68,10 +68,6 @@
     -1, -1, -1, -1, -1, -1, SoundScape, -1, -1, -1, -1
 };
 
-#if 0
-void MU_SetupGUSInitFile( void );
-#endif
-
 int MUSIC_GetPosition( void ) {
     songposition pos;
 
@@ -123,27 +119,6 @@
     else
         W_CacheLumpNum(SoundNumber(sndnum),PU_CACHE, CvtNull, 1);
 }
-
-#if 0
-//***************************************************************************
-//
-// SD_PrintActive
-//
-//***************************************************************************
-void SD_PrintActive ( void )
-{
-    int i;
-
-    myprintf("Active Sounds\n");
-    for (i=0; i<MAXSOUNDS; i++)
-    {
-        if (sounds[i].count>0)
-        {
-            myprintf("sound active #%ld\n",i);
-        }
-    }
-}
-#endif
 
 //***************************************************************************
 //
--- a/rott/rt_stat.c
+++ b/rott/rt_stat.c
@@ -1858,15 +1858,9 @@
     statobj_t *temp,*tempnext;
 
 
-#if (0)
-    Debug("\n");
-#endif
     for(temp = firstactivestat; temp;)
     {   tempnext = temp->nextactive;
 
-#if (0)
-        Debug("\nid: %d, shapenum: %d, numanims: %d",i++,temp->shapenum,temp->numanims);
-#endif
 
         if ((temp->shapenum != NOTHING) && (temp->flags & FL_ACTIVE))
         {   index = temp->itemnumber;
--- a/rott/rt_ted.c
+++ b/rott/rt_ted.c
@@ -1947,13 +1947,6 @@
             if (tile <= 32)
             {
                 index = tile;
-#if 0
-                if (tile==12)
-                {
-                    if (MAPSPOT(i,j,2)==0)
-                        MAPSPOT(i,j,2)=21;
-                }
-#endif
             }
             else
                 index = tile-3;
@@ -2749,18 +2742,6 @@
                         Error ("Illegal Maskedwall platform value at x=%d y=%d\n",i,j);
                         break;
                     }
-#if 0
-                    if (IsPlatform(i+1,j))
-                    {
-                        if ( (IsPlatform(i,j+1)) || (IsPlatform(i,j-1)) )
-                            SpawnStatic(i,j,83,MAPSPOT(i,j,2));
-                    }
-                    else if (IsPlatform(i-1,j))
-                    {
-                        if ( (IsPlatform(i,j+1)) || (IsPlatform(i,j-1)) )
-                            SpawnStatic(i,j,83,MAPSPOT(i,j,2));
-                    }
-#endif
                 }
                 else
                     Error("You have what appears to be a platform ontop\n a wall at x=%d y=%d\n",i,j);
@@ -3615,15 +3596,6 @@
                 SpawnSpring(i,j);
                 break;
 
-#if 0
-            case 460:
-//               if ( gamestate.Product != ROTT_SHAREWARE )
-            {
-                SpawnNewObj(i,j,&s_wind,inertobj);
-            }
-            break;
-#endif
-
             case 462:
             case 463:
             case 464:
@@ -4855,20 +4827,6 @@
                 *map = 29;
                 break;
 
-#if 0
-            case 37:
-            case 38:
-            case 39:
-                *map = 36;
-                break;
-
-            case 41:
-            case 42:
-            case 43:
-                *map = 40;
-                break;
-#endif
-
             case 50:
             case 51:
             case 52:
@@ -4875,20 +4833,6 @@
                 *map = 49;
                 break;
 
-#if 0
-            case 55:
-            case 56:
-            case 57:
-                *map = 54;
-                break;
-
-            case 59:
-            case 60:
-            case 61:
-                *map = 58;
-                break;
-#endif
-
             case 66:
             case 67:
             case 68:
@@ -4961,18 +4905,6 @@
             case 233:
                 *map = 44;
                 break;
-
-#if 0
-            //Skys
-            case 234:
-            case 235:
-            case 236:
-            case 237:
-            case 238:
-            case 239:
-                *map=(*(&(mapplanes[0][MAPSIZE*(0)+(0)]))) + 18;
-                break;
-#endif
             }
         }
     }
@@ -4988,26 +4920,6 @@
 */
 void DoLowMemoryConversionIconPlane (void)
 {
-#if 0
-    int i,j;
-    word * map;
-
-
-    for (j=0; j<mapheight; j++)
-    {
-        for(i=0; i<mapwidth; i++)
-        {
-            map=&(mapplanes[2][MAPSIZE*(j)+(i)]);
-            switch (*map)
-            {
-            case 13:
-                *(&(mapplanes[0][MAPSIZE*(j)+(i)]))=21;
-                *map=0;
-                break;
-            }
-        }
-    }
-#endif
 }
 
 
@@ -5332,28 +5244,6 @@
 {
 //   int i,j;
 //   word * map;
-
-
-#if 0
-    for (j=0; j<mapheight; j++)
-    {
-        for(i=0; i<mapwidth; i++)
-        {
-            map=&MAPSPOT(i,j,1);
-            switch (*map)
-            {
-            //sprites
-            case 42:
-            case 43:
-            case 63:
-            case 64:
-                *map = 43;
-                break;
-
-            }
-        }
-    }
-#endif
 }
 
 /*
@@ -5446,24 +5336,6 @@
 {
     int crud;
     int i;
-
-#if 0
-    mapwidth = mapheight = 128;
-
-    InsaneDump();
-    /*
-    for(i=0;i<11;i++)
-      {GetEpisode(i);
-       LoadROTTMap(i);
-       MapDebug("\n//================================//");
-       MapDebug("\n//   SHAREWARE LEVEL %d            //",i);
-       MapDebug("\n//================================//\n\n");
-
-       PrintTileStats();
-      }
-    */
-    Error("okay");
-#endif
 
     insetupgame=true;
 
--- a/rott/rt_vid.c
+++ b/rott/rt_vid.c
@@ -804,56 +804,6 @@
     VL_FadeIn(0,255,newpal,steps>>1);
 }
 
-
-#if 0
-
-/*
-=================
-=
-= VL_TestPaletteSet
-=
-= Sets the palette with outsb, then reads it in and compares
-= If it compares ok, fastpalette is set to true.
-=
-=================
-*/
-
-void VL_TestPaletteSet (void)
-{
-    int   i;
-
-    for (i=0; i<768; i++)
-        palette1[0][i] = i;
-
-    fastpalette = true;
-    VL_SetPalette (&palette1[0][0]);
-    VL_GetPalette (&palette2[0][0]);
-    if (_fmemcmp (&palette1[0][0],&palette2[0][0],768))
-        fastpalette = false;
-}
-
-
-/*
-==================
-=
-= VL_ColorBorder
-=
-==================
-*/
-
-void VL_ColorBorder (int color)
-{
-    _AH=0x10;
-    _AL=1;
-    _BH=color;
-    geninterrupt (0x10);
-    bordercolor = color;
-}
-
-
-#endif
-
-
 //==========================================================================
 
 //****************************************************************************
--- a/rott/rt_view.c
+++ b/rott/rt_view.c
@@ -683,16 +683,6 @@
         maxshade-=1;
     else if (maxshade<targetmax)
         maxshade+=1;
-
-#if 0
-    targetlevel=baseminshade+(GENERALNUMLIGHTS-numlights);
-    if (abs(minshade-targetlevel)==1)
-        minshade=targetlevel;
-    else if (minshade>targetlevel)
-        minshade-=2;
-    else if (minshade<targetlevel)
-        minshade+=2;
-#endif
 }
 
 /*
--- a/rott/sbconfig.c
+++ b/rott/sbconfig.c
@@ -449,23 +449,6 @@
         return  accum;
     else
         return -accum;
-
-#if 0	/* Old technique */
-    if((absValue>=warp->pWarp[i].low) && (absValue<=warp->pWarp[i].high))
-        if(warp->pWarp[i].shift>=0)
-            value=accum+((absValue-warp->pWarp[i].low)<<warp->pWarp[i].shift);
-        else
-            value=accum+((absValue-warp->pWarp[i].low)>>abs(warp->pWarp[i].shift));
-    else if(warp->pWarp[i].shift>=0)
-        accum+=(warp->pWarp[i].high-warp->pWarp[i].low)<<warp->pWarp[i].shift;
-    else
-        accum+=(warp->pWarp[i].high-warp->pWarp[i].low)>>abs(warp->pWarp[i].shift);
-
-    if(absValue>warp->pWarp[warp->nWarp-1].high)
-        value=accum;
-
-    return sign*value;
-#endif
 }