shithub: duke3d

Download patch

ref: f768d1838bb6ad7b646505861bcfe340339af93e
parent: 09ba7616f3ba9bf367aab25731191b96678ea492
author: unknown <fabien@fabien-PC.(none)>
date: Thu Dec 13 16:45:09 EST 2012

Removed Physic filesystem and DOS support

--- a/Engine/src/a.h
+++ b/Engine/src/a.h
@@ -58,9 +58,9 @@
 int32_t slopevlin(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
 int32_t settransnormal(void);
 int32_t settransreverse(void);
-int32_t setupdrawslab(int32_t,int32_t);
-int32_t drawslab(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
-int32_t stretchhline(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
+
+
+
 int32_t is_vmware_running(void);
 
     
--- a/Engine/src/build.h
+++ b/Engine/src/build.h
@@ -311,7 +311,7 @@
 			you call the loadboard function.
 ***************************************************************************/
 
-#define PORTSIG  "Port by Ryan C. Gordon, Andrew Henderson, Dan Olson, and a cast of thousands."
+#define PORTSIG  "Port by Ryan C. Gordon, Andrew Henderson, Dan Olson, Fabien Sanglard and a cast of thousands."
 
 
 //FCS: In order to see how the engine renders different part of the screen you can set the following macros
@@ -330,7 +330,7 @@
 //END VISUALIZE RENDERER
 
 //Global.c
-void Error (int errorType, uint8_t  *error, ...);
+void Error (int errorType, char  *error, ...);
 int FindDistance2D(int ix, int iy);
 
 #endif  /* defined _INCLUDE_BUILD_H_ */
--- a/Engine/src/cache1d.c
+++ b/Engine/src/cache1d.c
@@ -23,12 +23,7 @@
 #include "../../Game/src/cvar_defs.h"
 
 #include "types.h"
-//#include "file_lib.H"
 
-#if (defined USE_PHYSICSFS)
-#include "physfs.h"
-#endif
-
 /*
  *   This module keeps track of a standard linear cacheing system.
  *   To use this module, here's all you need to do:
@@ -228,7 +223,7 @@
 	Error(EXIT_FAILURE, "");
 }
 
-#if (!defined USE_PHYSICSFS)
+
 uint8_t  toupperlookup[256] =
 {
 	0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,
@@ -268,46 +263,10 @@
 	-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
 };
 
-#else
-static PHYSFS_file *filehan[MAXOPENFILES] =
-{
-	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-};
-#endif
 
 
 int32_t initgroupfile(const uint8_t  *filename)
 {
-#if (defined USE_PHYSICSFS)
-    static int initted_physfs = 0;
-    static int added_cwd = 0;
-
-    if (!initted_physfs)
-    {
-        if (!PHYSFS_init(_argv[0]))
-            return(-1);
-        initted_physfs = 1;
-    } /* if */
-
-    if (!added_cwd)
-    {
-        if (!PHYSFS_addToSearchPath(".", 0))
-            return(-1);
-        added_cwd = 1;
-    } /* if */
-
-    if (!PHYSFS_addToSearchPath(filename, 1))
-        return(-1);
-
-    return(1); /* uhh...? */
-#else
 	uint8_t  buf[16];
 	int32_t i, j, k;
 
@@ -333,7 +292,7 @@
 			return(-1);
 		}
 
-		//The ".grp" file format is just a collection of a lot of files stored into 1 big one. 
+		//FCS: The ".grp" file format is just a collection of a lot of files stored into 1 big one. 
 		//I tried to make the format as simple as possible: The first 12 bytes contains my name, 
 		//"KenSilverman". The next 4 bytes is the number of files that were compacted into the 
 		//group file. Then for each file, there is a 16 byte structure, where the first 12 
@@ -384,15 +343,11 @@
 
 	numgroupfiles++;
 	return(groupfil[numgroupfiles-1]);
-#endif
+
 }
 
 void uninitgroupfile(void)
 {
-#if (defined USE_PHYSICSFS)
-    PHYSFS_deinit();
-    memset(filehan, '\0', sizeof (filehan));
-#else
 	int32_t i;
 
 	for(i=numgroupfiles-1;i>=0;i--)
@@ -403,77 +358,9 @@
 			close(groupfil[i]);
 			groupfil[i] = -1;
 		}
-#endif
+
 }
 
