shithub: rott

Download patch

ref: a6f2e1afa77b093c3ce075cbcd3a82d4ba4a8ee5
parent: 6d2b9139785a94de353b6a9e47ac461118e0d3cd
parent: 7b5054b8046276adab754004a2d0238879854eb5
author: LTCHIPS <ltchips994@gmail.com>
date: Sat May 19 16:18:01 EDT 2018

Merge branch 'master' into screeneffect

--- a/rott/HashTable.c
+++ b/rott/HashTable.c
@@ -2,8 +2,8 @@
 #include <stdio.h>
 #include <string.h>
 #include "HashTable.h"
-//#include "LinkedList.h"
 
+
 #if !defined(ARRAY_SIZE)
     #define ARRAY_SIZE(x) (sizeof((x)) / sizeof((x)[0]))
 #endif
@@ -33,10 +33,6 @@
 
     }
     
-    //hashTable->table = malloc(sizeof(LinkedList) * initSize);
-    
-    //memset(hashTable->table,emptyNode, sizeof(listNode) * initSize);
-    //memcpy(hashTable->table, emptyNode, sizeof(listNode)*initSize);
 }
 
 int HashFunc(HashTable * hashTable, int key)
@@ -61,7 +57,7 @@
     
     //DeleteWithKey(list, key);
     //free(&hashTable->table[index]);
-    hashTable->table[index]->isAvaliable = 0;
+    hashTable->table[index]->isAvaliable = 1;
     
 }
 
@@ -108,14 +104,7 @@
     
     int origIndex = index;
     