-#if (defined USE_PHYSICSFS)
-static int locateOneElement(uint8_t  *buf)
-{
-    uint8_t  *ptr;
-    uint8_t  **rc;
-    uint8_t  **i;
-
-    if (PHYSFS_exists(buf))
-        return(1);  /* quick rejection: exists in current case. */
-
-    ptr = strrchr(buf, '/');  /* find entry at end of path. */
-    if (ptr == NULL)
-    {
-        rc = PHYSFS_enumerateFiles("/");
-        ptr = buf;
-    } /* if */
-    else
-    {
-        *ptr = '\0';
-        rc = PHYSFS_enumerateFiles(buf);
-        *ptr = '/';
-        ptr++;  /* point past dirsep to entry itself. */
-    } /* else */
-
-    for (i = rc; *i != NULL; i++)
-    {
-        if (stricmp(*i, ptr) == 0)
-        {
-            strcpy(ptr, *i); /* found a match. Overwrite with this case. */
-            PHYSFS_freeList(rc);
-            return(1);
-        } /* if */
-    } /* for */
-
-    /* no match at all... */
-    PHYSFS_freeList(rc);
-    return(0);
-} /* locateOneElement */
-
-
-int PHYSFSEXT_locateCorrectCase(uint8_t  *buf)
-{
-    int rc;
-    uint8_t  *ptr;
-    uint8_t  *prevptr;
-
-    while (*buf == '/')  /* skip any '/' at start of string... */
-        buf++;
-
-    ptr = prevptr = buf;
-    if (*ptr == '\0')
-        return(0);  /* Uh...I guess that's success. */
-
-    while ((ptr = strchr(ptr + 1, '/')) != NULL)
-    {
-        *ptr = '\0';  /* block this path section off */
-        rc = locateOneElement(buf);
-        *ptr = '/'; /* restore path separator */
-        if (!rc)
-            return(-2);  /* missing element in path. */
-    } /* while */
-
-    /* check final element... */
-    return(locateOneElement(buf) ? 0 : -1);
-} /* PHYSFSEXT_locateCorrectCase */
-#endif
-
-
 void crc32_table_gen(unsigned int* crc32_table) /* build CRC32 table */
 {
     unsigned int crc, poly;
@@ -557,31 +444,6 @@
 
 int32_t kopen4load(const char  *filename, int readfromGRP)
 { // FIX_00072: all files are now 1st searched in Duke's root folder and then in the GRP.
-#if (defined USE_PHYSICSFS)
-    int i;
-    PHYSFS_file *rc;
-    uint8_t  _filename[64];
-
-    assert(strlen(filename) < sizeof (_filename));
-    strcpy(_filename, filename);
-    PHYSFSEXT_locateCorrectCase(_filename);
-
-    rc = PHYSFS_openRead(_filename);
-    if (rc == NULL)
-        return(-1);
-
-    for (i = 0; i < MAXOPENFILES; i++)
-    {
-        if (filehan[i] == NULL)
-        {
-            filehan[i] = rc;
-            return(i);
-        }
-    }
-
-    PHYSFS_close(rc);  /* oh well. */
-    return(-1);
-#else
 	int32_t i, j, k, fil, newhandle;
 	uint8_t  bad;
 	uint8_t  *gfileptr;
@@ -631,15 +493,11 @@
 		}
 	}
 	return(-1);
-#endif
+
 }
 
 int32_t kread(int32_t handle, void *buffer, int32_t leng)
 {
-#if (defined USE_PHYSICSFS)
-    return(PHYSFS_read(filehan[handle], buffer, 1, leng));
-return(leng);
-#else
 	int32_t i, filenum, groupnum;
 
 	filenum = filehan[handle];
@@ -666,7 +524,7 @@
 	}
 
 	return(0);
-#endif
+
 }
 
 int kread16(int32_t handle, short *buffer)
@@ -697,20 +555,6 @@
 
 int32_t klseek(int32_t handle, int32_t offset, int32_t whence)
 {
-#if (defined USE_PHYSICSFS)
-    if (whence == SEEK_END)  /* !!! FIXME: You can try PHYSFS_filelength(). */
-    {
-		Error(EXIT_FAILURE, "Unsupported seek semantic!\n");
-    } /* if */
-
-    if (whence == SEEK_CUR)
-        offset += PHYSFS_tell(filehan[handle]);
-
-    if (!PHYSFS_seek(filehan[handle], offset))
-        return(-1);
-
-    return(offset);
-#else
 	int32_t i, groupnum;
 
 	groupnum = filegrp[handle];
@@ -729,7 +573,7 @@
 		return(filepos[handle]);
 	}
 	return(-1);