-    
-    //If it starts off at a NULL spot, it never existed...
-    if (hashTable->table[index] == 0)
-    {
-        return 0;
-    }
-    
-    while(hashTable->table[index]->key != key)
+    while(hashTable->table[index]->key != key && hashTable->table[index]->isAvaliable == 0)
     {
       //go to next cell
         ++index;
--- a/rott/cin_efct.c
+++ b/rott/cin_efct.c
@@ -29,10 +29,6 @@
 #include "z_zone.h"
 #include <string.h>
 
-#ifdef DOS
-#include <conio.h>
-#endif
-
 #include "modexlib.h"
 #include "fli_glob.h"
 //MED
@@ -308,10 +304,6 @@
 
     DrawBlankScreen ( );
 
-#ifdef DOS
-    VL_SetVGAPlaneMode ();
-#endif
-
     CinematicSetPalette (curpal);
 
     SafeFree (curpal);
@@ -364,9 +356,6 @@
 
     plane = 0;
 
-#ifdef DOS
-    for (plane=0; plane<4; plane++)
-#endif
     {
         buf=(byte *)bufferofs+ylookup[back->yoffset];
         offset=(back->currentoffset>>FRACTIONBITS)+plane;
@@ -373,11 +362,7 @@
 
         VGAWRITEMAP(plane);
 
-#ifdef DOS
-        for (i=plane; i<iGLOBAL_SCREENWIDTH; i+=4,offset+=4,buf++)
-#else
         for (i=0; i<iGLOBAL_SCREENWIDTH; i++,offset++,buf++)
-#endif
         {
             if (offset>=back->backdropwidth)
                 src=&(pic->data) + ( (offset - back->backdropwidth) * (pic->height) );
@@ -416,9 +401,6 @@
 
     plane = 0;
 
-#ifdef DOS
-    for (plane=0; plane<4; plane++)
-#endif
     {
         buf=(byte *)bufferofs+ylookup[back->yoffset];
         offset=(back->currentoffset>>FRACTIONBITS)+plane;
@@ -425,11 +407,7 @@
 
         VGAWRITEMAP(plane);
 
-#ifdef DOS
-        for (i=plane; i<iGLOBAL_SCREENWIDTH; i+=4,offset+=4,buf++)
-#else
         for (i=0; i<iGLOBAL_SCREENWIDTH; i++,offset++,buf++)
-#endif
         {
             if (offset>=back->backdropwidth)
                 src=back->data + ( (offset - back->backdropwidth) * (back->height) );
@@ -470,9 +448,6 @@
 
     plane = 0;
 
-#ifdef DOS
-    for (plane=0; plane<4; plane++)
-#endif
     {
         buf=(byte *)bufferofs;
         offset=(back->currentoffset>>FRACTIONBITS)+plane;
@@ -479,11 +454,7 @@
 
         VGAWRITEMAP(plane);
 
-#ifdef DOS
-        for (i=plane; i<iGLOBAL_SCREENWIDTH; i+=4,offset+=4,buf++)
-#else
         for (i=0; i<iGLOBAL_SCREENWIDTH; i++,offset++,buf++)
-#endif
         {
             if (offset>=back->backdropwidth)
                 src = shape + p->collumnofs[offset - back->backdropwidth];
@@ -578,11 +549,7 @@
     for (; x1<=x2 ; x1++, frac += cin_iscale)
     {
         VGAWRITEMAP(x1&3);
-#ifdef DOS
-        ScaleFilmPost(((p->collumnofs[frac>>FRACTIONBITS])+shape),buf+(x1>>2));
-#else
         ScaleFilmPost(((p->collumnofs[frac>>FRACTIONBITS])+shape),buf+x1);
-#endif
     }
 }
 
@@ -687,12 +654,7 @@
 */
 void DrawClearBuffer ( void )
 {
-#ifdef DOS
-    VGAMAPMASK(15);
-    memset((byte *)bufferofs,0,iGLOBAL_SCREENBWIDE*iGLOBAL_SCREENHEIGHT);
-#else
     memset((byte *)bufferofs,0,iGLOBAL_SCREENWIDTH*iGLOBAL_SCREENHEIGHT);
-#endif
 }
 
 /*
@@ -893,18 +855,11 @@
 
     plane = 0;
 
-#ifdef DOS
-    for (plane=0; plane<4; plane++)
-#endif
     {
         buf=(byte *)bufferofs;
         VGAWRITEMAP(plane);
 
-#ifdef DOS
-        for (i=plane; i<width; i+=4,buf++)
-#else
         for (i=0; i<width; i++,buf++)
-#endif
         {
             DrawFilmPost(buf,&src[0],200);
         }
@@ -935,9 +890,6 @@
 
     plane = 0;
 
-#ifdef DOS
-    for (plane=0; plane<4; plane++)
-#endif
     {
         buf=(byte *)bufferofs;
 
@@ -945,11 +897,7 @@
 
         VGAWRITEMAP(plane);
 
-#ifdef DOS
-        for (i=plane; i<width; i+=4,src+=(pic->height<<2),buf++)
-#else
         for (i=0; i<width; i++,src+=pic->height,buf++)
-#endif
         {
             DrawFilmPost(buf,src,height);
         }
--- a/rott/cin_main.c
+++ b/rott/cin_main.c
@@ -18,13 +18,6 @@
 
 */
 
-#ifdef DOS
-#include <malloc.h>
-#include <dos.h>
-#include <io.h>
-#include <conio.h>
-#endif
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <fcntl.h>
--- a/rott/cin_util.c
+++ b/rott/cin_util.c
@@ -20,10 +20,6 @@
 #include "cin_glob.h"
 #include "modexlib.h"
 
-#ifdef DOS
-#include <conio.h>
-#endif
-
 //MED
 #include "memcheck.h"
 
@@ -39,14 +35,7 @@
 
 void CinematicGetPalette (byte *pal)
 {
-#ifdef DOS
-    int	i;
-
-    outp (PEL_READ_ADR,0);
-    for (i=0 ; i<768 ; i++)
-        pal[i] = ((inp (PEL_DATA))<<2);
-#else
-#endif
+    STUB_FUNCTION;
 }
 
 /*
@@ -61,12 +50,5 @@
 
 void CinematicSetPalette (byte *pal)
 {
-#ifdef DOS
-    int	i;
-
-    outp (PEL_WRITE_ADR,0);
-    for (i=0 ; i<768 ; i++)
-        outp (PEL_DATA, pal[i]>>2);
-#else
-#endif
+    STUB_FUNCTION;
 }
--- a/rott/isr.c
+++ b/rott/isr.c
@@ -29,13 +29,6 @@
 */
 #include <stdlib.h>
 #include <stdio.h>
-
-#ifdef DOS
-#include <dos.h>
-#include <mem.h>
-#include <conio.h>
-#endif
-
 #include "rt_def.h"
 #include "task_man.h"
 #include "isr.h"
@@ -45,6 +38,7 @@
 #include "profile.h"
 #include "develop.h"
 #include "rt_main.h"
+#include "SDL2/SDL.h"
 
 #if (DEVELOPMENT == 1)
 
@@ -64,11 +58,6 @@
 volatile int Keyhead;
 volatile int Keytail;
 
-#ifdef DOS
-volatile int ticcount;
-volatile int fasttics;
-#endif
-
 volatile boolean PausePressed = false;
 volatile boolean PanicPressed = false;
 int KeyboardStarted=false;
@@ -99,658 +88,6 @@
     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                                         // 7
 };
 
-#ifdef DOS
-
-// Local Variables
-
-static task * timertask;
-#if (DEVELOPMENT == 1)
-static task * fasttimertask;
-#endif
-static int TimerStarted=false;
-static volatile int pausecount=0;
-static struct dostime_t starttime;
-
-void (__interrupt __far *oldtimerisr) ();
-void (__interrupt __far *oldkeyboardisr) () = NULL;
-
-static int LEDs;
-static volatile int KBFlags;
-
-/*
-================
-=
-= I_TimerISR
-=
-================
-*/
-
-void __interrupt I_TimerISR (void)
-{
-// acknowledge the interrupt
-
-    OUTP(0x20,0x20);
-    ticcount++;
-}
-
-/*
-================
-=
-= ISR_Timer
-=
-================
-*/
-#if 0
-#if (DEVELOPMENT == 1)
-static int time=0;
-static int t1=0;
-static int t2=0;
-static int t3=0;
-static int insettime=0;
-#endif
-#endif
-/*
-================
-=
-= ISR_SetTime
-=
-================
-*/
-void ISR_SetTime(int settime)
-{
-#if 0
-#if (DEVELOPMENT == 1)
-    int i;
-    int t;
-    int savetime;
-#endif
-#endif
-
-    ticcount=settime;
-#if 0
-#if (DEVELOPMENT == 1)
-    {
-        insettime=1;
-        savetime=time;
-        t1=0;
-        t2=0;
-        t3=0;
-        t=0;
-
-        for (i=0; i<settime; i++)
-        {
-            t++;
-            if (t==VBLCOUNTER)
-            {
-                t=0;
-                t1++;
-                if (t1==2)
-                {
-                    t1=0;
-                    t2++;
-                    if (t2==2)
-                    {
-                        t2=0;
-                        t3++;
-                        if (t3==2)
-                            t3=0;
-                    }
-                }
-            }
-        }
-        time=t+(time-savetime);
-        if (time>=VBLCOUNTER)
-        {
-            time-=VBLCOUNTER;
-            t1++;
-            if (t1==2)
-            {
-                t1=0;
-                t2++;
-                if (t2==2)
-                {
-                    t2=0;
-                    t3++;
-                    if (t3==2)
-                        t3=0;
-                }
-            }
-        }
-        insettime=0;
-    }
-#endif
-#endif
-}
-
-static void ISR_Timer (task *Task)
-{
-//	(*(int *)(Task->data))=((*(int *)(Task->data))+1)&0xffff;
-    (*(int *)(Task->data))++;
-
-#if 0
-#if (DEVELOPMENT == 1)
-    {
-        if (Task==timertask)
-        {
-            time++;
-            if ((time==VBLCOUNTER) && (insettime==0))
-            {
-                time=0;
-                VL_SetColor(0,(t1<<5)+20,(t2<<5)+20,(t3<<5)+20);
-                t1++;
-                if (t1==2)
-                {
-                    t1=0;
-                    t2++;
-                    if (t2==2)
-                    {
-                        t2=0;
-                        t3++;
-                        if (t3==2)
-                            t3=0;
-                    }
-                }
-            }
-        }
-    }
-#endif
-#endif
-}
-
-
-/*
-=====================
-=
-= I_SetTimer0
-=
-= Sets system timer 0 to the specified speed
-=
-=====================
-*/
-
-void I_SetTimer0(int speed)
-{
-    unsigned s;
-    if (!((speed > 0 && speed < 150)))
-        Error ("INT_SetTimer0: %i is a bad value",speed);
-    s=1192030U/(unsigned)speed;
-    OUTP(0x43,0x36);                            // Change timer 0
-    OUTP(0x40,s);
-    OUTP(0x40,s >> 8);
-}
-
-/*
-================
-=
-= I_Delay
-=
-================
-*/
-
-void I_Delay ( int delay )
-{
-    int time;
-
-    delay=(VBLCOUNTER*delay)/10;
-    IN_ClearKeysDown();
-    time=ticcount;
-    while (ticcount<time+delay)
-    {
-        if (LastScan)
-            break;
-    }
-}
-
-/*
-===============
-=
-= I_StartupTimer
-=
-===============
-*/
-
-void I_StartupTimer (void)
-{
-#if PROFILE
-    return;
-#else
-    struct dostime_t cmostime;
-
-    if (TimerStarted==true)
-        return;
-    TimerStarted=true;
-
-    I_GetCMOSTime ( &cmostime );
-    _dos_settime  ( &cmostime );
-
-//      I_SetTimer0(VBLCOUNTER);
-//      oldtimerisr = _dos_getvect(TIMERINT);
-//      _dos_setvect (TIMERINT, I_TimerISR);
-
-    timertask=TS_ScheduleTask( &ISR_Timer, VBLCOUNTER, 10, &ticcount);
-#if (DEVELOPMENT == 1)
-    fasttimertask=TS_ScheduleTask( &ISR_Timer, VBLCOUNTER*4, 10, &fasttics);
-#endif
-    TS_Dispatch();
-    I_GetCMOSTime ( &cmostime );
-    memcpy(&starttime,&cmostime,sizeof(starttime));
-    ticcount=0;
-    if (!quiet)
-        printf("I_StartupTimer: Timer Started\n");
-#endif
-}
-
-void I_ShutdownTimer (void)
-{
-#if PROFILE
-    return;
-#else
-    struct dostime_t dostime;
-    struct dostime_t cmostime;
-#if (DEVELOPMENT == 1)
-    int totaltime;
-#endif
-
-    if (TimerStarted==false)
-        return;
-    TimerStarted=false;
-
-//      OUTP(0x43,0x36);                            // Change timer 0
-//      OUTP(0x40,0);
-//      OUTP(0x40,0);
-//      _dos_setvect (TIMERINT, oldtimerisr);
-
-    I_GetCMOSTime ( &cmostime );
-    _dos_gettime  ( &dostime  );
-
-#if (DEVELOPMENT == 1)
-    SoftError("Time difference in seconds (DOS-CMOS) %ld\n",dostime.second-cmostime.second);
-    SoftError("Time difference in minutes (DOS-CMOS) %ld\n",dostime.minute-cmostime.minute);
-    SoftError("Time difference in hour (DOS-CMOS) %ld\n",dostime.hour-cmostime.hour);
-    totaltime=( ((cmostime.hour-starttime.hour)*3600) +
-                ((cmostime.minute-starttime.minute)*60) +
-                (cmostime.second-starttime.second)
-              );
-    SoftError("Total seconds = %ld Total Tics = %ld Game Tics = %ld\n",totaltime,totaltime*VBLCOUNTER,ticcount);
-#endif
-
-    TS_Terminate( timertask );
-#if (DEVELOPMENT == 1)
-    TS_Terminate( fasttimertask );
-#endif
-    TS_Shutdown();
-//   TS_Halt();
-    /*
-       if (oldtimerisr)
-          {
-          OUTP(0x43,0x36);                            // Change timer 0
-          OUTP(0x40,0);
-          OUTP(0x40,0);
-          _dos_setvect (TIMERINT, oldtimerisr);
-          // Set Date and Time from CMOS
-
-          OUTP(0x70,0);
-          time.second=inp(0x71);
-          OUTP(0x70,2);
-          time.minute=inp(0x71);
-          OUTP(0x70,4);
-          time.hour=inp(0x71);
-          time.second=(time.second&0x0f)+((time.second>>4)*10);
-          time.minute=(time.minute&0x0f)+((time.minute>>4)*10);
-          time.hour=(time.hour&0x0f)+((time.hour>>4)*10);
-          _dos_settime(&time);
-
-          OUTP(0x70,7);
-          date.day=inp(0x71);
-          OUTP(0x70,8);
-          date.month=inp(0x71);
-          OUTP(0x70,9);
-          date.year=inp(0x71);
-          date.day=(date.day&0x0f)+((date.day>>4)*10);
-          date.month=(date.month&0x0f)+((date.month>>4)*10);
-          date.year=(date.year&0x0f)+((date.year>>4)*10);
-          _dos_setdate(&date);
-    //      }
-    */
-#endif
-}
-
-/*
-===============
-=
-= I_GetCMOSTime
-=
-===============
-*/
-void I_GetCMOSTime ( struct dostime_t * cmostime )
-{
-    OUTP(0x70,0);
-    cmostime->second=inp(0x71);
-    OUTP(0x70,2);
-    cmostime->minute=inp(0x71);
-    OUTP(0x70,4);
-    cmostime->hour=inp(0x71);
-    cmostime->second=(cmostime->second&0x0f)+((cmostime->second>>4)*10);
-    cmostime->minute=(cmostime->minute&0x0f)+((cmostime->minute>>4)*10);
-    cmostime->hour=(cmostime->hour&0x0f)+((cmostime->hour>>4)*10);
-}
-
-/*
-============================================================================
-
-																KEYBOARD
-
-============================================================================
-*/
-#define ena_kbd           0xae
-#define caps_state        0x40
-#define num_state         0x20
-#define scroll_state      0x10
-
-#define kb_resend         0xfe
-#define kb_ack            0xfa
-#define kb_pr_led         0x40
-#define kb_error          0x80
-#define kb_fe             0x20
-#define kb_fa             0x10
-
-#define porta             0x60
-#define kb_status_port    0x64
-#define input_buffer_full 0x02
-#define led_cmd           0xed
-#define kb_enable         0xf4
-#define leds_off          0
-#define caps_led_on       0x04
-#define num_led_on        0x02
-#define scroll_led_on     0x01
-
-/*
-================
-=
-= I_SendKeyboardData
-=
-================
-*/
-
-void I_SendKeyboardData
-(
-    int val
-)
-
-{
-    int retry;
-    volatile int count;
-
-    _disable();
-
-    KBFlags &= ~( kb_fe | kb_fa );
-
-    count = 0xffff;
-    while( count-- )
-    {
-        if ( !( inp( kb_status_port ) & input_buffer_full ) )
-        {
-            break;
-        }
-    }
-
-    outp( porta, val );
-
-    _enable();
-
-    retry = 3;
-    while( retry-- )
-    {
-        count = 0x1a00;
-        while( count-- )
-        {
-            if ( KBFlags & kb_fe )
-            {
-                break;
-            }
-
-            if ( KBFlags & kb_fa )
-            {
-                return;
-            }
-        }
-    }
-
-    KBFlags |= kb_error;
-}
-
-/*
-================
-=
-= I_SetKeyboardLEDs
-=
-================
-*/
-
-void I_SetKeyboardLEDs
-(
-    int which,
-    boolean val
-)
-
-{
-    int mask;
-    int count;
-
-    _disable();
-    KBFlags |= kb_pr_led;
-
-    switch( which )
-    {
-    case scroll_lock :
-        mask = scroll_led_on;
-        break;
-
-    case num_lock :
-        mask = num_led_on;
-        break;
-
-    case caps_lock :
-        mask = caps_led_on;
-        break;
-
-    default :
-        mask = 0;
-        break;
-    }
-
-    if ( val )
-    {
-        LEDs |= mask;
-    }
-    else
-    {
-        LEDs &= ~mask;
-    }
-
-    count = 0;
-    do
-    {
-        if ( count > 3 )
-        {
-            break;
-        }
-
-        I_SendKeyboardData( led_cmd );
-        _disable();
-        I_SendKeyboardData( LEDs );
-        _disable();
-        I_SendKeyboardData( kb_enable );
-        _disable();
-        count++;
-    }
-    while( KBFlags & kb_error );
-
-    _enable();
-    KBFlags &= ~(kb_pr_led|kb_error);
-}
-
-
-/*
-================
-=
-= I_KeyboardISR
-=
-================
-*/
-void __interrupt I_KeyboardISR (void)
-{
-    int k;
-    int temp;
-    int keyon;
-    int strippedkey;
-
-    // Get the scan code
-    k = inp( 0x60 );
-
-    // Tell the XT keyboard controller to clear the key
-    temp = inp( 0x61 );
-    OUTP ( 0x61, temp | 0x80 );
-    OUTP ( 0x61, temp );
-
-    if ( KBFlags & kb_pr_led )
-    {
-        if ( k == kb_resend )
-        {
-            // Handle resend
-            KBFlags |= kb_fe;
-        }
-        else if (k == kb_ack)
-        {
-            // Handle ack
-            KBFlags |= kb_fa;
-        }
-    }
-    else if ( pausecount )
-    {
-        pausecount--;
-    }
-    else if ( k == 0xe1 )         // Handle Pause key
-    {
-        PausePressed = true;
-        pausecount = 5;
-    }
-    else if ( k == 0x46 )         // Handle Panic key (Scroll Lock)
-    {
-        PanicPressed = true;
-    }
-    else
-    {
-        if ( k == 0xE0 )
-        {
-            ExtendedKeyFlag = true;
-        }
-        else
-        {
-            keyon = k & 0x80;
-            strippedkey = k & 0x7f;
-
-            if ( ExtendedKeyFlag )
-            {
-                if ( ( strippedkey == sc_LShift ) ||
-                        ( strippedkey == sc_RShift ) )
-                {
-                    k = sc_None;
-                }
-                /*
-                            else
-                               {
-                               if ( strippedkey == sc_Alt )
-                                  {
-                                  k = sc_RightAlt | keyon;
-                                  }
-                               if ( strippedkey == sc_Control )
-                                  {
-                                  k = sc_RightCtrl | keyon;
-                                  }
-                               }
-                */
-            }
-
-            if ( k != sc_None )
-            {
-                if ( strippedkey == sc_LShift )
-                {
-                    k = sc_RShift | keyon;
-                }
-
-                if ( !keyon )
-                {
-                    LastScan = k;
-                }
-
-                if (k & 0x80)        // Up event
-                {
-                    Keystate[k&0x7f]=0;
-                }
-                else                 // Down event
-                {
-                    Keystate[k]=1;
-                }
-
-                KeyboardQueue[ Keytail ] = k;
-                Keytail = ( Keytail + 1 )&( KEYQMAX - 1 );
-            }
-
-            ExtendedKeyFlag = false;
-        }
-    }
-
-    // acknowledge the interrupt
-    OUTP ( 0x20, 0x20 );
-}
-
-
-/*
-===============
-=
-= I_StartupKeyboard
-=
-===============
-*/
-
-void I_StartupKeyboard (void)
-{
-    if (KeyboardStarted==true)
-        return;
-    KeyboardStarted=true;
-
-    LEDs = 0;
-    KBFlags = 0;
-    ExtendedKeyFlag = false;
-
-    oldkeyboardisr = _dos_getvect(KEYBOARDINT);
-    _dos_setvect (0x8000 | KEYBOARDINT, I_KeyboardISR);
-
-//   I_SetKeyboardLEDs( scroll_lock, 0 );
-
-    Keyhead = Keytail = 0;
-    memset(Keystate,0,sizeof(Keystate));
-    if (!quiet)
-        printf("I_StartupKeyboard: Keyboard Started\n");
-}
-
-void I_ShutdownKeyboard (void)
-{
-    if (KeyboardStarted==false)
-        return;
-    KeyboardStarted=false;
-
-    // Clear LEDS
-//   *( (byte *)0x417 ) &= ~0x70;
-
-    _dos_setvect (KEYBOARDINT, oldkeyboardisr);
-    *(short *)0x41c = *(short *)0x41a;      // clear bios key buffer
-}
-#else
-
-#include "SDL2/SDL.h"
-
 static int ticoffset;    /* offset for SDL_GetTicks() */
 static int ticbase;      /* game-supplied base */
 
@@ -839,4 +176,3 @@
 void I_ShutdownKeyboard (void)
 {
 }
-#endif
--- a/rott/modexlib.c
+++ b/rott/modexlib.c
@@ -24,14 +24,6 @@
 #include <string.h>
 #include <stdio.h>
 #include <ctype.h>
-
-#ifdef DOS
-#include <malloc.h>
-#include <dos.h>
-#include <conio.h>
-#include <io.h>
-#endif
-
 #include <stdlib.h>
 #include <sys/stat.h>
 #include <SDL2/SDL_video.h>
@@ -90,341 +82,6 @@
 
 void DrawCenterAim ();
 
-#ifdef DOS
-
-/*
-====================
-=
-= GraphicsMode
-=
-====================
-*/
-void GraphicsMode ( void )
-{
-    union REGS regs;
-
-    regs.w.ax = 0x13;
-    int386(0x10,&regs,&regs);
-    graphicsmode=true;
-}
-
-/*
-====================
-=
-= SetTextMode
-=
-====================
-*/
-void SetTextMode ( void )
-{
-
-    union REGS regs;
-
-    regs.w.ax = 0x03;
-    int386(0x10,&regs,&regs);
-    graphicsmode=false;
-
-}
-
-/*
-====================
-=
-= TurnOffTextCursor
-=
-====================
-*/
-void TurnOffTextCursor ( void )
-{
-
-    union REGS regs;
-
-    regs.w.ax = 0x0100;
-    regs.w.cx = 0x2000;
-    int386(0x10,&regs,&regs);
-
-}
-
-#if 0
-/*
-====================
-=
-= TurnOnTextCursor
-=
-====================
-*/
-void TurnOnTextCursor ( void )
-{
-
-    union REGS regs;
-
-    regs.w.ax = 0x03;
-    int386(0x10,&regs,&regs);
-
-}
-#endif
-
-/*
-====================
-=
-= WaitVBL
-=
-====================
-*/
-void WaitVBL( void )
-{
-    unsigned char i;
-
-    i=inp(0x03da);
-    while ((i&8)==0)
-        i=inp(0x03da);
-    while ((i&8)==1)
-        i=inp(0x03da);
-}
-
-
-/*
-====================
-=
-= VL_SetLineWidth
-=
-= Line witdh is in WORDS, 40 words is normal width for vgaplanegr
-=
-====================
-*/
-
-void VL_SetLineWidth (unsigned width)
-{
-    int i,offset;
-
-//
-// set wide virtual screen
-//
-    outpw (CRTC_INDEX,CRTC_OFFSET+width*256);
-
-//
-// set up lookup tables
-//
-    linewidth = width*2;
-
-    offset = 0;
-
-    for (i=0; i<iGLOBAL_SCREENHEIGHT; i++)
-    {
-        ylookup[i]=offset;
-        offset += linewidth;
-    }
-}
-
-/*
-=======================
-=
-= VL_SetVGAPlaneMode
-=
-=======================
-*/
-
-void VL_SetVGAPlaneMode ( void )
-{
-    GraphicsMode();
-    VL_DePlaneVGA ();
-    VL_SetLineWidth (48);
-    screensize=208*iGLOBAL_SCREENBWIDE*2;//bna++ *2
-    page1start=0xa0200;
-    page2start=0xa0200+screensize;
-    page3start=0xa0200+(2u*screensize);
-    displayofs = page1start;
-    bufferofs = page2start;
-    XFlipPage ();
-}
-
-/*
-=======================
-=
-= VL_CopyPlanarPage
-=
-=======================
-*/
-void VL_CopyPlanarPage ( byte * src, byte * dest )
-{
-    int plane;
-
-    for (plane=0; plane<4; plane++)
-    {
-        VGAREADMAP(plane);
-        VGAWRITEMAP(plane);
-        memcpy(dest,src,screensize);
-    }
-}
-
-/*
-=======================
-=
-= VL_CopyPlanarPageToMemory
-=
-=======================
-*/
-void VL_CopyPlanarPageToMemory ( byte * src, byte * dest )
-{
-    byte * ptr;
-    int plane,a,b;
-
-    for (plane=0; plane<4; plane++)
-    {
-        ptr=dest+plane;
-        VGAREADMAP(plane);
-        for (a=0; a<200; a++)
-            for (b=0; b<80; b++,ptr+=4)
-                *(ptr)=*(src+(a*linewidth)+b);
-    }
-}
-
-/*
-=======================
-=
-= VL_CopyBufferToAll
-=
-=======================
-*/
-void VL_CopyBufferToAll ( byte *buffer )
-{
-    int plane;
-
-    for (plane=0; plane<4; plane++)
-    {
-        VGAREADMAP(plane);
-        VGAWRITEMAP(plane);
-        if (page1start!=buffer)
-            memcpy((byte *)page1start,(byte *)buffer,screensize);
-        if (page2start!=buffer)
-            memcpy((byte *)page2start,(byte *)buffer,screensize);
-        if (page3start!=buffer)
-            memcpy((byte *)page3start,(byte *)buffer,screensize);
-    }
-}
-
-/*
-=======================
-=
-= VL_CopyDisplayToHidden
-=
-=======================
-*/
-void VL_CopyDisplayToHidden ( void )
-{
-    VL_CopyBufferToAll ( displayofs );
-}
-
-/*
-=================
-=
-= VL_ClearBuffer
-=
-= Fill the entire video buffer with a given color
-=
-=================
-*/
-
-void VL_ClearBuffer (unsigned buf, byte color)
-{
-    VGAMAPMASK(15);
-    memset((byte *)buf,color,screensize);
-}
-
-/*
-=================
-=
-= VL_ClearVideo
-=
-= Fill the entire video buffer with a given color
-=
-=================
-*/
-
-void VL_ClearVideo (byte color)
-{
-    VGAMAPMASK(15);
-    memset((byte *)(0xa000<<4),color,0x10000);
-}
-
-/*
-=================
-=
-= VL_DePlaneVGA
-=
-=================
-*/
-
-void VL_DePlaneVGA (void)
-{
-
-//
-// change CPU addressing to non linear mode
-//
-
-//
-// turn off chain 4 and odd/even
-//
-    outp (SC_INDEX,SC_MEMMODE);
-    outp (SC_DATA,(inp(SC_DATA)&~8)|4);
-
-    outp (SC_INDEX,SC_MAPMASK);         // leave this set throughout
-
-//
-// turn off odd/even and set write mode 0
-//
-    outp (GC_INDEX,GC_MODE);
-    outp (GC_DATA,inp(GC_DATA)&~0x13);
-
-//
-// turn off chain
-//
-    outp (GC_INDEX,GC_MISCELLANEOUS);
-    outp (GC_DATA,inp(GC_DATA)&~2);
-
-//
-// clear the entire buffer space, because int 10h only did 16 k / plane
-//
-    VL_ClearVideo (0);
-
-//
-// change CRTC scanning from doubleword to byte mode, allowing >64k scans
-//
-    outp (CRTC_INDEX,CRTC_UNDERLINE);
-    outp (CRTC_DATA,inp(CRTC_DATA)&~0x40);
-
-    outp (CRTC_INDEX,CRTC_MODE);
-    outp (CRTC_DATA,inp(CRTC_DATA)|0x40);
-}
-
-
-/*
-=================
-=
-= XFlipPage
-=
-=================
-*/
-
-void XFlipPage ( void )
-{
-    displayofs=bufferofs;
-
-//   _disable();
-
-    outp(CRTC_INDEX,CRTC_STARTHIGH);
-    outp(CRTC_DATA,((displayofs&0x0000ffff)>>8));
-
-//   _enable();
-
-    bufferofs += screensize;
-    if (bufferofs > page3start)
-        bufferofs = page1start;
-}
-
-#else
-
-
-
 #ifndef STUB_FUNCTION
 
 /* rt_def.h isn't included, so I just put this here... */
@@ -587,18 +244,7 @@
 */
 void VL_CopyPlanarPage ( byte * src, byte * dest )
 {
-#ifdef DOS
-    int plane;
-
-    for (plane=0; plane<4; plane++)
-    {
-        VGAREADMAP(plane);
-        VGAWRITEMAP(plane);
-        memcpy(dest,src,screensize);
-    }
-#else
     memcpy(dest,src,screensize);
-#endif
 }
 
 /*
@@ -610,21 +256,7 @@
 */
 void VL_CopyPlanarPageToMemory ( byte * src, byte * dest )
 {
-#ifdef DOS
-    byte * ptr;
-    int plane,a,b;
-
-    for (plane=0; plane<4; plane++)
-    {
-        ptr=dest+plane;
-        VGAREADMAP(plane);
-        for (a=0; a<200; a++)
-            for (b=0; b<80; b++,ptr+=4)
-                *(ptr)=*(src+(a*linewidth)+b);
-    }
-#else
     memcpy(dest,src,screensize);
-#endif
 }
 
 /*
@@ -636,21 +268,7 @@
 */
 void VL_CopyBufferToAll ( byte *buffer )
 {
-#ifdef DOS
-    int plane;
-
-    for (plane=0; plane<4; plane++)
-    {
-        VGAREADMAP(plane);
-        VGAWRITEMAP(plane);
-        if (page1start!=buffer)
-            memcpy((byte *)page1start,(byte *)buffer,screensize);
-        if (page2start!=buffer)
-            memcpy((byte *)page2start,(byte *)buffer,screensize);
-        if (page3start!=buffer)
-            memcpy((byte *)page3start,(byte *)buffer,screensize);
-    }
-#endif
+    STUB_FUNCTION;
 }
 
 /*
@@ -677,12 +295,7 @@
 
 void VL_ClearBuffer (byte *buf, byte color)
 {
-#ifdef DOS
-    VGAMAPMASK(15);
     memset((byte *)buf,color,screensize);
-#else
-    memset((byte *)buf,color,screensize);
-#endif
 }
 
 /*
@@ -697,12 +310,7 @@
 
 void VL_ClearVideo (byte color)
 {
-#ifdef DOS
-    VGAMAPMASK(15);
-    memset((byte *)(0xa000<<4),color,0x10000);
-#else
     memset (sdl_surface->pixels, color, iGLOBAL_SCREENWIDTH*iGLOBAL_SCREENHEIGHT);
-#endif
 }
 
 /*
@@ -853,22 +461,6 @@
 
 void XFlipPage ( void )
 {
-#ifdef DOS
-    displayofs=bufferofs;
-
-//   _disable();
-
-    outp(CRTC_INDEX,CRTC_STARTHIGH);
-    outp(CRTC_DATA,((displayofs&0x0000ffff)>>8));
-
-//   _enable();
-
-    bufferofs += screensize;
-    if (bufferofs > page3start)
-        bufferofs = page1start;
-#else
-    
-    
     if (StretchScreen) { //bna++
         StretchMemPicture ();
     } else {
@@ -876,11 +468,7 @@
     }
     RenderSurface();
     
-
-#endif
 }
-
-#endif
 
 void EnableScreenStretch(void)
 {
--- a/rott/rt_build.c
+++ b/rott/rt_build.c
@@ -24,12 +24,6 @@
 #include "watcom.h"
 #include <stdio.h>
 #include <stdlib.h>
-
-#ifdef DOS
-#include <dos.h>
-#include <conio.h>
-#endif
-
 #include "rt_build.h"
 #include "_rt_buil.h"
 #include "rt_dr_a.h"
@@ -242,20 +236,11 @@
     int i;
 
     shadingtable=colormap+(16<<8);
-
-#ifdef DOS
-    for (plane=0; plane<4; plane++)
-#endif
-
     {
         VGAWRITEMAP(plane);
         buf=(byte *)(bufferofs);
 
-#ifdef DOS
-        for (i=plane; i<viewwidth; i+=4,buf++)
-#else
         for (i=0; i<viewwidth; i++,buf++)
-#endif
         {
             height=(posts[i].wallheight);
             if (height<=4)
--- a/rott/rt_cfg.c
+++ b/rott/rt_cfg.c
@@ -25,17 +25,9 @@
 
 #define _ROTT_
 
-#ifdef DOS
-#include <io.h>
-#include <bios.h>
-#include <conio.h>
-#include <process.h>
-#else
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <errno.h>
-#endif
-
 #include <stdlib.h>
 #include <fcntl.h>
 #include <string.h>
@@ -101,13 +93,6 @@
 int     MUvolume         = 196;
 int     FXvolume         = 196;
 
-#ifdef DOS
-fx_blaster_config SBSettings =
-{
-    0x220, fx_SB, 7, 1, 5, 0x330, 0x620
-};
-#endif
-
 boolean mouseenabled     = 1;
 boolean usemouselook     = 0;
 int     inverse_mouse    = 1; //set  to -1 to invert mouse
@@ -137,9 +122,6 @@
 int     NumVoices        = 4;
 int     NumChannels      = 1;
 int     NumBits          = 8;
-#ifdef DOS
-int     MidiAddress      = 0x330;
-#endif
 boolean cybermanenabled  = false;
 boolean assassinenabled  = false;
 boolean spaceballenabled = false;
@@ -166,11 +148,7 @@
 #endif
 MacroList CommbatMacros[MAXMACROS];
 
-#ifdef DOS
-char *ApogeePath = "APOGEECD";
-#else
 char ApogeePath[256];
-#endif
 
 //******************************************************************************
 //
@@ -315,26 +293,10 @@
 
         ReadInt ("NumBits",&NumBits);
 
-#ifdef DOS
-        // Read in Midi Address
-
-        ReadInt ("MidiAddress",&MidiAddress);
-#endif
-
         // Read in stereo reversal
 
         ReadBoolean ("StereoReverse",&stereoreversed);
 
-#ifdef DOS
-        // Read in Sound Blaster info
-        ReadUnsigned ("SBType",  &SBSettings.Type );
-        ReadUnsigned ("SBPort",  &SBSettings.Address );
-        ReadUnsigned ("SBIrq",   &SBSettings.Interrupt );
-        ReadUnsigned ("SBDma8",  &SBSettings.Dma8 );
-        ReadUnsigned ("SBDma16", &SBSettings.Dma16 );
-        ReadUnsigned ("SBMidi",  &SBSettings.Midi );
-        ReadUnsigned ("SBEmu",   &SBSettings.Emu );
-#endif
     }
     else
         retval = false;
@@ -355,9 +317,6 @@
 )
 
 {
-#ifdef DOS
-    fx_blaster_config blaster;
-#endif
     int status;
 
     //
@@ -1035,13 +994,6 @@
 
         Z_Free (scriptbuffer);
     }
-#ifdef DOS
-    else if ( !SOUNDSETUP )
-    {
-        Error( "Could not find SOUND.ROT.  Please run SNDSETUP to configure "
-               "your sound hardware." );
-    }
-#endif
 
 
 #ifdef _ROTT_
@@ -1600,20 +1552,7 @@
     SafeWriteString(file,"\n;\n");
     SafeWriteString(file,"; Music Modes\n");
     SafeWriteString(file,"; 0  -  Off\n");
-#ifdef DOS
-    SafeWriteString(file,"; 1  -  UltraSound\n");
-    SafeWriteString(file,"; 2  -  Sound Blaster\n");
-    SafeWriteString(file,"; 3  -  Sound Man 16\n");
-    SafeWriteString(file,"; 4  -  Pro Audio Spectrum\n");
-    SafeWriteString(file,"; 5  -  Awe32\n");
-    SafeWriteString(file,"; 6  -  SoundScape\n");
-    SafeWriteString(file,"; 7  -  Wave Blaster\n");
-    SafeWriteString(file,"; 8  -  General Midi\n");
-    SafeWriteString(file,"; 9  -  Sound Canvas\n");
-    SafeWriteString(file,"; 10 -  Adlib\n");
-#else
     SafeWriteString(file,"; 6  -  On\n");
-#endif
     WriteParameter(file,"MusicMode        ",MusicMode);
 
     // Write out FX Mode
@@ -1621,20 +1560,7 @@
     SafeWriteString(file,"\n;\n");
     SafeWriteString(file,"; FX Modes\n");
     SafeWriteString(file,"; 0  -  Off\n");
-#ifdef DOS
-    SafeWriteString(file,"; 1  -  UltraSound\n");
-    SafeWriteString(file,"; 2  -  Sound Blaster\n");
-    SafeWriteString(file,"; 3  -  Sound Man 16\n");
-    SafeWriteString(file,"; 4  -  Pro Audio Spectrum\n");
-    SafeWriteString(file,"; 5  -  Awe32\n");
-    SafeWriteString(file,"; 6  -  SoundScape\n");
-    SafeWriteString(file,"; 7  -  Adlib\n");
-    SafeWriteString(file,"; 8  -  Disney Sound Source\n");
-    SafeWriteString(file,"; 9  -  Tandy Sound Source\n");
-    SafeWriteString(file,"; 10 -  PC Speaker\n");
-#else
     SafeWriteString(file,"; 6  -  On\n");
-#endif
     WriteParameter(file,"FXMode           ",FXMode);
 
     // Write in Music Volume
@@ -1673,24 +1599,7 @@
     SafeWriteString(file,"; 8 bit\n");
     SafeWriteString(file,"; 16 bit\n");
     WriteParameter(file,"NumBits          ",NumBits);
-
-#ifdef DOS
-    // Write out Midi Address
-
-    SafeWriteString(file,"\n;\n");
-    SafeWriteString(file,"; Midi Addresses\n");
-    SafeWriteString(file,"; $300\n");
-    SafeWriteString(file,"; $310\n");
-    SafeWriteString(file,"; $320\n");
-    SafeWriteString(file,"; $330\n");
-    SafeWriteString(file,"; $340\n");
-    SafeWriteString(file,"; $350\n");
-    SafeWriteString(file,"; $360\n");
-    SafeWriteString(file,"; $370\n");
-    SafeWriteString(file,"; $380\n");
-    WriteParameterHex(file,"MidiAddress      ",MidiAddress);
-#endif
-
+    
     // Write out stereo reversal
 
     SafeWriteString(file,"\n;\n");
@@ -1698,21 +1607,6 @@
     SafeWriteString(file,"; 0 no reversal\n");
     SafeWriteString(file,"; 1 reverse stereo\n");
     WriteParameter (file,"StereoReverse      ",stereoreversed);
-
-#ifdef DOS
-    // Write out Sound Blaster info
-
-    SafeWriteString(file,"\n;\n");
-    SafeWriteString(file,"; Sound Blaster Settings\n");
-    WriteParameter(file, "SBType           ", SBSettings.Type );
-    WriteParameterHex(file, "SBPort           ", SBSettings.Address );
-    WriteParameter(file, "SBIrq            ", SBSettings.Interrupt );
-    WriteParameter(file, "SBDma8           ", SBSettings.Dma8 );
-    WriteParameter(file, "SBDma16          ", SBSettings.Dma16 );
-    WriteParameterHex(file, "SBMidi           ", SBSettings.Midi );
-    WriteParameterHex(file, "SBEmu            ", SBSettings.Emu );
-#endif
-
     close (file);
 }
 
--- a/rott/rt_com.c
+++ b/rott/rt_com.c
@@ -23,14 +23,6 @@
 #include <string.h>
 #include <ctype.h>
 #include <stdarg.h>
-
-#ifdef DOS
-#include <conio.h>
-#include <dos.h>
-#include <process.h>
-#include <bios.h>
-#endif
-
 #include "rt_def.h"
 #include "_rt_com.h"
 #include "rt_com.h"
@@ -58,9 +50,6 @@
 int controlsynctime;
 
 // LOCAL VARIABLES
-#ifdef DOS
-static union  REGS   comregs;
-#endif
 
 static int    ComStarted=false;
 static int    transittimes[MAXPLAYERS];
@@ -100,13 +89,7 @@
         return;
     ComStarted=true;
 
-#ifdef DOS
-    netarg=CheckParm ("net");
-    netarg++;
-
-    netaddress=atol(_argv[netarg]);
-    rottcom=(rottcom_t *)netaddress;
-#elif defined(PLATFORM_UNIX)
+#if defined(PLATFORM_UNIX)
     /*
     server-specific options:
     -net: enables netplay
@@ -200,9 +183,6 @@
 
     if (!quiet)
     {
-#ifdef DOS
-        printf("ROTTNET: Communicating on vector %ld\n",(long int)rottcom->intnum);
-#endif
         printf("ROTTNET: consoleplayer=%ld\n",(long int)rottcom->consoleplayer);
     }
 }
@@ -227,9 +207,8 @@
 
     // Check to see if a packet is ready
 
-#ifdef DOS
-    int386(rottcom->intnum,&comregs,&comregs);
-#elif PLATFORM_UNIX
+
+#ifdef PLATFORM_UNIX
     ReadUDPPacket();
 #endif
 
@@ -323,9 +302,7 @@
 
 //   SoftError( "WritePacket: time=%ld size=%ld src=%ld type=%d\n",GetTicCount(),rottcom->datalength,rottcom->remotenode,rottcom->data[0]);
     // Send It !
-#ifdef DOS
-    int386(rottcom->intnum,&comregs,&comregs);
-#elif PLATFORM_UNIX
+#ifdef PLATFORM_UNIX
     WriteUDPPacket();
 #endif
 
--- a/rott/rt_dmand.c
+++ b/rott/rt_dmand.c
@@ -18,10 +18,6 @@
 
 */
 
-#ifdef DOS
-#include <mem.h>
-#endif
-
 #include "rt_def.h"
 #include "rt_util.h"
 #include "rt_sound.h"
--- a/rott/rt_draw.c
+++ b/rott/rt_draw.c
@@ -22,12 +22,6 @@
 #include "profile.h"
 #include "rt_def.h"
 #include <string.h>
-
-#ifdef DOS
-#include <dos.h>
-#include <conio.h>
-#endif
-
 #include "watcom.h"
 #include "sprites.h"
 #include "rt_actor.h"
@@ -1945,23 +1939,14 @@
 
     if (doublestep>1)
     {
-#ifdef DOS
-        for (plane=0; plane<4; plane+=2)
-#endif
         {
             VGAMAPMASK((1<<plane)+(1<<(plane+1)));
             buf=(byte *)(bufferofs);
-#ifdef DOS
-            for (post=&posts[plane]; post<&posts[viewwidth]; post+=4,buf++)
-#else
             for (post=&posts[plane]; post<&posts[viewwidth]; post+=2,buf+=2)
-#endif
             {
                 SetWallLightLevel(post);
                 DrawWallPost(post,buf);
-#ifndef DOS
                 DrawWallPost(post,buf+1);
-#endif
                 (post+1)->ceilingclip=post->ceilingclip;
                 (post+1)->floorclip=post->floorclip;
             }
@@ -1969,17 +1954,10 @@
     }
     else
     {
-#ifdef DOS
-        for (plane=0; plane<4; plane++)
-#endif
         {
             VGAWRITEMAP(plane);
             buf=(byte *)(bufferofs);
-#ifdef DOS
-            for (post=&posts[plane]; post<&posts[viewwidth]; post+=4,buf++)
-#else
             for (post=&posts[plane]; post<&posts[viewwidth]; post++,buf++)
-#endif
             {
                 SetWallLightLevel(post);
                 DrawWallPost(post,buf);
@@ -2481,19 +2459,7 @@
     botinc=d1-d2;
     if (plane->x1>=viewwidth)
         return;
-#ifdef DOS
-    for (pl=0; pl<4; pl++)
-#endif
     {
-#ifdef DOS
-        top=topinc*pl;
-        bot=(d2*dx)+(pl*botinc);
-        height=(plane->h1<<DHEIGHTFRACTION)+(dh*pl);
-        buf=(byte *)bufferofs+((pl+plane->x1)>>2);
-        VGAWRITEMAP((plane->x1+pl)&3);
-
-        for (i=plane->x1+pl; i<=plane->x2; i+=4,buf++)
-#else
         top=0;
         bot=(d2*dx);
         height=(plane->h1<<DHEIGHTFRACTION);
@@ -2500,7 +2466,6 @@
         buf=(byte *)bufferofs+(plane->x1);
 
         for (i=plane->x1; i<=plane->x2; i++,buf++)
-#endif
         {
             if ((i>=0 && i<viewwidth) && (bot!=0) && (posts[i].wallheight<=(height>>DHEIGHTFRACTION)) )
             {
@@ -2531,15 +2496,9 @@
                 }
             }
 
-#ifdef DOS
-            top+=topinc<<2;
-            bot+=botinc<<2;
-            height+=dh<<2;
-#else
             top+=topinc;
             bot+=botinc;
             height+=dh;
-#endif
         }
     }
 }
@@ -2622,28 +2581,12 @@
     botinc=d1-d2;
     if (plane->x1>=viewwidth)
         return;
-#ifdef DOS
-    for (pl=0; pl<4; pl++)
-#endif
     {
-#ifdef DOS
-        int planenum;
-
-        top=topinc*pl;
-        bot=(d2*dx)+(pl*botinc);
-        height=(plane->h1<<DHEIGHTFRACTION)+(dh*pl);
-        buf=(byte *)bufferofs+((pl+plane->x1)>>2);
-        planenum=((plane->x1+pl)&3);
-        VGAWRITEMAP(planenum);
-        VGAREADMAP(planenum);
-        for (i=plane->x1+pl; i<=plane->x2; i+=4,buf++)
-#else
         top=0;
         bot=(d2*dx);
         height=(plane->h1<<DHEIGHTFRACTION);
         buf=(byte *)bufferofs+(plane->x1);
         for (i=plane->x1; i<=plane->x2; i++,buf++)
-#endif
         {
             if ((i>=0 && i<viewwidth) && (bot!=0) && (posts[i].wallheight<=(height>>DHEIGHTFRACTION)) )
             {
@@ -2671,15 +2614,9 @@
                         ScaleMaskedPost (p3->collumnofs[texture]+shape3,buf);
                 }
             }
-#ifdef DOS
-            top+=topinc<<2;
-            bot+=botinc<<2;
-            height+=dh<<2;
-#else
             top+=topinc;
             bot+=botinc;
             height+=dh;
-#endif
         }
     }
 }
@@ -2703,11 +2640,7 @@
     whereami=20;
     VGAMAPMASK(15);
     for (i=0; i<18; i++)
-#ifdef DOS
-        memset((byte *)bufferofs+(ylookup[i+PLY])+(PLX>>2),0,6);
-#else
         memset((byte *)bufferofs+(ylookup[i+PLY])+PLX,0,6);
-#endif
     px=PLX;
     py=PLY;
     VW_DrawPropString(strupr(itoa(player->x,&buf[0],16)));
@@ -2873,13 +2806,8 @@
 
 void FlipPage ( void )
 {
-#ifdef DOS
-    unsigned displaytemp;
-
     whereami=22;
-    displayofs = bufferofs;
 
-    displaytemp = displayofs;
     if ( ( SHAKETICS != 0xFFFF ) && ( !inmenu ) && ( !GamePaused ) &&
             ( !fizzlein ) )
     {
@@ -2886,51 +2814,10 @@
         ScreenShake ();
     }
 
-
-//   _disable();
-    OUTP(CRTC_INDEX,CRTC_STARTHIGH);
-    OUTP(CRTC_DATA,((displayofs&0x0000ffff)>>8));
-
-
-    if (SHAKETICS != 0xFFFF)
-    {
-        if (SHAKETICS > 0)
-        {
-            OUTP (CRTC_INDEX, CRTC_STARTLOW);
-            OUTP (CRTC_DATA, (displayofs&0x000000FF));
-            displayofs = displaytemp;
-        }
-        else
-        {
-            displayofs = displaytemp;
-            OUTP(CRTC_INDEX,CRTC_STARTHIGH);
-            OUTP(CRTC_DATA,((displayofs&0x0000ffff)>>8));
-            OUTP (CRTC_INDEX, CRTC_STARTLOW);
-            OUTP (CRTC_DATA, (displayofs&0x000000FF));
-            SHAKETICS = 0xFFFF;
-        }
-    }
-//   _enable();
-
-    bufferofs += screensize;
-    if (bufferofs > page3start)
-        bufferofs = page1start;
-#else
-
-    whereami=22;
-
-    if ( ( SHAKETICS != 0xFFFF ) && ( !inmenu ) && ( !GamePaused ) &&
-            ( !fizzlein ) )
-    {
-        ScreenShake ();
-    }
-
     /* TODO some shake thing */
 
     /* just call the one in modexlib.c */
     XFlipPage();
-
-#endif
 }
 
 
@@ -2976,41 +2863,19 @@
     ysize=(iGLOBAL_SCREENHEIGHT<<16)/step;
     if (ysize>iGLOBAL_SCREENHEIGHT) ysize=iGLOBAL_SCREENHEIGHT;
 
-#ifdef DOS
-    for (plane=x; plane<x+4; plane++)
-#endif
     {
         yfrac=0;
-#ifdef DOS
-        VGAWRITEMAP(plane&3);
-#endif
         for (j=y; j<y+ysize; j++)
         {
             p=src+(iGLOBAL_SCREENWIDTH*(yfrac>>16));
-#ifdef DOS
-            buf=(byte *)bufferofs+ylookup[j]+(plane>>2);
-#else
             buf=(byte *)bufferofs+ylookup[j]+x;
-#endif
-#ifdef DOS
-            xfrac=(plane-x)*step;
-#else
             xfrac=0;
-#endif
             yfrac+=step;
-#ifdef DOS
-            for (i=plane; i<x+xsize; i+=4)
-#else
             for (i=x; i<x+xsize; i++)
-#endif
             {
                 *buf=*(p+(xfrac>>16));
                 buf++;
-#ifdef DOS
-                xfrac+=(step<<2);
-#else
                 xfrac+=step;
-#endif
             }
         }
     }
@@ -3622,11 +3487,7 @@
     sprtopoffset=centeryfrac - FixedMul(dc_texturemid,dc_invscale);
     shadingtable=colormap+(1<<12);
     VGAWRITEMAP(x&3);
-#ifdef DOS
-    ScaleMaskedPost(((p->collumnofs[offset])+src), (byte *)bufferofs+(x>>2));
-#else
     ScaleMaskedPost(((p->collumnofs[offset])+src), (byte *)bufferofs+x);
-#endif
 }
 
 
@@ -4204,11 +4065,7 @@
                 yhigh=0;
             postheight=yhigh-ylow+1;
             if (postheight>0)
-#ifdef DOS
-                DrawSkyPost((byte *)bufferofs + (x>>2) + ylookup[ylow],src,postheight);
-#else
                 DrawSkyPost((byte *)bufferofs + x + ylookup[ylow],src,postheight);
-#endif
         }
         FlipPage();
         CalcTics();
@@ -4302,11 +4159,7 @@
                     src=0;
                 dc_source=shape+(src * 200);
 //            if (RandomNumber("hello",0)<128)
-#ifdef DOS
-                R_DrawColumn ((byte *)bufferofs+(x>>2));
-#else
                 R_DrawColumn ((byte *)bufferofs+x);
-#endif
             }
 //         srcoffset+=0x10000;
             x++;
@@ -4431,10 +4284,6 @@
     int size;
 
     size=linewidth*200;
-
-#ifdef DOS
-    for (plane=0; plane<4; plane++)
-#endif
     {
         VGAWRITEMAP(plane);
         memcpy((byte *)bufferofs,bkgnd,size);
@@ -4455,10 +4304,6 @@
     int size;
 
     size=linewidth*200;
-
-#ifdef DOS
-    for (plane=0; plane<4; plane++)
-#endif
     {
         VGAREADMAP(plane);
         memcpy(bkgnd,(byte *)bufferofs,size);
@@ -4738,11 +4583,7 @@
         VGAWRITEMAP(x&3);
         for (y=0; y<200; y++)
         {
-#ifdef DOS
-            *((byte *)bufferofs+ylookup[y]+(x>>2))=*tmp++;
-#else
             *((byte *)bufferofs+ylookup[y]+x)=*tmp++;
-#endif
         }
     }
     tmp=sky;
@@ -4751,11 +4592,7 @@
         VGAWRITEMAP(x&3);
         for (y=0; y<200; y++)
         {
-#ifdef DOS
-            *((byte *)bufferofs+ylookup[y]+(x>>2))=*tmp++;
-#else
             *((byte *)bufferofs+ylookup[y]+x)=*tmp++;
-#endif
         }
     }
 
@@ -4818,11 +4655,7 @@
         VGAWRITEMAP(x&3);
         for (y=0; y<200; y++)
         {
-#ifdef DOS
-            *((byte *)bufferofs+ylookup[y]+(x>>2))=*tmp++;
-#else
             *((byte *)bufferofs+ylookup[y]+x)=*tmp++;
-#endif
         }
     }
     tmp=sky;
@@ -4831,11 +4664,7 @@
         VGAWRITEMAP(x&3);
         for (y=0; y<200; y++)
         {
-#ifdef DOS
-            *((byte *)bufferofs+ylookup[y]+(x>>2))=*tmp++;
-#else
             *((byte *)bufferofs+ylookup[y]+x)=*tmp++;
-#endif
         }
     }
 
@@ -6190,8 +6019,6 @@
     VL_FadeOut (0, 255, 0, 0, 0, 20);
 }
 
-#ifndef DOS
-
 void  DrawMenuPost (int height, byte * src, byte * buf)
 {
     int frac = hp_startfrac;
@@ -6460,8 +6287,6 @@
     }
 }
 
-#endif
-
 #if 0
 
 
@@ -6714,9 +6539,6 @@
     ParticleType * part;
 
     VL_ClearBuffer (bufferofs, 0);
-#ifdef DOS
-    for (plane=0; plane<4; plane++)
-#endif
     {
         VGAWRITEMAP(plane);
         for (i=0; i<numparticles; i++)
@@ -6730,11 +6552,7 @@
             if (dx>=viewwidth) dx=viewwidth-1;
             if (dy<0) dy=0;
             if (dy>=viewheight) dy=viewheight-1;
-#ifdef DOS
-            *( (byte *) bufferofs + (dx>>2) + ylookup[dy] ) = part->color;
-#else
             *( (byte *) bufferofs + dx + ylookup[dy] ) = part->color;
-#endif
         }
     }
 }
@@ -6766,18 +6584,11 @@
     int count;
 
     count=0;
-#ifdef DOS
-    for (plane=0; plane<4; plane++)
-#endif
     {
         VGAREADMAP(plane);
         for (a=0; a<200; a++)
         {
-#ifdef DOS
-            for (b=0; b<80; b++)
-#else
             for (b=0; b<320; b++)
-#endif
             {
                 if (*((byte *)bufferofs+(a*linewidth)+b)!=255)
                     count++;
@@ -6794,28 +6605,16 @@
     ParticleType * part;
 
     part=&Particle[0];
-
-#ifdef DOS
-    for (plane=0; plane<4; plane++)
-#endif
     {
         VGAREADMAP(plane);
         for (a=0; a<200; a++)
         {
-#ifdef DOS
-            for (b=0; b<80; b++)
-#else
             for (b=0; b<320; b++)
-#endif
             {
                 pixel = *((byte *)bufferofs+(a*linewidth)+b);
                 if (pixel!=255)
                 {
-#ifdef DOS
-                    part->endx=plane+(b<<2);
-#else
                     part->endx=b;
-#endif
                     part->endy=a;
                     part->color=pixel;
                     part++;
--- a/rott/rt_floor.c
+++ b/rott/rt_floor.c
@@ -19,10 +19,6 @@
 */
 // RT_FLOOR.C
 
-#ifdef DOS
-#include <conio.h>
-#endif
-
 #include "rt_def.h"
 #include "watcom.h"
 #include "rt_floor.h"
@@ -116,61 +112,15 @@
         ofs=-(1799-(centerskypost+viewheight*200/iGLOBAL_SCREENHEIGHT));
     }
 //ofs=centerskypost;
-#ifdef DOS
-    if (doublestep>0)
     {
-#ifdef DOS
-        for (plane=0; plane<4; plane+=2)
-#endif
         {
-#ifdef DOS
-            VGAMAPMASK((1<<plane)+(1<<(plane+1)));
-            for (dest=plane; dest<viewwidth; dest+=4)
-#else
-            for (dest=0; dest<viewwidth; dest+=2)
-#endif
-            {
-                height=posts[dest].ceilingclip;
-                height2=posts[dest+1].ceilingclip;
-                if (height<height2)
-                    height=height2;
-                if (height<=0)
-                    continue;
-                ang=(angle+pixelangle[dest])&(FINEANGLES-1);
-                src=skysegs[ang]-ofs;
-#ifdef DOS
-                DrawSkyPost((byte *)bufferofs + (dest>>2),src,height);
-#else
-                /* TODO: this isn't right since it's not really optimized */
-                DrawSkyPost((byte *)bufferofs + dest,src,height);
-                DrawSkyPost((byte *)bufferofs + dest + 1,src,height);
-#endif
-            }
-        }
-    }
-    else
-#endif
-    {
-#ifdef DOS
-        for (plane=0; plane<4; plane++)
-#endif
-        {
-#ifdef DOS
-            VGAWRITEMAP(plane);
-            for (dest=plane; dest<viewwidth; dest+=4)
-#else
             for (dest=0; dest<viewwidth; dest++)
-#endif
             {
                 if ((height=posts[dest].ceilingclip)<=0)
                     continue;
                 ang=(angle+pixelangle[dest])&(FINEANGLES-1);
                 src=skysegs[ang]-ofs;
-#ifdef DOS
-                DrawSkyPost((byte *)bufferofs + (dest>>2),src,height);
-#else
                 DrawSkyPost((byte *)bufferofs + dest,src,height);
-#endif
             }
         }
     }
@@ -212,24 +162,12 @@
 
     bufferofs+=screenofs;
 
-#ifdef DOS
-    for (plane=0; plane<4; plane++)
-#endif
     {
-#ifdef DOS
-        VGAWRITEMAP(plane);
-        for (dest=plane; dest<viewwidth; dest+=4)
-#else
         for (dest=0; dest<viewwidth; dest++)
-#endif
         {
             ang=(angle+pixelangle[dest])&(FINEANGLES-1);
             src=skysegs[ang]-ofs;
-#ifdef DOS
-            DrawSkyPost((byte *)bufferofs + (dest>>2),src,viewheight);
-#else
             DrawSkyPost((byte *)bufferofs + dest,src,viewheight);
-#endif
         }
     }
 
@@ -588,86 +526,19 @@
     dest=(byte *)bufferofs+ylookup[yp];
 
     /* TODO: horizontal isn't as easy as vertical in packed */
-#ifdef DOS
-    if (doublestep>0)
-    {
-        if (xleft&1)
-            xleft--;
 
-#ifdef DOS
-        for (plane=xleft; plane<xleft+4; plane+=2)
-#endif
-        {
-
-#ifdef DOS
-            mr_dest=dest+(plane>>2);
-#else
-            mr_dest=dest+xleft;
-#endif
-
-            mr_xfrac = startxfrac;
-            mr_yfrac = startyfrac;
-
-#ifdef DOS
-            startxfrac+=mr_xstep>>1;
-            startyfrac+=mr_ystep>>1;
-
-            mr_count=((xright-plane)>>2)+1;
-#else
-            mr_count = xright - xleft;
-#endif
-
-            if (mr_count)
-            {
-#ifdef DOS
-                int p;
-                ofs=((plane&3)<<3)+(plane&3)+1;
-//          VGAMAPMASK(*((byte *)mapmasks1+ofs));
-                p=plane&3;
-                VGAMAPMASK((1<<p) + (1<<(p+1)));
-#endif
-                DrawRow(mr_count,mr_dest,buf);
-
-#if 0
-                ofs=(byte)*((byte *)mapmasks2+ofs);
-                if (ofs!=0)
-                {
-                    VGAMAPMASK(ofs);
-                    DrawRow(mr_count,mr_dest+1,buf);
-                }
-#endif
-            }
-        }
-    }
-    else
-#endif
     {
-#ifdef DOS
-        for (plane=xleft; plane<xleft+4; plane++)
-#endif
         {
-#ifdef DOS
-            mr_dest=dest+(plane>>2);
-            VGAWRITEMAP(plane&3);
-#else
             mr_dest=dest+xleft;
-#endif
 
             mr_xfrac = startxfrac;
             mr_yfrac = startyfrac;
 
-#ifdef DOS
-            startxfrac+=mr_xstep>>2;
-            startyfrac+=mr_ystep>>2;
-
-            mr_count=((xright-plane)>>2)+1;
-#else
             // back off the pixel increment (orig. is 4x)
             mr_xstep >>= 2;
             mr_ystep >>= 2;
 
             mr_count = xright-xleft+1;
-#endif
 
             if (mr_count)
                 DrawRow(mr_count,mr_dest,buf);
@@ -729,7 +600,6 @@
     }
 }
 
-#ifndef DOS
 void DrawRow(int count, byte * dest, byte * src)
 {
     unsigned frac, fracstep;
@@ -746,4 +616,3 @@
         frac += fracstep;
     }
 }
-#endif
--- a/rott/rt_game.c
+++ b/rott/rt_game.c
@@ -17,13 +17,6 @@
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 */
-
-#ifdef DOS
-#include <dos.h>
-#include <io.h>
-#include <conio.h>
-#endif
-
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
@@ -192,11 +185,7 @@
     m = (x&3);
     mask = (1 << m);
 
-#ifdef DOS
-    origdest = (byte *)(bufferofs+ylookup[y]+(x>>2));
-#else
     origdest = (byte *)(bufferofs+ylookup[y]+x);
-#endif
 
     if (VW_MarkUpdateBlock (x, y, x+width-1, y+height-1))
     {
@@ -205,11 +194,7 @@
             src = (&(BkPic->data)+((80*200)*m)+(80*y)+(x>>2));
             dest = origdest;
 
-#ifdef DOS
-            VGAMAPMASK (mask);
-#else
             dest += planes;
-#endif
 
             for (j = 0; j < height; j++)
             {
@@ -219,30 +204,11 @@
                     } else {
                         *dest = *src++;
                     }
-#ifdef DOS
-                    dest++;
-#else
                     dest += 4;
-#endif
                 }
 
-#ifndef DOS
-                // draw the remainder.  did the DOS version even bother? - SBF
-                if ((width & 3) > planes) {
-                    if (shade) {
-                        *dest = *(colormap + ((MENUSHADELEVEL>>2)<<8) + *src);
-                    } else {
-                        *dest = *src;
-                    }
-                }
-#endif
-
                 src += (80-(width/4));
-#ifdef DOS
-                dest += (linewidth-(width/4));
-#else
                 dest += (linewidth-(width&~3));
-#endif
             }
 
             m++;
@@ -254,9 +220,6 @@
                 x+=4;
                 mask = 1;
                 m = 0;
-#ifdef DOS
-                origdest++;
-#endif
             }
         }
     }
@@ -1068,16 +1031,6 @@
         tempbuf=bufferofs;
         bufferofs=page1start;
         VW_DrawPropString (str);
-#ifdef DOS
-        px=x;
-        py=y;
-        bufferofs=page2start;
-        VW_DrawPropString (str);
-        px=x;
-        py=y;
-        bufferofs=page3start;
-        VW_DrawPropString (str);
-#endif
         bufferofs=tempbuf;
     }
 }
@@ -1709,11 +1662,7 @@
 
     mask = 1 << (xpos&3);
 
-#ifdef DOS
-    olddest = ylookup[ypos] + (xpos>>2);
-#else
     olddest = ylookup[ypos] + xpos;
-#endif
 
     for (planes = 0; planes < 4; planes++)
     {
@@ -1721,9 +1670,7 @@
 
         dest = olddest;
 
-#ifndef DOS
         dest += planes;
-#endif
 
         for (y = 0; y < height; y++)
         {
@@ -1742,32 +1689,13 @@
                         *(dest+page3start) = pixel;
                     }
                 }
-
-#ifdef DOS
-                dest++;
-#else
                 dest += 4;
-#endif
             }
-
-#ifdef DOS
-            dest += (linewidth-width);
-#else
             dest += (linewidth-width*4);
-#endif
         }
 
         if (heightmod)
             src += (heightmod*width);
-
-#ifdef DOS
-        mask <<= 1;
-        if (mask == 16)
-        {
-            mask = 1;
-            olddest++;
-        }
-#endif
     }
 }
 
@@ -1806,11 +1734,7 @@
 
     mask = 1 << (xpos&3);
 
-#ifdef DOS
-    olddest = ylookup[ypos] + (xpos>>2);
-#else
     olddest = ylookup[ypos] + xpos;
-#endif
 
     for (planes = 0; planes < 4; planes++)
     {
@@ -1818,9 +1742,7 @@
 
         dest = olddest;
 
-#ifndef DOS
         dest += planes;
-#endif
 
         for (y = 0; y < height; y++)
         {
@@ -1841,32 +1763,14 @@
                         *(dest+page3start) = pixel;
                     }
                 }
-
-#ifdef DOS
-                dest++;
-#else
                 dest += 4;
-#endif
             }
 
-#ifdef DOS
-            dest += (linewidth-width);
-#else
             dest += (linewidth-width*4);
-#endif
         }
 
         if (heightmod)
             src += (heightmod*width);
-
-#ifdef DOS
-        mask <<= 1;
-        if (mask == 16)
-        {
-            mask = 1;
-            olddest++;
-        }
-#endif
     }
 }
 
@@ -1985,25 +1889,14 @@
     int k;
     int amt;
 
-#ifdef DOS
     if (up)
-        amt = 2;
-    else
-        amt = -2;
-#else
-    if (up)
         amt = 8;
     else
         amt = -8;
-#endif
 
     mask = 1;
 
-#ifdef DOS
-    olddest = ylookup[ypos] + (xpos>>2);
-#else
     olddest = ylookup[ypos] + xpos;
-#endif
 
     for (planes = 0; planes < 4; planes++)
     {
@@ -2011,9 +1904,7 @@
 
         dest = olddest;
 
-#ifndef DOS
         dest += planes;
-#endif
 
         for (y = 0; y < height; y++)
         {
@@ -2036,18 +1927,10 @@
                     }
                 }
 
-#ifdef DOS
-                dest++;
-#else
                 dest += 4;
-#endif
             }
 
-#ifdef DOS
-            dest += (linewidth-width);
-#else
             dest += (linewidth-width*4);
-#endif
         }
 
         mask <<= 1;
@@ -2208,25 +2091,14 @@
     int k;
     int amt;
 
-#ifdef DOS
     if (up)
-        amt = 2;
-    else
-        amt = -2;
-#else
-    if (up)
         amt = 8;
     else
         amt = -8;
-#endif
 
     mask = 1;
 