-#endif
+
 }
 
 #ifdef __APPLE__
@@ -743,9 +587,6 @@
 
 int32_t kfilelength(int32_t handle)
 {
-#if (defined USE_PHYSICSFS)
-    return(PHYSFS_fileLength(filehan[handle]));
-#else
 	int32_t i, groupnum;
 
 	groupnum = filegrp[handle];
@@ -752,22 +593,15 @@
 	if (groupnum == 255) return(filelength(filehan[handle]));
 	i = filehan[handle];
 	return(gfileoffs[groupnum][i+1]-gfileoffs[groupnum][i]);
-#endif
+
 }
 
 void kclose(int32_t handle)
 {
-#if (defined USE_PHYSICSFS)
-    if (filehan[handle] != NULL)
-    {
-        PHYSFS_close(filehan[handle]);
-        filehan[handle] = NULL;
-    } /* if */
-#else
 	if (handle < 0) return;
 	if (filegrp[handle] == 255) close(filehan[handle]);
 	filehan[handle] = -1;
-#endif
+
 }
 
 
--- a/Engine/src/engine.c
+++ b/Engine/src/engine.c
@@ -54,54 +54,6 @@
 #define MAXWALLSB 2048
 #define MAXCLIPDIST 1024
 
-#ifdef PLATFORM_DOS
-	/* MUST CALL MALLOC THIS WAY TO FORCE CALLS TO KMALLOC! */
-void *kmalloc(size_t size) { return(malloc(size)); }
-void *kkmalloc(size_t size);
-#pragma aux kkmalloc =\
-	"call kmalloc",\
-	parm [eax]\
-
-	/* MUST CALL FREE THIS WAY TO FORCE CALLS TO KFREE! */
-void kfree(void *buffer) { free(buffer); }
-void kkfree(void *buffer);
-#pragma aux kkfree =\
-	"call kfree",\
-	parm [eax]\
-
-#endif
-
-#ifdef SUPERBUILD
-	/* MUST CALL LOADVOXEL THIS WAY BECAUSE WATCOM STINKS! */
-
-/* !!! wtf does this do?! --ryan. */
-static void loadvoxel(int32_t voxindex)
-{
-    voxindex = 0;  /* prevent compiler whining. */
-}
-
-#if ((defined __WATCOMC__) && (defined PLATFORM_DOS))
-void kloadvoxel(int32_t voxindex);
-#pragma aux kloadvoxel =\
-	"call loadvoxel",\
-	parm [eax]\
-
-#else
-#define kloadvoxel(a) (loadvoxel(a))
-#endif
-
-	/* These variables need to be copied into BUILD */
-#define MAXXSIZ 128
-#define MAXYSIZ 128
-#define MAXZSIZ 200
-#define MAXVOXELS 512
-#define MAXVOXMIPS 5
-int32_t voxoff[MAXVOXELS][MAXVOXMIPS], voxlock[MAXVOXELS][MAXVOXMIPS];
-static int32_t ggxinc[MAXXSIZ+1], ggyinc[MAXXSIZ+1];
-static int32_t lowrecip[1024], nytooclose, nytoofar;
-static uint32_t  distrecip[16384];
-#endif
-
 /* used to be static. --ryan. */
 uint8_t  moustat = 0;
 
@@ -151,7 +103,7 @@
 };
 int32_t reciptable[2048], fpuasm;
 
-uint8_t  kensmessage[128];
+char  kensmessage[128];
 
 
 
@@ -274,7 +226,7 @@
 int32_t searchx = -1, searchy;                     /* search input  */
 short searchsector, searchwall, searchstat;     /* search output */
 
-static uint8_t  artfilename[20];
+static char  artfilename[20];
 static int32_t numtilefiles, artfil = -1, artfilnum, artfilplc;
 
 static uint8_t  inpreparemirror = 0;
@@ -2567,7 +2519,7 @@
 	faketimerhandler();
 }
 
-int loadboard(uint8_t  *filename, int32_t *daposx, int32_t *daposy,
+int loadboard(char  *filename, int32_t *daposx, int32_t *daposy,
               int32_t *daposz, short *daang, short *dacursectnum)
 {
     int x;
@@ -3665,7 +3617,7 @@
 }
 
 
-int loadpics(uint8_t  *filename, uint8_t * gamedir)
+int loadpics(char  *filename, char * gamedir)
 {
 	int32_t offscount, localtilestart, localtileend, dasiz;
 	short fil, i, j, k;
@@ -3691,24 +3643,7 @@
 		artfilename[6] = ((k/10)%10)+48;
 		artfilename[5] = ((k/100)%10)+48;
 
-		/*
-		// Are we loading a TC?
-		if(gamedir[0] != 0)
-		{
-			// Yes
-			sprintf(fullpathartfilename, "%s\\%s", gamedir, artfilename);
-			if(!SafeFileExists(fullpathartfilename))
-			{
-				// If this isn't in the TC's game root, then just load it as normal
-				sprintf(fullpathartfilename, "%s", artfilename);
-			}
-		}
-		else
-		{
-			// No
-			sprintf(fullpathartfilename, "%s", artfilename);
-		}
-		*/
+	
 
 		if ((fil = TCkopen4load(artfilename,0)) != -1)
 		{
@@ -3777,35 +3712,8 @@
 	return(0);
 }
 
-#ifdef SUPERBUILD
-void qloadkvx(int32_t voxindex, uint8_t  *filename)
-{
-	int32_t i, fil, dasiz, lengcnt, lengtot;
-	uint8_t  *ptr;
 
-	if ((fil = kopen4load(filename,0)) == -1) return;
 
-	lengcnt = 0;
-	lengtot = kfilelength(fil);
-
-	for(i=0;i<MAXVOXMIPS;i++)
-	{
-		kread32(fil,&dasiz);
-
-			/* Must store filenames to use cacheing system :( */
-		voxlock[voxindex][i] = 200;
-		allocache(&voxoff[voxindex][i],dasiz,(uint8_t  *)&voxlock[voxindex][i]);
-		ptr = (uint8_t  *)voxoff[voxindex][i];
-		kread(fil,ptr,dasiz);
-
-		lengcnt += dasiz+4;
-		if (lengcnt >= lengtot-768) break;
-	}
-	kclose(fil);
-}
-#endif
-
-
 int clipinsidebox(int32_t x, int32_t y, short wallnum, int32_t walldist)
 {
 	walltype *wal;
@@ -4948,125 +4856,7 @@
 			/* Draw it! */
 		ceilspritescan(lx,rx-1);
 	}
-#ifdef SUPERBUILD
-	else if ((cstat&48) == 48)
-	{
-		lx = 0; rx = xdim-1;
-		for(x=lx;x<=rx;x++)
-		{
-			lwall[x] = (long)startumost[x+windowx1]-windowy1;
-			swall[x] = (long)startdmost[x+windowx1]-windowy1;
-		}
-		for(i=smostwallcnt-1;i>=0;i--)
-		{
-			j = smostwall[i];
-			if ((xb1[j] > rx) || (xb2[j] < lx)) continue;
-			if ((yp <= yb1[j]) && (yp <= yb2[j])) continue;
-			if (spritewallfront(tspr,(long)thewall[j]) && ((yp <= yb1[j]) || (yp <= yb2[j]))) continue;
 
-			dalx2 = max(xb1[j],lx); darx2 = min(xb2[j],rx);
-
-			switch(smostwalltype[i])
-			{
-				case 0:
-					if (dalx2 <= darx2)
-					{
-						if ((dalx2 == lx) && (darx2 == rx)) return;
-							clearbufbyte(&swall[dalx2],(darx2-dalx2+1)*sizeof(swall[0]),0L);
-					}
-					break;
-				case 1:
-					k = smoststart[i] - xb1[j];
-					for(x=dalx2;x<=darx2;x++)
-						if (smost[k+x] > lwall[x]) lwall[x] = smost[k+x];
-					break;
-				case 2:
-					k = smoststart[i] - xb1[j];
-					for(x=dalx2;x<=darx2;x++)
-						if (smost[k+x] < swall[x]) swall[x] = smost[k+x];
-					break;
-			}
-		}
-
-		if (lwall[rx] >= swall[rx])
-		{
-			for(x=lx;x<rx;x++)
-				if (lwall[x] < swall[x]) break;
-			if (x == rx) return;
-		}
-
-		for(i=0;i<MAXVOXMIPS;i++)
-			if (!voxoff[tilenum][i])
-			{
-				kloadvoxel(tilenum);
-				break;
-			}
-
-		longptr = (int32_t *)voxoff[tilenum][0];
-		//if (!(cstat&128)) tspr->z -= mulscale6(longptr[5],(long)tspr->yrepeat);
-		if (!(cstat&128))
-        {
-#pragma message ("[Crashbug: commenting out for now]")
-			// crashes 2nd demo of atomic, when pig jumps in hole.
-            tspr->z -= mulscale6(longptr[5],(long)tspr->yrepeat);
-        }
-		yoff = (long)((int8_t  )((picanm[sprite[tspr->owner].picnum]>>16)&255))+((long)tspr->yoffset);
-		tspr->z -= ((yoff*tspr->yrepeat)<<2);
-
-		globvis = globalvisibility;
-		if (sec->visibility != 0) globvis = mulscale4(globvis,(long)((uint8_t )(sec->visibility+16)));
-
-		if ((searchit >= 1) && (yp > (4<<8)) && (searchy >= lwall[searchx]) && (searchy < swall[searchx]))
-		{
-			siz = divscale19(xdimenscale,yp);
-
-			xv = mulscale16(((long)tspr->xrepeat)<<16,xyaspect);
-
-			xspan = ((longptr[0]+longptr[1])>>1);
-			yspan = longptr[2];
-			xsiz = mulscale30(siz,xv*xspan);
-			ysiz = mulscale14(siz,tspr->yrepeat*yspan);
-
-				/* Watch out for divscale overflow */
-			if (((xspan>>11) < xsiz) && (yspan < (ysiz>>1)))
-			{
-				x1 = xb-(xsiz>>1);
-				if (xspan&1) x1 += mulscale31(siz,xv);  /* Odd xspans */
-				i = mulscale30(siz,xv*xoff);
-				if ((cstat&4) == 0) x1 -= i; else x1 += i;
-
-				y1 = mulscale16(tspr->z-globalposz,siz);
-				/*y1 -= mulscale14(siz,tspr->yrepeat*yoff);*/
-				y1 += (globalhoriz<<8)-ysiz;
-				/*if (cstat&128)  //Already fixed up above */
-				y1 += (ysiz>>1);
-
-				x2 = x1+xsiz-1;
-				y2 = y1+ysiz-1;
-				if (((y1|255) < (y2|255)) && (searchx >= (x1>>8)+1) && (searchx <= (x2>>8)))
-				{
-					if ((sec->ceilingstat&3) == 0)
-						startum = globalhoriz+mulscale24(siz,sec->ceilingz-globalposz)-1;
-					else
-						startum = 0;
-					if ((sec->floorstat&3) == 0)
-						startdm = globalhoriz+mulscale24(siz,sec->floorz-globalposz)+1;
-					else
-						startdm = 0x7fffffff;
-
-						/* sprite */
-					if ((searchy >= max(startum,(y1>>8))) && (searchy < min(startdm,(y2>>8))))
-					{
-						searchsector = sectnum; searchwall = spritenum;
-						searchstat = 3; searchit = 1;
-					}
-				}
-			}
-		}
-
-		drawvox(tspr->x,tspr->y,tspr->z,(long)tspr->ang+1536,(long)tspr->xrepeat,(long)tspr->yrepeat,tilenum,tspr->shade,tspr->pal,lwall,swall);
-	}
-#endif
 	if (automapping == 1) show2dsprite[spritenum>>3] |= pow2char[spritenum&7];
 }
 
@@ -5154,23 +4944,6 @@
 		i = j;
 	}
 