-#ifdef DOS
-    olddest = (byte *)(bufferofs - screenofs + ylookup[ypos] + (xpos>>2));
-#else
     olddest = (byte *)(bufferofs - screenofs + ylookup[ypos] + xpos);
-#endif
 
     for (planes = 0; planes < 4; planes++)
     {
@@ -2234,9 +2106,7 @@
 
         dest = olddest;
 
-#ifndef DOS
         dest += planes;
-#endif
 
         for (y = 0; y < height; y++)
         {
@@ -2252,18 +2122,9 @@
                     }
                 }
 
-#ifdef DOS
-                dest++;
-#else
                 dest += 4;
-#endif
             }
-
-#ifdef DOS
-            dest += (linewidth-width);
-#else
             dest += (linewidth-width*4);
-#endif
         }
 
         mask <<= 1;
@@ -2715,11 +2576,8 @@
 
     mask = 1 << (xpos&3);
 
-#ifdef DOS
-    olddest = (byte *)(bufferofs + ylookup[ypos] + (xpos>>2));
-#else
     olddest = (byte *)(bufferofs + ylookup[ypos] + xpos);
-#endif
+    
     for (planes = 0; planes < 4; planes++)
     {
         VGAMAPMASK (mask);
@@ -2726,10 +2584,6 @@
 
         dest = olddest;
 
-#ifdef DOS
-        dest += planes;
-#endif
-
         for (y = 0; y < height; y++)
         {
             for (x = 0; x < width; x++)
@@ -2739,21 +2593,12 @@
                 if (pixel != 255)
                     *(dest) = pixel;
 
-#ifdef DOS
-                dest++;
-#else
                 dest += 4;
-#endif
             }
 
-#ifdef DOS
-            dest += (linewidth-width);
-#else
             dest += (linewidth-width*4);
-#endif
         }
 
-#ifdef DOS
         mask <<= 1;
         if (mask == 16)
         {
@@ -2760,7 +2605,6 @@
             mask = 1;
             olddest++;
         }
-#endif
     }
 }
 
@@ -2858,11 +2702,8 @@
     int  plane;
     int w;
 
-#ifdef DOS
-    dest = ylookup[y]+(x>>2);
-#else
     dest = ylookup[y]+x;
-#endif
+
     mask = 1 << (x&3);
 
     dest1 = (byte *)(dest+page1start);
@@ -2880,20 +2721,13 @@
                 screen2 += linewidth,
                 screen3 += linewidth, source+=width)
         {
-#ifdef DOS
-            memcpy (screen1, source, width);
-            memcpy (screen2, source, width);
-            memcpy (screen3, source, width);
-#else
             for (x = 0; x < width; x++) {
                 screen1[x*4+plane] = source[x];
                 screen2[x*4+plane] = source[x];
                 screen3[x*4+plane] = source[x];
             }
-#endif
         }
 
-#ifdef DOS
         mask <<= 1;
 
         if (mask == 16)
@@ -2903,7 +2737,6 @@
             dest2++;
             dest3++;
         }
-#endif
     }
 }
 
--- a/rott/rt_in.c
+++ b/rott/rt_in.c
@@ -24,12 +24,6 @@
 #include <SDL2/SDL_keycode.h>
 #include <SDL2/SDL_mouse.h>
 
-#if PLATFORM_DOS
-#include <conio.h>
-#include <dos.h>
-#include <i86.h>
-#endif
-
 #if USE_SDL
 #include "SDL2/SDL.h"
 #endif
@@ -536,10 +530,6 @@
     Joy_xb = 1 << Joy_xs;      // Use shift value to get x bit mask
     Joy_ys = joy? 3 : 1;       // Do the same for y axis
     Joy_yb = 1 << Joy_ys;
-
-#ifdef DOS
-    JoyStick_Vals ();
-#else
     if (joy < sdl_total_sticks)
     {
         Joy_x = SDL_JoystickGetAxis (sdl_joysticks[joy], 0);
@@ -548,7 +538,6 @@
         Joy_x = 0;
         Joy_y = 0;
     }
-#endif
 
     *xp = Joy_x;
     *yp = Joy_y;
@@ -798,9 +787,7 @@
 void INL_ShutJoy (word joy)
 {
     JoysPresent[joy] = false;
-#ifndef DOS
     if (joy < sdl_total_sticks) SDL_JoystickClose (sdl_joysticks[joy]);
-#endif
 }
 
 
@@ -1541,7 +1528,6 @@
     int scancode;
     boolean send = false;
 
-#ifndef PLATFORM_DOS
     /* HACK HACK HACK */
     /*
       OK, we want the new keys NOW, and not when the update gets them.
@@ -1554,7 +1540,6 @@
     tail = Keytail;
     queuegotit=1;
     /* HACK HACK HACK */
-#endif
 
     while (head != tail)
     {
--- a/rott/rt_main.c
+++ b/rott/rt_main.c
@@ -24,19 +24,7 @@
 #include <stddef.h>
 #include <fcntl.h>
 #include <string.h>
-
-#ifdef DOS
-#include <malloc.h>
-#include <dos.h>
-#include <io.h>
-#include <conio.h>
-#include <graph.h>
-#include <process.h>
-#include <direct.h>
-#include <bios.h>
-#else
 #include <signal.h>
-#endif
 
 #if USE_SDL
 /* Need to redefine main to SDL_main on some platforms... */
@@ -116,9 +104,6 @@
 
 boolean newlevel = false;
 boolean infopause;
-#ifdef DOS
-boolean SOUNDSETUP=false;
-#endif
 boolean quiet = false;
 
 #if (DEVELOPMENT == 1)
@@ -157,10 +142,8 @@
 void CheckRemoteRidicule ( int scancode );
 void SetRottScreenRes (int Width, int Height);
 
-#ifndef DOS
 extern void crash_print (int);
 extern int setup_homedir (void);
-#endif
 
 //extern int G_argc;
 //extern char G_argv[30][80];
@@ -182,10 +165,9 @@
 {
     char *macwd;
     extern char *BATTMAPS;
-#ifndef DOS
+    
     _argc = argc;
     _argv = argv;
-#endif
 
 #if defined(PLATFORM_MACOSX)
     {
@@ -207,11 +189,9 @@
     }
 #endif
 
-#ifndef DOS
     signal (11, crash_print);
 
     if (setup_homedir() == -1) return 1;
-#endif
 
     // Set which release version we're on
     gamestate.Version = ROTTVERSION;
@@ -333,32 +313,6 @@
                 printf( "Sound FX disabled.\n" );
         }
 
-#ifdef DOS
-        if ( status1 || status2 || status3 )
-        {
-            printf( "\n\nROTT was unable to initialize your " );
-            if ( status1 )
-            {
-                printf( "music " );
-                MusicMode = 0;
-            }
-            if ( status2 || status3 )
-            {
-                if ( status1 )
-                {
-                    printf( "or " );
-                }
-                printf( "sound fx " );
-
-                FXMode = 0;
-            }
-
-            printf( "hardware.\n"
-                    "Now entering sound setup.\n" );
-            SOUNDSETUP = true;
-        }
-#endif
-
         Init_Tables ();
         InitializeRNG ();
         InitializeMessages();
@@ -402,14 +356,6 @@
 //   SetBorderColor(155);
     SetViewSize(8);
 
-#ifdef DOS
-    if ( SOUNDSETUP )
-    {
-        SwitchPalette( origpal, 35 );
-        CP_SoundSetup();
-    }
-#endif
-
     playstate = ex_titles;
 
 //   I_SetKeyboardLEDs( caps_lock, 0 );
@@ -478,10 +424,6 @@
     {
         SetTextMode();
         TurnOffTextCursor ();
-#ifdef DOS
-        if (CheckParm ("SOUNDSETUP") == 0)
-        {
-#endif
 #ifdef ANSIESC
             printf("\n\n\n");
 #endif
@@ -531,24 +473,6 @@
 #endif
 
             UL_ColorBox (0, 0, 80, 2, 0x1e);
-#ifdef DOS
-        }
-        else
-        {
-            printf("\n\n");
-            strcpy (title,"Rise of the Triad Sound Setup  Version ");
-            strcat (title,itoa(ROTTMAJORVERSION,&buf[0],10));
-            strcat (title,".");
-            strcat (title,itoa(ROTTMINORVERSION,&buf[0],10));
-
-            px=(80-strlen(title))>>1;
-            py=0;
-
-            UL_printf(title);
-
-            UL_ColorBox (0, 0, 80, 1, 0x1e);
-        }
-#endif
     }
     else
     {
@@ -568,9 +492,6 @@
     int i,n;
 
     infopause=false;
-#ifdef DOS
-    SOUNDSETUP = false;
-#endif
     tedlevel=false;
     NoWait=false;
     NoSound=false;
@@ -632,9 +553,6 @@
         printf ("   MONO       - Enable mono-monitor support.\n");
         printf ("   SCREENSHOTS- Clean screen capture for shots.\n");
         printf ("   PAUSE      - Pauses startup screen information.\n");
-#ifdef DOS
-        printf ("   SOUNDSETUP - Setup sound for ROTT\n");
-#endif
         printf ("   ENABLEVR   - Enable VR helmet input devices\n");
         printf ("   NOECHO     - Turn off sound reverb\n");
         printf ("   DEMOEXIT   - Exit program when demo is terminated\n");
@@ -692,9 +610,6 @@
         printf ("         Tab              - Toggle KillCount display\n");
         printf (" \n");
         printf ("SCREENSHOOT\n");
-#ifdef DOS /* makes no sense under Linux as there are no lbm viewers there */
-        printf ("         Alt+V            - Screenshoot in LBM format\n");
-#endif
         printf ("         Alt+C            - Screenshoot in PCX format\n");
         exit (0);
     }
@@ -800,9 +715,6 @@
             infopause=true;
             break;
         case 13:
-#ifdef DOS
-            SOUNDSETUP = true;
-#endif
             break;
         case 14:
             startlevel = (ParseNum(_argv[i + 1])-1);
@@ -1685,9 +1597,6 @@
 void ShutDown ( void )
 {
     if ( ( standalone == false )
-#ifdef DOS
-            || ( SOUNDSETUP )
-#endif
        )
     {
         WriteConfig ();
@@ -1703,9 +1612,6 @@
 
     ShutdownClientControls();
     I_ShutdownKeyboard();
-#ifdef DOS /* the UL_ErrorStartup() call is commented out... */
-    UL_ErrorShutdown ();
-#endif
     ShutdownGameCommands();
     MU_Shutdown();
     I_ShutdownTimer();
@@ -1781,20 +1687,12 @@
     printf("LIGHTRATE =%ld\n",GetLightRateTile());
     printf("\nCENTERY=%ld\n",centery);
 #else
-#ifdef DOS
-    if ( !SOUNDSETUP )
-    {
-#endif
 #if (SHAREWARE==0)
         txtscn = (byte *) W_CacheLumpNum (W_GetNumForName ("regend"), PU_CACHE, CvtNull, 1);
 #else
         txtscn = (byte *) W_CacheLumpNum (W_GetNumForName ("shareend"), PU_CACHE, CvtNull, 1);
 #endif
-#if DOS
-        for (k = 0; k < 23; k++)
-            printf ("\n");
-        memcpy ((byte *)0xB8000, txtscn, 4000);
-#elif defined (ANSIESC)
+#if defined (ANSIESC)
         DisplayTextSplash (txtscn, 25);
 #endif
 
@@ -1811,20 +1709,8 @@
 
         UL_printf (itoa(ROTTMINORVERSION,&buf[0],10));
 #endif
-#ifdef DOS
-    }
 #endif
-#endif
 
-#ifdef DOS
-    if ( SOUNDSETUP )
-    {
-        printf( "\nSound setup complete.\n"
-                "Type ROTT to run the game.\n" );
-    }
-    ShutDown();
-#endif
-
     ClearScanCodes();
     
     exit(0);
@@ -2362,34 +2248,7 @@
 
 void DoBossKey ( void )
 {
-#ifdef DOS
-    union REGS regs;
-    ShutdownClientControls();
-
-    SetTextMode();
-
-    // move cursor to the row 0 column 4
-    regs.w.ax = 0x0200;
-    regs.w.bx = 0;
-    regs.w.dx = 0x0004;
-    int386(0x10,&regs,&regs);
-    px=0;
-    py=0;
-    UL_printf("C:\\>\n");
-
-    LastScan = 0;
-    IN_WaitForKey ();
-    VL_SetVGAPlaneMode();
-    VL_SetPalette(origpal);
-    SetBorderColor(0);
-    TurnShakeOff();
-    SetupScreen(true);
-    ThreeDRefresh();
-
-    StartupClientControls();
-#else
     STUB_FUNCTION;
-#endif
 }
 
 
@@ -2734,13 +2593,7 @@
         {
             SaveScreen( false );
         }
-#ifdef DOS /* makes no sense under Linux as there are no lbm viewers there */
-        else if ( Keyboard[ sc_Alt] && Keyboard[ sc_V ] )
-        {
-            SaveScreen( true );
-        }
 #endif
-#endif
     }
 #ifdef USE_SDL
     /* SDL doesn't send proper release events for these */
@@ -3153,41 +3006,6 @@
 
 void GetFileName (boolean saveLBM)
 {
-#ifdef DOS
-    char num[4];
-    int cnt = 0;
-    struct find_t fblock;
-
-    if (saveLBM)
-        memcpy (savename, "ROTT0000.LBM\0", 13);
-    else
-        memcpy (savename, "ROTT0000.PCX\0", 13);
-
-    if (_dos_findfirst (savename, 0, &fblock) != 0)
-        return;
-
-    do
-    {
-        cnt++;
-        memset (&num[0], 0, 4);
-        itoa (cnt, num, 10);
-
-        if (cnt > 99)
-        {
-            savename[5] = num[0];
-            savename[6] = num[1];
-            savename[7] = num[2];
-        }
-        else if (cnt > 9)
-        {
-            savename[6] = num[0];
-            savename[7] = num[1];
-        }
-        else
-            savename[7] = num[0];
-    }
-    while (_dos_findfirst (savename, 0, &fblock) == 0);
-#else
     int i;
 
     for (i = 0; i < 9999; i++) {
@@ -3205,7 +3023,6 @@
             return;
         }
     }
-#endif
 }
 
 //****************************************************************************
--- a/rott/rt_map.c
+++ b/rott/rt_map.c
@@ -19,12 +19,6 @@
 */
 #include "rt_def.h"
 #include <string.h>
-
-#ifdef DOS
-#include <conio.h>
-#include <dos.h>
-#endif
-
 #include "sprites.h"
 #include "rt_map.h"
 #include "rt_dr_a.h"
@@ -160,38 +154,19 @@
     x*=tilesize;
     y*=tilesize;
 
-#ifdef DOS
-    buf=(byte *)bufferofs+ylookup[y]+(x>>2);
-#else
     buf=(byte *)bufferofs+ylookup[y]+x;
-#endif
 
     source=W_CacheLumpNum(tile,PU_CACHE, CvtNull, 1);
 
-#ifdef DOS
-    for (p=0; p<4; p++)
-#endif
     {
-#ifdef DOS
-        VGAWRITEMAP(p);
-        s=source+((p*hp_srcstep)>>10);
-#else
         s=source;
-#endif
+        
         b=buf;
 
-#ifdef DOS
-        for (i=p; i<tilesize; i+=4,b++)
-#else
         for (i=0; i<tilesize; i++,b++)
-#endif
         {
             DrawMapPost(tilesize,s,b);
-#ifdef DOS
-            s+=(hp_srcstep>>8);
-#else
             s+=(hp_srcstep>>10);
-#endif
         }
     }
 }
@@ -227,37 +202,16 @@
 
     x*=tilesize;
     y*=tilesize;
-
-#ifdef DOS
-    buf=(byte *)bufferofs+ylookup[y]+(x>>2);
-#else
+    
     buf=(byte *)bufferofs+ylookup[y]+x;
-#endif
-
-#ifdef DOS
-    for (p=0; p<4; p++)
-#endif
     {
-#ifdef DOS
-        VGAWRITEMAP(p);
-        s=skytile+((p*hp_srcstep)>>10);
-#else
         s=skytile;
-#endif
 
         b=buf;
-#ifdef DOS
-        for (i=p; i<tilesize; i+=4,b++)
-#else
         for (i=0; i<tilesize; i++,b++)
-#endif
         {
             DrawMapPost(tilesize,s,b);
-#ifdef DOS
-            s+=(hp_srcstep>>8);
-#else
             s+=(hp_srcstep>>10);
-#endif
         }
     }
 }
@@ -618,15 +572,8 @@
     CheckHolidays();
 
     // Clear area for map
-
-#ifdef DOS
-    VGAMAPMASK(15);
     for (ty=37; ty<37+127; ty++)
-        memset((byte *)bufferofs+ylookup[ty]+24,0,32);
-#else
-    for (ty=37; ty<37+127; ty++)
         memset((byte *)bufferofs+ylookup[ty]+96,0,128);
-#endif
 }
 
 /*
@@ -651,18 +598,9 @@
 
     for (mapx=0; mapx<mapwidth; mapx++)
     {
-#ifdef DOS
-        VGAWRITEMAP(mapx&3);
-        buf=(byte *)bufferofs+ylookup[37]+((96+mapx)>>2);
-#else
         buf=(byte *)bufferofs+ylookup[37]+((96+mapx));
-#endif
 
-#ifdef DOS
-        for (mapy=0; mapy<mapheight; mapy++,buf+=iGLOBAL_SCREENBWIDE)
-#else
         for (mapy=0; mapy<mapheight; mapy++,buf+=iGLOBAL_SCREENWIDTH)
-#endif
         {
             if ((mapx==player->tilex ) && (mapy==player->tiley))
             {
--- a/rott/rt_menu.c
+++ b/rott/rt_menu.c
@@ -32,14 +32,8 @@
 #include <string.h>
 #include <ctype.h>
 
-#if PLATFORM_DOS
-#include <conio.h>
-#include <dos.h>
-#include <io.h>
-#elif PLATFORM_UNIX
 #include <unistd.h>
 #include "SDL2/SDL.h"
-#endif
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -1508,10 +1502,6 @@
     int returnvalue = 0;
     int scancode = 0;
 
-#ifdef DOS
-    _disable ();      // must disable for SHIFT purposes
-#endif
-
     IN_UpdateKeyboard ();
 
     LS = Keyboard[sc_LShift];
@@ -1539,10 +1529,6 @@
     Keyboard[sc_LShift] = LS;
     Keyboard[sc_RShift] = RS;
 
-#ifdef DOS
-    _enable ();
-#endif
-
     return (returnvalue);
 }
 
@@ -1560,9 +1546,7 @@
     char str[45];
     int which;
     boolean found = false;
-#ifndef DOS
     char *pathsave;
-#endif
 
     //
     // SEE WHICH SAVE GAME FILES ARE AVAILABLE & READ STRING IN
@@ -3564,16 +3548,9 @@
     s=&game.picture[0];
     for (i=0; i<320; i+=2)
     {
-#ifdef DOS
-        VGAREADMAP(i&3);
-        b=(byte *)bufferofs+(i>>2);
-        for (j=0; j<100; j++,s++,b+=iGLOBAL_SCREENBWIDE<<1)
-            *s=*b;
-#else
         b=(byte *)bufferofs+i;
         for (j=0; j<100; j++,s++,b+=(iGLOBAL_SCREENWIDTH<<1))
             *s=*b;
-#endif
     }
 
     ScanForSavedGames ();
@@ -4888,11 +4865,6 @@
 void ReadAnyControl (ControlInfo *ci)
 {
 
-#if PLATFORM_DOS
-    union REGS inregs;
-    union REGS outregs;
-#endif
-
     int mouseactive = 0;
     word buttons = 0;
 //   struct Spw_IntPacket packet;
@@ -4929,71 +4901,6 @@
             ci->dir = dir_North;
             mouseactive = 1;
         }
-
-#elif PLATFORM_DOS
-        // READ MOUSE MOTION COUNTERS
-        // RETURN DIRECTION
-        // HOME MOUSE
-        // CHECK MOUSE BUTTONS
-
-        inregs.w.ax = PMOUSE;
-        int386 (MouseInt, &inregs, &outregs);
-
-        mousex = outregs.w.cx;
-        mousey = outregs.w.dx;
-
-
-        if (mousey < (CENTER-SENSITIVE))
-        {
-            ci->dir = dir_North;
-
-            inregs.w.cx = CENTER;
-            inregs.w.dx = CENTER;
-
-            inregs.w.ax = SMOUSE;
-            int386 (MouseInt, &inregs, &outregs);
-
-            mouseactive = 1;
-
-        }
-        else if (mousey > (CENTER+SENSITIVE))
-        {
-            ci->dir = dir_South;
-
-            inregs.w.cx = CENTER;
-            inregs.w.dx = CENTER;
-
-            inregs.w.ax = SMOUSE;
-            int386 (MouseInt, &inregs, &outregs);
-
-            mouseactive = 1;
-        }
-
-        if (mousex < (CENTER-SENSITIVE))
-        {
-            ci->dir = dir_West;
-
-            inregs.w.cx = CENTER;
-            inregs.w.dx = CENTER;
-
-            inregs.w.ax = SMOUSE;
-            int386 (MouseInt, &inregs, &outregs);
-
-
-            mouseactive = 1;
-        }
-        else if (mousex > (CENTER+SENSITIVE))
-        {
-            ci->dir = dir_East;
-
-            inregs.w.cx = CENTER;
-            inregs.w.dx = CENTER;
-
-            inregs.w.ax = SMOUSE;
-            int386 (MouseInt, &inregs, &outregs);
-
-            mouseactive = 1;
-        }
 #endif
 
         buttons = IN_GetMouseButtons();
@@ -5207,31 +5114,13 @@
 //
 //****************************************************************************
 
-void MusicVolume
-(
-    void
-)
-
+void MusicVolume (void)
 {
-#ifdef DOS
-    extern boolean SOUNDSETUP;
-#endif
 
     SliderMenu( &MUvolume, 254, 0, 33, 81, 225, 8, "block3", MUSIC_SetVolume,
                 "Music Volume", "Low", "High" );
 
-#ifdef DOS
-    if ( SOUNDSETUP )
-    {
-        DrawSoundSetupMainMenu();
-    }
-    else
-    {
-#endif
-        DrawControlMenu();
-#ifdef DOS
-    }
-#endif
+    DrawControlMenu();
 }
 
 
@@ -5247,9 +5136,6 @@
 )
 
 {
-#ifdef DOS
-    extern boolean SOUNDSETUP;
-#endif
     int oldvolume;
 
     oldvolume = FXvolume;
@@ -5257,18 +5143,7 @@
     SliderMenu( &FXvolume, 254, 0, 33, 81, 225, 8, "block3", FX_SetVolume,
                 "Sound Volume", "Low", "High" );
 
-#ifdef DOS
-    if ( SOUNDSETUP )
-    {
-        DrawSoundSetupMainMenu();
-    }
-    else
-    {
-#endif
-        DrawControlMenu();
-#ifdef DOS
-    }
-#endif
+    DrawControlMenu();
 }
 
 
@@ -9409,761 +9284,8 @@
     }
 }
 
-#ifdef DOS
-void SS_DrawSBTypeMenu( void );
-void SS_SBTypeMenu( void );
-void SS_DrawPortMenu( void );
-void SS_PortMenu( void );
-void SS_Draw8BitDMAMenu( void );
-void SS_8BitDMAMenu( void );
-void SS_Draw16BitDMAMenu( void );
-void SS_16BitDMAMenu( void );
-void SS_DrawIrqMenu( void );
-void SS_IrqMenu( void );
-void SS_Quit( void );
-void DrawSoundSetupMainMenu( void );
-void CP_SoundSetup( void );
-void SS_MusicMenu( void );
-void SS_DrawMusicMenu( void );
-void SS_SoundMenu( void );
-void SS_DrawSoundMenu( void );
-void SS_SetupMusicCardMenu( void );
-void DrawMusicCardMenu( void );
-void SS_SetupSoundBlaster( int sbmenu );
-void SS_SetupSoundCardMenu( void );
-void SS_VoiceMenu( int sbmenu );
-void SS_DrawVoiceMenu( void );
-void SS_ChannelMenu( void );
-void SS_DrawChannelMenu( void );
-void SS_BitMenu( void );
-void SS_DrawBitMenu( void );
-
-extern int musicnums[ 11 ];
-extern int fxnums[ 11 ];
-
-static int midinums[ 12 ]  = {
-    0x220, 0x230, 0x240, 0x250, 0x300, 0x320,
-    0x330, 0x332, 0x334, 0x336, 0x340, 0x360
-};
-static int voicenums[8] = {1, 2, 3, 4, 5, 6, 7, 8};
-static int resnums[2]   = {8, 16};
-static int smnums[2]    = {1, 2};
-
-//
-// MENU ITEMS
-//
-CP_MenuNames SoundSetupMenuNames[] =
-{
-    "SETUP SOUND FX",
-    "SETUP MUSIC",
-    "SOUND FX VOLUME",
-    "MUSIC VOLUME",
-    "QUIT"
-};
-
-CP_iteminfo SoundSetupMenuItems  = { MENU_X, 48, 5, STARTITEM, 32, SoundSetupMenuNames, mn_largefont };
-CP_itemtype SoundSetupMenu[] =
-{
-    { CP_CursorLocation, "\0",  'S', (menuptr)SS_SoundMenu },
-    { CP_Active,         "\0",  'S', (menuptr)SS_MusicMenu },
-    { CP_Active,         "\0",  'S', (menuptr)FXVolume },
-    { CP_Active,         "\0",  'M', (menuptr)MusicVolume },
-    { CP_Active,         "\0",  'Q', (menuptr)SS_Quit }
-};
-
-CP_MenuNames SoundSetupMusicNames[] =
-{
-    "None",
-    "Ultrasound",
-    "Sound Blaster",
-    "Sound Man 16",
-    "Pro Audio Spectrum",
-    "AWE 32",
-    "Soundscape",
-    "Wave Blaster",
-    "General Midi",
-    "Sound Canvas",
-    "Adlib"
-};
-
-CP_iteminfo SoundSetupMusicItems  = { 44, MENU_Y + 15, 11, STARTITEM, 16, SoundSetupMusicNames, mn_smallfont };
-CP_itemtype SoundSetupMusic[] =
-{
-    { CP_CursorLocation, "\0",  'N', (menuptr)SS_SetupMusicCardMenu },
-    { CP_Active,         "\0",  'U', (menuptr)SS_SetupMusicCardMenu },
-    { CP_Active,         "\0",  'S', (menuptr)SS_SetupMusicCardMenu },
-    { CP_Active,         "\0",  'S', (menuptr)SS_SetupMusicCardMenu },
-    { CP_Active,         "\0",  'P', (menuptr)SS_SetupMusicCardMenu },
-    { CP_Active,         "\0",  'A', (menuptr)SS_SetupMusicCardMenu },
-    { CP_Active,         "\0",  'S', (menuptr)SS_SetupMusicCardMenu },
-    { CP_Active,         "\0",  'W', (menuptr)SS_SetupMusicCardMenu },
-    { CP_Active,         "\0",  'G', (menuptr)SS_SetupMusicCardMenu },
-    { CP_Active,         "\0",  'S', (menuptr)SS_SetupMusicCardMenu },
-    { CP_Active,         "\0",  'A', (menuptr)SS_SetupMusicCardMenu }
-};
-
-
-CP_MenuNames SoundSetupSoundNames[] =
-{
-    "None",
-    "Ultrasound",
-    "Sound Blaster",
-    "Sound Man 16",
-    "Pro Audio Spectrum",
-    "AWE 32",
-    "Soundscape",
-    "Adlib",
-    "Disney Sound Source",
-    "Tandy Sound Source",
-    "PC Speaker"
-};
-
-CP_iteminfo SoundSetupSoundItems  = { MENU_X, MENU_Y + 15, 11, STARTITEM, 16, SoundSetupSoundNames, mn_smallfont };
-CP_itemtype SoundSetupSound[] =
-{
-    { CP_CursorLocation, "\0",  'N', (menuptr)SS_SetupSoundCardMenu },
-    { CP_Active,         "\0",  'U', (menuptr)SS_SetupSoundCardMenu },
-    { CP_Active,         "\0",  'S', (menuptr)SS_SetupSoundCardMenu },
-    { CP_Active,         "\0",  'S', (menuptr)SS_SetupSoundCardMenu },
-    { CP_Active,         "\0",  'P', (menuptr)SS_SetupSoundCardMenu },
-    { CP_Active,         "\0",  'A', (menuptr)SS_SetupSoundCardMenu },
-    { CP_Active,         "\0",  'S', (menuptr)SS_SetupSoundCardMenu },
-    { CP_Active,         "\0",  'A', (menuptr)SS_SetupSoundCardMenu },
-    { CP_Active,         "\0",  'S', (menuptr)SS_SetupSoundCardMenu },
-    { CP_Active,         "\0",  'T', (menuptr)SS_SetupSoundCardMenu },
-    { CP_Active,         "\0",  'P', (menuptr)SS_SetupSoundCardMenu }
-};
-
-CP_MenuNames SoundSetupMidiPortNames[] =
-{
-    "220", "230", "240", "250", "300", "320",
-    "330", "332", "334", "336", "340", "360"
-};
-
-CP_iteminfo SoundSetupMidiPortItems = { 108, MENU_Y + 10, 12, STARTITEM, 16, SoundSetupMidiPortNames, mn_smallfont };
-CP_itemtype SoundSetupMidiPort[] =
-{
-    { CP_Active,         "\0",  'a', NULL },
-    { CP_Active,         "\0",  'a', NULL },
-    { CP_Active,         "\0",  'a', NULL },
-    { CP_Active,         "\0",  'a', NULL },
-    { CP_Active,         "\0",  'a', NULL },
-    { CP_CursorLocation, "\0",  'a', NULL },
-    { CP_Active,         "\0",  'a', NULL },
-    { CP_Active,         "\0",  'a', NULL },
-    { CP_Active,         "\0",  'a', NULL },
-    { CP_Active,         "\0",  'a', NULL },
-    { CP_Active,         "\0",  'a', NULL },
-    { CP_Active,         "\0",  'a', NULL }
-};
-
-CP_MenuNames SoundSetupVoiceNames[] =
-{
-    "1 voice",
-    "2 voices",
-    "3 voices",
-    "4 voices",
-    "5 voices",
-    "6 voices",
-    "7 voices",
-    "8 voices"
-};
-
-CP_iteminfo SoundSetupVoiceItems  = { MENU_X + 36, 24, 8, STARTITEM, 32, SoundSetupVoiceNames, mn_largefont };
-CP_itemtype SoundSetupVoice[] =
-{
-    { CP_CursorLocation, "\0",  'a', NULL },
-    { CP_Active,         "\0",  'a', NULL },
-    { CP_Active,         "\0",  'a', NULL },
-    { CP_Active,         "\0",  'a', NULL },
-    { CP_Active,         "\0",  'a', NULL },
-    { CP_Active,         "\0",  'a', NULL },
-    { CP_Active,         "\0",  'a', NULL },
-    { CP_Active,         "\0",  'a', NULL }
-};
-
-CP_MenuNames SoundSetupChannelNames[] =
-{
-    "  Mono Sound FX",
-    "Stereo Sound FX"
-};
-
-CP_iteminfo SoundSetupChannelItems  = { MENU_X, MP_Y, 2, STARTITEM, 32, SoundSetupChannelNames, mn_largefont };
-CP_itemtype SoundSetupChannel[] =
-{
-    { CP_CursorLocation, "\0",  'M', NULL },
-    { CP_Active,         "\0",  'S', NULL }
-};
-
-CP_MenuNames SoundSetupResolutionNames[] =
-{
-    "8 Bit Mixing",
-    "16 Bit Mixing"
-};
-
-CP_iteminfo SoundSetupResolutionItems  = { MENU_X, MP_Y, 2, STARTITEM, 32, SoundSetupResolutionNames, mn_largefont };
-CP_itemtype SoundSetupResolution[] =
-{
-    { CP_CursorLocation, "\0",  'a', NULL },
-    { CP_Active,         "\0",  'b', NULL }
-};
-
-static int typenums[ 5 ] =
-{
-    fx_SB, fx_SB20, fx_SBPro, fx_SBPro2, fx_SB16
-};
-
-static char typetostring[ 6 ] =
-{
-    5, 0, 2, 1, 3, 4
-};
-
-#define UNDEFINED -1
-
-CP_MenuNames TypeNames[] =
-{
-    "Sound Blaster or compatible",
-    "Sound Blaster 2.0",
-    "Sound Blaster Pro (old)",
-    "Sound Blaster Pro 2.0 (new)",
-    "Sound Blaster 16 or AWE32",
-    "Undefined"
-};
-
-CP_iteminfo TypeItems  = { MENU_X - 13, MENU_Y + 36, 5, STARTITEM, 10, TypeNames, mn_smallfont };
-CP_itemtype TypeMenu[] =
-{
-    { CP_CursorLocation, "\0",  'S', NULL },
-    { CP_Active,         "\0",  'S', NULL },
-    { CP_Active,         "\0",  'S', NULL },
-    { CP_Active,         "\0",  'S', NULL },
-    { CP_Active,         "\0",  'S', NULL }
-};
-
-static int portnums[ 7 ] =
-{
-    0x210, 0x220, 0x230, 0x240, 0x250, 0x260, 0x280
-};
-
-CP_MenuNames PortNames[] =
-{
-    "210", "220", "230", "240", "250", "260", "280"
-};
-
-CP_iteminfo PortItems = { 92, 32, 7, STARTITEM, 32, PortNames, mn_largefont };
-CP_itemtype PortMenu [] =
-{
-    { CP_CursorLocation, "\0",  '2', NULL },
-    { CP_Active,         "\0",  '2', NULL },
-    { CP_Active,         "\0",  '2', NULL },
-    { CP_Active,         "\0",  '2', NULL },
-    { CP_Active,         "\0",  '2', NULL },
-    { CP_Active,         "\0",  '2', NULL },
-    { CP_Active,         "\0",  '2', NULL }
-};
-
-static int _8BitDMAnums[ 3 ] =
-{
-    0, 1, 3
-};
-
-CP_MenuNames _8BitDMANames[] =
-{
-    "DMA channel 0",
-    "DMA channel 1",
-    "DMA channel 3"
-};
-
-CP_iteminfo _8BitDMAItems = { 32, 60, 3, STARTITEM, 32, _8BitDMANames, mn_largefont };
-CP_itemtype _8BitDMAMenu [] =
-{
-    { CP_CursorLocation, "\0",  '0', NULL },
-    { CP_Active,         "\0",  '1', NULL },
-    { CP_Active,         "\0",  '3', NULL }
-};
-
-static int _16BitDMAnums[ 3 ] =
-{
-    5, 6, 7
-};
-
-CP_MenuNames _16BitDMANames[] =
-{
-    "DMA channel 5",
-    "DMA channel 6",
-    "DMA channel 7"
-};
-
-CP_iteminfo _16BitDMAItems = { 32, 60, 3, STARTITEM, 32, _16BitDMANames, mn_largefont };
-CP_itemtype _16BitDMAMenu [] =
-{
-    { CP_CursorLocation, "\0",  '5', NULL },
-    { CP_Active,         "\0",  '6', NULL },
-    { CP_Active,         "\0",  '7', NULL }
-};
-
-static int irqnums[ 8 ] =
-{
-    2, 3, 5, 7, 10, 11, 12, 15
-};
-
-CP_MenuNames IrqNames[] =
-{
-    "IRQ 2",
-    "IRQ 3",
-    "IRQ 5",
-    "IRQ 7",
-    "IRQ 10",
-    "IRQ 11",
-    "IRQ 12",
-    "IRQ 15"
-};
-
-CP_iteminfo IrqItems = { 82, 24, 8, STARTITEM, 32, IrqNames, mn_largefont };
-CP_itemtype IrqMenu [] =
-{
-    { CP_CursorLocation, "\0",  'a', NULL },
-    { CP_Active,         "\0",  'a', NULL },
-    { CP_Active,         "\0",  'a', NULL },
-    { CP_Active,         "\0",  'a', NULL },
-    { CP_Active,         "\0",  'a', NULL },
-    { CP_Active,         "\0",  'a', NULL },
-    { CP_Active,         "\0",  'a', NULL },
-    { CP_Active,         "\0",  'a', NULL }
-};
-
-CP_MenuNames SBSetupNames[] =
-{
-    "Use Current Settings",
-    "Custom Setup"
-};
-
-CP_iteminfo SBSetupItems  = { MENU_X - 11, MENU_Y + 76, 2, STARTITEM, 19, SBSetupNames, mn_largefont };
-CP_itemtype SBSetupMenu[] =
-{
-    { CP_CursorLocation, "\0",  'U', SS_SetupSoundBlaster },
-    { CP_Active,         "\0",  'C', (menuptr)SS_SBTypeMenu },
-};
-
-extern fx_blaster_config SBSettings;
-
 //******************************************************************************
 //
-// SS_DrawSBSetupMenu()
-//
-//******************************************************************************
-
-void SS_DrawSBSetupMenu
-(
-    void
-)
-
-{
-    char text[ 80 ];
-    char num[ 10 ];
-    char *undefined;
-
-    MenuNum = SNDCARDS;
-    SetAlternateMenuBuf();
-    ClearMenuBuf();
-    SetMenuTitle( "Sound Blaster Setup" );
-
-    WindowW = 288;
-    WindowH = 158;
-    WindowX = 96;
-    WindowY = 32;
-    PrintX  = 0;
-    PrintY  = 32;
-
-    CurrentFont = tinyfont;
-
-    undefined = "Undefined";
-
-    SBSetupMenu[ 0 ].active = CP_Active;
-
-    PrintBattleOption( true, WindowX + 16, PrintY, "Current Settings:" );
-    PrintY += 9;
-
-    strcpy( text, "Card Type : " );
-
-    if ( ( SBSettings.Type < fx_SB ) || ( SBSettings.Type > fx_SB16 ) )
-    {
-        SBSettings.Type = UNDEFINED;
-        strcat( text, undefined );
-        SBSetupMenu[ 0 ].active = CP_Inactive;
-    }
-    else
-    {
-        strcat( text, TypeNames[ (unsigned int)typetostring[ SBSettings.Type ] ] );
-    }
-
-    PrintBattleOption( true, WindowX, PrintY, text );
-    PrintY += 6;
-
-    strcpy( text, "Port : " );
-    if ( SBSettings.Address != (unsigned long)UNDEFINED )
-    {
-        itoa( SBSettings.Address, num, 16 );
-        strcat( text, num );
-    }
-    else
-    {
-        strcat( text, undefined );
-        SBSetupMenu[ 0 ].active = CP_Inactive;
-    }
-
-    PrintBattleOption( true, WindowX + 19, PrintY, text );
-    PrintY += 6;
-
-    strcpy( text, "IRQ : " );
-    if ( SBSettings.Interrupt != (unsigned long)UNDEFINED )
-    {
-        itoa( SBSettings.Interrupt, num, 10 );
-        strcat( text, num );
-    }
-    else
-    {
-        strcat( text, undefined );
-        SBSetupMenu[ 0 ].active = CP_Inactive;
-    }
-    PrintBattleOption( true, WindowX + 23, PrintY, text );
-    PrintY += 6;
-
-    strcpy( text, "DMA : " );
-    if ( SBSettings.Dma8 != (unsigned long)UNDEFINED )
-    {
-        itoa( SBSettings.Dma8, num, 10 );
-        strcat( text, num );
-    }
-    else
-    {
-        strcat( text, undefined );
-        SBSetupMenu[ 0 ].active = CP_Inactive;
-    }
-    PrintBattleOption( true, WindowX + 21, PrintY, text );
-    PrintY += 6;
-
-    strcpy( text, "16-Bit DMA : " );
-    if ( SBSettings.Dma16 != (unsigned long)UNDEFINED )
-    {
-        itoa( SBSettings.Dma16, num, 10 );
-        strcat( text, num );
-    }
-    else
-    {
-        strcat( text, undefined );
-    }
-    PrintBattleOption( true, WindowX - 4, PrintY, text );
-    PrintY += 6;
-
-    MN_GetCursorLocation( &SBSetupItems, &SBSetupMenu[ 0 ] );
-    DrawMenu( &SBSetupItems, &SBSetupMenu[ 0 ] );
-    DisplayInfo( 0 );
-
-    FlipMenuBuf();
-    RefreshMenuBuf( 0 );
-}
-
-
-//******************************************************************************
-//
-// SS_DrawSBTypeMenu()
-//
-//******************************************************************************
-
-void SS_DrawSBTypeMenu
-(
-    void
-)
-
-{
-    MenuNum = SNDCARDS;
-    SetAlternateMenuBuf();
-    ClearMenuBuf();
-    SetMenuTitle( "Select Sound Blaster Type" );
-    MN_GetActive( &TypeItems, &TypeMenu[ 0 ], SBSettings.Type, typenums );
-    DrawMenu( &TypeItems, &TypeMenu[ 0 ] );
-    DisplayInfo( 0 );
-
-    FlipMenuBuf();
-}
-
-//******************************************************************************
-//
-// SS_SBTypeMenu()
-//
-//******************************************************************************
-
-void SS_SBTypeMenu
-(
-    void
-)
-
-{
-    int which;
-
-    do
-    {
-        SS_DrawSBTypeMenu();
-        which = HandleMenu( &TypeItems, &TypeMenu[0], NULL );
-        if ( which >= 0 )
-        {
-            SBSettings.Type = typenums[ which ];
-            SS_PortMenu();
-            if ( handlewhich == -1 )
-            {
-                continue;
-            }
-            return;
-        }
-    }
-    while( which >= 0 );
-
-    handlewhich = -2;
-}
-
-//******************************************************************************
-//
-// SS_DrawPortMenu()
-//
-//******************************************************************************
-
-void SS_DrawPortMenu
-(
-    void
-)
-
-{
-    MenuNum = SNDCARDS;
-    SetAlternateMenuBuf();
-    ClearMenuBuf();
-    SetMenuTitle( "Select Sound Blaster Port" );
-    MN_GetActive( &PortItems, &PortMenu[ 0 ], SBSettings.Address, portnums );
-    DrawMenu( &PortItems, &PortMenu[ 0 ] );
-    DisplayInfo( 0 );
-
-    FlipMenuBuf();
-}
-
-//******************************************************************************
-//
-// SS_PortMenu()
-//
-//******************************************************************************
-
-void SS_PortMenu
-(
-    void
-)
-
-{
-    int which;
-
-    do
-    {
-        SS_DrawPortMenu();
-        which = HandleMenu( &PortItems, &PortMenu[0], NULL );
-        if ( which >= 0 )
-        {
-            SBSettings.Address = portnums[ which ];
-            SBSettings.Emu = SBSettings.Address;
-            SS_8BitDMAMenu();
-            if ( handlewhich == -1 )
-            {
-                continue;
-            }
-            return;
-        }
-    }
-    while( which >= 0 );
-
-    handlewhich = -1;
-}
-
-//******************************************************************************
-//
-// SS_Draw8BitDMAMenu()
-//
-//******************************************************************************
-
-void SS_Draw8BitDMAMenu
-(
-    void
-)
-
-{
-    MenuNum = SNDCARDS;
-    SetAlternateMenuBuf();
-    ClearMenuBuf();
-    SetMenuTitle( "Select 8-bit DMA Channel" );
-    MN_GetActive( &_8BitDMAItems, &_8BitDMAMenu[ 0 ], SBSettings.Dma8, _8BitDMAnums );
-    DrawMenu( &_8BitDMAItems, &_8BitDMAMenu[ 0 ] );
-    DisplayInfo( 0 );
-
-    FlipMenuBuf();
-}
-
-//******************************************************************************
-//
-// SS_8BitDMAMenu()
-//
-//******************************************************************************
-
-void SS_8BitDMAMenu
-(
-    void
-)
-
-{
-    int which;
-
-    do
-    {
-        SS_Draw8BitDMAMenu();
-        which = HandleMenu( &_8BitDMAItems, &_8BitDMAMenu[0], NULL );
-        if ( which >= 0 )
-        {
-            SBSettings.Dma8 = _8BitDMAnums[ which ];
-            SS_16BitDMAMenu();
-            if ( handlewhich == -1 )
-            {
-                continue;
-            }
-            return;
-        }
-    }
-    while( which >= 0 );
-
-    handlewhich = -1;
-}
-
-//******************************************************************************
-//
-// SS_Draw16BitDMAMenu()
-//
-//******************************************************************************
-
-void SS_Draw16BitDMAMenu
-(
-    void
-)
-
-{
-    MenuNum = SNDCARDS;
-    SetAlternateMenuBuf();
-    ClearMenuBuf();
-    SetMenuTitle( "Select 16-bit DMA Channel" );
-    MN_GetActive( &_16BitDMAItems, &_16BitDMAMenu[ 0 ], SBSettings.Dma16, _16BitDMAnums );
-    DrawMenu( &_16BitDMAItems, &_16BitDMAMenu[ 0 ] );
-    DisplayInfo( 0 );
-
-    FlipMenuBuf();
-}
-
-//******************************************************************************
-//
-// SS_16BitDMAMenu()
-//
-//******************************************************************************
-
-void SS_16BitDMAMenu
-(
-    void
-)
-
-{
-    int which;
-
-    if ( SBSettings.Type != fx_SB16 )
-    {
-        SS_IrqMenu();
-        return;
-    }
-
-    do
-    {
-        SS_Draw16BitDMAMenu();
-        which = HandleMenu( &_16BitDMAItems, &_16BitDMAMenu[0], NULL );
-        if ( which >= 0 )
-        {
-            SBSettings.Dma16 = _16BitDMAnums[ which ];
-            SS_IrqMenu();
-            if ( handlewhich == -1 )
-            {
-                continue;
-            }
-            return;
-        }
-    }
-    while( which >= 0 );
-
-    handlewhich = -1;
-}
-
-//******************************************************************************
-//
-// SS_DrawIrqMenu()
-//
-//******************************************************************************
-
-void SS_DrawIrqMenu
-(
-    void
-)
-
-{
-    MenuNum = SNDCARDS;
-    SetAlternateMenuBuf();
-    ClearMenuBuf();
-    SetMenuTitle( "Select Sound Blaster IRQ" );
-    MN_GetActive( &IrqItems, &IrqMenu[ 0 ], SBSettings.Interrupt, irqnums );
-    DrawMenu( &IrqItems, &IrqMenu[ 0 ] );
-    DisplayInfo( 0 );
-
-    FlipMenuBuf();
-}
-
-//******************************************************************************
-//
-// SS_IrqMenu()
-//
-//******************************************************************************
-
-void SS_IrqMenu
-(
-    void
-)
-
-{
-    int which;
-
-    do
-    {
-        SS_DrawIrqMenu();
-        which = HandleMenu( &IrqItems, &IrqMenu[0], NULL );
-
-        if ( which >= 0 )
-        {
-            SBSettings.Interrupt = irqnums[ which ];
-            SS_SetupSoundBlaster( true );
-
-            if ( handlewhich == -1 )
-            {
-                continue;
-            }
-
-            return;
-        }
-    }
-    while( which >= 0 );
-
-    handlewhich = -1;
-}
-#endif
-
-
-//******************************************************************************
-//
 // GetNextWord()
 //
 //******************************************************************************
@@ -10294,731 +9416,3 @@
 
     MN_PlayMenuSnd( SD_ESCPRESSEDSND );
 }
-
-#ifdef DOS
-
-//****************************************************************************
-//
-// DrawSoundSetupMainMenu ()
-//
-//****************************************************************************
-void DrawSoundSetupMainMenu
-(
-    void
-)
-
-{
-    MenuNum = 1;
-
-    SetAlternateMenuBuf();
-    ClearMenuBuf();
-    SetMenuTitle( "Sound Setup" );
-    if ( FXMode == 0 )
-    {
-        SoundSetupMenu[ 2 ].active = CP_Inactive;
-    }
-    else if ( SoundSetupMenu[ 2 ].active == CP_Inactive )
-    {
-        SoundSetupMenu[ 2 ].active = CP_Active;
-    }
-
-    if ( MusicMode == 0 )
-    {
-        SoundSetupMenu[ 3 ].active = CP_Inactive;
-    }
-    else if ( SoundSetupMenu[ 3 ].active == CP_Inactive )
-    {
-        SoundSetupMenu[ 3 ].active = CP_Active;
-    }
-
-    MN_GetCursorLocation( &SoundSetupMenuItems, &SoundSetupMenu[ 0 ] );
-    DrawMenu( &SoundSetupMenuItems, &SoundSetupMenu[ 0 ] );
-    DisplayInfo( 0 );
-
-    FlipMenuBuf();
-}
-
-
-//******************************************************************************
-//
-// Sound Setup Quit
-//
-//******************************************************************************
-
-void SS_Quit
-(
-    void
-)
-
-{
-    extern boolean WriteSoundFile;
-
-    CP_DisplayMsg( "Do you wish to\nsave your changes?\n"
-                   "Press ESC to return\nto sound setup.", 12 );
-
-    if ( CP_Acknowledge != CP_ESC )
-    {
-        WriteSoundFile = true;
-        if ( CP_Acknowledge == CP_NO )
-        {
-            WriteSoundFile = false;
-        }
-
-        MU_FadeOut(310);
-        VL_FadeOut (0, 255, 0, 0, 0, 10);
-        ShutdownMenuBuf();
-        QuitGame ();
-    }
-
-    DrawSoundSetupMainMenu();
-}
-
-//******************************************************************************
-//
-// Sound Setup
-//
-//******************************************************************************
-
-void CP_SoundSetup ( void )
-{
-    int which;
-    extern boolean WriteSoundFile;
-
-    WriteSoundFile = false;
-
-    SetupMenuBuf();
-    DrawSoundSetupMainMenu();
-    IN_ClearKeysDown();
-
-    if ( MusicMode != 0 )
-    {
-        MU_StartSong( song_title );
-    }
-
-    while( 1 )
-    {
-        which = HandleMenu( &SoundSetupMenuItems, SoundSetupMenu, NULL );
-        if ( which == -1 )
-        {
-            SS_Quit();
-        }
-    }
-}
-
-//******************************************************************************
-//
-// SS_MusicMenu ()
-//
-//******************************************************************************
-
-void SS_MusicMenu
-(
-    void
-)
-
-{
-    int which;
-
-    MN_MakeActive( &SoundSetupMusicItems, &SoundSetupMusic[ 0 ], MusicMode );
-
-    SS_DrawMusicMenu ();
-    IN_ClearKeysDown();
-
-    do
-    {
-        which = HandleMenu( &SoundSetupMusicItems, &SoundSetupMusic[ 0 ], NULL );
-    }
-    while( which > 0 );
-
-    DrawSoundSetupMainMenu();
-    handlewhich = RETURNVAL;
-}
-
-
-//******************************************************************************
-//
-// SS_DrawMusicMenu ()
-//
-//******************************************************************************
-
-void SS_DrawMusicMenu
-(
-    void
-)
-
-{
-    MenuNum = SNDCARDS;
-
-    SetAlternateMenuBuf();
-    ClearMenuBuf();
-    SetMenuTitle( "Select Music Card" );
-
-    MN_GetCursorLocation( &SoundSetupMusicItems, &SoundSetupMusic[ 0 ] );
-    DrawMenu( &SoundSetupMusicItems, &SoundSetupMusic[ 0 ] );
-    DisplayInfo( 0 );
-
-    FlipMenuBuf();
-}
-
-
-//******************************************************************************
-//
-// SS_SetupMusicCardMenu()
-//
-//******************************************************************************
-
-void SS_SetupMusicCardMenu
-(
-    void
-)
-
-{
-    int status;
-    int select;
-    if ( ( ( musicnums[ handlewhich ] == SoundBlaster ) ||
-            ( musicnums[ handlewhich ] == WaveBlaster ) ||
-            ( musicnums[ handlewhich ] == Awe32 ) ) &&
-            ( fxnums[ FXMode ] != SoundBlaster ) &&
-            ( fxnums[ FXMode ] != Awe32 ) )
-    {
-        CP_ErrorMsg( "Music Error",
-                     "Please set your Sound FX card to Sound Blaster before "
-                     "selecting this card for music.", mn_smallfont );
-
-        handlewhich = -1;
-        return;
-    }
-
-    MusicMode = handlewhich;
-
-    MU_Shutdown();
-
-    if ( ( musicnums[ MusicMode ] == GenMidi ) ||
-            ( musicnums[ MusicMode ] == SoundCanvas ) ||
-            ( musicnums[ MusicMode ] == WaveBlaster ) ||
-            ( musicnums[ MusicMode ] == Awe32 ) )
-    {
-        DrawMusicCardMenu();
-
-        IN_ClearKeysDown ();
-
-        select = HandleMenu( &SoundSetupMidiPortItems,
-                             &SoundSetupMidiPort[0], NULL );
-
-        if ( select > -1 )
-        {
-            MidiAddress = midinums[ select ];
-        }
-        else
-        {
-            SS_DrawMusicMenu ();
-            handlewhich = RETURNVAL;
-            MusicMode = 0;
-            return;
-        }
-    }
-
-    if ( MusicMode != 0 )
-    {
-        if ( ( musicnums[ handlewhich ] == WaveBlaster ) ||
-                ( musicnums[ handlewhich ] == Awe32 ) )
-        {
-            SD_Shutdown();
-        }
-
-        SetAlternateMenuBuf();
-        ClearMenuBuf();
-        SetMenuTitle( "Music Card Initialization" );
-        WindowW = 288;
-        WindowH = 158;
-        PrintX = WindowX = 0;
-        PrintY = WindowY = 65;
-        newfont1 = (font_t *)W_CacheLumpName( "newfnt1", PU_CACHE, Cvt_font_t, 1 );
-        CurrentFont = newfont1;
-        MenuBufCPrint( "Initializing card.\nPlease wait." );
-        FlipMenuBuf();
-        RefreshMenuBuf( 0 );
-
-        status = MU_Startup( false );
-        if ( status )
-        {
-            MusicMode = 0;
-
-            CP_ErrorMsg( "Music Error", MUSIC_ErrorString( MUSIC_Error ),
-                         mn_smallfont );
-            SS_DrawMusicMenu ();
-            handlewhich = RETURNVAL;
-        }
-        else
-        {
-            handlewhich = -1;
-            MU_StartSong( song_title );
-        }
-
-        if ( ( musicnums[ MusicMode ] == WaveBlaster ) ||
-                ( musicnums[ MusicMode ] == Awe32 ) )
-        {
-            status = SD_Startup( false );
-            if ( status != FX_Ok )
-            {
-                CP_ErrorMsg( "Sound FX Error", FX_ErrorString( FX_Error ),
-                             mn_smallfont );
-
-                handlewhich = -2;
-            }
-        }
-    }
-    else
-    {
-        handlewhich = -1;
-        MU_Shutdown();
-    }
-}
-
-
-//******************************************************************************
-//
-// DrawMusicCardMenu()
-//
-//******************************************************************************
-
-void DrawMusicCardMenu
-(
-    void
-)
-
-{
-    MenuNum = SNDCARDS;
-    SetAlternateMenuBuf();
-    ClearMenuBuf();
-    SetMenuTitle( "Select MIDI Port Address" );
-    MN_GetActive( &SoundSetupMidiPortItems, &SoundSetupMidiPort[ 0 ],
-                  MidiAddress, midinums );
-    DrawMenu( &SoundSetupMidiPortItems, &SoundSetupMidiPort[ 0 ] );
-    DisplayInfo( 0 );
-
-    FlipMenuBuf();
-}
-
-//******************************************************************************
-//
-// SS_SoundMenu ()
-//
-//******************************************************************************
-
-void SS_SoundMenu
-(
-    void
-)
-
-{
-    int which;
-
-    MN_MakeActive( &SoundSetupSoundItems, &SoundSetupSound[0], FXMode );
-
-    SS_DrawSoundMenu ();
-    IN_ClearKeysDown();
-
-    do {
-        which = HandleMenu( &SoundSetupSoundItems, &SoundSetupSound[ 0 ], NULL );
-    }
-    while( which >= 0 );
-
-    DrawSoundSetupMainMenu();
-    handlewhich = RETURNVAL;
-}
-
-
-//******************************************************************************
-//
-// SS_DrawSoundMenu ()
-//
-//******************************************************************************
-
-void SS_DrawSoundMenu
-(
-    void
-)
-
-{
-    MenuNum = SNDCARDS;
-
-    SetAlternateMenuBuf();
-    ClearMenuBuf();
-    SetMenuTitle ("Select Sound FX Card");
-
-    MN_GetCursorLocation( &SoundSetupSoundItems, &SoundSetupSound[0] );
-
-    DrawMenu( &SoundSetupSoundItems, &SoundSetupSound[ 0 ] );
-    DisplayInfo( 0 );
-
-    FlipMenuBuf();
-}
-
-
-//******************************************************************************
-//
-// SS_SetupSoundBlaster()
-//
-//******************************************************************************
-
-void SS_SetupSoundBlaster
-(
-    int sbmenu
-)
-
-{
-    int status;
-
-    status = FX_SetupSoundBlaster( SBSettings, &MaxVoices,
-                                   &MaxBits, &MaxChannels );
-
-    if ( status == FX_Ok )
-    {
-        SS_VoiceMenu( sbmenu );
-
-        if ( handlewhich < 0 )
-        {
-            return;
-        }
-        SetAlternateMenuBuf();
-        ClearMenuBuf();
-        SetMenuTitle( "Sound Card Initialization" );
-        WindowW = 288;
-        WindowH = 158;
-        PrintX = WindowX = 0;
-        PrintY = WindowY = 65;
-        newfont1 = (font_t *)W_CacheLumpName( "newfnt1", PU_CACHE, Cvt_font_t, 1 );
-        CurrentFont = newfont1;
-        MenuBufCPrint( "Initializing card.\nPlease wait." );
-        FlipMenuBuf();
-        RefreshMenuBuf( 0 );
-
-        status = SD_Startup( false );
-
-        RefreshMenuBuf( 0 );
-    }
-
-    if ( status != FX_Ok )
-    {
-        CP_ErrorMsg( "Sound FX Error", FX_ErrorString( FX_Error ),
-                     mn_smallfont );
-
-        handlewhich = -2;
-    }
-}
-
-
-//******************************************************************************
-//
-// SS_SetupSoundCardMenu()
-//
-//******************************************************************************
-
-void SS_SetupSoundCardMenu
-(
-    void
-)
-
-{
-    int which;
-    int FXstatus;
-    extern int fxnums[];
-
-    INFXSETUP = true;
-
-    FXMode = handlewhich;
-
-    SD_Shutdown();
-
-    if ( FXMode == 0 )
-    {
-        handlewhich = -1;
-    }
-    else
-    {
-        if ( ( fxnums[ FXMode ] == SoundBlaster ) ||
-                ( fxnums[ FXMode ] == Awe32 ) )
-        {
-            do
-            {
-                SS_DrawSBSetupMenu();
-                which = HandleMenu( &SBSetupItems, &SBSetupMenu[ 0 ], NULL );
-            }
-            while( which == -2 );
-
-            if ( which == -1 )
-            {
-                FXMode = 0;
-                handlewhich = 0;
-                SS_DrawSoundMenu();
-            }
-            else
-            {
-                handlewhich = -1;
-            }
-
-            INFXSETUP = false;
-            return;
-        }
-
-        FXstatus = SD_SetupFXCard( &MaxVoices, &MaxBits, &MaxChannels );
-        if ( FXstatus == FX_Ok )
-        {
-            SS_VoiceMenu( true );
-
-            if ( handlewhich == -1 )
-            {
-                SS_DrawSoundMenu ();
-                handlewhich = RETURNVAL;
-                FXMode = 0;
-                SD_Shutdown ();
-                INFXSETUP = false;
-                return;
-            }
-
-            SetAlternateMenuBuf();
-            ClearMenuBuf();
-            SetMenuTitle( "Sound Card Initialization" );
-            WindowW = 288;
-            WindowH = 158;
-            PrintX = WindowX = 0;
-            PrintY = WindowY = 65;
-            newfont1 = (font_t *)W_CacheLumpName( "newfnt1", PU_CACHE, Cvt_font_t, 1 );
-            CurrentFont = newfont1;
-            MenuBufCPrint( "Initializing card.\nPlease wait." );
-            FlipMenuBuf();
-            RefreshMenuBuf( 0 );
-
-            FXstatus = SD_Startup( false );
-
-            RefreshMenuBuf( 0 );
-        }
-
-        if ( FXstatus != FX_Ok )
-        {
-            FXMode = 0;
-            handlewhich = RETURNVAL;
-
-            CP_ErrorMsg( "Sound FX Error", FX_ErrorString( FX_Error ),
-                         mn_smallfont );
-            SS_DrawSoundMenu();
-        }
-        else
-        {
-            handlewhich = -1;
-        }
-    }
-
-    INFXSETUP = false;
-}
-
-
-//******************************************************************************
-//
-// SS_VoiceMenu ()
-//
-//******************************************************************************
-
-void SS_VoiceMenu
-(
-    int sbmenu
-)
-
-{
-    int which;
-
-    if ( MaxVoices < 2 )
-    {
-        NumVoices = 1;
-        SS_ChannelMenu();
-        return;
-    }
-
-    do
-    {
-        SS_DrawVoiceMenu ();
-
-        which = HandleMenu( &SoundSetupVoiceItems, &SoundSetupVoice[0],
-                            NULL );
-        if ( which >= 0 )
-        {
-            NumVoices = voicenums[ which ];
-            SS_ChannelMenu();
-            if ( handlewhich == -1 )
-            {
-                continue;
-            }
-            return;
-        }
-    }
-    while( which >= 0 );
-
-    if ( sbmenu )
-    {
-        handlewhich = -1;
-    }
-    else
-    {
-        handlewhich = -2;
-    }
-}
-
-//******************************************************************************
-//
-// SS_DrawVoiceMenu()
-//
-//******************************************************************************
-
-void SS_DrawVoiceMenu
-(
-    void
-)
-
-{
-    MenuNum = SNDCARDS;
-
-    SetAlternateMenuBuf();
-    ClearMenuBuf();
-    SetMenuTitle ("Number of Voices");
-
-    MN_GetActive( &SoundSetupVoiceItems, &SoundSetupVoice[0],
-                  NumVoices, voicenums );
-
-    DrawMenu( &SoundSetupVoiceItems, &SoundSetupVoice[ 0 ] );
-    DisplayInfo( 0 );
-
-    FlipMenuBuf();
-}
-
-//******************************************************************************
-//
-// SS_ChannelMenu ()
-//
-//******************************************************************************
-
-void SS_ChannelMenu
-(
-    void
-)
-
-{
-    int which;
-
-    if ( MaxChannels < 2 )
-    {
-        NumChannels = 1;
-        SS_BitMenu();
-        return;
-    }
-
-    do
-    {
-        SS_DrawChannelMenu ();
-        which = HandleMenu( &SoundSetupChannelItems, &SoundSetupChannel[0],
-                            NULL );
-        if ( which >= 0 )
-        {
-            NumChannels = smnums[ which ];
-            SS_BitMenu();
-            if ( handlewhich == -1 )
-            {
-                continue;
-            }
-            return;
-        }
-    }
-    while( which >= 0 );
-
-    handlewhich = -1;
-}
-
-//******************************************************************************
-//
-// SS_DrawChannelMenu()
-//
-//******************************************************************************
-
-void SS_DrawChannelMenu
-(
-    void
-)
-
-{
-    MenuNum = SNDCARDS;
-
-    SetAlternateMenuBuf();
-    ClearMenuBuf();
-    SetMenuTitle ("Number of Channels");
-
-    MN_GetActive( &SoundSetupChannelItems, &SoundSetupChannel[0],
-                  NumChannels, smnums );
-
-    DrawMenu( &SoundSetupChannelItems, &SoundSetupChannel[ 0 ] );
-    DisplayInfo( 0 );
-
-    FlipMenuBuf();
-}
-
-//******************************************************************************
-//
-// SS_BitMenu ()
-//
-//******************************************************************************
-
-void SS_BitMenu
-(
-    void
-)
-
-{
-    int which;
-
-    if ( MaxBits < 16 )
-    {
-        NumBits = 8;
-        return;
-    }
-
-    SS_DrawBitMenu ();
-
-    which = HandleMenu( &SoundSetupResolutionItems,
-                        &SoundSetupResolution[0], NULL );
-
-    if ( which >= 0 )
-    {
-        NumBits = resnums[ which ];
-        return;
-    }
-
-    handlewhich = -1;
-}
-
-
-//******************************************************************************
-//
-// SS_DrawBitMenu()
-//
-//******************************************************************************
-
-void SS_DrawBitMenu
-(
-    void
-)
-
-{
-    MenuNum = SNDCARDS;
-
-    SetAlternateMenuBuf();
-    ClearMenuBuf();
-    SetMenuTitle ("Playback Resolution");
-
-    MN_GetActive( &SoundSetupResolutionItems, &SoundSetupResolution[0],
-                  NumBits, resnums );
-
-    DrawMenu( &SoundSetupResolutionItems, &SoundSetupResolution[ 0 ] );
-    DisplayInfo( 0 );
-
-    FlipMenuBuf();
-}
-#endif
--- a/rott/rt_msg.c
+++ b/rott/rt_msg.c
@@ -33,11 +33,6 @@
 #include "rt_main.h"
 #include "rt_net.h"
 #include "rt_com.h"
-
-#ifdef DOS
-#include <mem.h>
-#endif
-
 #include <stdlib.h>
 //MED
 #include "memcheck.h"
--- a/rott/rt_net.c
+++ b/rott/rt_net.c
@@ -22,12 +22,6 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <fcntl.h>
-
-#ifdef DOS
-#include <dos.h>
-#include <io.h>
-#endif
-
 #include "rt_def.h"
 #include "rt_main.h"
 #include "rt_net.h"
@@ -848,7 +842,7 @@
             ( ( who == MSG_DIRECTED_TO_TEAM ) && ( BATTLE_Team[ from ] ==
                     BATTLE_Team[ consoleplayer ] ) ) )
     {
-        strcpy( name, "(� RR from " );
+        strcpy( name, "(� RR from " );
         strcat( name, PLAYERSTATE[from].codename );
         strcat( name, ")" );
         AddMessage( name, MSG_REMOTERIDICULE );
--- a/rott/rt_playr.c
+++ b/rott/rt_playr.c
@@ -17,16 +17,10 @@
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 */
-
-#ifdef DOS
-#include <dos.h>
-#endif
-
 #include <string.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <stdarg.h>