-	/*for(i=spritesortcnt-1;i>=0;i--)
-	{
-		xs = tspriteptr[i].x-globalposx;
-		ys = tspriteptr[i].y-globalposy;
-		zs = tspriteptr[i].z-globalposz;
-
-		xp = ys*cosglobalang-xs*singlobalang;
-		yp = (zs<<1);
-		zp = xs*cosglobalang+ys*singlobalang;
-
-		xs = scale(xp,halfxdimen<<12,zp)+((halfxdimen+windowx1)<<12);
-		ys = scale(yp,xdimenscale<<12,zp)+((globalhoriz+windowy1)<<12);
-
-		drawline256(xs-65536,ys-65536,xs+65536,ys+65536,31);
-		drawline256(xs+65536,ys-65536,xs-65536,ys+65536,31);
-	}*/
-
 	while ((spritesortcnt > 0) && (maskwallcnt > 0))  /* While BOTH > 0 */
 	{
 		j = maskwall[maskwallcnt-1];
@@ -6431,43 +6204,6 @@
 		clipsectcnt = 0; clipsectnum = 1;
 		do
 		{
-
-#if 0
-			/*Push FACE sprites */
-			for(i=headspritesect[clipsectorlist[clipsectcnt]];i>=0;i=nextspritesect[i])
-			{
-				spr = &sprite[i];
-				if (((spr->cstat&48) != 0) && ((spr->cstat&48) != 48)) continue;
-				if ((spr->cstat&dasprclipmask) == 0) continue;
-
-				dax = (*x)-spr->x; day = (*y)-spr->y;
-				t = (spr->clipdist<<2)+walldist;
-				if ((klabs(dax) < t) && (klabs(day) < t))
-				{
-					t = ((tilesizy[spr->picnum]*spr->yrepeat)<<2);
-					if (spr->cstat&128) daz = spr->z+(t>>1); else daz = spr->z;
-					if (picanm[spr->picnum]&0x00ff0000) daz -= ((long)((int8_t  )((picanm[spr->picnum]>>16)&255))*spr->yrepeat<<2);
-					if (((*z) < daz+ceildist) && ((*z) > daz-t-flordist))
-					{
-						t = (spr->clipdist<<2)+walldist;
-
-						j = getangle(dax,day);
-						dx = (sintable[(j+512)&2047]>>11);
-						dy = (sintable[(j)&2047]>>11);
-						bad2 = 16;
-						do
-						{
-							*x = (*x) + dx; *y = (*y) + dy;
-							bad2--; if (bad2 == 0) break;
-						} while ((klabs((*x)-spr->x) < t) && (klabs((*y)-spr->y) < t));
-						bad = -1;
-						k--; if (k <= 0) return(bad);
-						updatesector(*x,*y,sectnum);
-					}
-				}
-			}
-#endif
-
 			sec = &sector[clipsectorlist[clipsectcnt]];
 			if (dir > 0)
 				startwall = sec->wallptr, endwall = startwall + sec->wallnum;
@@ -6772,11 +6508,8 @@
 							col += ((numframes&2)<<2);
 					}
 
-#ifdef PLATFORM_DOS
-					tempint = (mul5(200+yp1)<<7)+(320+xp1)+pageoffset;
-#else
+
 					tempint = (mul5(200+yp1)<<7)+(320+xp1);
-#endif
 
 					setcolor16((long)col);
 
@@ -6826,11 +6559,9 @@
 					if (((320+xp1) >= 2) && ((320+xp1) <= 637))
 						if (((200+yp1) >= 2) && ((200+yp1) <= ydim16-3))
 						{
-#ifdef PLATFORM_DOS
-							tempint = (mul5(200+yp1)<<7)+(320+xp1)+pageoffset;
-#else
+
 							tempint = (mul5(200+yp1)<<7)+(320+xp1);
-#endif
+
 
 							setcolor16((long)col);
 							drawpixel16(tempint-1-1280);
--- a/Engine/src/engine.h
+++ b/Engine/src/engine.h
@@ -58,7 +58,7 @@
 void nextpage(void);
 void drawrooms(int32_t daposx, int32_t daposy, int32_t daposz,
                short daang, int32_t dahoriz, short dacursectnum);
-int loadboard(uint8_t  *filename, int32_t *daposx, int32_t *daposy,
+int loadboard(char  *filename, int32_t *daposx, int32_t *daposy,
 			  int32_t *daposz, short *daang, short *dacursectnum);
 void drawmasks(void);
 void printext256(int32_t xpos, int32_t ypos, short col, short backcol,
@@ -67,13 +67,13 @@
 			uint8_t  name[82], uint8_t  fontsize);
 void initengine(void);
 void uninitengine(void);
-int loadpics(uint8_t  *filename, uint8_t * gamedir);
+int loadpics(char  *filename, char * gamedir);
 int saveboard(uint8_t  *filename, int32_t *daposx, int32_t *daposy, int32_t *daposz,
                          short *daang, short *dacursectnum);
 void plotpixel(int32_t x, int32_t y, uint8_t  col);
 uint8_t  getpixel(int32_t x, int32_t y);
 void setbrightness(uint8_t  dabrightness, uint8_t  *dapal);
-int screencapture(uint8_t  *filename, uint8_t  inverseit);
+int screencapture(char  *filename, uint8_t  inverseit);
 void getmousevalues(short *mousx, short *mousy, short *bstatus);
 int clipmove (int32_t *x, int32_t *y, int32_t *z, short *sectnum, int32_t xvect,
 			int32_t yvect, int32_t walldist, int32_t ceildist,
--- a/Engine/src/engine_protos.h
+++ b/Engine/src/engine_protos.h
@@ -51,7 +51,7 @@
 extern void unprotect_ASM_pages(void);
 extern void _platform_init(int argc, char  **argv, const char  *title, const char  *icon);
 extern int setvesa(int32_t x, int32_t y);
-extern int screencapture(uint8_t  *filename, uint8_t  inverseit);
+extern int screencapture(char  *filename, uint8_t  inverseit);
 extern void setvmode(int mode);
 extern int _setgamemode(uint8_t  davidoption, int32_t daxdim, int32_t daydim);
 extern void getvalidvesamodes(void);
@@ -123,7 +123,7 @@
 //extern static __inline int32_t getclipmask(int32_t a, int32_t b, int32_t c, int32_t d);
 extern int wallfront(int32_t l1, int32_t l2);
 extern void drawrooms(int32_t daposx, int32_t daposy, int32_t daposz, short daang, int32_t dahoriz, short dacursectnum);
-extern int loadboard(uint8_t  *filename, int32_t *daposx, int32_t *daposy, int32_t *daposz, short *daang, short *dacursectnum);
+extern int loadboard(char  *filename, int32_t *daposx, int32_t *daposy, int32_t *daposz, short *daang, short *dacursectnum);
 extern int saveboard(uint8_t  *filename, int32_t *daposx, int32_t *daposy, int32_t *daposz, short *daang, short *dacursectnum);
 extern int setgamemode(uint8_t  davidoption, int32_t daxdim, int32_t daydim);
 extern void setmmxoverlay(int isenabled);
@@ -133,7 +133,7 @@
 extern void nextpage(void);
 extern void loadtile(short tilenume);
 extern int allocatepermanenttile(short tilenume, int32_t xsiz, int32_t ysiz);
-extern int loadpics(uint8_t  *filename, uint8_t * gamedir);
+extern int loadpics(char  *filename, char * gamedir);
 extern void qloadkvx(int32_t voxindex, uint8_t  *filename);
 extern int clipinsidebox(int32_t x, int32_t y, short wallnum, int32_t walldist);
 extern void drawline256(int32_t x1, int32_t y1, int32_t x2, int32_t y2, uint8_t  col);
--- a/Engine/src/sdl_driver.c
+++ b/Engine/src/sdl_driver.c
@@ -1373,7 +1373,7 @@
 
 
 // Capture BMP of the current frame
-int screencapture(uint8_t  *filename, uint8_t  inverseit)
+int screencapture(char  *filename, uint8_t  inverseit)
 {
 //  FIX_00006: better naming system for screenshots + message when pic is taken. 
 //  Use ./screenshots folder. Screenshot code rerwritten. Faster and
--- a/Game/src/audiolib/fx_man.c
+++ b/Game/src/audiolib/fx_man.c
@@ -33,15 +33,8 @@
 #include "sndcards.h"
 #include "multivoc.h"
 
-#ifdef PLAT_DOS
-#include "blaster.h"
-#include "pas16.h"
-#include "sndscape.h"
-#include "guswave.h"
-#include "sndsrc.h"
-#else
+
 #include "dsl.h"
-#endif
 
 #include "ll_man.h"
 #include "user.h"
--- a/Game/src/audiolib/multivoc.c
+++ b/Game/src/audiolib/multivoc.c
@@ -450,17 +450,8 @@
 	VoiceNode *voice;
 	VoiceNode *next;
 	char      *buffer;
+
 	
-#ifdef PLAT_DOS
-	if ( MV_DMAChannel >= 0 )
-	{
-		// Get the currently playing buffer
-		buffer = ( char * )DMA_GetCurrentPos( MV_DMAChannel );
-		MV_MixPage   = ( unsigned )( buffer - MV_MixBuffer[ 0 ] );
-		MV_MixPage >>= MV_BuffShift;
-	}
-#endif
-	
 	// Toggle which buffer we'll mix next
 	MV_MixPage++;
 	if ( MV_MixPage >= MV_NumberOfBuffers )
@@ -532,37 +523,6 @@
 			
 	}
 }
-
-#ifdef PLAT_DOS
-int leftpage  = -1;
-int rightpage = -1;
-
-void MV_ServiceGus( char **ptr, unsigned long *length )
-   {
-   if ( leftpage == MV_MixPage )
-      {
-      MV_ServiceVoc();
-      }
-
-   leftpage = MV_MixPage;
-
-   *ptr = MV_MixBuffer[ MV_MixPage ];
-   *length = MV_BufferSize;
-   }
-
-void MV_ServiceRightGus( char **ptr, unsigned long *length )
-   {
-   if ( rightpage == MV_MixPage )
-      {
-      MV_ServiceVoc();
-      }
-
-   rightpage = MV_MixPage;
-
-   *ptr = MV_MixBuffer[ MV_MixPage ] + MV_RightChannelOffset;
-   *length = MV_BufferSize;
-   }
-#endif
 
 /*---------------------------------------------------------------------
    Function: MV_GetNextVOCBlock
--- a/Game/src/audiolib/user.c
+++ b/Game/src/audiolib/user.c
@@ -28,10 +28,6 @@
    (c) Copyright 1994 James R. Dose.  All Rights Reserved.
 **********************************************************************/
 
-#ifdef PLAT_DOS
-#include <dos.h>
-#endif
-
 #include <string.h>
 #include "user.h"
 
@@ -100,34 +96,5 @@
    )
 
    {
-#ifdef PLAT_DOS
-   int i;
-   char *text;
-   char *ptr;
-
-   text = NULL;
-   i = 1;
-   while( i < _argc )
-      {
-      ptr = _argv[ i ];
-
-      // Only check parameters preceded by - or /
-      if ( ( *ptr == '-' ) || ( *ptr == '/' ) )
-         {
-         ptr++;
-         if ( stricmp( parameter, ptr ) == 0 )
-            {
-            i++;
-            text = _argv[ i ];
-            break;
-            }
-         }
-
-      i++;
-      }
-
-   return( text );
-#else
    return NULL;
-#endif
    }
--- a/Game/src/duke3d.h
+++ b/Game/src/duke3d.h
@@ -434,7 +434,7 @@
 typedef struct
 {
 	unsigned int crc32;
-	uint8_t * name;
+	char * name;
 	uint32_t size;
 } crc32_t;
 
--- a/Game/src/global.c
+++ b/Game/src/global.c
@@ -494,7 +494,7 @@
    return (ix - (ix>>4) + (t>>2) + (t>>3));
 }
 #include "SDL.h"
-void Error (int errorType, uint8_t  *error, ...)
+void Error (int errorType, char  *error, ...)
 {
    va_list argptr;
 
--- a/Game/src/midi/win_midiout.cpp
+++ b/Game/src/midi/win_midiout.cpp
@@ -1164,9 +1164,6 @@
 // Duke3D-specific.  --ryan.
 void PlayMusic(char  *fn)
 {
-	//extern int File_Exists(uint8_t  *fn);
-	//extern void GetOnlyNameOfFile(uint8_t  *fn);
-
 	short      fp;
     int32_t        l;
 	char  *cfn;
--- a/Game/src/util_lib.h
+++ b/Game/src/util_lib.h
@@ -50,7 +50,7 @@
 extern  uint8_t  **  _argv;
 
 void RegisterShutdownFunction( void (* shutdown) (void) );
-void   Error (int errorType, uint8_t  *error, ...);
+void   Error (int errorType, char  *error, ...);
 
 uint8_t    CheckParm (uint8_t  *check);