-
 #include "rt_def.h"
 #include "watcom.h"
 #include "rt_sound.h"
@@ -2366,17 +2360,7 @@
 
 void StartVRFeedback (int guntype)
 {
-#ifdef DOS
-    union REGS inregs;
-    union REGS outregs;
-
-    inregs.x.eax = VR_FEEDBACK_SERVICE;
-    inregs.x.ebx = 1;
-    inregs.x.ecx = guntype;
-    int386 (0x33, &inregs, &outregs);
-#else
     STUB_FUNCTION;
-#endif
 }
 
 //******************************************************************************
@@ -2387,16 +2371,7 @@
 
 void StopVRFeedback (void)
 {
-#ifdef DOS
-    union REGS inregs;
-    union REGS outregs;
-
-    inregs.x.eax = VR_FEEDBACK_SERVICE;
-    inregs.x.ebx = 0;
-    int386 (0x33, &inregs, &outregs);
-#else
     STUB_FUNCTION;
-#endif
 }
 
 //******************************************************************************
@@ -2409,67 +2384,7 @@
 
 void PollVirtualReality (void)
 {
-#ifdef DOS
-    union REGS inregs;
-    union REGS outregs;
-    short int  mousexmove,
-          mouseymove;
-    word vr_buttons;
-
-    inregs.x.eax = VR_INPUT_SERVICE;
-
-    inregs.x.ebx = player->angle;
-    inregs.x.ecx = player->yzangle;
-
-    int386 (0x33, &inregs, &outregs);
-
-    vr_buttons = outregs.w.bx;
-
-    buttonpoll[bt_run          ] |= VR_BUTTON(VR_RUNBUTTON          );
-    buttonpoll[bt_strafeleft   ] |= VR_BUTTON(VR_STRAFELEFTBUTTON   );
-    buttonpoll[bt_straferight  ] |= VR_BUTTON(VR_STRAFERIGHTBUTTON  );
-    buttonpoll[bt_attack       ] |= VR_BUTTON(VR_ATTACKBUTTON       );
-    buttonpoll[bt_lookup       ] |= VR_BUTTON(VR_LOOKUPBUTTON       );
-    buttonpoll[bt_lookdown     ] |= VR_BUTTON(VR_LOOKDOWNBUTTON     );
-    buttonpoll[bt_swapweapon   ] |= VR_BUTTON(VR_SWAPWEAPONBUTTON   );
-    buttonpoll[bt_use          ] |= VR_BUTTON(VR_USEBUTTON          );
-    buttonpoll[bt_horizonup    ] |= VR_BUTTON(VR_HORIZONUPBUTTON    );
-    buttonpoll[bt_horizondown  ] |= VR_BUTTON(VR_HORIZONDOWNBUTTON  );
-    buttonpoll[bt_map          ] |= VR_BUTTON(VR_MAPBUTTON          );
-    buttonpoll[bt_pistol       ] |= VR_BUTTON(VR_PISTOLBUTTON       );
-    buttonpoll[bt_dualpistol   ] |= VR_BUTTON(VR_DUALPISTOLBUTTON   );
-    buttonpoll[bt_mp40         ] |= VR_BUTTON(VR_MP40BUTTON         );
-    buttonpoll[bt_missileweapon] |= VR_BUTTON(VR_MISSILEWEAPONBUTTON);
-    buttonpoll[bt_recordsound  ] |= VR_BUTTON(VR_RECORDBUTTON       );
-
-    mousexmove = outregs.w.cx;
-    mouseymove = outregs.w.dx;
-
-    VX = 0;
-    VY = 0;
-
-
-    if ((abs (mouseymove)) >= threshold)
-    {
-        VY =  MOUSE_TZ_INPUT_SCALE*mouseymove;
-        if (abs(mouseymove)>200)
-        {
-            buttonpoll[bt_run]=true;
-        }
-    }
-
-    if ((abs (mousexmove)) >= threshold)
-    {
-        VX = -mouse_ry_input_scale*mousexmove;
-        VX += FixedMul(MX,sensitivity_scalar[mouseadjustment]*MOUSE_RY_SENSITIVITY_SCALE);
-        if (abs(mousexmove)>10)
-        {
-            buttonpoll[bt_run]=true;
-        }
-    }
-#else
     STUB_FUNCTION;
-#endif
 }
 
 
--- a/rott/rt_scale.c
+++ b/rott/rt_scale.c
@@ -21,13 +21,6 @@
 #include "watcom.h"
 #include <stdio.h>
 #include <string.h>
-
-#ifdef DOS
-#include <malloc.h>
-#include <dos.h>
-#include <conio.h>
-#endif
-
 #include "modexlib.h"
 #include "rt_util.h"
 #include "rt_draw.h"
@@ -395,28 +388,6 @@
 
 void ScaleMaskedWidePost (byte * src, byte * buf, int x, int width)
 {
-#ifdef DOS
-    int  ofs;
-    int  msk;
-
-    whereami=30;
-    buf+=x>>2;
-    ofs=((x&3)<<3)+(x&3)+width-1;
-    VGAMAPMASK(*((byte *)mapmasks1+ofs));
-    ScaleMaskedPost(src,buf);
-    msk=(byte)*((byte *)mapmasks2+ofs);
-    if (msk==0)
-        return;
-    buf++;
-    VGAMAPMASK(msk);
-    ScaleMaskedPost(src,buf);
-    msk=(byte)*((byte *)mapmasks3+ofs);
-    if (msk==0)
-        return;
-    buf++;
-    VGAMAPMASK(msk);
-    ScaleMaskedPost(src,buf);
-#else
     buf += x;
 
     while (width--) {
@@ -423,33 +394,10 @@
         ScaleMaskedPost(src,buf);
         buf++;
     }
-#endif
 }
 
 void ScaleClippedWidePost (byte * src, byte * buf, int x, int width)
 {
-#ifdef DOS
-    int  ofs;
-    int  msk;
-
-    whereami=31;
-    buf+=x>>2;
-    ofs=((x&3)<<3)+(x&3)+width-1;
-    VGAMAPMASK(*((byte *)mapmasks1+ofs));
-    ScaleClippedPost(src,buf);
-    msk=(byte)*((byte *)mapmasks2+ofs);
-    if (msk==0)
-        return;
-    buf++;
-    VGAMAPMASK(msk);
-    ScaleClippedPost(src,buf);
-    msk=(byte)*((byte *)mapmasks3+ofs);
-    if (msk==0)
-        return;
-    buf++;
-    VGAMAPMASK(msk);
-    ScaleClippedPost(src,buf);
-#else
     buf += x;
 
     while (width--) {
@@ -456,7 +404,6 @@
         ScaleClippedPost(src,buf);
         buf++;
     }
-#endif
 }
 
 
@@ -573,17 +520,10 @@
         startfrac=frac;
         if (doublestep>1)
         {
-#ifdef DOS
-            for (plane=startx; plane<startx+4; plane+=2,startfrac+=(dc_iscale<<1))
-#endif
             {
                 frac=startfrac;
 //   VGAWRITEMAP(plane&3);
-#ifdef DOS
-                for (x1=plane; x1<=x2; x1+=4, frac += (dc_iscale<<2))
-#else
                 for (x1=startx; x1<=x2; x1+=2, frac += (dc_iscale<<1))
-#endif
                 {
                     if (
                         (posts[x1].wallheight>sprite->viewheight) &&
@@ -599,24 +539,12 @@
         }
         else
         {
-#ifdef DOS
-            for (plane=startx; plane<startx+4; plane++,startfrac+=dc_iscale)
-#endif
             {
                 frac=startfrac;
 
-#ifdef DOS
-                b=(byte *)bufferofs+(plane>>2);
-                VGAWRITEMAP(plane&3);
-#else
                 b=(byte *)bufferofs+startx;
-#endif
-
-#ifdef DOS
-                for (x1=plane; x1<=x2; x1+=4, frac += (dc_iscale<<2),b++)
-#else
+                
                 for (x1=startx; x1<=x2; x1++, frac += dc_iscale,b++)
-#endif
                 {
                     if (posts[x1].wallheight>sprite->viewheight)
                         continue;
@@ -699,26 +627,11 @@
     startx=x1;
     startfrac=frac;
 
-#ifdef DOS
-    for (plane=startx; plane<startx+4; plane++,startfrac+=dc_iscale)
-#endif
-
     {
         frac=startfrac;
-
-#ifdef DOS
-        b=(byte *)bufferofs+(plane>>2);
-        VGAWRITEMAP(plane&3);
-        VGAREADMAP(plane&3);
-#else
         b=(byte *)bufferofs+startx;
-#endif
 
-#ifdef DOS
-        for (x1=plane; x1<=x2; x1+=4, frac += (dc_iscale<<2),b++)
-#else
         for (x1=startx; x1<=x2; x1++, frac += dc_iscale,b++)
-#endif
         {
             if (posts[x1].wallheight>sprite->viewheight)
                 continue;
@@ -788,25 +701,12 @@
     startx=x1;
     startfrac=frac;
 
-#ifdef DOS
-    for (plane=startx; plane<startx+4; plane++,startfrac+=dc_iscale)
-#endif
-
     {
         frac=startfrac;
 
-#ifdef DOS
-        b=(byte *)bufferofs+(plane>>2);
-        VGAWRITEMAP(plane&3);
-#else
         b=(byte *)bufferofs+startx;
-#endif
 
-#ifdef DOS
-        for (x1=plane; x1<=x2; x1+=4, frac += (dc_iscale<<2),b++)
-#else
         for (x1=startx; x1<=x2; x1++, frac += dc_iscale,b++)
-#endif
         {
             if (posts[x1].wallheight>sprite->viewheight)
                 continue;
@@ -879,23 +779,11 @@
 
     startx=x1;
     startfrac=frac;
-
-#ifdef DOS
-    for (plane=startx; plane<startx+4; plane++,startfrac+=dc_iscale)
-#endif
     {
         frac=startfrac;
-#ifdef DOS
-        b=(byte *)bufferofs+(plane>>2);
-#else
         b=(byte *)bufferofs+startx;
-#endif
         VGAWRITEMAP(plane&3);
-#ifdef DOS
-        for (x1=plane; x1<=x2 ; x1+=4, frac += dc_iscale<<2,b++)
-#else
         for (x1=startx; x1<=x2 ; x1++, frac += dc_iscale,b++)
-#endif
             ScaleClippedPost(((p->collumnofs[frac>>SFRACBITS])+shape),b);
     }
 }
@@ -964,26 +852,11 @@
 
     startx=x1;
     startfrac=frac;
-
-#ifdef DOS
-    for (plane=startx; plane<startx+4; plane++,startfrac+=dc_iscale)
-#endif
-
+    
     {
         frac=startfrac;
-
-#ifdef DOS
-        b=(byte *)bufferofs+(plane>>2);
-        VGAWRITEMAP(plane&3);
-#else
         b=(byte *)bufferofs+startx;
-#endif
-
-#ifdef DOS
-        for (x1=plane; x1<=x2 ; x1+=4, frac += dc_iscale<<2,b++)
-#else
         for (x1=startx; x1<=x2 ; x1++, frac += dc_iscale,b++)
-#endif
             ScaleClippedPost(((p->collumnofs[frac>>SFRACBITS])+shape),b);
     }
 }
@@ -1072,26 +945,11 @@
     startx=x1;
     startfrac=frac;
 
-#ifdef DOS
-    for (plane=startx; plane<startx+4; plane++,startfrac+=dc_iscale)
-#endif
-
     {
         frac=startfrac;
-
-#ifdef DOS
-        b=(byte *)bufferofs+(plane>>2);
-        VGAWRITEMAP(plane&3);
-        VGAREADMAP(plane&3);
-#else
         b=(byte *)bufferofs+startx;
-#endif
 
-#ifdef DOS
-        for (x1=plane; x1<=x2 ; x1+=4, frac += dc_iscale<<2,b++)
-#else
         for (x1=startx; x1<=x2 ; x1++, frac += dc_iscale,b++)
-#endif
             if (type==0)
                 ScaleClippedPost(((p->collumnofs[frac>>SFRACBITS])+shape),b);
             else
@@ -1330,29 +1188,13 @@
 
     startx=x-p->leftoffset;
     buffer = (byte*)bufferofs+ylookup[y-p->topoffset];
-
-#ifdef DOS
-    for (plane=startx; plane<startx+4; plane++)
-#endif
     {
-#ifdef DOS
-        b=buffer+(plane>>2);
-        VGAWRITEMAP(plane&3);
-#else
         b=buffer+startx;
-#endif
-
-#ifdef DOS
-        for (cnt = plane-startx; cnt < p->width; cnt+=4,b++)
-#else
         for (cnt = 0; cnt < p->width; cnt++,b++)
-#endif
             DrawNormalPost ((byte *)(p->collumnofs[cnt]+shape), b);
     }
 }
 
-#ifndef DOS
-
 void R_DrawColumn (byte * buf)
 {
     // This is *NOT* 100% correct - DDOI
@@ -1459,5 +1301,3 @@
         dest += iGLOBAL_SCREENWIDTH;
     }
 }
-
-#endif
--- a/rott/rt_sound.c
+++ b/rott/rt_sound.c
@@ -33,13 +33,7 @@
 #include "watcom.h"
 #include <stdio.h>
 #include <stdlib.h>
-
-#if PLATFORM_DOS
-#include <mem.h>
-#include <io.h>
-#elif PLATFORM_UNIX
 #include <unistd.h>
-#endif
 
 #include "rt_cfg.h"
 #include "isr.h"
@@ -66,18 +60,7 @@
 static int remotestart;
 static boolean SoundsRemapped = false;
 
-#ifdef DOS
 int musicnums[ 11 ] = {
-    -1, UltraSound, SoundBlaster, SoundMan16, ProAudioSpectrum,
-    Awe32, SoundScape, WaveBlaster, GenMidi, SoundCanvas, Adlib
-};
-
-int fxnums[ 11 ] = {
-    -1, UltraSound, SoundBlaster, SoundMan16, ProAudioSpectrum,
-    Awe32, SoundScape, Adlib, SoundSource, TandySoundSource, PC
-};
-#else
-int musicnums[ 11 ] = {
     -1, -1, -1, -1, -1, -1, SoundScape, -1, -1, -1, -1
 };
 
@@ -84,7 +67,6 @@
 int fxnums[ 11 ] = {
     -1, -1, -1, -1, -1, -1, SoundScape, -1, -1, -1, -1
 };
-#endif
 
 #if 0
 void MU_SetupGUSInitFile( void );
@@ -186,17 +168,6 @@
     card = fxnums[ FXMode ];
     if (card==-1) // Check if it is off
         return (0);
-#ifdef DOS
-    if ( ( card == SoundBlaster ) || ( card == Awe32 ) )
-    {
-        extern fx_blaster_config SBSettings;
-
-        status = FX_SetupSoundBlaster( SBSettings, numvoices,
-                                       numbits, numchannels );
-    }
-    else
-    {
-#endif
         status=FX_SetupCard( card, &device );
         if ( status == FX_Ok )
         {
@@ -204,9 +175,6 @@
             *numbits=device.MaxSampleBits;
             *numchannels=device.MaxChannels;
         }
-#ifdef DOS
-    }
-#endif
 
     return (status);
 }
@@ -240,29 +208,10 @@
 
     switch (card)
     {
-#ifdef DOS
-    case UltraSound:
-    case SoundBlaster:
-    case SoundMan16:
-    case ProAudioSpectrum:
-    case Awe32:
-    case SoundSource:
-    case TandySoundSource:
-#endif
     case SoundScape:
         soundstart=W_GetNumForName("digistrt")+1;
         soundtype=fx_digital;
         break;
-#ifdef DOS
-    case Adlib:
-        soundstart=W_GetNumForName("adstart")+1;
-        soundtype=fx_muse;
-        break;
-    case PC:
-        soundstart=W_GetNumForName("pcstart")+1;
-        soundtype=fx_muse;
-        break;
-#endif
     default:
         Error("FX: Unsupported Card number %d",FXMode);
         break;
@@ -299,12 +248,8 @@
         bits     = 8;
     }
 
-#ifdef DOS
-    status=FX_Init( card, voices, channels, bits, 11000 );
-#else
     status=FX_Init( card, voices, channels, bits, 11025 );
-#endif
-
+    
     if (status != FX_Ok)
     {
         if (bombonerror)
@@ -1053,31 +998,8 @@
     if (card==-1) // Check if it is off
         return (0);
 
-#ifdef DOS
-    if ( ( card == SoundBlaster ) || ( card == Awe32 ) || ( card == WaveBlaster ) )
-    {
-        if ( SD_Started == false )
-        {
-            extern fx_blaster_config SBSettings;
-            int numvoices;
-            int numbits;
-            int numchannels;
-
-            FX_SetupSoundBlaster( SBSettings, &numvoices,
-                                  &numbits, &numchannels );
-        }
-    }
-
-    if (card== UltraSound)
-    {
-        MU_SetupGUSInitFile();
-    }
-
-    status=MUSIC_Init( card, MidiAddress );
-#else
     /* Not DOS, no address config needed */
     status=MUSIC_Init( card, 0 );
-#endif
 
 
     if (status != MUSIC_Ok) {
@@ -1113,32 +1035,8 @@
     MU_Started=false;
 }
 
-#ifdef DOS
 //***************************************************************************
 //
-// MU_SetupGUSInitFile - initialize GUS stuff
-//
-//***************************************************************************
-
-void MU_SetupGUSInitFile( void )
-{
-    char filename[ 128 ];
-
-    GetPathFromEnvironment( filename, ApogeePath, GUSMIDIINIFILE );
-    if (access (filename, F_OK) != 0)
-    {
-        int lump;
-
-        lump=W_GetNumForName("gusmidi");
-
-        SaveFile (filename, W_CacheLumpNum(lump,PU_CACHE, CvtNull, 1), W_LumpLength(lump));
-    }
-}
-
-#endif
-
-//***************************************************************************
-//
 // MU_GetNumForType - returns number of song in rottsongs of specific type
 //
 //***************************************************************************
@@ -1185,17 +1083,10 @@
 
     currentsong=W_CacheLumpNum(lump,PU_STATIC, CvtNull, 1);
 
-#ifdef PLATFORM_DOS
     if (rottsongs[num].loopflag == loop_yes)
-        MUSIC_PlaySong(currentsong,size,MUSIC_LoopSong);
-    else
-        MUSIC_PlaySong(currentsong,size,MUSIC_PlayOnce);
-#else
-    if (rottsongs[num].loopflag == loop_yes)
         MUSIC_PlaySongROTT(currentsong,size,MUSIC_LoopSong);
     else
         MUSIC_PlaySongROTT(currentsong,size,MUSIC_PlayOnce);
-#endif
 
     MU_SetVolume (MUvolume);
 }
--- a/rott/rt_stat.c
+++ b/rott/rt_stat.c
@@ -19,12 +19,6 @@
 */
 
 #include "rt_def.h"
-
-#ifdef DOS
-#include <malloc.h>
-#include <dos.h>
-#endif
-
 #include <string.h>
 #include "sprites.h"
 #include <stdio.h>
--- a/rott/rt_str.c
+++ b/rott/rt_str.c
@@ -110,11 +110,7 @@
                     if ((y>=0) && (y<iGLOBAL_SCREENHEIGHT))
                     {
                         if (*source>0)
-#ifdef DOS
-                            *((byte *)(bufferofs+ylookup[y]+(x>>2))) = *source;
-#else
                             *((byte *)(bufferofs+ylookup[y]+x)) = *source;
-#endif
                     }
                     source++;
                     y++;
@@ -172,59 +168,12 @@
 
 void VW_DrawPropString (const char *string)
 {
-#ifdef DOS
     byte  pix;
     int   width,step,height,ht;
     byte  *source, *dest, *origdest;
     int   ch,mask;
 
-
     ht = CurrentFont->height;
-    dest = origdest = (byte *)(bufferofs+ylookup[py]+(px>>2));
-
-
-    mask = 1<<(px&3);
-
-
-    while ((ch = *string++)!=0)
-    {
-        ch -= 31;
-        width = step = CurrentFont->width[ch];
-        source = ((byte *)CurrentFont)+CurrentFont->charofs[ch];
-        while (width--)
-        {
-            VGAMAPMASK(mask);
-
-            height = ht;
-            while (height--)
-            {
-                pix = *source;
-                if (pix)
-                    *dest = pix;
-
-                source++;
-                dest += linewidth;
-            }
-
-            px++;
-            mask <<= 1;
-            if (mask == 16)
-            {
-                mask = 1;
-                origdest++;
-            }
-            dest = origdest;
-        }
-    }
-    bufferheight = ht;
-    bufferwidth = ((dest+1)-origdest)*4;
-#else
-    byte  pix;
-    int   width,step,height,ht;
-    byte  *source, *dest, *origdest;
-    int   ch,mask;
-
-    ht = CurrentFont->height;
     dest = origdest = (byte *)(bufferofs+ylookup[py]+px);
 
     while ((ch = (unsigned char)*string++)!=0)
@@ -252,7 +201,6 @@
     }
     bufferheight = ht;
     bufferwidth = ((dest+1)-origdest);
-#endif
 }
 
 
@@ -292,11 +240,7 @@
 
 
     ht = CurrentFont->height;
-#ifdef DOS
-    dest = origdest = (byte *)(bufferofs+ylookup[py]+(px>>2));
-#else
     dest = origdest = (byte *)(bufferofs+ylookup[py]+px);
-#endif
 
 
     mask = 1<<(px&3);
@@ -323,25 +267,12 @@
             }
 
             px++;
-#ifdef DOS
-            mask <<= 1;
-            if (mask == 16)
-            {
-                mask = 1;
-                origdest++;
-            }
-#else
             origdest++;
-#endif
             dest = origdest;
         }
     }
     bufferheight = ht;
-#ifdef DOS
-    bufferwidth = ((dest+1)-origdest)*4;
-#else
     bufferwidth = ((dest+1)-origdest);
-#endif
 
 }
 
@@ -1844,36 +1775,36 @@
     }
     if ( type == SINGLE_FRAME )
     {
-        DrawRottText( x1, y1, '�', foreground, background );
-        DrawRottText( x2, y1, '�', foreground, background );
-        DrawRottText( x1, y2, '�', foreground, background );
-        DrawRottText( x2, y2, '�', foreground, background );
+        DrawRottText( x1, y1, '�', foreground, background );
+        DrawRottText( x2, y1, '�', foreground, background );
+        DrawRottText( x1, y2, '�', foreground, background );
+        DrawRottText( x2, y2, '�', foreground, background );
         for( x = x1 + 1; x < x2; x++ )
         {
-            DrawRottText( x, y1, '�', foreground, background );
-            DrawRottText( x, y2, '�', foreground, background );
+            DrawRottText( x, y1, '�', foreground, background );
+            DrawRottText( x, y2, '�', foreground, background );
         }
         for( y = y1 + 1; y < y2; y++ )
         {
-            DrawRottText( x1, y, '�', foreground, background );
-            DrawRottText( x2, y, '�', foreground, background );
+            DrawRottText( x1, y, '�', foreground, background );
+            DrawRottText( x2, y, '�', foreground, background );
         }
     }
     if ( type == DOUBLE_FRAME )
     {
-        DrawRottText( x1, y1, '�', foreground, background );
-        DrawRottText( x2, y1, '�', foreground, background );
-        DrawRottText( x1, y2, '�', foreground, background );
-        DrawRottText( x2, y2, '�', foreground, background );
+        DrawRottText( x1, y1, '�', foreground, background );
+        DrawRottText( x2, y1, '�', foreground, background );
+        DrawRottText( x1, y2, '�', foreground, background );
+        DrawRottText( x2, y2, '�', foreground, background );
         for( x = x1 + 1; x < x2; x++ )
         {
-            DrawRottText( x, y1, '�', foreground, background );
-            DrawRottText( x, y2, '�', foreground, background );
+            DrawRottText( x, y1, '�', foreground, background );
+            DrawRottText( x, y2, '�', foreground, background );
         }
         for( y = y1 + 1; y < y2; y++ )
         {
-            DrawRottText( x1, y, '�', foreground, background );
-            DrawRottText( x2, y, '�', foreground, background );
+            DrawRottText( x1, y, '�', foreground, background );
+            DrawRottText( x2, y, '�', foreground, background );
         }
     }
 }
--- a/rott/rt_swift.c
+++ b/rott/rt_swift.c
@@ -30,11 +30,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-
-#ifdef DOS
-#include <dos.h>
-#endif
-
 #include "rt_def.h"
 #include "rt_swift.h"
 #include "_rt_swft.h"
--- a/rott/rt_ted.c
+++ b/rott/rt_ted.c
@@ -25,15 +25,7 @@
 #include <string.h>
 #include <stdlib.h>
 #include <time.h>
-
-#ifdef DOS
-#include <io.h>
-#include <conio.h>
-#include <dos.h>
-#else
 #include <errno.h>
-#endif
-
 #include "states.h"
 #include "watcom.h"
 #include "rt_ted.h"
--- a/rott/rt_util.c
+++ b/rott/rt_util.c
@@ -20,13 +20,7 @@
 
 #include "rt_def.h"
 
-#ifdef DOS
-#include <malloc.h>
-#include <dos.h>
-#include <conio.h>
-#include <io.h>
-#include <direct.h>
-#elif USE_SDL
+#if USE_SDL
 #include "SDL2/SDL.h"
 #endif
 
@@ -339,36 +333,11 @@
 
 
     SetTextMode ();
-#ifdef DOS
-    memcpy ((byte *)0xB8000, &ROTT_ERR, 160*7);
-#elif defined (ANSIESC)
+#if defined (ANSIESC)
     DisplayTextSplash (&ROTT_ERR, 7);
 #endif
     memset (msgbuf, 0, 300);
 
-#ifdef DOS
-    px = ERRORVERSIONCOL-1;
-    py = ERRORVERSIONROW;
-#if (SHAREWARE == 1)
-    UL_printf ("S");
-#else
-    UL_printf ("R");
-#endif
-
-    px = ERRORVERSIONCOL;
-    py = ERRORVERSIONROW;
-#if (BETA == 1)
-    UL_printf ("�");
-#else
-    UL_printf (itoa(ROTTMAJORVERSION,&buf[0],10));
-#endif
-
-    // Skip the dot
-    px++;
-
-    UL_printf (itoa(ROTTMINORVERSION,&buf[0],10));
-#endif
-
     va_start (argptr, error);
     vsprintf (&msgbuf[0], error, argptr);
     va_end (argptr);
@@ -423,28 +392,6 @@
     ShutDown();	// DDOI - moved this so that it doesn't try to access player
     // which is freed by this function.
 
-#ifdef DOS
-    GetPathFromEnvironment( filename, ApogeePath, ERRORFILE );
-    handle=SafeOpenAppend ( filename );
-    for (y=0; y<16; y++)
-    {
-        for (x=0; x<160; x+=2)
-            SafeWrite(handle,(byte *)0xB8000+(y*160)+x,1);
-        i=10;
-        SafeWrite(handle,&i,1);
-        i=13;
-        SafeWrite(handle,&i,1);
-    }
-
-    close(handle);
-
-    if ( SOUNDSETUP )
-    {
-        getch();
-    }
-
-#endif
-
 #if USE_SDL
     SDL_Quit();
 #endif
@@ -1018,14 +965,8 @@
 
 void GetPathFromEnvironment( char *fullname, const char *envname, const char *filename )
 {
-
-#ifdef DOS
-    char *path;
-    path = getenv( envname );
-#else
     const char *path;
     path = envname;
-#endif
 
     if ( path != NULL )
     {
@@ -1243,13 +1184,6 @@
 
 void GetaPalette (byte *palette)
 {
-#ifdef DOS
-    int	i;
-
-    OUTP (PEL_READ_ADR,0);
-    for (i=0 ; i<768 ; i++)
-        palette[i] = inp (PEL_DATA)<<2;
-#else
     int i;
     SDL_Palette *pal = sdl_surface->format->palette;
 
@@ -1260,7 +1194,6 @@
 
         palette += 3;
     }
-#endif
 }
 
 /*
@@ -1275,13 +1208,6 @@
 
 void SetaPalette (byte *pal)
 {
-#ifdef DOS
-    int	i;
-
-    OUTP (PEL_WRITE_ADR,0);
-    for (i=0 ; i<768 ; i++)
-        OUTP (PEL_DATA, pal[i]>>2);
-#else
     SDL_Color cmap[256];
     int i;
 
@@ -1294,19 +1220,11 @@
 
     SDL_SetPaletteColors(sdl_surface->format->palette, cmap, 0, 256);
     //SDL_SetColors (SDL_GetWindowSurface(window), cmap, 0, 256);
-#endif
 }
 
 void GetPalette(char * palette)
 {
-#ifdef DOS
     int i;
-
-    OUTP(0x03c7,0);
-    for (i=0; i<256*3; i++)
-        *(palette+(unsigned char)i)=inp(0x3c9)<<2;
-#else
-    int i;
     SDL_Palette *pal = sdl_surface->format->palette;
 
     for (i = 0; i < 256; i++) {
@@ -1316,7 +1234,6 @@
 
         palette += 3;
     }
-#endif
 }
 
 void SetPalette ( char * pal )
@@ -1387,17 +1304,6 @@
 
 void VL_FillPalette (int red, int green, int blue)
 {
-#ifdef DOS
-    int   i;
-
-    OUTP (PEL_WRITE_ADR,0);
-    for (i=0; i<256; i++)
-    {
-        OUTP (PEL_DATA,red);
-        OUTP (PEL_DATA,green);
-        OUTP (PEL_DATA,blue);
-    }
-#else
     SDL_Color cmap[256];
     int i;
 
@@ -1411,7 +1317,6 @@
     //SDL_SetColors (SDL_GetVideoSurface (), cmap, 0, 256);
     SDL_SetPaletteColors(sdl_surface->format->palette, cmap, 0, 256);
     
-#endif
 }
 
 //===========================================================================
@@ -1426,14 +1331,7 @@
 
 void VL_SetColor  (int color, int red, int green, int blue)
 {
-#ifdef DOS
-    OUTP (PEL_WRITE_ADR,color);
-    OUTP (PEL_DATA,red);
-    OUTP (PEL_DATA,green);
-    OUTP (PEL_DATA,blue);
-#else
     STUB_FUNCTION;
-#endif
 }
 
 //===========================================================================
@@ -1448,14 +1346,7 @@
 
 void VL_GetColor  (int color, int *red, int *green, int *blue)
 {
-#ifdef DOS
-    OUTP (PEL_READ_ADR,color);
-    *red   = inp (PEL_DATA);
-    *green = inp (PEL_DATA);
-    *blue  = inp (PEL_DATA);
-#else
     STUB_FUNCTION;
-#endif
 }
 
 //===========================================================================
@@ -1490,16 +1381,6 @@
 
 void VL_SetPalette (byte *palette)
 {
-#ifdef DOS
-    int   i;
-
-    OUTP (PEL_WRITE_ADR, 0);
-
-    for (i = 0; i < 768; i++)
-    {
-        OUTP (PEL_DATA, gammatable[(gammaindex<<6)+(*palette++)]);
-    }
-#else
     SDL_Color cmap[256];
     int i;
 
@@ -1512,8 +1393,7 @@
 
     //SDL_SetColors (SDL_GetWindowSurface(window), cmap, 0, 256);
     SDL_SetPaletteColors(sdl_surface->format->palette, cmap, 0, 256);
-    
-#endif
+
 }
 
 
@@ -1532,14 +1412,6 @@
 
 void VL_GetPalette (byte *palette)
 {
-#ifdef DOS
-    int   i;
-
-    OUTP (PEL_READ_ADR, 0);
-
-    for (i = 0; i < 768; i++)
-        *palette++ = inp (PEL_DATA);
-#else
     int i;
     SDL_Palette *pal = sdl_surface->format->palette;
     //SDL_Palette *pal = SDL_GetVideoSurface()->format->palette;
@@ -1551,7 +1423,6 @@
 
         palette += 3;
     }
-#endif
 }
 
 
@@ -1565,42 +1436,7 @@
 
 void UL_DisplayMemoryError ( int memneeded )
 {
-#ifdef DOS
-    char buf[4000];
-    int i;
-
-    ShutDown ();
-    TextMode ();
-
-    for (i = 0; i < 19; i++)
-        printf ("\n");
-
-    memcpy (buf, &ROTT_ERR, 4000);
-    memcpy ((byte *)0xB8000, &buf[160*7], 4000-(160*7));
-
-    px = ERRORVERSIONCOL;
-    py = ERRORVERSIONROW;
-#if (BETA == 1)
-    UL_printf ("�");
-#else
-    UL_printf (itoa(ROTTMAJORVERSION,&buf[0],10));
-#endif
-    px++;
-
-    UL_printf (itoa(ROTTMINORVERSION,&buf[0],10));
-
-    px = LOWMEMORYCOL;
-    py = LOWMEMORYROW;
-    UL_printf ("You need ");
-    UL_printf (itoa(memneeded,&buf[0],10));
-    UL_printf (" bytes more memory");
-    if ( SOUNDSETUP )
-    {
-        getch();
-    }
-#else
     STUB_FUNCTION;
-#endif
     exit (0);
 }
 
@@ -1615,30 +1451,11 @@
 
 void UL_printf (byte *str)
 {
-#ifdef DOS
-    byte *s;
-    byte *screen;
-
-    s = str;
-    screen = (byte *)(0xB8000 + (py*160) + (px<<1));
-
-    while (*s)
-    {
-        *screen = *s;
-        s++;
-        screen += 2;
-        px++;
-
-        if ((*s < 32) && (*s > 0))
-            s++;
-    }
-#else
 #ifdef ANSIESC
     printf ("\x1b[%d;%dH%s",py,px,str);
 #else
     printf ("%s ",str);	// Hackish but works - DDOI
 #endif
-#endif
 }
 
 /*
@@ -1651,28 +1468,14 @@
 
 void UL_ColorBox (int x, int y, int w, int h, int color)
 {
-#ifdef DOS
-    byte *screen;
+#if defined (ANSIESC)
     int i,j;
 
 
     for (j=0; j<h; j++)
     {
-        screen = (byte *)(0xB8000 + ((y+j)*160) + (x<<1) + 1);
         for (i=0; i<w; i++)
         {
-            *screen = (byte)color;
-            screen+=2;
-        }
-    }
-#elif defined (ANSIESC)
-    int i,j;
-
-
-    for (j=0; j<h; j++)
-    {
-        for (i=0; i<w; i++)
-        {
             printf ("\x1b[%d;%dH",y+j,x+i);
             put_dos2ansi(color);
         }
@@ -1823,42 +1626,6 @@
 
 boolean UL_ChangeDirectory (char *path)
 {
-#ifdef DOS
-    char *p;
-    char dir[9];
-    char *d;
-
-    d = &dir[0];
-    p = path;
-    memset (dir, 0, 9);
-
-    // Check for a drive at the beginning of the path
-    if (*(p+1) == ':')
-    {
-        *d++ = *p++;      // drive letter
-        *d++ = *p++;      // colon
-
-        if (UL_ChangeDrive (dir) == false)
-            return (false);
-    }
-
-    if (*p == SLASHES)
-    {
-        chdir ("\\");
-        p++;
-    }
-
-    d = &dir[0];
-    while (*p)
-    {
-        p = UL_GetPath (p, d);
-
-        if (chdir (d) == -1)
-            return (false);
-    }
-
-    return (true);
-#else
     if (!path || !*path) {
         return true;
     }
@@ -1868,7 +1635,6 @@
     }
 
     return true;
-#endif
 }
 
 
@@ -1891,25 +1657,9 @@
 
 boolean UL_ChangeDrive (char *drive)
 {
-#ifdef DOS
-    unsigned d, total, tempd;
-
-    d = toupper (*drive);
-
-    d = d - 'A' + 1;
-
-    _dos_setdrive (d, &total);
-    _dos_getdrive (&tempd);
-
-    if (d != tempd)
-        return (false);
-
-    return (true);
-#else
     STUB_FUNCTION;
 
     return false;
-#endif
 }
 
 
--- a/rott/rt_vid.c
+++ b/rott/rt_vid.c
@@ -20,12 +20,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-
-#ifdef DOS
-#include <dos.h>
-#include <conio.h>
-#endif
-
 #include "rt_def.h"
 #include "rt_vid.h"
 #include "_rt_vid.h"
@@ -84,33 +78,6 @@
 
 void VL_MemToScreen (byte *source, int width, int height, int x, int y)
 {
-#ifdef DOS
-    byte *screen, *dest, mask;
-    int  plane;
-
-    dest = (byte *)(bufferofs+ylookup[y]+(x>>2));
-//   dest = (byte *)(displayofs+ylookup[y]+(x>>2));
-    mask = 1 << (x&3);
-
-
-    for (plane = 0; plane<4; plane++)
-    {
-        VGAMAPMASK (mask);
-
-        screen = dest;
-        for (y = 0; y < height; y++, screen += linewidth, source+=width)
-            memcpy (screen, source, width);
-
-
-        mask <<= 1;
-
-        if (mask == 16)
-        {
-            mask = 1;
-            dest++;
-        }
-    }
-#else
     /* TODO please optimize me */
 
     byte *ptr, *destline;
@@ -129,7 +96,6 @@
             }
         }
     }
-#endif
 }
 // bna function start
 void VL_MemToScreenClipped (byte *source, int width, int height, int x, int y);
@@ -220,18 +186,11 @@
     int    HeightIndex;
     int    WidthIndex;
 
-#ifdef DOS
-    start = ( byte * )( bufferofs + ( x>>2 ) + ylookup[ y ] );
-#else
     start = ( byte * )( bufferofs +  x + ylookup[ y ] );
-#endif
 
     source       = &tile->data;
     sourcewidth  = tile->width;
     sourceheight = tile->height;
-#ifdef DOS
-    offx >>= 2;
-#endif
     if ( offx >= sourcewidth )
     {
         offx %= sourcewidth;
@@ -244,21 +203,12 @@
     startoffset = offy * sourcewidth;
     planesize = sourcewidth * sourceheight;
 
-#ifdef DOS
-    width >>= 2;
-
-    mask  = 1 << ( x & 3 );
-#endif
     plane = 4;
     while( plane > 0 )
     {
         VGAMAPMASK( mask );
 
-#ifdef DOS
-        origdest = start;
-#else
         origdest = start+(4-plane);
-#endif
 
         sourcey     = offy;
         sourceoff   = source + startoffset;
@@ -272,11 +222,7 @@
             while( WidthIndex-- )
             {
                 *dest = sourceoff[ sourcex ];
-#ifdef DOS
-                dest++;
-#else
                 dest += 4;
-#endif
 
                 sourcex++;
                 if ( sourcex >= sourcewidth )
@@ -284,12 +230,7 @@
                     sourcex = 0;
                 }
             }
-
-#ifdef DOS
-            origdest  += iGLOBAL_SCREENBWIDE;
-#else
             origdest += iGLOBAL_SCREENWIDTH;
-#endif
 
             sourceoff += sourcewidth;
             sourcey++;
@@ -302,14 +243,6 @@
 
         source += planesize;
 
-#ifdef DOS
-        mask <<= 1;
-        if ( mask > 8 )
-        {
-            mask = 1;
-        }
-#endif
-
         plane--;
     }
 }
@@ -338,48 +271,6 @@
 
 void VL_Bar (int x, int y, int width, int height, int color)
 {
-#ifdef DOS
-    byte  *dest;
-    byte  leftmask,rightmask;
-    int   midbytes,linedelta;
-
-    leftmask = leftmasks[x&3];
-    rightmask = rightmasks[(x+width-1)&3];
-    midbytes = ((x+width+3)>>2) - (x>>2) - 2;
-    linedelta = linewidth-(midbytes+1);
-
-    dest = (byte *)(bufferofs+ylookup[y]+(x>>2));
-
-    if (midbytes < 0)
-    {
-        // all in one byte
-        VGAMAPMASK (leftmask&rightmask);
-        while (height--)
-        {
-            *dest = color;
-            dest += linewidth;
-        }
-        VGAMAPMASK (15);
-        return;
-    }
-
-    while (height--)
-    {
-        VGAMAPMASK (leftmask);
-        *dest++ = color;
-
-        VGAMAPMASK (15);
-        memset (dest,color,midbytes);
-        dest += midbytes;
-
-        VGAMAPMASK (rightmask);
-        *dest = color;
-
-        dest += linedelta;
-    }
-
-    VGAMAPMASK(15);
-#else
     byte *dest = (byte *)(bufferofs+ylookup[y]+x);
 
     while (height--) {
@@ -387,7 +278,6 @@
 
         dest += linewidth;
     }
-#endif
 }
 
 
@@ -414,50 +304,6 @@
 
 void VL_TBar (int x, int y, int width, int height)
 {
-#ifdef DOS
-    byte  *dest;
-    byte  pixel;
-    byte  readmask;
-    byte  writemask;
-    int   w = width;
-
-    while (height--)
-    {
-        width = w;
-
-        dest = (byte*)(bufferofs+ylookup[y]+(x>>2));
-        readmask    = (x&3);
-        writemask   = 1 << readmask;
-
-        VGAREADMAP (readmask);
-        VGAMAPMASK (writemask);
-
-        while (width--)
-        {
-            pixel = *dest;
-
-            pixel = *(colormap+(27<<8)+pixel);
-
-            *dest = pixel;
-
-            writemask <<= 1;
-            if (writemask == 16)
-            {
-                writemask = 1;
-                dest++;
-            }
-
-            readmask++;
-            if (readmask == 4)
-                readmask = 0;
-
-            VGAREADMAP (readmask);
-            VGAMAPMASK (writemask);
-        }
-
-        y++;
-    }
-#else
     int w = width;
 
     while (height--) {
@@ -477,8 +323,6 @@
 
         y++;
     }
-
-#endif
 }
 
 
@@ -504,45 +348,9 @@
 
 void VL_Hlin (unsigned x, unsigned y, unsigned width, unsigned color)
 {
-#ifdef DOS
-    unsigned xbyte;
-    byte     *dest;
-    byte     leftmask,
-             rightmask;
-    int      midbytes;
-
-    xbyte =      x >> 2;
-    leftmask    = leftmasks[x&3];
-    rightmask   = rightmasks[(x+width-1)&3];
-    midbytes    = ((x+width+3)>>2) - xbyte - 2;
-
-    dest = (byte*)(bufferofs+ylookup[y]+xbyte);
-
-    if (midbytes<0)
-    {
-        // all in one byte
-        VGAMAPMASK (leftmask & rightmask);
-        *dest = color;
-        VGAMAPMASK(15);
-        return;
-    }
-
-    VGAMAPMASK (leftmask);
-    *dest++ = color;
-
-    VGAMAPMASK (15);
-    memset (dest, color, midbytes);
-    dest += midbytes;
-
-    VGAMAPMASK (rightmask);
-    *dest = color;
-
-    VGAMAPMASK (15);
-#else
     byte *dest = (byte*)(bufferofs+ylookup[y]+x);
 
     memset(dest, color, width);
-#endif
 }
 
 
@@ -554,23 +362,6 @@
 
 void VL_Vlin (int x, int y, int height, int color)
 {
-#ifdef DOS
-    byte  *dest,
-          mask;
-
-    mask = pixmasks[x&3];
-    VGAMAPMASK (mask);
-
-    dest = (byte *)(bufferofs+ylookup[y]+(x>>2));
-
-    while (height--)
-    {
-        *dest = color;
-        dest += linewidth;
-    }
-
-    VGAMAPMASK (15);
-#else
     byte *dest = (byte*)(bufferofs+ylookup[y]+x);
 
     while (height--) {
@@ -578,7 +369,6 @@
 
         dest += linewidth;
     }
-#endif
 }
 
 
@@ -619,47 +409,6 @@
 
 void VL_THlin (unsigned x, unsigned y, unsigned width, boolean up)
 {
-#ifdef DOS
-    byte     *dest;
-    byte     pixel;
-    byte     readmask;
-    byte     writemask;
-
-
-    readmask    = (x&3);
-    writemask   = 1 << readmask;
-
-    dest = (byte*)(bufferofs+ylookup[y]+(x>>2));
-
-    VGAREADMAP (readmask);
-    VGAMAPMASK (writemask);
-
-    while (width--)
-    {
-        pixel = *dest;
-
-        if (up)
-            pixel = *(colormap+(13<<8)+pixel);
-        else
-            pixel = *(colormap+(27<<8)+pixel);
-
-        *dest = pixel;
-
-        writemask <<= 1;
-        if (writemask == 16)
-        {
-            writemask = 1;
-            dest++;
-        }
-
-        readmask++;
-        if (readmask == 4)
-            readmask = 0;
-
-        VGAREADMAP (readmask);
-        VGAMAPMASK (writemask);
-    }
-#else
     byte *dest = (byte*)(bufferofs+ylookup[y]+x);
 
     while (width--) {
@@ -675,7 +424,6 @@
 
         dest++;
     }
-#endif
 }
 
 
@@ -688,36 +436,6 @@
 
 void VL_TVlin (unsigned x, unsigned y, unsigned height, boolean up)
 {
-#ifdef DOS
-    byte     *dest;
-    byte     pixel;
-    byte     readmask;
-    byte     writemask;
-
-
-
-    readmask    = (x&3);
-    writemask   = 1 << readmask;
-
-    dest = (byte*)(bufferofs+ylookup[y]+(x>>2));
-
-    VGAREADMAP (readmask);
-    VGAMAPMASK (writemask);
-
-    while (height--)
-    {
-        pixel = *dest;
-
-        if (up)
-            pixel = *(colormap+(13<<8)+pixel);
-        else
-            pixel = *(colormap+(27<<8)+pixel);
-
-        *dest = pixel;
-
-        dest += linewidth;
-    }
-#else
     byte *dest = (byte*)(bufferofs+ylookup[y]+x);
 
     while (height--) {
@@ -733,7 +451,6 @@
 
         dest += linewidth;
     }
-#endif
 }
 
 
@@ -1260,12 +977,6 @@
         }
     }
     // bna section end
-
-#ifdef DOS
-    inp  (STATUS_REGISTER_1);
-    outp (ATR_INDEX,0x31);
-    outp (ATR_INDEX,color);
-#endif
 }
 
 //****************************************************************************
@@ -1276,15 +987,7 @@
 
 void SetBorderColorInterrupt (int color)
 {
-#ifdef DOS
-    union REGS regs;
-
-    regs.w.ax = 0x1001;
-    regs.w.bx = color<<8;
-    int386(0x10,&regs,&regs);
-#else
     STUB_FUNCTION;
-#endif
 }
 
 
@@ -1346,12 +1049,7 @@
     y1<<=16;
     while (count>0)
     {
-#ifdef DOS
-        VGAWRITEMAP((x1>>16)&3);
-        *((byte *)bufferofs+(x1>>18)+(ylookup[y1>>16]))=color;
-#else
         *((byte *)bufferofs+(x1>>16)+(ylookup[y1>>16]))=color;
-#endif
         x1+=xinc;
         y1+=yinc;
         count--;
@@ -1381,11 +1079,7 @@
     if ((y<0) || ((y+p->height)>=200))
         Error ("DrawXYPic: y is out of range\n");
 
-#ifdef DOS
-    buffer = (byte*)bufferofs+(x>>2)+ylookup[y];
-#else
     buffer = (byte*)bufferofs+ylookup[y];
-#endif
 
     src=(byte *)&p->data;
 
@@ -1396,11 +1090,7 @@
         {
             buf=buffer+ylookup[yy];
             for (xx = 0; xx < p->width; xx++,buf++)
-#ifdef DOS
-                *(buf)=*(src++);
-#else
                 *(buf+plane+xx*4)=*(src++);
-#endif
         }
     }
 }
--- a/rott/rt_view.c
+++ b/rott/rt_view.c
@@ -33,10 +33,6 @@
 #include "modexlib.h"
 #include "rt_menu.h"
 
-#ifdef DOS
-#include <mem.h>
-#endif
-
 #include <stdlib.h>
 
 #include "rt_main.h"
@@ -106,30 +102,7 @@
     109
 };
 
-#ifdef DOS
-byte    mapmasks1[4][9] = {
-    {1,3,7,15,15,15,15,15,15},
-    {2,6,14,14,14,14,14,14,14},
-    {4,12,12,12,12,12,12,12,12},
-    {8,8,8,8,8,8,8,8,8}
-};
 
-byte    mapmasks2[4][9] = {
-    {0,0,0,0,1,3,7,15,15},
-    {0,0,0,1,3,7,15,15,15},
-    {0,0,1,3,7,15,15,15,15},
-    {0,1,3,7,15,15,15,15,15}
-};
-
-byte    mapmasks3[4][9] = {
-    {0,0,0,0,0,0,0,0,1},
-    {0,0,0,0,0,0,0,1,3},
-    {0,0,0,0,0,0,1,3,7},
-    {0,0,0,0,0,1,3,7,15}
-};
-#endif
-
-
 /*
 =============================================================================
 
@@ -684,11 +657,7 @@
     }
 
     // Calculate offset of view window
-#ifdef DOS
-    screenofs = ( screenx >> 2 ) + ylookup[ screeny ];
-#else
     screenofs = screenx + ylookup[ screeny ];
-#endif
 
 //
 // calculate trace angles and projection constants
--- a/rott/scriplib.c
+++ b/rott/scriplib.c
@@ -18,12 +18,6 @@
 
 */
 // scriplib.c
-
-#ifdef DOS
-#include <io.h>
-#include <dos.h>
-#endif
-
 #include <fcntl.h>
 #include <string.h>
 
--- a/rott/w_wad.c
+++ b/rott/w_wad.c
@@ -23,13 +23,6 @@
 #include <string.h>
 #include <fcntl.h>
 #include <sys/stat.h>
-
-#if PLATFORM_DOS
-#include <malloc.h>
-#include <conio.h>
-#include <io.h>
-#endif
-
 #include "rt_def.h"
 #include "rt_util.h"
 #include "_w_wad.h"
--- a/rott/z_zone.c
+++ b/rott/z_zone.c
@@ -23,11 +23,6 @@
 #include <stdlib.h>
 #include <string.h>
 
-#ifdef DOS
-#include <dos.h>
-#include <conio.h>
-#endif
-
 #include "rt_def.h"
 #include "_z_zone.h"
 #include "z_zone.h"
@@ -752,22 +747,7 @@
 
 int Z_AvailHeap ( void )
 {
-#ifdef DOS
-    union REGS zregs;
-    struct SREGS zsregs;
-
-
-    zregs.x.eax = 0x00000500;
-    memset( &zsregs, 0, sizeof(zsregs) );
-    zsregs.es = FP_SEG( &MemInfo );
-    zregs.x.edi = FP_OFF( &MemInfo );
-
-    int386x( DPMI_INT, &zregs, &zregs, &zsregs );
-
-    return ((int)MemInfo.LargestBlockAvail);
-#else
     return MAXMEMORYSIZE;
-#endif
 }
 
 /*