diff -Naurd ../nethack-3.3.1/sys/msdos/old/exesmurf.c ./sys/msdos/old/exesmurf.c
--- ../nethack-3.3.1/sys/msdos/old/exesmurf.c Sat Apr 4 03:22:46 1998
+++ ./sys/msdos/old/exesmurf.c Thu Jan 1 01:00:00 1970
@@ -1,384 +0,0 @@
-/*	SCCS Id: @(#)exesmurf.c	 3.1	 91/01/29			  */
-/* Copyright (c) Pierre Martineau and Stephen Spackman 1991, 1992, 1993.  */
-/* NetHack may be freely redistributed.  See license for details.	  */
-
-/******************************************************************************
-*                                                                             *
-*                         EXE header list and modify                          *
-*                                                                             *
-*                        by Pierre Martineau, 91/01/29                        *
-*                                                                             *
-*                                Version 1.2                                  *
-*                                                                             *
->*****************************************************************************<
-* Modified (stephen@estragon.uchicago.edu):                                   *
-* 1990oct23 sps Overlay splitter-outer first cut                              *
-*        31     Error handling; some #defines                                 *
-*     nov01     /l                                                            *
-*   91jan29     Changed default overlay file names to conform to ovlmgr 30a0  *
-******************************************************************************/
-
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <math.h>
-
-/** parameters ***************************************************************/
-#define MAXFILENAME 128   /* Probably overkill - theoretical limit is 80     */
-#define NPARTS	    36	  /* Maximum # of overlay files (excluding root .EXE)*/
-#define COPYBUFSIZE 32768 /* Fair sized buffer for file copy                 */
-#define BAKEXT      ".BAK"/* Extension for .exe backups                      */
-#define OVLEXT      ".OVL"/* Default extension for overlay files             */
-/* #define MANYZEROES */  /* Old style default: foo00001.ovl, not foo0.ovl   */
-/*****************************************************************************/
-
-#define BOOLEAN int
-#define TRUE    1
-#define FALSE   0
-
-int sstrccnt(register char const *s, register char c)
-  { int n = 0;
-
-    while (*s) if (*s++ == c) n++;
-    return n;
-  }
-
-FILE *wrkfile, *outfile;
-long min, max, stk;
-BOOLEAN listflg = FALSE;
-BOOLEAN verbose = FALSE;
-BOOLEAN minflg = FALSE;
-BOOLEAN maxflg = FALSE;
-BOOLEAN stkflg = FALSE;
-
-int column = 0;
-
-struct exehdr {
-unsigned signature;
-unsigned mod512;
-unsigned pages;
-unsigned relocitems;
-unsigned headerparas;
-unsigned minalloc;
-unsigned maxalloc;
-unsigned ss;
-unsigned sp;
-unsigned checksum;
-unsigned ip;
-unsigned cs;
-unsigned relocptr;
-unsigned ovlnum;
-} exehdr_area;
-
-main(argc, argv)
-int argc;
-char *argv[];
-{
-char *dot, *slash;
-char fname[MAXFILENAME], oname[MAXFILENAME], zname[MAXFILENAME];
-char *jname = NULL;
-char *args;
-int i;
-long offset, oldstk;
-unsigned nparts = 0, part = 0, partstart[NPARTS + 2];
-
-    printf("EXE list and modify V1.1s, by Pierre Martineau, 90/05/20.\n");
-    printf("This program may be freely distributed.\n");
-
-	if ((argc < 2) || (argc > NPARTS + 2)) {
-        usage();
-        return;
-    }
-
-/*  Process any remaining arguments  */
-
-    if (argc == 2) {
-        listflg = TRUE;
-        verbose = TRUE; /* ??? */
-    }
-    else {
-        i = 2;
-        while (argc-- > 2) {
-            args = argv[i];
-	    if ('0' <= args[0] && args[0] <= '9') { /* File split request */
-			if (nparts >= NPARTS) {
-			printf("\nToo many .OVL files requested (max. %d)\n", NPARTS);
-		    usage();
-		    return;
-		}
-		else if (!atoi(args)) {
-		    printf("\nCan't relocate the root overlay (#0)\n");
-		    usage();
-		    return;
-		}
-		else if (nparts && partstart[nparts - 1] >= atoi(args)) {
-		    printf("\nOverlay starts must be in ascending order\n");
-		    usage();
-		    return;
-		}
-		partstart[nparts++] = atoi(args);
-	    } else {
-		if ((args[0] != '-') && (args[0] != '/')) {
-		    printf("\nInvalid switch in paramater %s!\n", argv[i]);
-			usage();
-			return;
-		}
-		args++;
-		if (strnicmp(args, "min", 3) == 0) {
-		    args += 3;
-		    min = atol(args);
-		    minflg = TRUE;
-		}
-		else if (strnicmp(args, "max", 3) == 0) {
-		    args += 3;
-		    max = atol(args);
-		    maxflg = TRUE;
-		}
-		else if (strnicmp(args, "stk", 3) == 0) {
-		    args += 3;
-		    stk = atol(args);
-		    stkflg = TRUE;
-		}
-		else if (strnicmp(args, "v", 1) == 0) {
-		    listflg = TRUE;
-                    verbose = TRUE;
-                }
-                else if (strnicmp(args, "l", 1) == 0)
-                    listflg = TRUE;
-                else if (strnicmp(args, "p", 1) == 0) {
-                    args++;
-                    jname = args;
-                }
-		else {
-		    printf("\nInvalid paramater %s!\n", argv[i]);
-		    usage();
-		    return;
-		}
-            }
-            i++;
-        }
-    }
-
-/*  Extract filename from first argumemt  */
-
-    strcpy(fname, argv[1]);
-    dot = strrchr(fname, '.');
-    slash = strrchr(fname, '\\');
-    if ((dot == NULL) || (slash > dot))
-        strcat(fname, ".exe");
-
-    if (nparts) {
-	strcpy(oname,fname);
-	*strrchr(fname, '.') = '\0';
-	strcat(fname,BAKEXT);
-	if (!stricmp(oname,fname)) {
-	    printf(
-                "\nI refuse to split a file with extension "BAKEXT": %s\n",
-                oname
-            );
-	    return;
-	}
-        if (!jname || nparts > 1 && !sstrccnt(jname, '?')) {
-            char ext[5];
-            char *t;
-
-            if (!jname) {
-                strcpy(zname, oname);
-                *strrchr(zname, '.') = '\0';
-                strcpy(ext, OVLEXT);
-            } else {
-                if (strrchr(jname, '.') &&
-                     (!strrchr(jname, '\\') ||
-                         strrchr(jname, '.') > strrchr(jname, '\\')
-                     )
-                ) {
-                    strncpy(ext, strrchr(jname, '.'), sizeof(ext));
-                    ext[sizeof(ext) - 1] = '\0';
-                    strncpy(zname, jname, strrchr(jname, '.') - jname);
-                    zname[strrchr(jname, '.') - jname] = '\0';
-                } else {
-                    strcpy(zname, jname);
-                    strcpy(ext, OVLEXT);
-                }
-            }
-            t = strrchr(zname, '\\') ? strrchr(zname, '\\') + 1:
-                strrchr(zname, ':') ? strrchr(zname, ':') + 1:
-                zname;
-            if (strlen(t) >= 8)
-                t[7] = '\0';
-#if defined(MANYZEROES)
-	    while (strlen(t) < 8)
-#endif
-	      strcat(t, "?");
-            strcat(zname, ext);
-            jname = zname;
-        }
-	if (rename(oname,fname)) { /* This assumes oldname, newname.
-				      There's some confusion. OK for TC2.0 */
-	    printf("\nCouldn't rename (original) %s to %s\n", oname, fname);
-	    return;
-	}
-	if ((outfile = fopen(oname, "wb")) == NULL) {
-            printf("\nCouldn't create file %s\n",oname);
-            return;
-        }
-    }
-
-    if ((wrkfile = fopen(fname, "r+b")) == NULL) {
-        printf("\nCouldn't open file %s\n", fname);
-        return;
-    }
-
-    fread(&exehdr_area, sizeof (struct exehdr), 1, wrkfile);
-    if (exehdr_area.signature != 0x5a4d) {
-        printf("\nNot an EXE file!\n");
-        return;
-    }
-
-    while(!feof(wrkfile)) {
-        if (nparts) {
-	    if (exehdr_area.ovlnum == partstart[part]) {
-	         fclose(outfile);
-                 {
-                     int p = part + 1;
-                     strcpy(oname, jname);
-                     while (sstrccnt(oname, '?') > 1) {
-                         *strrchr(oname, '?') = '0' + p % 10;
-                         p /= 10;
-                     }
-                     *strchr(oname, '?') = (p > 9 ? 'a' - 10 : '0') + p;
-                 }
-                 part++;
-		 if ((outfile = fopen(oname, "wb")) == NULL) {
-                     printf("\nCan't open file %s\n", oname);
-                     return;
-                 }
-	    }
-            fwrite(&exehdr_area, sizeof (struct exehdr), 1, outfile);
-            if (ferror(outfile)) {
-                printf("\nWrite error while moving overlay header in %s\n", oname);
-                return;
-            }
-	}
-        if (listflg)
-            show_hdr();
-        else if (nparts)
-            printf("[overlay %d]\r", exehdr_area.ovlnum); /* Keep talking... */
-        if ((minflg || maxflg || stkflg) && (exehdr_area.ovlnum == 0) && (exehdr_area.signature == 0x5a4d)) {
-            if (minflg)
-                exehdr_area.minalloc = min;
-            if (maxflg)
-                exehdr_area.maxalloc = max;
-            if (stkflg) {
-                oldstk = exehdr_area.sp;
-                exehdr_area.sp = stk;
-                if (!minflg) {
-                    exehdr_area.minalloc += ((stk - oldstk) / 16);
-                    printf("\nAdjusting size of minalloc!\n");
-                }
-            }
-            fseek(nparts ? outfile : wrkfile, ftell(wrkfile) - sizeof (struct exehdr), SEEK_SET);
-            fwrite(&exehdr_area, sizeof (struct exehdr), 1, nparts ? outfile : wrkfile);
-            if (ferror(nparts ? outfile : wrkfile)) {
-                printf("Write error while trying to update header!\n");
-                fclose(nparts ? outfile : wrkfile);
-                return;
-            }
-        }
-        offset = exehdr_area.pages;
-        offset *= 512L;
-        offset -= sizeof(struct exehdr);
-        if (nparts) { /* Copy the stuff across */
-	    static char buffer[COPYBUFSIZE];
-	    while (offset > sizeof(buffer)) {
-	         fread(buffer, sizeof(buffer), 1, wrkfile);
-                 if (ferror(wrkfile)) {
-                     printf("\nRead error in overlay body\n");
-                     return;
-                 }
-		 fwrite(buffer, sizeof(buffer), 1, outfile);
-                 if (ferror(outfile)) {
-                     printf("\nWrite error moving overlay body, file %s\n", oname);
-                     return;
-                 }
-		 offset -= sizeof(buffer);
-	    }
-	    fread(buffer, (unsigned)offset, 1, wrkfile);
-            if (ferror(wrkfile)) {
-                printf("\nRead error in overlay body\n");
-                return;
-            }
-            fwrite(buffer, (unsigned)offset, 1, outfile);
-            if (ferror(outfile)) {
-                printf("\nWrite error moving overlay body, file %s\n", oname);
-                return;
-            }
-        } else fseek(wrkfile, offset, SEEK_CUR);
-        fread(&exehdr_area, sizeof (struct exehdr), 1, wrkfile);
-        if (ferror(wrkfile)) {
-            printf("Read error while trying to get a header!\n");
-            fclose(wrkfile);
-            return;
-        }
-    }
-    if (nparts) {
-        fclose(outfile);
-        if (!listflg) printf("                    \r");
-    }
-    fclose(wrkfile);
-    if (listflg && !verbose && column % 4) printf("\n");
-}
-
-show_hdr()
-{
-long lsize;
-
-    lsize = exehdr_area.pages;
-    if (exehdr_area.mod512 != 0)
-        lsize--;
-    lsize *= 512L;
-    lsize += exehdr_area.minalloc * 16;
-    lsize += exehdr_area.mod512;
-    lsize -= exehdr_area.headerparas * 16;
-
-    if (verbose) {
-        printf("\nOverlay: %d\n", exehdr_area.ovlnum);
-        printf("Size (512 byte pages)\t-%6x\t\t%6u\n", exehdr_area.pages, exehdr_area.pages);
-        printf("Remainder (last page)\t-%6x\t\t%6u\n", exehdr_area.mod512, exehdr_area.mod512);
-        printf("Header size (in paras)\t-%6x\t\t%6u\n", exehdr_area.headerparas, exehdr_area.headerparas);
-        printf("Minalloc (in paras)\t-%6x\t\t%6u\n", exehdr_area.minalloc, exehdr_area.minalloc);
-        printf("Maxalloc (in paras)\t-%6x\t\t%6u\n", exehdr_area.maxalloc, exehdr_area.maxalloc);
-        printf("Load size (in bytes)\t-%6lx\t\t%6lu\n", lsize, lsize);
-        printf("Relocation items\t-%6x\t\t%6u\n", exehdr_area.relocitems, exehdr_area.relocitems);
-        printf("Relocation table offset\t-%6x\t\t%6u\n", exehdr_area.relocptr, exehdr_area.relocptr);
-        printf("Checksum\t\t-%6x\t\t%6u\n", exehdr_area.checksum, exehdr_area.checksum);
-        printf("Initial CS:IP\t\t-  %04x:%04x\n", exehdr_area.cs, exehdr_area.ip);
-        printf("Initial SS:SP\t\t-  %04x:%04x\n", exehdr_area.ss, exehdr_area.sp);
-    } else {
-        if (!exehdr_area.ovlnum) {
-            printf("\nOverlay: %d\n", exehdr_area.ovlnum);
-            printf("Minalloc (in paras)\t-%6x\t\t%6u\n", exehdr_area.minalloc, exehdr_area.minalloc);
-            printf("Maxalloc (in paras)\t-%6x\t\t%6u\n", exehdr_area.maxalloc, exehdr_area.maxalloc);
-            printf("Stored size (in bytes)\t-%6lx\t\t%6lu\n", exehdr_area.pages * 512L, exehdr_area.pages * 512L);
-            printf("Load size (in bytes)\t-%6lx\t\t%6lu\n", lsize, lsize);
-            printf("Initial CS:IP, SS:SP\t-  %04x:%04x\t  %04x:%04x\n", exehdr_area.cs, exehdr_area.ip, exehdr_area.ss, exehdr_area.sp);
-	} else {
-	    static bis = 0;
-	    if (!bis++)
-                printf("\nOvl StrdSz LoadSz | Ovl StrdSz LoadSz | Ovl StrdSz LoadSz | Ovl StrdSz LoadSz\n");
-            printf("%3d:%6lu %6lu%s", exehdr_area.ovlnum, exehdr_area.pages * 512L, lsize, ++column % 4 ? " | " : "\n");
-        }
-    }
-}
-
-usage()
-{
-    printf("\nUsage: exesmurf exe_file [/l] [/v] [/min#####] [/max#####] [/stk#####]\n");
-    printf("                [n1 n2...nn] [/p????????.???]\n");
-    printf("       where: min   = minalloc\n");
-    printf("              max   = maxalloc\n");
-    printf("              stk   = stack size\n");
-    printf("              ##### = decimal number of paragraphs\n");
-    printf("              ni    = overlay starting each new .OVL file, n1 < n2 <...< nn\n");
-    printf("              p     = DOS filename, maybe with ?s, for overlay files.\n");
-}
diff -Naurd ../nethack-3.3.1/sys/msdos/old/exesmurf.doc ./sys/msdos/old/exesmurf.doc
--- ../nethack-3.3.1/sys/msdos/old/exesmurf.doc Sat Apr 4 03:22:47 1998
+++ ./sys/msdos/old/exesmurf.doc Thu Jan 1 01:00:00 1970
@@ -1,97 +0,0 @@
-	SCCS Id: @(#)exesmurf.doc	 3.1		91/01/29
-        Copyright (c) Pierre Martineau and Stephen Spackman 1991, 1992, 1993.
-        NetHack may be freely redistributed.  See license for details.
-		     ============================
-		     PC NetHack Support Utilities
-		     ============================
-		     Last revision: 1991January29
-
-This file contains documentation for the NetHack MS-DOS support
-utility EXESMURF.EXE.  This utility examines and modifies the load
-parameters of an .EXE file and can be used to split .OVL files off a
-monolithic overlaid executable using ovlmgr.
-
-EXESMURF
---------
-exesmurf FILENAME[.EXT] /v
-exesmurf FILENAME[.EXT] /minN
-exesmurf FILENAME[.EXT] /maxN
-exesmurf FILENAME[.EXT] /l
-exesmurf FILENAME[.EXT] N... [/pPATTERN]
-
-The programme exesmurf is basically a reimplementation of Microsoft's
-EXEMOD utility.  However, this incarnation is one that is
-"overlay-aware" (as they say).  It will provide the user with
-information about the executable and its overlays, and allow you to
-modify the executable's parameters and overlay locations.
-
-This program is made available for all users who were not graced with a
-release of EXEMOD in their Microsoft product, or who need the
-additional functionality it provides.
-
-/v.
-If exesmurf is invoked with a filename as argument, optionally
-followed by a /v, the filename's exeheader is listed for your viewing
-pleasure, along with the headers of any Microsoft-format overlays the
-file may contain.  The listing is verbose; if there are many overlays
-you will want to redirect the output.  Note that the redundancy in the
-output listing largely reflects redundancy in the file structure.
-
-/minN, /maxN, /stackN.
-Exesmurf may also be used to modify the "minalloc", "maxalloc" and
-"stack" allocation parameters of the executable file.  This can be
-accomplished with the /min, /max, and /stack flags respectively.  Any
-arguments to these flags should be *immediately* followed by a decimal
-number N.  Note that this is inconsistent with the arguments to EXEMOD
-which takes hex numbers, and *needs* a space between the flag and the
-number.
-
-/l.
-The /l option requests a version of the /v listing (see above) in
-which the information about overlays is very much compressed; only
-their decimal file and load sizes are given, in a multi-column format.
-The resulting display will generally fit on a single screen.  This
-turns out to be very useful when contemplating appropriate parameters
-for the overlay splitting operation described next.
-
-N... [/pPATTERN].
-The overlay-unpacking function of exesmurf is invoked by following the
-filename argument by a sequence of decimal numbers.  Each of these
-numbers is an overlay number at which a new external overlay file is
-to be started.  The main executable file will keep its old name after
-the overlays have been unloaded; the original input file will be
-retained, with its extension changed to .BAK.  By default, the output
-files will be derived from the input file name by appending a
-discriminating character (in sequence, 0, 1, ..., 9, a, b, ..., z) to
-the basename and changing the extension to .OVL; but if the basename
-is a full 8 characters long, the discriminating character will replace
-the last character instead.  This default is chosen for compatibility
-with ovlmgr.  The default may be overridden with the /p option, which
-specifies a file PATTERN - a file name, possibly complete with
-extension, containing one or more ? characters (* is not allowed),
-which will be replaced by discriminating characters.  If there is
-exactly one questionmark, it will be replaced by a digit or letter in
-the sequence described above, but if more than one questionmark
-appears a decimal numbering scheme is used instead.
-	Note that the numeric arguments are overlay numbers, not
-indices, and they indicate the starting overlays of files.  This
-permits us to manipulate files in which (for some reason) the overlays
-are not stored in ascending order, but it does mean that if a
-mentioned overlay does not exist in the original file, no new overlay
-file will be started.  This is a realistic risk, since the Microsoft
-linker does not seem to generate overlays at all if there is no actual
-code generated into the segments in question.
-	Note further that this operation can be reversed with the DOS
-copy/b operation, always supposing that it works as documented in your
-release of the operating system: the overlays are simply moved
-page-by-page to the external files.
-	No guarantees are made as to how this programme will behave if
-there is debug information or other strangeness stored after the last
-overlay in the file.
-
-Whenever exesmurf is invoked, the extension .EXE is assumed for the
-file if no extension is given.  Other extensions are probably only
-meaningful for examining overlay files.
-----------------------------------------------------------------------
-Stephen P Spackman                       stephen@estragon.uchicago.edu
-----------------------------------------------------------------------
diff -Naurd ../nethack-3.3.1/sys/msdos/old/maintovl.doc ./sys/msdos/old/maintovl.doc
--- ../nethack-3.3.1/sys/msdos/old/maintovl.doc Sat Apr 4 03:22:48 1998
+++ ./sys/msdos/old/maintovl.doc Thu Jan 1 01:00:00 1970
@@ -1,340 +0,0 @@
-	SCCS Id: @(#)maintovl.doc	 3.1		92/11/23
-        Copyright (c) NetHack PC Development Team 1990, 1991, 1992, 1993.
-        NetHack may be freely redistributed.  See license for details.
-		     ===========================
-			Maintaining PC NetHack
-		     ===========================
-		     Last revision: 1992november23
-
-The installation of the system of overlay management that currently
-brings full-featured NetHack to the IBM PC and compatibles has
-introduced a number of arcanities into the source code of the
-programme, and unfortunately running afoul of these intricacies can
-result (as we ourselves have discovered) in the most bizarre and
-strangely inexplicable dysfunctional manifestations, aka sick bugs.
-
-This document is required reading for anyone making substantive
-changes to NetHack for the PC or embarking upon a revision of its
-overlay structure.
-
-
-1. The overlay manager
-----------------------
-NetHack is by now a fairly large programme (in excess of 800
-kilobytes), and in order to compile it for the PC (which typically
-has little more than 500k of available memory) it was necessary to
-rely on the technique of _overlaying_, whereby not all the
-programme is resident in memory at the same time, segments of the
-programme being loaded and discarded as they are needed. Unlike
-traditional candidates for the overlaying strategy, however, NetHack
-does not exhibit strongly phased behaviour; although much of the code
-is not being used at any one moment, there is comparatively little
-code that can confidently be said not to be related to or potentially
-necessary for the immediate progress of the game.
-	Furthermore we wished to develop an overlaying strategy that
-did _not_ involve intimate knowledge of the operation of the
-programme (since NetHack is an international team effort, and few
-people have a good feeling for the totality of the code structure),
-and which would not require substantive changes to the source code,
-impacting on its maintainability and portability.
-	It turned out to be impossible to satisfy these goals with
-tools that are widely available at the time of writing, and so we
-undertook to write our own overlay manager (compatible with
-Microsoft's, but more in concert with NetHack's particular needs).
-The result is called ovlmgr.asm and is documented in the file
-ovlmgr.doc. You would probably be well advised to read at least the
-less technical parts of that file now.
-
-
-2. The trampoli mechanism
--------------------------
-One of the difficulties with using overlays for C (particularly
-Microsoft C) is that while common C programming practise places heavy
-reliance on function pointers, Microsoft's overlay linker is unable
-to resolve calls through pointers to functions that are in remote
-overlays. Nor, unfortunately, does it choose to report such failures;
-rather, it generates calls into (what often turns out to be in the
-case of our nonstandard overlay manager) the deepest of space. This
-can result in truly strange behaviour on the part of your programme -
-including bugs that come and go in as close to a random pattern as
-you are ever likely to see.
-	Other than the creative use of pattern-matching utilities
-such as grep to locate the offending calls, there is unfortunately no
-advice we can offer in tracking down these bugs. Once they have been
-isolated, however, they can be remedied straightforwardly.
-
-In order for the linker not to screw up on a pointered function call
-it is (to simplify an actually rather complicated situation)
-necessary that the function called be located in the ROOT "overlay",
-and thus not be subject to swapping. Rather than linking the full
-text of every pointered function into the root, however, it suffices
-to place a "trampoline" function there which performs a direct call
-to the "real" function that does the work, in whatever overlay it
-might naturally reside in. Due to a not-quite-accident of the
-behaviour of the C preprocessor (it was originally intended to make
-possible functions whose address can be taken but which expand inline
-as macros where possible, a not unrelated function), it turns out to
-be possible to arrange for this without major change to the C source
-code - and without serious impact on the performance of "regular"
-calls to the same functions.
-
-The C preprocessor's expansion of a macro with parameters is triggered
-by an encounter with the macro name immediately followed by an open
-parenthesis. If the name is found, but it is not followed by a
-parenthesis, the macro is not matched and no expansion takes place.
-At the same time it may be noted that (unless someone has been oddly
-strange and enclosed a function name in quite unneeded parentheses!),
-a function name is typically followed by an open parenthesis if, and
-only if, it is being declared, defined or invoked; if its address is
-being taken it will necessarily be followed by some other token.
-Furthermore it will be observed that (except in the unfortunate case
-of the ill-conceived new-style ANSI declaration of a function that
-takes no parameters) the number of parameters to a call of the
-function (assuming that this number is fixed; if not, I grant, we have
-a problem) is the same in all these contexts. This implies that if all
-the modules of a programme are uniformly processed in the context of a
-macro definition such as
-
-	#define zook(a,b) plenk(a,b)
-
-and assuming that all functions named zook() take exactly two
-arguments, then the resulting programme will be completely identical
-to the original (without this definition) except that the link
-map will report the existence of the function plenk() in place of
-zook() -- UNLESS there was a place in the programme where the address
-of zook was taken. In that case, the linker would report an
-unresolved external reference for zook.
-	That unresolved reference is, of course, precisely what we
-need; if in another source file (one that did not see the macro
-definition) we placed the function definition
-
-	some_t zook(this_t a, that_t b)
-	  { extern some_t plenk(this_t, that_t);
-	    return plenk(a, b);
-	  }
-
-this would both satisfy the unresolved reference and restore the
-original semantics of the programme (even including pointer
-comparison!) -- while providing us with precisely the kind of
-"trampoline" module that we need to circumvent the problem with the
-linker.
-	This is the basis of the approach we have taken in PC
-NetHack; rather than using the somewhat idiosyncratic identifier
-"plenk", however, we have systematically employed (in the files
-trampoli.h and trampoli.c) identifiers generated by appending
-underscores to the ends of the names of the functions we have needed
-to so indirect(1).
-
-There are a few small complications. The first is ensuring that both
-the versions of the trampoli'd function (foo() and foo_()) are
-similarly typed by the appropriate extern declarations (which
-themselves must be written); this can be accomplished by placing all
-of these declarations in a header file that is processed _twice_,
-once before and once after the inclusion of the file containing the
-trampoli macro definitions, thereby ensuring that both variants of
-the name have been seen in connection with the appropriate types. The
-second is that some care must be exercised not to employ other macros
-that interfere with the normal recognition of function syntax: it is
-the presence of the open parenthesis after the name of the function
-that triggers name substitution, and not the fact that the function
-is called; and so (particularly in the case of declarations) it is
-necessary that if a macro is used to supply the _arguments_ of a
-trampoli'd function, it must also supply the name (this necessity in
-fact triggered a change in the style of the macros that provide
-dialect-independent function declaration in NetHack; the new style
-would have you write FDECL(functionName, (argTypes...)).
-	Finally, there is the case of functions declared to take no
-arguments whatsoever; in Standard C this is notated:
-
-	some_t aFunction(void);
-
-for no theoretically well-motivated reason I can discern. Such a
-declaration will _not_ match a macro definition such as
-
-	#define aFunction() aFunction_()
-
--- ../nethack-3.3.1/sys/msdos/old/maintovl.doc fact the compiler will detect an error when processing that
-declaration in the scope of this macro. The only solution is to
-eschew the use of this strange syntax and unfrabjously forgo the
-concomitant security of well- and thoroughly- checked typage. To
-which end we have provided an ecchy macro, NDECL(functionName), which
-uses the new syntax _unless_ the compiler is not Standard or OVERLAY
-is enabled.
-
-There is one further consideration: that this technique only applies,
-of course, to functions that are published to the linker. For this
-reason, wherever such trampoli'd functions were originally declared
-static, that declaration has been changed to "STATIC_PTR", a macro
-that expands to "static" unless the OVERLAY flag has been selected in
-the configuration file, enabling the trampoli mechanism. Thus such
-functions lose their privacy in this one case.
-
-
-3. OVLx
--------
-The strategies described above work fine, but they only stretch so
-far. In particular, they do not admit of an overlay structure in
-which functions are linked into different overlays even though they
-originate in the same source file.
-	Classically, this is not considered a real limitation,
-because one has the freedom to regroup the functions into different
-source files as needed; however, in the case of NetHack this was not
-a realistic option, since what structure this unwieldy programme has
-is precisely in the current grouping of functions together.
-Nonetheless, the ability to perform some functional grouping is an
-absolute requirement for acceptable performance, since many NetHack
-source modules (were.c, for example) contain one or two tiny
-functions that are called with great frequency (several millions of
-times per game is not unheard of) and whose return value determines
-whether the remaining large, slow functions of the file will be
-required at all in the near future. Obviously these small checking
-functions should be linked into the same overlays with their callers,
-while the remainder of the source module should not.
-
-In order to make this possible we ran a dynamic profile on the game
-to determine exactly which functions in which modules required such
-distinguished treatment, and we have flagged each function for
-conditional compilation (with #if ... #endif) in groups according
-approximately to their frequency of invocation and functionality.
-These groups have been arbitrarily named in each source file (in
-decreasing order of frequency), OVL0, OVL1, OVL2, OVL3 and OVLB (B
-for "base functions", those that deserve no special treatment at
-all). It is thus possible to compile only a small number of the
-functions in a file by defining but one or two of these symbols on
-the compiler's command line (with the switch /DOVL2, for example);
-the compiler will ignore the remainder as if they did not exist.
-(There is an "escape clause" in hack.h that ensures that if none of
-these flags is defined on the command line, then all of them will be
-during compilation; this makes the non-use of this mechanism
-straightforward!)
-	By repeated invocation of the compiler on the _same_ source
-file it is possible to accumulate disjoint object modules that
-between them contain the images of all the functions in the original
-source, but partitioned as is most convenient. Care must, of course,
-be taken over conflicts of name in both the object file put out (all
-slices will by default be called SRCFILE.OBJ, and this default must
-be overridden with distinct file names for each output slice) and in
-the names of the text segments the compiler is to generate; you can
-see this at work in Makefile.ovl. (You may wonder, as we did at
-first, why the text segment name would have to be made distinct in
-each object file slice (the default segment name is a function of the
-source file name and the compilation model only). The reason for this
-is, quite daftly to my mind, that the linker considers the identity
-of segment names and combine classes better reason to combine
-segments than the programmer's explicit instructions in the requested
-overlay pattern is reason to keep them apart. Programmer, ask not
-why...).
-
-Once again, that works fine except for the small matter of
-declarations (where have we heard this before?). For objects that
-once were static must now be made visible to the linker that they may
-be resolved across the reaches of inter-overlay space. To this end we
-have provided three macros, all of which expand simply to "static" if
-no OVLx flags are defined on the compilation command line. They are:
-
-STATIC_DCL	which introduces a declaration (as distinct from a
-		definition) of an object that would be static were it
-		not for the requirements of the OVLx mechanism. Its
-		expansion is "static", normally, but it becomes
-		"extern" in the event that this source file has been
-		split into slices with the OVLx mechanism.
-
-STATIC_OVL	is used when _defining_ a function (giving its text,
-		that is) that is logically static but may be called
-		across slices; it expands to "static" unless OVLx is
-		active; in the latter case it expands to null,
-		leaving the function with "previous linkage" as the
-		standard says. Note that this behaviour is quite
-		similar to, but very different from, that of
-		STATIC_PTR (described above), which has the same two
-		expansions but which is triggered not by OVLx but by
-		the OVERLAY flag which enables the trampoli mechanism.
-			STATIC_OVL also differs from the STATIC_DCL
-		and STATIC_VAR in that it is employed _within_ OVLx
-		slices, while the others are used to generate
-		declarations and are deployed in areas common to all
-		slices.
-
-STATIC_VAR	is used to introduce uninitialised would-be-static
-		variables. Its expansion is complex, since it must
-		read as "static" in the usual case, but as "extern"
-		if OVLx is in use -- in all overlays but one, where
-		it must expand to the null sequence -- giving it
-		"previous linkage" and "tentative definition" (to
-		ensure that the variable gets defined at all).
-			This one took a while to get right, and
-		believe me, using the macro is a lot easier than
-		trying to keep the #ifdefs straight yourself!
-
-An initialised variable that is file-level static unless OVLx is in
-use must now be written with a STATIC_DCL declaration, and a
-definition (and static initialiser) enclosed within the bracketing
-tag of one of the OVLx slices (any will do; we use OVLB).
-	Type definitions, macro definitions and extern declarations
-should, of course remain outside any OVLx slice.
-
-Finally, of course, objects whose visibility need not be extended may
-safely continue to be declared static. And in this case, at least,
-the compiler will provide diagnostics that inform you when an object
-has slipped through the cracks and requires the application of Magic
-Macro Salve.
-
-It is perhaps less than obvious that when a function is _both_ called
-across an OVLx split and referenced through a pointer, it should be
-treated as a pointered function (that is, it should get trampoli
-entries and should be defined STATIC_PTR). The reason for this is that
-the STATIC_xxx macros associated with OVLx _only_ change the
-declaration patterns of the objects, while trampoli results in the
-generation of necessary code.
-	It is correct to do this, because the declarations produced by
-STATIC_PTR are triggered by OVERLAY's being defined, and the selection
-of OVERLAY is an absolute precondition for the activation of OVLx.
-
-
-4. Hacking
-----------
-Before undertaking any serious modifications to the overlay structure
-or support mechanisms, you should know that a _lot_ of work has gone
-into the current scheme. If performance seems poor, remember: the
-overlay manager itself can be invoked up to ten thousand times in a
-second, and although the space available for loading overlays (once
-the data and stack spaces have been accounted for) is less than half
-the total size of the overlays that are swapped through it, a disk
-access occurs well under 0.1% of the time(2). Furthermore, this
-performance (such as it is) has been achieved without substantive
-change or restructuring of the NetHack source code, which must remain
-portable to many platforms other than the PC.
-
-If these observations do not daunt you, you are a Bit Warrior indeed
-(or aspiration anyway), and we await your comments with bait.
-
-------------------------------------------------------------------------
-
-NOTES:
-------
-
-(1) In fact, we have applied this technique throughout NetHack, even
-    in cases where it is not strictly necessary (since the pointered
-    calls are not across overlay splits, for example - though note
-    that there are more splits than might be initially apparent, due
-    to the effects of the OVLx hackage as described in section 3).
-    There is, however, one exception; and beware: it is an exception
-    with fangs. The file termcap.c contains a few pointered functions
-    that we decided _not_ to trampoli for performance reasons (screen
-    output is one of the problem areas on the PC port at the moment,
-    in terms of performance). It is therefore vital to the health of
-    PC NetHack as it currently stands that the OVLx slice termcap.0 be
-    linked into the ROOT "overlay".
-
-(2) These figures are for a 4.77 MHz PC-XT running in low memory with
-    an older version of both the overlay manager and the NetHack
-    overlay arrangement. On a more capable computer and with the
-    current software, the figures are probably more like a 100kHz peak
-    service rate and a hit rate (since we fixed the bug in the LRU
-    clock logic!) in excess of 99.99% -- hopefully not both at the
-    same time.
-
-------------------------------------------------------------------------
-Stephen P Spackman                         stephen@estragon.uchicago.edu
-------------------------------------------------------------------------
-			     * Hack On! *
diff -Naurd ../nethack-3.3.1/sys/msdos/old/Makefile.dat ./sys/msdos/old/Makefile.dat
--- ../nethack-3.3.1/sys/msdos/old/Makefile.dat Sat Apr 4 03:22:55 1998
+++ ./sys/msdos/old/Makefile.dat Thu Jan 1 01:00:00 1970
@@ -1,108 +0,0 @@
-#	SCCS Id: @(#)Makefile.dat  3.1   93/04/25
-#	Copyright (c) NetHack PC Development Team 1992, 1993.
-#	NetHack may be freely redistributed.  See license for details.
-#
-# PC NetHack 3.1 Data Files Makefile for NDMAKE and MSC >= 6.0ax, or
-# MSVC >= 1.0, or DGJPP 1.9.
-
-DAT	= ..\dat
-INCL	= ..\include
-UTL	= ..\util
-
-default: all
-
-all:	$(DAT)\data	    $(DAT)\rumors	$(DAT)\dungeon \
-	$(DAT)\oracles	    $(DAT)\quest.dat	$(DAT)\sp_lev.tag
-
-$(UTL)\utility.tag: $(UTL)\*.c $(UTL)\*.l $(UTL)\*.y $(INCL)\*.h
-	@echo You must "make all" in $(UTL) first.
-	@attrib .foo
-
-$(DAT)\data: 	$(UTL)\utility.tag    $(DAT)\data.base
-	$(UTL)\makedefs -d
-
-$(DAT)\rumors:	$(UTL)\utility.tag    $(DAT)\rumors.tru   $(DAT)\rumors.fal
-	$(UTL)\makedefs -r
-
-$(DAT)\quest.dat: $(UTL)\utility.tag  $(DAT)\quest.txt
-	$(UTL)\makedefs -q
-
-$(DAT)\oracles:	$(UTL)\utility.tag    $(DAT)\oracles.txt
-	$(UTL)\makedefs -h
-
-#
-# Note: `options` should be created via date.h target in ..\src\makefile
-#
-$(DAT)\options: $(UTL)\utility.tag    $(INCL)\config.h    $(INCL)\pcconf.h
-	$(UTL)\makedefs -v
-
-$(DAT)\sp_lev.tag: $(UTL)\utility.tag $(DAT)\bigroom.des  $(DAT)\castle.des \
-	$(DAT)\endgame.des $(DAT)\gehennom.des $(DAT)\knox.des   \
-	$(DAT)\medusa.des  $(DAT)\oracle.des   $(DAT)\tower.des  \
-	$(DAT)\yendor.des  $(DAT)\arch.des     $(DAT)\barb.des   \
-	$(DAT)\caveman.des $(DAT)\elf.des      $(DAT)\healer.des \
-	$(DAT)\knight.des  $(DAT)\priest.des   $(DAT)\rogue.des  \
-	$(DAT)\samurai.des $(DAT)\tourist.des  $(DAT)\valkyrie.des \
-	$(DAT)\wizard.des
-	$(UTL)\lev_comp $(DAT)\bigroom.des
-	$(UTL)\lev_comp $(DAT)\castle.des
-	$(UTL)\lev_comp $(DAT)\endgame.des
-	$(UTL)\lev_comp $(DAT)\gehennom.des
-	$(UTL)\lev_comp $(DAT)\knox.des
-	$(UTL)\lev_comp $(DAT)\mines.des
-	$(UTL)\lev_comp $(DAT)\medusa.des
-	$(UTL)\lev_comp $(DAT)\oracle.des
-	$(UTL)\lev_comp $(DAT)\tower.des
-	$(UTL)\lev_comp $(DAT)\yendor.des
-	$(UTL)\lev_comp $(DAT)\arch.des
-	$(UTL)\lev_comp $(DAT)\barb.des
-	$(UTL)\lev_comp $(DAT)\caveman.des
-	$(UTL)\lev_comp $(DAT)\elf.des
-	$(UTL)\lev_comp $(DAT)\healer.des
-	$(UTL)\lev_comp $(DAT)\knight.des
-	$(UTL)\lev_comp $(DAT)\priest.des
-	$(UTL)\lev_comp $(DAT)\rogue.des
-	$(UTL)\lev_comp $(DAT)\samurai.des
-	$(UTL)\lev_comp $(DAT)\tourist.des
-	$(UTL)\lev_comp $(DAT)\valkyrie.des
-	$(UTL)\lev_comp $(DAT)\wizard.des
-	echo sp_levs done > $(DAT)\sp_lev.tag
-
-$(DAT)\dungeon:	$(UTL)\utility.tag  $(DAT)\dungeon.def
-	$(UTL)\makedefs -e
-	$(UTL)\dgn_comp $(DAT)\dungeon.pdf
-
-clean: spotless
-
-spotless:
-	if exist $(DAT)\?-fill?.lev	del $(DAT)\?-fill?.lev
-	if exist $(DAT)\?-goal.lev	del $(DAT)\?-goal.lev
-	if exist $(DAT)\?-locate.lev	del $(DAT)\?-locate
-	if exist $(DAT)\?-start.lev	del $(DAT)\?-start.lev
-	if exist $(DAT)\air.lev		del $(DAT)\air.lev
-	if exist $(DAT)\asmodeus.lev	del $(DAT)\asmodeus.lev
-	if exist $(DAT)\astral.lev	del $(DAT)\astral.lev
-	if exist $(DAT)\baalz.lev	del $(DAT)\baalz.lev
-	if exist $(DAT)\bigroom.lev	del $(DAT)\bigroom.lev
-	if exist $(DAT)\castle.lev	del $(DAT)\castle.lev
-	if exist $(DAT)\data		del $(DAT)\data
-	if exist $(DAT)\dungeon		del $(DAT)\dungeon
-	if exist $(DAT)\dungeon.pdf	del $(DAT)\dungeon.pdf
-	if exist $(DAT)\earth.lev	del $(DAT)\earth.lev
-	if exist $(DAT)\fakewiz?.lev	del $(DAT)\fakewiz?.lev
-	if exist $(DAT)\fire.lev	del $(DAT)\fire.lev
-	if exist $(DAT)\juiblex.lev	del $(DAT)\juiblex.lev
-	if exist $(DAT)\medusa-?.lev	del $(DAT)\medusa-?.lev
-	if exist $(DAT)\mine*.lev	del $(DAT)\mine*.lev
-	if exist $(DAT)\options		del $(DAT)\options
-	if exist $(DAT)\oracle.lev	del $(DAT)\oracle.lev
-	if exist $(DAT)\oracles		del $(DAT)\oracles
-	if exist $(DAT)\orcus.lev	del $(DAT)\orcus.lev
-	if exist $(DAT)\rumors		del $(DAT)\rumors
-	if exist $(DAT)\quest.dat	del $(DAT)\quest.dat
-	if exist $(DAT)\sanctum.lev	del $(DAT)\sanctum.lev
-	if exist $(DAT)\tower?.lev	del $(DAT)\tower?.lev
-	if exist $(DAT)\valley.lev	del $(DAT)\valley.lev
-	if exist $(DAT)\water.lev	del $(DAT)\water.lev
-	if exist $(DAT)\wizard?.lev	del $(DAT)\wizard?.lev
-	if exist $(DAT)\sp_lev.tag	del $(DAT)\sp_lev.tag
diff -Naurd ../nethack-3.3.1/sys/msdos/old/MakeMSC.src ./sys/msdos/old/MakeMSC.src
--- ../nethack-3.3.1/sys/msdos/old/MakeMSC.src Sat Apr 4 03:22:54 1998
+++ ./sys/msdos/old/MakeMSC.src Thu Jan 1 01:00:00 1970
@@ -1,740 +0,0 @@
-# SCCS Id: @(#)MakeMSC.src	3.1	93/07/11
-# Copyright (c) NetHack PC Development Team 1992, 1993
-# PC NetHack 3.1 Makefile for Microsoft(tm) "C" >= 6.0ax and MSVC >= 1.0
-#
-# Nota Bene:	Before you get to here you should have already read
-# 		the Install.dos file located in the sys/msdos directory.
-
-# This Makefile supports two different overlay management schemes.
-# You must select either the one that supports Microsoft C
-# version 6, or the one that supports Microsoft C version 7 and 
-# Microsoft Visual C++ Professional version 1 (MSVC).  By default this 
-# Makefile is set up for version 7 or greater (including MSVC).  Certain 
-# sections particular to each compiler are marked either MSC7/MSVC or MSC6.
-# If you are using Microsoft C version 7 or MSVC, make sure that all the MSC6
-# sections are commented out and pay particular attention
-# to all sections marked MSC7/MSVC, uncommenting all the variables.
-# Do the same thing for MSC6 if you are using that version of
-# the compiler.
-#
-# MSC6 Notes:
-#	As it is set up, this makefile requires that exesmurf (the
-#	NetHack overlay-aware .exe header editor) be on your path or in the
-#	$(SRC) directory. If you wish to change the path or use Microsoft
-#	EXEMOD instead, see the symbols EXEPATCH and EXEFLAGS.
-#
-
-#
-# Game Installation Variables.
-# NOTE: Make sure GAMEDIR exists before make is started.
-#
-
-GAME	= NetHack
-GAMEDIR = c:\games\nethack
-default: $(GAME)
-
-#
-#	Source code and data file directories.
-#
-
-DAT	= ..\dat
-INCL	= ..\include
-SRC	= .
-OBJ	= $(SRC)\o
-SYS	= ..\sys\msdos
-SSYS	= ..\sys\share
-UTL	= ..\util
-WIN	= ..\win\tty
-
-#
-#	Exe File Info.
-#	($(MAKE) macro is often predefined, so we use $(MAKEBIN) instead.)
-#
-
-ASM	= masm		# Assembler
-CC	= cl		# Compiler
-LINK	= link		# Linker
-MAKEBIN = make45l	# Make Utility
-
-#
-# Make the necessary changes in *one* of the two sections below.
-#
-
-
-#### MSC7/MSVC Section Only #####
-# MSC7 and MSVC Compiler Flags are set up in the setup.bat file using
-# the CL environment variable as the total lenth of the compiler
-# command line exceeds the MSDOS 128 character limit.
-#
-CFLAGS	= /c
-LFLAGS	= /noi /seg:512 /map /st:5120 /DYNAMIC:1052 /INFO
-OVLMUCKING =	# None required
-MSC6MUCK =	# None required
-OVERLAY =	# None required
-OVERLAY_H =	# None required
-############################
-
-
-#### MSC6 Section Only #####
-#
-# First comment out the MSC7/MSVC section.  And uncomment much of what is below.
-#
-
-#
-# CC	There was a register bug, to be safe remove stack probes.
-# /Gt18 is currently about the largest value that keeps the initialised
-#	data segment below 64K (and keeps the linker happy).
-# /G2	286 or higher machines can use the /G2 CFLAG option for better
-#	performance.
-#
-#CFLAGS	= /AL /c /Os /Gs /Gt18 /Zp1 /W0 /I$(INCL)
-#LFLAGS	= /noi /seg:512 /map /st:4096
-#EXEPATCH = exesmurf	# Executable Massager
-#EXEFLAGS = /max4500 /min4500
-#OVLMUCKING = $(EXEPATCH) $(OBJ)\ovlmgr.obj
-#MSC6MUCK = msc6muck
-
-#
-# For Microsoft C version <= 6.00ax, we use a custom overlay
-# manager.
-#
-# Switch the following $(OBJ)\$(OVLMGR): lines if you don't have a
-# MASM compatible assembler.
-#$(OBJ)\ovlmgr.obj: $(SYS)\ovlmgr.asm
-#	$(ASM) $(AFLAGS) $(SYS)\ovlmgr.asm, $@ ;
-$(OBJ)\ovlmgr.obj: ; copy $(SYS)\ovlmgr.obj $(OBJ)\ovlmgr.obj
-
-#
-# Object files and a header file required for trampoli overlay system.
-#
-#OVERLAY = $(OBJ)\ovlmgr.obj $(OBJ)\trampoli.o
-#OVERLAY_H = $(INCL)\trampoli.h
-
-#
-# If you need to recompile ovlmgr.asm you may want to change
-# some of the flags.
-AFLAGS = /MX
-# /Di386	= Use 386 specific enhancements
-# /DNOEMS	= Do not use EMS memory
-# /DDEBUG	= Report memory usage on startup
-# /DNOSPLIT	= EXE file is not split out to OVL files
-
-#
-# Uncomment these sections.
-#
-#$(EXEPATCH): $(EXEPATCH).exe
-#$(EXEPATCH).exe: $(OBJ)\$(EXEPATCH).o
-#	$(LINK) $(OBJ)\$*.o, $*.exe;
-
-############################
-
-#
-#	Optional high-quality BSD random number generation routines
-#	(see pcconf.h).	Set to nothing if not used.
-#
-
-RANDOM	= $(OBJ)\random.o
-# RANDOM	=
-
-#
-# If TERMLIB is #defined in the source (in include\pcconf.h), 
-# comment out the upper line and uncomment the lower.  Make sure 
-# that TERMLIB contains the full pathname to the termcap library. 
-
-TERMLIB =
-#TERMLIB = $(SSYS)\termcap.lib
-
-#
-#	Nothing below this line should have to be changed.
-#
-
-#
-#	Make Roolz dude.
-#	Due to an NDMake inadequacy these must accord with a topological
-#	sort of the generated-from relation... output on the left, input
-#	on the right. Trust me.
-#
-
-.SUFFIXES: .exe .0 .0-1 .0-2 .0-3 .1 .1-2 .1-3 .1-b .2 .2-3 .2-b .3 .3-b .b \
-	   .o .c .y .l .obj .asm
-
-.c.o:
-	$(CC) $(CFLAGS) /Fo$@ $<
-.c.0:
-	$(CC) $(CFLAGS) /DOVL0 /NT$(@F) /Fo$@ $<
-.c.0-1:
-	$(CC) $(CFLAGS) /DOVL0 /DOVL1 /NT$(@F) /Fo$@ $<
-.c.0-2:
-	$(CC) $(CFLAGS) /DOVL0 /DOVL1 /DOVL2 /NT$(@F) /Fo$@ $<
-.c.0-3:
-	$(CC) $(CFLAGS) /DOVL0 /DOVL1 /DOVL2 /DOVL3 /NT$(@F) /Fo$@ $<
-.c.1:
-	$(CC) $(CFLAGS) /DOVL1 /NT$(@F) /Fo$@ $<
-.c.1-2:
-	$(CC) $(CFLAGS) /DOVL1 /DOVL2 /NT$(@F) /Fo$@ $<
-.c.1-3:
-	$(CC) $(CFLAGS) /DOVL1 /DOVL2 /DOVL3 /NT$(@F) /Fo$@ $<
-.c.1-b:
-	$(CC) $(CFLAGS) /DOVL1 /DOVL2 /DOVL3 /DOVLB /NT$(@F) /Fo$@ $<
-.c.2:
-	$(CC) $(CFLAGS) /DOVL2 /NT$(@F) /Fo$@ $<
-.c.2-3:
-	$(CC) $(CFLAGS) /DOVL2 /DOVL3 /NT$(@F) /Fo$@ $<
-.c.2-b:
-	$(CC) $(CFLAGS) /DOVL2 /DOVL3 /DOVLB /NT$(@F) /Fo$@ $<
-.c.3:
-	$(CC) $(CFLAGS) /DOVL3 /NT$(@F) /Fo$@ $<
-.c.3-b:
-	$(CC) $(CFLAGS) /DOVL3 /DOVLB /NT$(@F) /Fo$@ $<
-.c.b:
-	$(CC) $(CFLAGS) /DOVLB /NT$(@F) /Fo$@ $<
-.asm.obj:
-	$(ASM) $(AFLAGS) $<, $@ ;
-
-#
-#	Header Objects.
-#
-
-CONFIG_H   = $(GLOBAL_H)	$(INCL)\tradstdc.h	$(INCL)\config.h
-DECL_H	   = $(YOU_H)		$(INCL)\spell.h		$(INCL)\color.h	\
-	     $(INCL)\obj.h	$(INCL)\onames.h	$(INCL)\pm.h \
-	     $(INCL)\decl.h
-DGN_FILE_H = $(INCL)\align.h	$(INCL)\dgn_file.h
-DISPLAY_H  = $(MONDATA_H)	$(INCL)\vision.h	$(INCL)\display.h
-DUNGEON_H  = $(INCL)\align.h	$(INCL)\dungeon.h
-EMIN_H	   = $(DUNGEON_H)	$(INCL)\emin.h
-EPRI_H	   = $(DUNGEON_H)	$(INCL)\align.h		$(INCL)\epri.h
-ESHK_H	   = $(DUNGEON_H)	$(INCL)\eshk.h
-GLOBAL_H   = $(PCCONF_H)	$(INCL)\coord.h		$(INCL)\global.h
-HACK_H	   = $(CONFIG_H)	$(DUNGEON_H)		$(DECL_H) \
-	     $(DISPLAY_H)	$(INCL)\monsym.h	$(INCL)\mkroom.h \
-	     $(INCL)\objclass.h	$(INCL)\trap.h		$(INCL)\flag.h	\
-	     $(RM_H)		$(INCL)\vision.h	$(INCL)\wintype.h \
-	     $(INCL)\engrave.h	$(INCL)\rect.h \
-	     $(INCL)\trampoli.h	$(INCL)\hack.h
-MONDATA_H  = $(INCL)\align.h	$(INCL)\mondata.h
-MONST_H	   = $(INCL)\align.h	$(INCL)\monst.h
-PCCONF_H   = $(INCL)\micro.h	$(INCL)\system.h	$(INCL)\pcconf.h
-PERMONST_H = $(INCL)\monattk.h	$(INCL)\monflag.h	$(INCL)\align.h	\
-	     $(INCL)\permonst.h
-RM_H	   = $(INCL)\align.h	$(INCL)\rm.h
-SP_LEV_H   = $(INCL)\align.h	$(INCL)\sp_lev.h
-VAULT_H	   = $(DUNGEON_H)	$(INCL)\vault.h
-YOU_H	   = $(MONST_H)		$(YOUPROP_H)		$(INCL)\align.h	\
-	     $(INCL)\attrib.h	$(INCL)\you.h
-YOUPROP_H  = $(PERMONST_H)	$(MONDATA_H)		$(INCL)\prop.h	\
-	     $(INCL)\pm.h	$(INCL)\youprop.h
-
-#
-#	Overlay Objects.
-#
-
-ROOT =	$(OVERLAY) $(OBJ)\main.o $(OBJ)\msdos.0 $(OBJ)\dungeon.0 \
-	$(OBJ)\alloc.o $(OBJ)\random.o $(OBJ)\decl.o $(OBJ)\dbridge.0 \
-	$(OBJ)\objects.o $(OBJ)\invent.0 $(OBJ)\mkobj.0 $(OBJ)\mkroom.0 \
-	$(OBJ)\rnd.0 $(OBJ)\video.0 $(OBJ)\mondata.0 $(OBJ)\muse.o \
-	$(OBJ)\engrave.0 $(OBJ)\explode.o $(OBJ)\display.o $(OBJ)\vision.o \
-	$(OBJ)\attrib.0 $(OBJ)\rect.o $(OBJ)\vis_tab.o $(OBJ)\hacklib.0 \
-	$(OBJ)\monst.o $(OBJ)\hack.3 $(OBJ)\topl.0 $(OBJ)\trap.0 \
-	$(OBJ)\termcap.0 $(OBJ)\wintty.o $(OBJ)\monmove.0 $(OBJ)\dogmove.0
-
-# These could use to go in root, but are in OLV1 to make
-# the game loadable in under 512 free ram.
-# rhack and friends
-OVL01 = $(OBJ)\allmain.0 $(OBJ)\artifact.0 $(OBJ)\attrib.1 $(OBJ)\cmd.1 \
-	$(OBJ)\do.1 $(OBJ)\do.3 $(OBJ)\eat.0 $(OBJ)\engrave.2 \
-	$(OBJ)\getline.0-1 $(OBJ)\hack.1-2 \
-	$(OBJ)\botl.1 $(OBJ)\sounds.0 $(OBJ)\timeout.0 \
-	$(OBJ)\track.1 $(OBJ)\vault.0 $(OBJ)\wizard.0 $(OBJ)\hacklib.1
-# startup
-OVL02 = $(OBJ)\dungeon.1 $(OBJ)\files.o $(OBJ)\pcsys.o \
-	$(OBJ)\monstr.o $(OBJ)\msdos.b
-# main monster code
-OVL03 = $(OBJ)\cmd.0 $(OBJ)\engrave.1 $(OBJ)\mondata.1 \
-	$(OBJ)\mthrowu.0 $(OBJ)\priest.0 $(OBJ)\track.0 \
-	$(OBJ)\trap.1 $(OBJ)\were.0
-# monster movement
-OVL04 = $(OBJ)\mon.0-1 $(OBJ)\monmove.1
-# pet monster movement
-OVL05 = $(OBJ)\dog.1 $(OBJ)\dogmove.1-b
-# advanced monsters
-OVL06 = $(OBJ)\minion.o $(OBJ)\mcastu.o
-OVL07 = $(OBJ)\priest.1-b $(OBJ)\shk.1-b
-OVL08 = $(OBJ)\were.1-b
-OVL09 = $(OBJ)\wizard.1-b
-OVL10 = $(OBJ)\worm.o
-# 11-15 around the movement loop
-# domove and friends
-OVL11 = $(OBJ)\hack.0 $(OBJ)\apply.0 $(OBJ)\do_wear.1 $(OBJ)\lock.0 \
-	$(OBJ)\cmd.2
-OVL12 = $(OBJ)\detect.o
-OVL13 = $(OBJ)\attrib.2-b $(OBJ)\exper.o
-OVL14 = $(OBJ)\eat.1 $(OBJ)\invent.1
-OVL15 = $(OBJ)\makemon.0-2 $(OBJ)\mkobj.1
-OVL16 = $(OBJ)\makemon.b $(OBJ)\mplayer.o $(OBJ)\mkobj.2-b
-OVL17 = $(OBJ)\mhitm.1-b
-OVL18 = $(OBJ)\mthrowu.1
-OVL19 = $(OBJ)\mthrowu.2-b
-OVL20 = $(OBJ)\allmain.1 $(OBJ)\mhitm.0 $(OBJ)\mhitu.0-1 $(OBJ)\rnd.1 \
-	$(OBJ)\weapon.0-1
-OVL21 = $(OBJ)\mon.2-b
-OVL22 = $(OBJ)\artifact.1 $(OBJ)\uhitm.o $(OBJ)\weapon.2-b
-OVL23 = $(OBJ)\do_wear.0 $(OBJ)\mhitu.2-b
-OVL24 = $(OBJ)\steal.0-1
-OVL25 = $(OBJ)\monmove.2-b $(OBJ)\steal.2-b
-OVL26 = $(OBJ)\rnd.2-b
-OVL27 = $(OBJ)\do_wear.2 $(OBJ)\mondata.2 $(OBJ)\objnam.0-1 \
-	$(OBJ)\polyself.0-1
-OVL28 = $(OBJ)\do_name.0
-OVL29 = $(OBJ)\objnam.2-b $(OBJ)\hacklib.2-b
-OVL30 = $(OBJ)\pager.o
-OVL31 = $(OBJ)\botl.0
-OVL32 = $(OBJ)\botl.b $(OBJ)\topl.b $(OBJ)\termcap.1 $(OBJ)\windows.o \
-	$(OBJ)\video.1
-OVL33 = $(OBJ)\topl.1-2
-OVL34 = $(OBJ)\pline.o
-OVL35 = $(OBJ)\termcap.2-b $(OBJ)\video.2-b
-OVL36 = $(OBJ)\quest.o $(OBJ)\questpgr.o
-OVL37 = $(OBJ)\invent.b
-OVL38 = $(OBJ)\hack.b
-OVL39 = $(OBJ)\mondata.b $(OBJ)\timeout.1-b $(OBJ)\dog.b $(OBJ)\sounds.1-b
-OVL40 = $(OBJ)\do.0 $(OBJ)\invent.3
-OVL41 = $(OBJ)\cmd.b $(OBJ)\getline.2 $(OBJ)\write.o
-OVL42 = $(OBJ)\apply.2-b
-OVL43 = $(OBJ)\do.b $(OBJ)\drawing.o
-OVL44 = $(OBJ)\dokick.o
-OVL45 = $(OBJ)\dothrow.o
-OVL46 = $(OBJ)\eat.2-b
-OVL47 = $(OBJ)\invent.2 $(OBJ)\pickup.o
-OVL48 = $(OBJ)\lock.1-b
-OVL49 = $(OBJ)\polyself.2-b
-OVL50 = $(OBJ)\potion.o
-OVL51 = $(OBJ)\pray.o
-OVL52 = $(OBJ)\read.1-b $(OBJ)\spell.o
-OVL53 = $(OBJ)\ball.o
-# clothing stuff
-OVL54 = $(OBJ)\do_wear.b $(OBJ)\wield.o $(OBJ)\worn.o
-# Zappage
-OVL55 = $(OBJ)\zap.o
-OVL56 = $(OBJ)\dbridge.1-b
-OVL57 = $(OBJ)\trap.b
-# Unusual circumstances
-OVL58 = $(OBJ)\artifact.b $(OBJ)\do_name.1-b $(OBJ)\fountain.o $(OBJ)\music.o \
-	$(OBJ)\rumors.o $(OBJ)\sit.o $(OBJ)\vault.1-b
-# Uppers and Downers
-OVL59 = $(OBJ)\apply.1 $(OBJ)\bones.o $(OBJ)\mklev.o
-OVL60 = $(OBJ)\save.o $(OBJ)\restore.o
-OVL61 = $(OBJ)\mkmaze.o $(OBJ)\mkroom.1-b $(OBJ)\mkmap.o
-# Note: version.o is in OVL62, but in a special way.  See below.
-OVL62 = $(OBJ)\allmain.2-b $(OBJ)\end.o $(OBJ)\engrave.b \
-	$(OBJ)\o_init.o $(OBJ)\options.o $(OBJ)\rip.o \
-	$(OBJ)\shknam.o $(OBJ)\topten.o $(OBJ)\tty.o \
-	$(OBJ)\u_init.o $(OBJ)\unix.1-b
-# Levelling
-OVL63 = $(OBJ)\do.2 $(OBJ)\dog.2 $(OBJ)\extralev.o \
-	$(OBJ)\sp_lev.o $(OBJ)\track.2-b
-
-#
-#	Make Objects.
-#
-
-MOBJ = $(OVL01) $(OVL02) $(OVL03) $(OVL04) $(OVL05) $(OVL06) $(OVL07) $(OVL08)\
-       $(OVL09) $(OVL10) $(OVL11) $(OVL12) $(OVL13) $(OVL14) $(OVL15) $(OVL16)\
-       $(OVL17) $(OVL18) $(OVL19) $(OVL20) $(OVL21) $(OVL22) $(OVL23) $(OVL24)\
-       $(OVL25) $(OVL26) $(OVL27) $(OVL28) $(OVL29) $(OVL30) $(OVL31) $(OVL32)\
-       $(OVL33) $(OVL34) $(OVL35) $(OVL36) $(OVL37) $(OVL38) $(OVL39) $(OVL40)\
-       $(OVL41) $(OVL42) $(OVL43) $(OVL44) $(OVL45) $(OVL46) $(OVL47) $(OVL48)\
-       $(OVL49) $(OVL50) $(OVL51) $(OVL52) $(OVL53) $(OVL54) $(OVL55) $(OVL56)\
-       $(OVL57) $(OVL58) $(OVL59) $(OVL60) $(OVL61) $(OVL62) $(OVL63)
-
-VOBJ = $(ROOT)	$(MOBJ)
-
-HOBJ = $(VOBJ)	$(OBJ)\version.o
-
-OVERLAYS = ($(OVL01)) ($(OVL02)) ($(OVL03)) ($(OVL04)) ($(OVL05)) ($(OVL06)) \
-	   ($(OVL07)) ($(OVL08)) ($(OVL09)) ($(OVL10)) ($(OVL11)) ($(OVL12)) \
-	   ($(OVL13)) ($(OVL14)) ($(OVL15)) ($(OVL16)) ($(OVL17)) ($(OVL18)) \
-	   ($(OVL19)) ($(OVL20)) ($(OVL21)) ($(OVL22)) ($(OVL23)) ($(OVL24)) \
-	   ($(OVL25)) ($(OVL26)) ($(OVL27)) ($(OVL28)) ($(OVL29)) ($(OVL30)) \
-	   ($(OVL31)) ($(OVL32)) ($(OVL33)) ($(OVL34)) ($(OVL35)) ($(OVL36)) \
-	   ($(OVL37)) ($(OVL38)) ($(OVL39)) ($(OVL40)) ($(OVL41)) ($(OVL42)) \
-	   ($(OVL43)) ($(OVL44)) ($(OVL45)) ($(OVL46)) ($(OVL47)) ($(OVL48)) \
-	   ($(OVL49)) ($(OVL50)) ($(OVL51)) ($(OVL52)) ($(OVL53)) ($(OVL54)) \
-	   ($(OVL55)) ($(OVL56)) ($(OVL57)) ($(OVL58)) ($(OVL59)) ($(OVL60)) \
-	   ($(OVL61)) ($(OVL62)	$(OBJ)\version.o) ($(OVL63))
-
-#
-#	Primary make targets.
-#
-
-GAMEFILE = $(GAMEDIR)\$(GAME).exe
-
-all: install
-
-install: $(DAT)\sp_lev.tag	$(GAMEFILE)	$(MSC6MUCK)	install.tag
-	@echo Don't forget to check HACKDIR in $(GAMEDIR)\NetHack.cnf.
-	@echo Done.
-
-install.tag: $(GAMEFILE) $(MSC6MUCK)
-	copy $(SSYS)\termcap		$(GAMEDIR)
-	copy $(DAT)\*.?			$(GAMEDIR)
-	copy $(DAT)\*.dat		$(GAMEDIR)
-	copy $(DAT)\*.lev		$(GAMEDIR)
-	copy $(SSYS)\NetHack.cnf	$(GAMEDIR)
-	copy $(UTL)\recover.exe		$(GAMEDIR)
-	copy $(SYS)\msdos.hlp		$(GAMEDIR)
-	del  $(GAMEDIR)\makefile
-	echo install done > install.tag
-
-$(GAME): $(GAMEFILE) $(MSC6MUCK)
-
-$(GAME).exe: $(GAMEFILE) $(MSC6MUCK)
-
-$(GAMEFILE): $(UTL)\utility.tag $(OBJ) $(OVLMUCKING) $(HOBJ)
-	@echo Loading....
-	$(LINK) $(LFLAGS) $(ROOT) $(OVERLAYS),$(GAMEFILE),$(GAME),$(TERMLIB);
-	@del $(GAMEDIR)\$(GAME).bak > NUL
-	@echo $(GAME) is up to date.
-
-msc6muck:
-	$(EXEPATCH) $(GAMEFILE) $(EXEFLAGS)
-	$(EXEPATCH) $(GAMEFILE) 1 40
-
-#
-#	Secondary Targets.
-#
-
-clean:
-	del $(OBJ)\*.o
-	del $(OBJ)\*.0
-	del $(OBJ)\*.0-1
-	del $(OBJ)\*.0-2
-	del $(OBJ)\*.0-3
-	del $(OBJ)\*.1
-	del $(OBJ)\*.1-2
-	del $(OBJ)\*.1-3
-	del $(OBJ)\*.1-b
-	del $(OBJ)\*.2
-	del $(OBJ)\*.2-3
-	del $(OBJ)\*.2-b
-	del $(OBJ)\*.3
-	del $(OBJ)\*.3-b
-	del $(OBJ)\*.b
-	del $(OBJ)\*.obj
-	rmdir $(OBJ)
-
-spotless: clean
-	del *.exe
-	del *.bak
-	del *.tag
-	del *.map
-	del *.obj
-	del *.lib
-	del *.txt
-
-$(OBJ):
-	if not exist $(OBJ)\*.* mkdir $(OBJ)
-
-#
-# I'm not too fond of using this `attrib .foo` command to stop make,
-# but I can't think of any better generic way to do it.
-# It works for DOS 3.3, 4.00, & 5.0.
-# If you find a better one please feel free to implement it.
-#
-$(UTL)\utility.tag: monst.c	alloc.c			objects.c \
-	$(UTL)\makedefs.c	$(UTL)\panic.c		$(UTL)\recover.c \
-	$(UTL)\dgn_main.c	$(UTL)\dgn_comp.l	$(UTL)\dgn_comp.y \
-	$(UTL)\lev_main.c	$(UTL)\lev_comp.l	$(UTL)\lev_comp.y \
-	$(HACK_H)		$(INCL)\patchlevel.h	$(INCL)\qtext.h
-	@echo You must first "$(MAKEBIN) all" in the $(UTL) directory.
-	@attrib .foo
-
-$(DAT)\sp_lev.tag: $(UTL)\utility.tag
-	@echo You must first "$(MAKEBIN) all" in the $(DAT) directory.
-	@attrib .foo
-
-#
-# Other dependencies
-#
-
-$(INCL)\date.h: $(VOBJ)
-	$(UTL)\makedefs -v
-
-#
-#	Overlay/PC source code dependencies.
-#
-
-#
-#	$(SYS) files.
-#
-
-$(OBJ)\msdos.0: $(HACK_H) $(INCL)\termcap.h $(SYS)\msdos.c
-	$(CC) $(CFLAGS) /DOVL0 /NT$(@F) /Fo$@ $(SYS)\msdos.c
-
-$(OBJ)\msdos.b: $(HACK_H) $(INCL)\termcap.h $(SYS)\msdos.c
-	$(CC) $(CFLAGS) /DOVLB /NT$(@F) /Fo$@ $(SYS)\msdos.c
-
-$(OBJ)\trampoli.o: $(HACK_H) $(SYS)\trampoli.c
-	$(CC) $(CFLAGS) /Fo$@ $(SYS)\trampoli.c
-
-$(OBJ)\video.0:	$(HACK_H) $(INCL)\wintty.h $(SYS)\video.c
-	$(CC) $(CFLAGS) /DOVL0 /NT$(@F) /Fo$@ $(SYS)\video.c
-
-$(OBJ)\video.1: $(HACK_H) $(INCL)\wintty.h $(SYS)\video.c
-	$(CC) $(CFLAGS) /DOVL1 /NT$(@F) /Fo$@ $(SYS)\video.c
-
-$(OBJ)\video.2-b: $(HACK_H) $(INCL)\wintty.h $(SYS)\video.c
-	$(CC) $(CFLAGS) /DOVL2 /DOVLB /NT$(@F) /Fo$@ $(SYS)\video.c
-
-$(OBJ)\exesmurf.o: $(SYS)\exesmurf.c
-	$(CC) $(CFLAGS) /Fo$@ $(SYS)\exesmurf.c
-
-#
-#	$(SSYS) files.
-#
-
-$(OBJ)\main.o: $(HACK_H)	$(SSYS)\pcmain.c
-	$(CC) $(CFLAGS) /Fo$@ $(SSYS)\pcmain.c
-
-$(OBJ)\pcsys.o:	$(HACK_H)	$(INCL)\wintty.h	$(SSYS)\pcsys.c
-	$(CC) $(CFLAGS) /Fo$@ $(SSYS)\pcsys.c
-
-$(OBJ)\random.o: $(SSYS)\random.c
-	$(CC) $(CFLAGS) /Fo$@ $(SSYS)\random.c
-
-$(OBJ)\tty.o: $(HACK_H)		$(INCL)\wintty.h	$(SSYS)\pctty.c
-	$(CC) $(CFLAGS) /Fo$@	$(SSYS)\pctty.c
-
-$(OBJ)\unix.0: $(HACK_H)	$(SSYS)\pcunix.c
-	$(CC) $(CFLAGS) /DOVL0 /Fo$@ $(SSYS)\pcunix.c
-
-$(OBJ)\unix.1-b: $(HACK_H)	$(SSYS)\pcunix.c
-	$(CC) $(CFLAGS) /DOVL1 /DOVL2 /DOVL3 /DOVLB /Fo$@ $(SSYS)\pcunix.c
-
-#
-#	$(WIN) files.
-#
-
-$(OBJ)\getline.0-1: $(HACK_H)	$(INCL)\wintty.h	$(INCL)\func_tab.h \
-	$(WIN)\getline.c
-	$(CC) $(CFLAGS) /DOVL0 /DOVL1 /NT$(@F) /Fo$@ $(WIN)\getline.c
-
-$(OBJ)\getline.2: $(HACK_H)	$(INCL)\wintty.h	$(INCL)\func_tab.h \
-	$(WIN)\getline.c
-	$(CC) $(CFLAGS) /DOVL2 /NT$(@F) /Fo$@ $(WIN)\getline.c
-
-$(OBJ)\getline.b: $(HACK_H)	$(INCL)\wintty.h	$(INCL)\func_tab.h \
-	$(WIN)\getline.c
-	$(CC) $(CFLAGS) /DOVLB /NT$(@F) /Fo$@ $(WIN)\getline.c
-
-$(OBJ)\termcap.0: $(HACK_H)	$(INCL)\wintty.h	$(INCL)\termcap.h \
-	$(WIN)\termcap.c
-	$(CC) $(CFLAGS) /DOVL0 /NT$(@F) /Fo$@ $(WIN)\termcap.c
-
-$(OBJ)\termcap.1: $(HACK_H)	$(INCL)\wintty.h	$(INCL)\termcap.h \
-	$(WIN)\termcap.c
-	$(CC) $(CFLAGS) /DOVL1 /NT$(@F) /Fo$@ $(WIN)\termcap.c
-
-$(OBJ)\termcap.2-b: $(HACK_H)	$(INCL)\wintty.h	$(INCL)\termcap.h \
-	$(WIN)\termcap.c
-	$(CC) $(CFLAGS) /DOVL2 /DOVLB /NT$(@F) /Fo$@ $(WIN)\termcap.c
-
-$(OBJ)\topl.0: $(HACK_H)	$(INCL)\termcap.h	$(INCL)\wintty.h \
-	$(WIN)\topl.c
-	$(CC) $(CFLAGS) /DOVL0 /NT$(@F) /Fo$@ $(WIN)\topl.c
-
-$(OBJ)\topl.1-2: $(HACK_H)	$(INCL)\termcap.h	$(INCL)\wintty.h \
-	$(WIN)\topl.c
-	$(CC) $(CFLAGS) /DOVL1 /DOVL2 /NT$(@F) /Fo$@ $(WIN)\topl.c
-
-$(OBJ)\topl.b: $(HACK_H)	$(INCL)\termcap.h	$(INCL)\wintty.h \
-	$(WIN)\topl.c
-	$(CC) $(CFLAGS) /DOVLB /NT$(@F) /Fo$@ $(WIN)\topl.c
-
-$(OBJ)\wintty.o: $(HACK_H)	$(INCL)\wintty.h	$(INCL)\termcap.h \
-	$(WIN)\wintty.c
-	$(CC) $(CFLAGS) /DOVL0 /DOVL1 /DOVL2 /DOVLB /Fo$@ $(WIN)\wintty.c
-
-#
-#	$(SRC) files.
-#
-# DO NOT DELETE THIS LINE
-#
-
-$(OBJ)\allmain.0:	$(HACK_H)
-$(OBJ)\allmain.1:	$(HACK_H)
-$(OBJ)\allmain.2-b:	$(HACK_H)
-$(OBJ)\alloc.o:		$(CONFIG_H)
-$(OBJ)\apply.0:		$(HACK_H)	$(INCL)\edog.h
-$(OBJ)\apply.1:		$(HACK_H)	$(INCL)\edog.h
-$(OBJ)\apply.2-b:	$(HACK_H)	$(INCL)\edog.h
-$(OBJ)\artifact.0:	$(HACK_H)	$(INCL)\artifact.h  $(INCL)\artilist.h
-$(OBJ)\artifact.1:	$(HACK_H)	$(INCL)\artifact.h  $(INCL)\artilist.h
-$(OBJ)\artifact.2:	$(HACK_H)	$(INCL)\artifact.h  $(INCL)\artilist.h
-$(OBJ)\artifact.b:	$(HACK_H)	$(INCL)\artifact.h  $(INCL)\artilist.h
-$(OBJ)\attrib.0:	$(HACK_H)
-$(OBJ)\attrib.1:	$(HACK_H)
-$(OBJ)\attrib.2-b:	$(HACK_H)
-$(OBJ)\ball.o:		$(HACK_H)
-$(OBJ)\bones.o:		$(HACK_H)
-$(OBJ)\botl.0:		$(HACK_H)
-$(OBJ)\botl.1:		$(HACK_H)
-$(OBJ)\botl.2:		$(HACK_H)
-$(OBJ)\botl.b:		$(HACK_H)
-$(OBJ)\cmd.0:		$(HACK_H)	$(INCL)\func_tab.h
-$(OBJ)\cmd.1:		$(HACK_H)	$(INCL)\func_tab.h
-$(OBJ)\cmd.b:		$(HACK_H)	$(INCL)\func_tab.h
-$(OBJ)\dbridge.0:	$(HACK_H)
-$(OBJ)\dbridge.1-b:	$(HACK_H)
-$(OBJ)\decl.o:		$(HACK_H)	$(INCL)\quest.h
-$(OBJ)\detect.o:	$(HACK_H)	$(INCL)\artifact.h
-$(OBJ)\display.o:	$(HACK_H)
-$(OBJ)\do.0:		$(HACK_H)	$(INCL)\lev.h
-$(OBJ)\do.1:		$(HACK_H)	$(INCL)\lev.h
-$(OBJ)\do.2:		$(HACK_H)	$(INCL)\lev.h
-$(OBJ)\do.3:		$(HACK_H)	$(INCL)\lev.h
-$(OBJ)\do.b:		$(HACK_H)	$(INCL)\lev.h
-$(OBJ)\do_name.0:	$(HACK_H)
-$(OBJ)\do_name.1-b:	$(HACK_H)
-$(OBJ)\do_wear.0-1:	$(HACK_H)
-$(OBJ)\do_wear.2:	$(HACK_H)
-$(OBJ)\do_wear.b:	$(HACK_H)
-$(OBJ)\dog.0:		$(HACK_H)	$(INCL)\edog.h
-$(OBJ)\dog.1:		$(HACK_H)	$(INCL)\edog.h
-$(OBJ)\dog.2:		$(HACK_H)	$(INCL)\edog.h
-$(OBJ)\dog.b:		$(HACK_H)	$(INCL)\edog.h
-$(OBJ)\dogmove.0:	$(HACK_H)	$(INCL)\mfndpos.h	$(INCL)\edog.h
-$(OBJ)\dogmove.1-b:	$(HACK_H)	$(INCL)\mfndpos.h	$(INCL)\edog.h
-$(OBJ)\dokick.o:	$(HACK_H)	$(ESHK_H)
-$(OBJ)\dothrow.o:	$(HACK_H)
-$(OBJ)\drawing.o:	$(HACK_H)	$(INCL)\termcap.h
-$(OBJ)\dungeon.o:	$(HACK_H)	$(DGN_FILE_H)
-$(OBJ)\eat.0:		$(HACK_H)
-$(OBJ)\eat.1:		$(HACK_H)
-$(OBJ)\eat.2-b:		$(HACK_H)
-$(OBJ)\end.o:		$(HACK_H)	$(ESHK_H)
-$(OBJ)\engrave.0-1:	$(HACK_H)	$(INCL)\lev.h
-$(OBJ)\engrave.2:	$(HACK_H)	$(INCL)\lev.h
-$(OBJ)\engrave.b:	$(HACK_H)	$(INCL)\lev.h
-$(OBJ)\exper.o:		$(HACK_H)
-$(OBJ)\explode.o:	$(HACK_H)
-$(OBJ)\extralev.o:	$(HACK_H)
-$(OBJ)\files.o:		$(HACK_H)
-$(OBJ)\fountain.o:	$(HACK_H)
-$(OBJ)\hack.0:		$(HACK_H)
-$(OBJ)\hack.1:		$(HACK_H)
-$(OBJ)\hack.2:		$(HACK_H)
-$(OBJ)\hack.b:		$(HACK_H)
-$(OBJ)\hacklib.0:	$(HACK_H)
-$(OBJ)\hacklib.1:	$(HACK_H)
-$(OBJ)\hacklib.2-b:	$(HACK_H)
-$(OBJ)\invent.0:	$(HACK_H)	$(INCL)\artifact.h
-$(OBJ)\invent.1:	$(HACK_H)	$(INCL)\artifact.h
-$(OBJ)\invent.2:	$(HACK_H)	$(INCL)\artifact.h
-$(OBJ)\invent.3:	$(HACK_H)	$(INCL)\artifact.h
-$(OBJ)\invent.b:	$(HACK_H)	$(INCL)\artifact.h
-$(OBJ)\lock.0:		$(HACK_H)
-$(OBJ)\lock.1-b:	$(HACK_H)
-$(OBJ)\mail.0:		$(HACK_H)	$(INCL)\mail.h
-$(OBJ)\mail.1-b:	$(HACK_H)	$(INCL)\mail.h
-$(OBJ)\makemon.0-2:	$(HACK_H)	$(EPRI_H)	$(EMIN_H)
-$(OBJ)\makemon.b:	$(HACK_H)	$(EPRI_H)	$(EMIN_H)
-$(OBJ)\mcastu.o:	$(HACK_H)
-$(OBJ)\mhitm.0:		$(HACK_H)	$(INCL)\artifact.h	$(INCL)\edog.h
-$(OBJ)\mhitm.1-b:	$(HACK_H)	$(INCL)\artifact.h	$(INCL)\edog.h
-$(OBJ)\mhitu.0-1:	$(HACK_H)	$(INCL)\artifact.h	$(INCL)\edog.h
-$(OBJ)\mhitu.2-b:	$(HACK_H)	$(INCL)\artifact.h	$(INCL)\edog.h
-$(OBJ)\minion.o:	$(HACK_H)	$(EMIN_H)
-$(OBJ)\mklev.o:		$(HACK_H)
-$(OBJ)\mkmaze.o:	$(HACK_H)	$(SP_LEV_H)
-$(OBJ)\mkobj.0:		$(HACK_H)	$(INCL)\artifact.h	$(INCL)\prop.h
-$(OBJ)\mkobj.1:		$(HACK_H)	$(INCL)\artifact.h	$(INCL)\prop.h
-$(OBJ)\mkobj.2-b:	$(HACK_H)	$(INCL)\artifact.h	$(INCL)\prop.h
-$(OBJ)\mkroom.0:	$(HACK_H)
-$(OBJ)\mkroom.1-b:	$(HACK_H)
-$(OBJ)\mon.0-1:		$(HACK_H)	$(INCL)\mfndpos.h	$(INCL)\edog.h
-$(OBJ)\mon.2-b:		$(HACK_H)	$(INCL)\mfndpos.h	$(INCL)\edog.h
-$(OBJ)\mondata.0-1:	$(HACK_H)	$(ESHK_H)	$(EPRI_H)
-$(OBJ)\mondata.2:	$(HACK_H)	$(ESHK_H)	$(EPRI_H)
-$(OBJ)\mondata.b:	$(HACK_H)	$(ESHK_H)	$(EPRI_H)
-$(OBJ)\monmove.0-1:	$(HACK_H)	$(INCL)\mfndpos.h $(INCL)\artifact.h
-$(OBJ)\monmove.2-b:	$(HACK_H)	$(INCL)\mfndpos.h $(INCL)\artifact.h
-$(OBJ)\monst.o:		$(CONFIG_H)	$(PERMONST_H)	$(INCL)\monsym.h \
-			$(ESHK_H)	$(VAULT_H)	$(EPRI_H) \
-			$(INCL)\color.h
-$(OBJ)\monstr.o:	$(CONFIG_H)
-$(OBJ)\mplayer.o:	$(HACK_H)
-$(OBJ)\mthrowu.0:	$(HACK_H)
-$(OBJ)\mthrowu.1:	$(HACK_H)
-$(OBJ)\mthrowu.2-b:	$(HACK_H)
-$(OBJ)\muse.o:		$(HACK_H)
-$(OBJ)\music.o:		$(HACK_H)
-$(OBJ)\o_init.o:	$(HACK_H)
-$(OBJ)\objects.o:	$(CONFIG_H)	$(INCL)\obj.h	$(INCL)\objclass.h \
-			$(INCL)\prop.h	$(INCL)\color.h
-$(OBJ)\objnam.0-1:	$(HACK_H)
-$(OBJ)\objnam.2-b:	$(HACK_H)
-$(OBJ)\options.o:	$(HACK_H)	$(INCL)\termcap.h
-$(OBJ)\pager.o:		$(HACK_H)
-	$(CC) $(CFLAGS) /Od /Fo$(OBJ)\$*.o $*.c
-$(OBJ)\pickup.o:	$(HACK_H)
-$(OBJ)\pline.o:		$(HACK_H)	$(EPRI_H)
-$(OBJ)\polyself.0-1:	$(HACK_H)
-$(OBJ)\polyself.2-b:	$(HACK_H)
-$(OBJ)\potion.o:	$(HACK_H)
-$(OBJ)\pray.o:		$(HACK_H)	$(EPRI_H)
-$(OBJ)\priest.0:	$(HACK_H)	$(INCL)\mfndpos.h	$(ESHK_H) \
-			$(EPRI_H)	$(EMIN_H)
-$(OBJ)\priest.1-b:	$(HACK_H)	$(INCL)\mfndpos.h	$(ESHK_H) \
-			$(EPRI_H)	$(EMIN_H)
-$(OBJ)\quest.o:		$(HACK_H)	$(INCL)\quest.h	$(INCL)\qtext.h
-$(OBJ)\questpgr.o:	$(HACK_H)	$(INCL)\qtext.h
-$(OBJ)\read.0:		$(HACK_H)
-$(OBJ)\read.1-b:	$(HACK_H)
-$(OBJ)\rect.o:		$(HACK_H)
-$(OBJ)\restore.o:	$(HACK_H)	$(INCL)\lev.h	$(INCL)\termcap.h \
-			$(INCL)\quest.h
-$(OBJ)\rip.o:		$(HACK_H)
-$(OBJ)\rnd.0:		$(HACK_H)
-$(OBJ)\rnd.1:		$(HACK_H)
-$(OBJ)\rnd.2-b:		$(HACK_H)
-$(OBJ)\rumors.o:	$(HACK_H)
-$(OBJ)\save.o:		$(HACK_H)	$(INCL)\lev.h	$(INCL)\quest.h
-$(OBJ)\shk.0:		$(HACK_H)	$(ESHK_H)
-$(OBJ)\shk.1-b:		$(HACK_H)	$(ESHK_H)
-$(OBJ)\shknam.0:	$(HACK_H)	$(ESHK_H)
-$(OBJ)\shknam.1-b:	$(HACK_H)	$(ESHK_H)
-$(OBJ)\sit.o:		$(HACK_H)	$(INCL)\artifact.h
-$(OBJ)\sounds.0:	$(HACK_H)	$(INCL)\edog.h	$(ESHK_H)
-$(OBJ)\sounds.1-b:	$(HACK_H)	$(INCL)\edog.h	$(ESHK_H)
-$(OBJ)\sp_lev.o:	$(HACK_H)	$(SP_LEV_H)	$(INCL)\rect.h
-$(OBJ)\spell.o:		$(HACK_H)
-$(OBJ)\steal.0-1:	$(HACK_H)
-$(OBJ)\steal.2-b:	$(HACK_H)
-$(OBJ)\timeout.0:	$(HACK_H)
-$(OBJ)\timeout.1-b:	$(HACK_H)
-$(OBJ)\topten.o:	$(HACK_H)
-$(OBJ)\track.0:		$(HACK_H)
-$(OBJ)\track.1:		$(HACK_H)
-$(OBJ)\track.2-b:	$(HACK_H)
-$(OBJ)\trap.0-1:	$(HACK_H)	$(INCL)\edog.h
-$(OBJ)\trap.2:		$(HACK_H)	$(INCL)\edog.h
-$(OBJ)\trap.b:		$(HACK_H)	$(INCL)\edog.h
-$(OBJ)\u_init.o:	$(HACK_H)
-$(OBJ)\uhitm.o:		$(HACK_H)	$(INCL)\artifact.h
-$(OBJ)\vault.0:		$(HACK_H)	$(VAULT_H)
-$(OBJ)\vault.1-b:	$(HACK_H)	$(VAULT_H)
-$(OBJ)\version.o:	$(HACK_H)	$(INCL)\date.h	$(INCL)\patchlev.h
-$(OBJ)\vision.o:	$(HACK_H)	$(INCL)\vis_tab.h
-$(OBJ)\vis_tab.o:	$(HACK_H)	$(INCL)\vis_tab.h
-$(OBJ)\weapon.0-1:	$(HACK_H)
-$(OBJ)\weapon.2-b:	$(HACK_H)
-$(OBJ)\were.0:		$(HACK_H)
-$(OBJ)\were.1-b:	$(HACK_H)
-$(OBJ)\wield.o:		$(HACK_H)
-$(OBJ)\wizard.0:	$(HACK_H)	$(INCL)\qtext.h
-$(OBJ)\wizard.1-b:	$(HACK_H)	$(INCL)\qtext.h
-$(OBJ)\worm.o:		$(HACK_H)	$(INCL)\lev.h
-$(OBJ)\worn.o:		$(HACK_H)
-$(OBJ)\write.o:		$(HACK_H)
-$(OBJ)\zap.o:		$(HACK_H)
diff -Naurd ../nethack-3.3.1/sys/msdos/old/MakeMSC.utl ./sys/msdos/old/MakeMSC.utl
--- ../nethack-3.3.1/sys/msdos/old/MakeMSC.utl Sat Apr 4 03:22:54 1998
+++ ./sys/msdos/old/MakeMSC.utl Thu Jan 1 01:00:00 1970
@@ -1,322 +0,0 @@
-#	SCCS Id: @(#)MakeMSC.utl	 3.1	 93/05/23
-# Copyright (c) NetHack PC Development Team 1992, 1993.
-# NetHack may be freely redistributed.  See license for details.
-#
-# PC NetHack 3.1 Utilities Source Code Makefile for Microsoft(tm) "C" >= 6.0ax
-# and Microsoft Visual C++ Professional version >= 1.0.
-#
-#	In addition to your C compiler,
-#
-#	if you want to change		you will need a
-#	files with suffix		workalike for
-#	       .y			    yacc
-#	       .l			    lex
-
-#
-#	Executables.
-#
-
-CC	= cl
-LINK	= link
-MAKEBIN	= make45l
-
-#
-#	Yacc/Lex ... if you got 'em.
-#	(Note: if you don't, leave the top pair uncommented.)
-#
-
-YACC	= yacc
-LEX	= lex
-# YACC	= bison -y
-# LEX	= flex
-
-YTABC	= y_tab.c
-YTABH	= y_tab.h
-LEXYYC	= lexyy.c
-
-#
-#	Flags.
-#
-
-#
-#	+ prepare for CodeView symbolic debugger.
-#
-
-CDFLAGS	=
-#CDFLAGS = /Zi
-
-LDFLAGS =
-#LDFLAGS = /CO
-
-#
-#	CC
-#
-
-CPPFLAGS = /E /AL /c /Os /Gs /Gt20 /Zp1 /W0 /I$(INCL) $(CDFLAGS)
-CFLAGS	 = /AL /c /Os /Gs /Gt20 /Zp1 /W0 /I$(INCL) $(CDFLAGS)
-
-#
-#	Link
-#
-
-LFLAGS	= /noi /seg:512 /map /st:5120 $(LDFLAGS)
-
-#
-#	Directories
-#
-
-INCL	= ..\include
-DAT	= ..\dat
-SRC	= ..\src
-OBJ	= $(SRC)\o
-
-default: all
-#
-#	If you have yacc and lex programs and make any changes, comment
-#	out the upper two targets and uncomment the lower two.
-#
-
-do_yacc: yacc_msg
-do_lex:  lex_msg
-# do_yacc: yacc_act
-# do_lex:  lex_act
-
-#
-#	Optional C library specifier for those with non-standard
-#	libraries or a multiple-target library setup.
-#
-
-# CLIB	   = llibcer /nod
-CLIB	 =
-
-#############################################################################
-#
-# nothing below this line should have to be changed
-#
-
-#
-#	Utility Objects.
-#
-
-MAKESRC     =	makedefs.c
-
-SPLEVSRC    =   lev_yacc.c  lev_$(LEX).c  lev_main.c  panic.c
-
-DGNCOMPSRC  =   dgn_yacc.c  dgn_$(LEX).c  dgn_main.c
-
-MAKEOBJS    =	makedefs.o	  $(OBJ)\monst.o    $(OBJ)\objects.o
-
-SPLEVOBJS   =	lev_yacc.o	  lev_$(LEX).o	    lev_main.o \
-		$(OBJ)\alloc.o	  $(OBJ)\decl.o     $(OBJ)\drawing.o \
-		$(OBJ)\monst.o    $(OBJ)\objects.o  panic.o
-
-DGNCOMPOBJS =	dgn_yacc.o	  dgn_$(LEX).o	    dgn_main.o \
-		$(OBJ)\alloc.o	  panic.o
-
-RECOVOBJS   =	recover.o
-
-#
-#	Header Objects.
-#
-
-CONFIG_H   = $(GLOBAL_H)           $(INCL)\tradstdc.h $(INCL)\config.h
-DECL_H     = $(YOU_H)              $(INCL)\quest.h    $(INCL)\spell.h  \
-             $(INCL)\color.h       $(INCL)\obj.h      $(INCL)\onames.h \
-             $(INCL)\pm.h          $(INCL)\decl.h
-DGN_FILE_H = $(INCL)\align.h       $(INCL)\dgn_file.h
-DISPLAY_H  = $(MONDATA_H)          $(INCL)\vision.h   $(INCL)\display.h
-DUNGEON_H  = $(INCL)\align.h       $(INCL)\dungeon.h
-EMIN_H     = $(DUNGEON_H)          $(INCL)\emin.h
-EPRI_H     = $(DUNGEON_H)          $(INCL)\align.h    $(INCL)\epri.h
-ESHK_H     = $(DUNGEON_H)          $(INCL)\eshk.h
-GLOBAL_H   = $(PCCONF_H)           $(INCL)\coord.h    $(INCL)\global.h
-HACK_H     = $(CONFIG_H)           $(DUNGEON_H)       $(DECL_H)          \
-             $(DISPLAY_H)          $(RM_H)            $(INCL)\monsym.h   \
-             $(INCL)\mkroom.h      $(INCL)\objclass.h $(INCL)\trap.h     \
-             $(INCL)\flag.h        $(INCL)\vision.h   $(INCL)\wintype.h  \
-             $(INCL)\engrave.h     $(INCL)\rect.h     $(INCL)\winprocs.h \
-             $(INCL)\trampoli.h    $(INCL)\hack.h
-MONDATA_H  = $(INCL)\align.h       $(INCL)\mondata.h
-MONST_H    = $(INCL)\align.h       $(INCL)\monst.h
-PCCONF_H   = $(INCL)\micro.h       $(INCL)\system.h   $(INCL)\pcconf.h
-PERMONST_H = $(INCL)\monattk.h     $(INCL)\monflag.h  $(INCL)\align.h \
-             $(INCL)\permonst.h
-RM_H       = $(INCL)\align.h       $(INCL)\rm.h
-SP_LEV_H   = $(INCL)\align.h       $(INCL)\sp_lev.h
-VAULT_H    = $(DUNGEON_H)          $(INCL)\vault.h
-YOU_H      = $(MONST_H)            $(YOUPROP_H)       $(INCL)\align.h \
-             $(INCL)\attrib.h      $(INCL)\you.h
-YOUPROP_H  = $(PERMONST_H)         $(MONDATA_H)       $(INCL)\prop.h \
-             $(INCL)\pm.h          $(INCL)\youprop.h
-
-#
-#	Make Rules.
-#
-
-.SUFFIXES:  .exe .o .c .y .l
-
-.c.o:
-	$(CC) $(CFLAGS) /Fo$*.o $*.c
-
-#
-#	Primary Targets.
-#
-all:	utility.tag
-
-utility.tag: $(OBJ)             $(INCL)\onames.h     $(INCL)\pm.h \
-             $(SRC)\monstr.c    $(SRC)\vis_tab.c     lev_comp.exe \
-             dgn_comp.exe       recover.exe
-             echo utilities made > utility.tag
-
-$(OBJ):
-	if not exist $(OBJ)\*.* mkdir $(OBJ)
-
-clean:
-	del *.o
-	del *.map
-
-spotless: clean
-	if exist utility.tag	   del utility.tag
-	if exist makedefs.exe	   del makedefs.exe
-	if exist lev_comp.exe	   del lev_comp.exe
-	if exist dgn_comp.exe	   del dgn_comp.exe
-	if exist recover.exe	   del recover.exe
-	if exist $(INCL)\date.h	   del $(INCL)\date.h
-	if exist $(INCL)\onames.h  del $(INCL)\onames.h
-	if exist $(INCL)\pm.h	   del $(INCL)\pm.h
-	if exist $(INCL)\vis_tab.h del $(INCL)\vis_tab.h
-	if exist $(SRC)\monstr.c   del $(SRC)\monstr.c
-	if exist $(SRC)\vis_tab.c  del $(SRC)\vis_tab.c
-
-#
-#	Secondary Targets.
-#
-
-$(INCL)\onames.h: makedefs.exe
-	.\makedefs -o
-
-$(INCL)\pm.h: makedefs.exe
-	.\makedefs -p
-
-$(SRC)\monstr.c: makedefs.exe
-	.\makedefs -m
-
-$(SRC)\vis_tab.h: makedefs.exe
-	.\makedefs -z
-
-$(SRC)\vis_tab.c: makedefs.exe
-	.\makedefs -z
-
-#
-#	Makedefs Stuff
-#
-
-makedefs.exe:	$(MAKEOBJS)
-	$(LINK) $(LFLAGS) $(MAKEOBJS), $*.exe,, $(CLIB);
-
-makedefs.o:	$(CONFIG_H)	    $(PERMONST_H)      $(INCL)\objclass.h \
-		$(INCL)\monsym.h    $(INCL)\qtext.h	$(INCL)\patchlevel.h
-
-#
-#	Level Compiler Dependencies
-#
-
-lev_comp.exe:	$(SPLEVOBJS)
-	$(LINK) $(LFLAGS) $(SPLEVOBJS),lev_comp.exe,, $(CLIB);
-
-lev_yacc.o:	$(HACK_H)   $(SP_LEV_H)    lev_yacc.c
-	$(CC) $(CFLAGS) /Fo$*.o $*.c
-
-lev_$(LEX).o:	$(HACK_H)   $(SP_LEV_H)    $(INCL)\lev_comp.h \
-		lev_$(LEX).c
-	$(CC) $(CFLAGS) /Fo$*.o $*.c
-
-lev_main.o:	$(HACK_H)   $(SP_LEV_H)
-
-$(INCL)\lev_comp.h: lev_yacc.c
-
-lev_yacc.c:	lev_comp.y
-	$(MAKEBIN) YY=lev do_yacc
-
-lev_$(LEX).c:	lev_comp.l
-	$(MAKEBIN) YY=lev do_lex
-
-#
-#	Dungeon Dependencies
-#
-
-dgn_comp.exe:	$(DGNCOMPOBJS)
-	$(LINK) $(LFLAGS) $(DGNCOMPOBJS),$*.exe,, $(CLIB);
-
-dgn_yacc.o:	$(HACK_H)   $(DGN_FILE_H)  dgn_yacc.c
-	$(CC) $(CFLAGS) /Fo$*.o $*.c
-
-dgn_$(LEX).o:	$(HACK_H)   $(DGN_FILE_H)  $(INCL)\dgn_comp.h \
-		dgn_$(LEX).c
-	$(CC) $(CFLAGS) /Fo$*.o $*.c
-
-dgn_main.o:	$(HACK_H)
-
-$(INCL)\dgn_comp.h:	dgn_yacc.c
-
-dgn_yacc.c: dgn_comp.y
-	$(MAKEBIN) YY=dgn do_yacc
-
-dgn_$(LEX).c:  dgn_comp.l
-	$(MAKEBIN) YY=dgn do_lex
-
-#
-#	Yacc & Lex Magic.
-#
-
-yacc_msg:
-	@echo $(YY)_comp.y has changed. To update $(YY)_yacc.c and $(YY)_comp.h run $(YACC).
-
-yacc_act:
-	$(YACC) -d $(YY)_comp.y
-	copy $(YTABC) $(YY)_yacc.c
-	copy $(YTABH) $(INCL)\$(YY)_comp.h
-	del $(YTABC)
-	del $(YTABH)
-
-lex_msg:
-	@echo $(YY)_comp.l has changed. To update $(YY)_$(LEX).c run $(LEX).
-
-lex_act:
-	$(LEX) $(YY)_comp.l
-	copy $(LEXYYC) $(YY)_$(LEX).c
-	del $(LEXYYC)
-
-#
-#	Recover Utility
-#
-
-recover.exe:	$(RECOVOBJS)
-	$(LINK) $(LFLAGS) $*.o,$*.exe,, $(CLIB);
-
-recover.o:	$(CONFIG_H)	recover.c
-	$(CC) $(CFLAGS) /Fo$*.o $*.c
-
-#
-#	Other Dependencies.
-#
-
-$(OBJ)\alloc.o:	$(CONFIG_H)	$(SRC)\alloc.c
-	$(CC) $(CFLAGS) /Fo$(OBJ)\$*.o $(SRC)\$*.c
-
-$(OBJ)\decl.o:  $(HACK_H)       $(INCL)\quest.h   $(SRC)\decl.c
-	$(CC) $(CFLAGS) /Fo$(OBJ)\$*.o $(SRC)\$*.c
-
-$(OBJ)\drawing.o: $(HACK_H)     $(INCL)\termcap.h $(SRC)\drawing.c
-	$(CC) $(CFLAGS) /Fo$(OBJ)\$*.o $(SRC)\$*.c
-
-$(OBJ)\monst.o: $(CONFIG_H)	     $(PERMONST_H)	$(ESHK_H)	 \
-		$(EPRI_H)	     $(VAULT_H)		$(INCL)\monsym.h \
-		$(INCL)\color.h    $(SRC)\monst.c
-	$(CC) $(CFLAGS) /Fo$(OBJ)\$*.o $(SRC)\$*.c
-
-$(OBJ)\objects.o: $(CONFIG_H)	     $(INCL)\obj.h	$(INCL)\objclass.h \
-		  $(INCL)\prop.h     $(INCL)\color.h	$(SRC)\objects.c
-	$(CC) $(CFLAGS) /Fo$(OBJ)\$*.o $(SRC)\$*.c
-
-panic.o:	$(CONFIG_H)
diff -Naurd ../nethack-3.3.1/sys/msdos/old/ovlmgr.asm ./sys/msdos/old/ovlmgr.asm
--- ../nethack-3.3.1/sys/msdos/old/ovlmgr.asm Sat Apr 4 03:22:51 1998
+++ ./sys/msdos/old/ovlmgr.asm Thu Jan 1 01:00:00 1970
@@ -1,2124 +0,0 @@
-;	SCCS Id: @(#)ovlmgr.asm 		91/09/04
-;  Copyright (c) 1989, 1990, 1991, 1992, 1993 Pierre Martineau and
-;  Stephen Spackman.  All Rights Reserved.
-;  This product may be freely redistributed.  See NetHack license for details.
-
-VERSION 	EQU	3100h
-
-		PAGE	57,132
-		TITLE	'DOS Overlay Manager for MSC 5.1+'
-		SUBTTL	'Copyright (c) 1989, 1990, 1991, 1992, 1993 Pierre Martineau and Stephen Spackman. All Rights Reserved.'
-
-; Multiple overlay file support for v30a0 by Norm Meluch with some input from Stephen.
-
-; acknowledgements:   - Many thanks to Norm Meluch for his invaluable help
-;		      - No thanks to Microsoft
-;		      - alltrsidsctysti!!!
-;		      - izchak and friends for impetus
-;		      - us for brilliance
-;		      - coffee for speed
-;		      - others as necessary
-
-; assumptions:	      - all registers are preserved including flags
-;		      - the stack is preserved
-;		      - re-entrancy is not required
-
-; options:	      /Di386	use 80386-specific opcodes
-;				(faster, but no good for weaker machines)
-;		      /DNOEMS	omit EMS support
-;				(needed if application uses EMS)
-;		      /DNOSPLIT	omit support for external .OVL files
-
-DOSALLOC	EQU	48h			; memory allocation
-DOSFREE 	EQU	49h			; free allocated memory
-DOSREALLOC	EQU	4ah			; modify memory block
-DOSREAD 	EQU	3fh			; read bytes from handle
-DOSSEEK 	EQU	42h			; logical handle seek
-DOSOPEN 	EQU	3dh			; open handle
-DOSCLOSE	EQU	3eh			; close handle
-DOSSETDTA	EQU	1ah			; Set Data transfer area
-DOSGETDTA	EQU	2fh			; Get Data transfer area
-DOSSEARCH	EQU	4eh			; Search for 1st file match
-DOSNEXTFILE	EQU	4fh			; Search for next file match
-DOSEXEC 	EQU	4bh			; exec child process
-DOSPUTC 	EQU	02h			; print a char
-DOSVERSION	EQU	30h			; get version number
-DOSGETVEC	EQU	35h			; get interrupt vector
-DOSGETSWITCH	EQU	3700h			; get DOS switchar
-DOS		EQU	21h			; Dos interrupt #
-PRINT		EQU	09h			; print string
-TERMINATE	EQU	4ch			; terminate process
-EMM		EQU	67h			; EMM handler int vector
-EMMSTATUS	EQU	40h			; get EMM status
-EMMFRAME	EQU	41h			; get EMM page frame
-EMMTOTALS	EQU	42h			; get EMM pages available
-EMMALLOC	EQU	43h			; allocate EMM pages
-EMMMAP		EQU	44h			; map EMM pages
-EMMFREE 	EQU	45h			; free EMM pages
-MAXNAMESIZE	EQU	50h			; max path name size
-MAXFILES	EQU	0Eh			; max # of *.OVL files
-EXESIGNUM	EQU	5a4dh			; Exe header signature
-CR		EQU	0dh
-LF		EQU	0ah
-ESCAPE		EQU	1bh
-BELL		EQU	07h
-PARSIZ		EQU	10h			; this is the size of a paragraph - this better not change!
-FAERIE		EQU	00h			; Used for dummy segment allocation
-
-NOERR		EQU	0
-DOSERR		EQU	1
-FILEERR 	EQU	2
-NOMEMERR	EQU	3
-FILEIOERR	EQU	4
-VICTIMERR	EQU	5
-RELERR		EQU	6
-EMSERR		EQU	7
-HDRERR		EQU	8
-NAMERR		EQU	9
-OVLERR		EQU	10
-NOHDRERR	EQU	11
-
-; The following EXTRNs are supplied by the linker
-
-EXTRN		$$OVLBASE:BYTE			; segment of OVERLAY_AREA
-EXTRN		$$MPGSNOVL:BYTE 		; ^ to module table
-EXTRN		$$MPGSNBASE:WORD		; ^ to module segment fixups
-EXTRN		$$INTNO:BYTE			; interrupt number to be used
-EXTRN		$$COVL:WORD			; number of physical overlays
-EXTRN		$$CGSN:WORD			; number of modules
-EXTRN		$$MAIN:FAR			; ^ to function main()
-
-PUBLIC		$$OVLINIT			; Our entry point
-						; called by the c startup code
-IFDEF i386
-OP32		MACRO				; 32 bit operand override
-		DB	066h
-		ENDM
-
-pusha		MACRO				; push all registers
-		DB	060h
-		ENDM
-
-popa		MACRO				; pop all registers
-		DB	061h
-		ENDM
-ENDIF
-
-ovlflgrec	RECORD	locked:1=0,ems:1=0,loaded:1=0,file:4=0,pad:1 ; overlay flags
-		; "file" is the overlay file this overlay is in; 0 is the .EXE
-		; itself. Otherwise, the numbers are arbitrary.
-
-; This is a dirty hack. What we need is a virtual segment that will be built
-; by the (our) loader in multiple copies, one per overlay. Unfortunately, this
-; doesn't seem to be a sensible idea in the minds of the folks at Microsoft.
-; Declaring this segment AT will ensure that it never appears in the exefile,
-; and ASSUME is dumb enough to be fooled.
-;
-; The reason we want to do this is also not-to-be-tried-at-home: it turns out
-; that we can code a faster interrupt handler if we map overlay numbers to
-; segment values. Normally we would consider this unacceptable programming
-; practise because it is 86-mode specific, but the *need* for this entire
-; programme is 86-mode specific, anyway.
-
-pspseg		SEGMENT PARA AT FAERIE		; dummy segment for psp
-		ORG	2ch			; ^ to segment of environmemt in psp
-pspenv		LABEL	WORD
-pspseg		ENDS
-
-ovltbl		SEGMENT PARA AT FAERIE		; Dummy segment definition for overlay table
-
-; NOTE: This segment definition MUST be exactly 16 bytes long
-
-ovlflg		ovlflgrec	<0,0,0,0,0> 	; overlay flags
-ovlinvcnt	DB	?			; invocation count
-ovlmemblk	DW	?			; ^ to allocated memory block
-ovllrudat	DD	?			; misc lru data (pseudo time stamp)
-ovlemshdl	DW	?			; ovl ems memory handle
-ovlfiloff	DW	?			; ovl file offset in pages (512 bytes)
-ovlsiz		DW	?			; ovl size in paragraphs
-ovlhdrsiz	DW	?			; hdr size in paragraphs
-
-IF1
-IF		($ - ovlflg) GT PARSIZ
-		.ERR
-		%OUT This segment MUST be no more than 16 bytes, REALLY!!!
-ENDIF
-ENDIF
-
-OVLSEGSIZ	EQU	PARSIZ			; this had better be true!!! (16 bytes)
-
-ovltbl		ENDS
-
-DTASTRUC	STRUC				; internal DTA for ovlmgr
-		DB	21 DUP (0)
-file_attr	DB	0
-file_time	DW	0
-file_date	DW	0
-file_size	DD	0
-file_name	DB	9 DUP (0)
-file_ext	DB	3 DUP (0)
-dtapad		DB	86 DUP (0)		; Pad to 128 bytes
-DTASTRUC	ENDS
-
-EXEHDR		STRUC				; structure of an EXE header
-exesign 	DW	EXESIGNUM		; signature
-exelstpgesiz	DW	?			; last page size (512 byte pages)
-exesiz		DW	?			; total pages (including partial last page)
-relocitems	DW	?			; number of relocation entries
-hdrparas	DW	?			; number of paragraphs in the header
-minalloc	DW	?			; minimum paragraph allocation
-maxalloc	DW	?			; maximum patagraph allocation
-exess		DW	?			; initial stack segment
-exesp		DW	?			; initial stack pointer
-exechksum	DW	?			; checksum
-exeip		DW	?			; initial instruction pointer
-execs		DW	?			; initial code segment
-reloctbloff	DW	?			; offset from beginning of header to relocation table
-exeovlnum	DW	?			; overlay number
-EXEHDR		ENDS
-
-MASK_used	EQU	1			; memory block flag
-
-MEMCTLBLK	STRUC				; memory block structure
-memblkflg	DB	?			; flags
-memblkpad1	DB	?			; go ahead, delete me!
-memblknxt	DW	?			; ^ to next block
-memblkprv	DW	?			; ^ to previous block
-memblkovl	DW	?			; ^ to overlay occupying this block
-memblksiz	DW	?			; size in paragraphs
-memblkpad	DB	PARSIZ - memblkpad MOD PARSIZ DUP (?) ; pad to 16 bytes
-MEMCTLBLK	ENDS
-
-MEMCTLBLKSIZ	EQU	TYPE MEMCTLBLK / PARSIZ ; should equal 1 paragraph
-
-;-------------------------------------------------------------------------------
-
-code		SEGMENT PUBLIC
-
-; NOTE: the following order is optimum for alignment purposes across the
-;	entire INTEL 80x86 family of processors.
-
-ovltim		DD	?			; pseudo-lru time variable
-farcall 	DD	?			; internal trampoline.
-oldvec		DD	-1			; saved interrupt vector
-oldint21	DD	-1			; saved int 21 vector
-sireg		DW	?			; temp save area
-IFDEF i386
-		DW	?			; for esi
-ENDIF
-dsreg		DW	?			; temp save area
-ssreg		DW	?
-spreg		DW	?
-ovlfilhdl	DW	MAXFILES+1 DUP (-1)  	; always-open file handles for .EXE, .OVL
-ovltblbse	DW	-1			; segment of first overlay descriptor
-memblks 	DW	16 DUP (-1)		; allocated memory blocks
-memblk1st	DW	?			; first memory block
-emsmemblks	DW	16 DUP (-1)		; ems allocated memory blocks (64K each)
-curemshandle	DW	-1			; currently mapped handle
-ovlcnt		DW	?			; # overlays
-modcnt		DW	?			; # of modules
-ovlrootcode	DW	?			; logical segment of OVERLAY_AREA
-ovldata 	DW	?			; logical segment of OVERLAY_END
-pspadd		DW	?			; our psp address + 10h (for relocations)
-emsframe	DW	?			; EMM page frame segment
-moduletbl	DD	256 DUP (?)		; module lookup table (256 modules)
-curovl		DW	OFFSET stkframe 	; ^ into stack frame
-stkframe	DW	256*3 DUP (?)		; internal stack (256 ovls deep)
-tempmem 	DW	16 DUP (-1)		; temp mem block storage
-intnum		DW	?			; ovlmgr int number
-hdr		EXEHDR	<>			; EXE header work area
-		DB	512-TYPE EXEHDR DUP (?) ; exe hdr buffer for relocations
-EXEHDRTMPSIZ	EQU	$ - hdr 		; size of temp reloc buffer
-filestring	DB	MAXNAMESIZE DUP (0)	; string space for file specs
-pathlen		DW	?			; path length of file spec
-namelen		DW	?			; length of file names
-ovldta		DTASTRUC <>			; DTA for ovlmgr use
-dtaseg		DW	?			; DTA segment for program
-dtaoffset	DW	?			; DTA offset for program
-errortbl	DW	-1			; error message pointers
-		DW	OFFSET baddos
-		DW	OFFSET nofile
-		DW	OFFSET noroom
-		DW	OFFSET badio
-		DW	OFFSET nocore
-		DW	OFFSET nocore
-		DW	OFFSET badems
-		DW	OFFSET badhdr
-		DW	OFFSET badnam
-		DW	OFFSET noovl
-		DW	OFFSET nohdr
-		DW	OFFSET unknown
-		DW	OFFSET unknown
-		DW	OFFSET unknown
-		DW	OFFSET unknown
-emmname 	DB	"EMMXXXX0"              ; EMM device driver name
-emmtot		DW	0			; total emm blocks free
-emmframesiz	DW	4			; frame size in blocks
-emmflg		DB	0			; EMM present flag
-
-i386code	DB	'386 specific code enabled.',CR,LF,'$'
-memavl		DB	'Conventional memory available: $'
-paragraphs	DB	'H paragraphs.',CR,LF,'$'
-emsavl		DB	'EMS memory available: $'
-pages		DB	'H 16K-pages.',CR,LF,'$'
-baddos		DB	'Incorrect DOS version. Must be 3.00 or later.$'
-nofile		DB	'Inaccessible EXE file. Can',39,'t load overlays.$'
-noroom		DB	'Not enough free memory left to run this program.$'
-badio		DB	'File I/O error.$'
-nocore		DB	'Internal memory allocation failure.$'
-badems		DB	'EMS memory manager error.$'
-badhdr		DB	'Executable or overlay header missing or damaged.$'
-badnam		DB	'Unable to resolve overlay file names.$'
-noovl		DB	'Inaccessible OVL file. Can',39,'t load overlays.$'
-nohdr		DB	'Incomplete executable.  OVL files missing?$'
-unknown 	DB	'Unknown error!$'
-msghead 	DB	ESCAPE,'[0m',ESCAPE,'[K',CR,LF,ESCAPE,'[K',ESCAPE,'[1mOVLMGR:',ESCAPE,'[0m $'
-diag		DB	ESCAPE,'[K',CR,LF,ESCAPE,'[K','        ($'
-msgtail 	DB	ESCAPE,'[K',CR,LF,ESCAPE,'[K',BELL,'$'
-ovlext		DB	'?.OVL',0
-
-;-------------------------------------------------------------------------------
-
-$$OVLINIT	PROC	FAR			; Init entry point
-
-		ASSUME	CS:code,DS:pspseg,ES:NOTHING
-
-		push	ax
-		push	bx
-		push	cx
-		push	dx
-		push	si
-		push	di
-		push	bp
-		push	ds
-		push	es			; save the world
-
-		cld
-		mov	ax,ds			; get our psp
-		add	ax,10h
-		mov	pspadd,ax		; save it
-		mov	ah,DOSVERSION
-		int	DOS
-		cmp	al,3			; DOS 3.0 or later
-		jnc	doenvthing
-		mov	al,DOSERR		; incorrect version of dos
-		jmp	putserr
-doenvthing:
-		mov	ds,pspenv		; get environment segment
-		mov	si,-1
-envloop:					; search for end of environment
-		inc	si
-		cmp	WORD PTR [si],0
-		jnz	envloop
-		add	si,4			; point to EXE filename
-
-		call	openfiles		; Search & open overlay files
-IFNDEF NOEMS
-chkems:
-		mov	ah,DOSGETVEC
-		mov	al,EMM
-		int	DOS
-		mov	ax,cs
-		mov	ds,ax
-		mov	di,0ah
-		mov	si,OFFSET emmname
-		mov	cx,8
-		repe	cmpsb
-		mov	al,0
-		jnz	setemmflg
-		mov	al,-1
-setemmflg:
-		mov	emmflg,al
-		jnz	noemshere
-		mov	ah,EMMFRAME
-		int	EMM
-		mov	emsframe,bx
-		mov	ah,EMMTOTALS
-		int	EMM
-		mov	emmtot,bx
-noemshere:
-ENDIF
-		mov	ax,SEG $$OVLBASE	; OVERLAY_AREA segment
-		mov	ovlrootcode,ax
-		mov	ax,SEG $$COVL		; segment of DGROUP
-		mov	ds,ax
-		mov	bx,$$CGSN		; number of modules
-		mov	modcnt,bx		; save for later use
-		mov	bx,$$COVL		; number of physical overlays
-		mov	ovlcnt,bx		; save for later use
-
-; Now allocate memory
-		mov	ah,DOSALLOC		; bx contains # paras needed for ovltbl
-		int	DOS
-		jnc	gotovlram
-		jmp	buyram
-gotovlram:
-		mov	ovltblbse,ax		; overlay descriptor table begins at start of memory block
-
-		mov	cx,ovlcnt
-zeromem:
-		mov	es,ax
-		mov	es:ovlflg,0		; initialise ovl flags
-		mov	es:ovlinvcnt,0		; initialise invocation count
-		mov	es:ovlmemblk,0
-		mov	WORD PTR es:ovllrudat,0	 ; initialise ovl lru
-		mov	WORD PTR es:ovllrudat+2,0
-		mov	es:ovlemshdl,-1
-		mov	es:ovlfiloff,0		; initialize file offset
-		mov	es:ovlsiz,0		; initialize overlay size
-		mov	es:ovlhdrsiz,0
-		inc	ax
-		loop	zeromem		
-
-		mov	ax,cs
-		mov	ds,ax
-IFDEF DEBUG
-IFDEF i386
-		mov	ah,print
-		mov	dx,OFFSET msghead
-		int	DOS
-		mov	ah,print
-		mov	dx,OFFSET i386code
-		int	DOS
-ENDIF
-		mov	ah,print
-		mov	dx,OFFSET msghead
-		int	DOS
-		mov	ah,print
-		mov	dx,OFFSET memavl
-		int	DOS
-		mov	ax,0a000h
-		sub	ax,ovltblbse
-		call	itoa
-		mov	ah,print
-		mov	dx,OFFSET paragraphs
-		int	DOS
-IFNDEF NOEMS
-		mov	ah,print
-		mov	dx,OFFSET msghead
-		int	DOS
-		mov	ah,print
-		mov	dx,OFFSET emsavl
-		int	DOS
-		mov	ax,emmtot
-		call	itoa
-		mov	ah,print
-		mov	dx,OFFSET pages
-		int	DOS
-ENDIF
-ENDIF
-		ASSUME	ES:ovltbl
-
-		xor	bp,bp
-		xor	di,di
-		xor	si,si			; file handle loop ctr
-filsegtbllpp:					; initialise ovl table
-		call	gethdr			; get an EXE header
-
-		mov	ax,ovltblbse
-		add	ax,hdr.exeovlnum
-		mov	es,ax			; ^ to ovl table entry
-IFNDEF NOSPLIT
-		mov	cx,si			; set file # in ovlflg
-		shl	cx,1
-		mov	ovlflg,cl
-ENDIF
-		mov	ax,hdr.exesiz
-		shl	ax,1
-		shl	ax,1
-		shl	ax,1
-		shl	ax,1
-		shl	ax,1			; * 32
-		mov	dx,hdr.exelstpgesiz
-		or	dx,dx
-		jz	emptypage
-		shr	dx,1
-		shr	dx,1
-		shr	dx,1
-		shr	dx,1			; / 16
-		inc	dx
-		sub	ax,20h
-		add	ax,dx
-emptypage:
-		sub	ax,hdr.hdrparas 	; actual size of code
-		mov	ovlsiz,ax		; overlay size in paragraphs
-		cmp	hdr.exeovlnum,0 	; skip if ovl 0 (root code)
-		jz	notlargest
-		cmp	ax,di			; find largest ovl
-		jc	notlargest
-		mov	di,ax
-notlargest:
-		mov	ax,hdr.hdrparas
-		shl	ax,1
-		shl	ax,1
-		shl	ax,1
-		shl	ax,1
-		mov	ovlhdrsiz,ax		; hdr size in bytes
-		mov	ovlfiloff,bp		; initialise ovl file offset
-		add	bp,hdr.exesiz		; ^ to next overlay
-		mov	dx,bp
-		mov	cl,dh
-		mov	dh,dl
-		xor	ch,ch
-		xor	dl,dl
-		shl	dx,1
-		rcl	cx,1			; cx:dx = bp * 512
-		mov	al,0
-		mov	ah,DOSSEEK		; seek to next ovl
-		int	DOS
-
-		mov	cx,ovlcnt		; check if all overlays found
-		mov	ax,ovltblbse
-		dec	cx			; ovlcnt includes root
-		add	ax,cx
-ovloop:
-		mov	es,ax
-IFNDEF NOSPLIT
-		mov	bl,ovlflg
-		and	bx,MASK file
-
-		cmp	bx,0			; if file # is 0
-		jne	again
-ENDIF
-		cmp	ovlfiloff,0		; and offset is 0
-		jne	again
-		jmp	filsegtbllpp		; then we're still looking
-again:
-		dec	ax
-		loop	ovloop
-
-		ASSUME	ES:nothing		; prepare first memory block
-
-		mov	ax,ovlrootcode		; OVERLAY_AREA segment
-		mov	memblk1st,ax		; save pointer to first mem block
-		mov	es,ax
-		mov	es:memblkflg,0		; clear mem flags
-		mov	es:memblknxt,0		; set next to nothing
-		mov	es:memblkprv,0		; set previous to nothing
-		mov	es:memblkovl,0		; no overlay loaded
-		mov	es:memblksiz,di 	; di contains OVERLAY_AREA size in paragraphs
-		add	ax,di
-		mov	ovldata,ax		; end of OVERLAY_END
-		push	di
-		mov	es,ovltblbse		; temporary
-		call	getemsmem		; see if any ems available
-		mov	es:ovlemshdl,-1 	; fix these!
-		and	es:ovlflg,NOT MASK ems
-		push	dx
-		call	getmoreram		; see if there are any other pieces lying around
-		pop	ax
-		pop	di
-		or	ax,ax			; any ems?
-		jnz	noramcheck
-		inc	di
-		cmp	dx,di
-		jc	buyram
-noramcheck:
-		mov	WORD PTR ovltim,0	; initialise global lru time stamp
-		mov	WORD PTR ovltim+2,0
-		mov	di,OFFSET stkframe
-		mov	WORD PTR cs:[di],-1	; initialise stack frame
-		add	di,6
-		mov	ax,ovltblbse
-		mov	cs:[di],ax
-		mov	curovl,di		; initialise stack frame pointer
-		mov	es,ax
-		mov	es:ovlflg,MASK locked OR MASK loaded ; set flags on ovl 0
-		jmp	short chgintvec
-buyram:
-		mov	al,NOMEMERR		; free up some TSRs or something
-		jmp	putserr
-chgintvec:
-		mov	ax,SEG $$INTNO
-		mov	ds,ax
-		mov	al,$$INTNO		; get int number to use
-		xor	ah,ah
-		shl	ax,1
-		shl	ax,1
-		mov	intnum,ax
-		call	setvectors		; set up interrupt vectors
-		mov	cx,modcnt		; module count
-		mov	ax,SEG $$MPGSNBASE
-		mov	es,ax
-		mov	ax,cs
-		mov	ds,ax
-
-		ASSUME	DS:code
-
-		mov	bx,OFFSET $$MPGSNBASE	; ^ to linker provided overlay segment fixups
-		mov	si,OFFSET $$MPGSNOVL	; ^ to linker provided module table
-		mov	di,OFFSET moduletbl	; ^ to our module table
-modloop:
-		mov	al,es:[si]		; real physical ovl number
-		xor	ah,ah
-		add	ax,ovltblbse		; ovlctlseg address
-		mov	[di],ax 		; save in module table
-		mov	ax,es:[bx]		; get seg fixup
-		sub	ax,ovlrootcode		; adjust for relative reference
-		mov	[di+2],ax		; save in module table
-		add	di,4
-		add	bx,2
-		inc	si
-		loop	modloop
-		pop	es
-		pop	ds
-		pop	bp
-		pop	di
-		pop	si
-		pop	dx
-		pop	cx
-		pop	bx
-		pop	ax			; restore the world
-		jmp	$$MAIN			; And away we go!
-
-$$OVLINIT	ENDP
-
-;-------------------------------------------------------------------------------
-
-ovlmgr		PROC	FAR			; This is the it!
-
-		ASSUME	DS:NOTHING,ES:NOTHING
-
-IFDEF i386
-		OP32
-ENDIF
-		mov	sireg,si		; preserve si
-		mov	dsreg,ds		; and ds
-		pop	si			; retrieve caller ip
-		pop	ds			;     "      "    cs
-		push	ax
-		push	bx
-		cld
-		lodsb				; module # to call
-		xor	ah,ah
-		mov	bx,ax
-		lodsw				; offset in ovl to call
-		mov	WORD PTR farcall,ax	; into trampoline
-		mov	ax,si
-		mov	si,curovl		; get stack frame pointer
-		add	si,6			; update stack
-		mov	cs:[si-4],ds		; save return seg
-		mov	cs:[si-2],ax		; and return offset
-
-		shl	bx,1
-		shl	bx,1			; * 4 (2 words/entry in module tbl)
-		add	bx,OFFSET moduletbl
-		mov	ds,cs:[bx]		; ovl tbl entry
-		mov	ax,cs:[bx+2]		; segment fixup
-		mov	cs:[si],ds		; ovl entry into stack frame
-		mov	curovl,si
-
-		ASSUME	DS:ovltbl
-
-IFDEF i386
-		OP32
-ENDIF
-		mov	si,WORD PTR ovltim	; lru time stamp
-IFDEF i386
-		OP32
-ENDIF
-		inc	si			; time passes!
-IFDEF i386
-		OP32
-ENDIF
-		mov	WORD PTR ovltim,si	; update global clock
-IFDEF i386
-		OP32
-ENDIF
-		mov	WORD PTR ovllrudat,si	; as well as ovl clock
-IFNDEF i386
-		mov	si,WORD PTR ovltim+2
-		jz	ininc			; dword increment
-cryupcdon:
-		mov	WORD PTR ovllrudat+2,si ; as well as ovl clock
-ENDIF
-		test	ovlflg,MASK loaded	; ovl loaded?
-		jz	inload			; load it or map it then.
-ovlloadedupc:
-		inc	ovlinvcnt
-		add	ax,ovlmemblk		; add fixup and segment address
-		mov	WORD PTR farcall+2,ax	; into trampoline
-IFDEF i386
-		OP32
-ENDIF
-		mov	si,sireg		; retore all registers
-		mov	ds,dsreg
-		pop	bx
-		pop	ax
-		popf				; don't forget these!
-		call	DWORD PTR farcall	; and GO
-		pushf				; preserve registers again!
-		mov	dsreg,ds
-IFDEF i386
-		OP32
-ENDIF
-		mov	sireg,si
-		mov	si,curovl		; stack frame pointer
-		mov	ds,cs:[si]
-		dec	ovlinvcnt
-		sub	si,6			; adjust stack
-		mov	ds,cs:[si]		; retrieve ovl tbl entry
-		push	cs:[si+2]		; set return address
-		push	cs:[si+4]
-		mov	curovl,si
-IFDEF i386
-		OP32
-ENDIF
-		mov	si,WORD PTR ovltim	; do the lru thing again
-IFDEF i386
-		OP32
-ENDIF
-		inc	si
-IFDEF i386
-		OP32
-ENDIF
-		mov	WORD PTR ovltim,si
-IFDEF i386
-		OP32
-ENDIF
-		mov	WORD PTR ovllrudat,si
-IFNDEF i386
-		mov	si,WORD PTR ovltim+2
-		jz	outinc
-crydncdon:
-		mov	WORD PTR ovllrudat+2,si
-ENDIF
-		test	ovlflg,MASK loaded	; ovl loaded?
-		jz	outload 		; better get it before someone notices
-jmpback:
-IFDEF i386
-		OP32
-ENDIF
-		mov	si,sireg		; get registers back
-		mov	ds,dsreg
-		iret				; and GO back
-
-IFNDEF i386
-ininc:
-		inc	si
-		mov	WORD PTR ovltim+2,si	; update global and
-		jmp	cryupcdon
-ENDIF
-
-inload:
-		test	ovlflg,MASK ems
-		jz	infile
-		push	ax
-		mov	ax,ovlemshdl
-		call	mappage
-		pop	ax
-		jmp	ovlloadedupc
-infile:
-		call	loadoverlay		; self explanatory
-		jmp	ovlloadedupc
-
-IFNDEF i386
-outinc:
-		inc	si
-		mov	WORD PTR ovltim+2,si
-		jmp	crydncdon
-ENDIF
-
-outload:
-		test	ovlflg,MASK ems
-		jz	outfile
-		push	ax
-		mov	ax,ovlemshdl
-		call	mappage
-		pop	ax
-		jmp	jmpback
-outfile:
-		call	loadoverlay
-		jmp	jmpback
-
-ovlmgr		ENDP
-
-;-------------------------------------------------------------------------------
-
-loadoverlay	PROC	NEAR			; load overlay pointed to by es
-
-		ASSUME	DS:NOTHING,ES:ovltbl
-
-IFDEF i386
-		OP32
-		pusha			       ; eax,ecx,edx,ebx,esp,ebp,esi,edi
-ELSE
-		push	ax
-		push	cx
-		push	dx
-		push	bx
-		push	bp
-		push	si
-		push	di
-ENDIF
-		push	ds
-		push	es			; just in case
-		mov	ax,ds
-		mov	es,ax
-		cmp	ovlinvcnt,0
-		jnz	fxdadr			; Yup, it's a toughie
-		mov	ax,ovlsiz		; How much?
-		call	getpages		; never fail mem alloc, you bet.
-		jmp	gleaner
-fxdadr:
-		call	releasepages		; free memory where this ovl should be loaded
-gleaner:
-		add	ax,MEMCTLBLKSIZ 	; skip mem ctl blk
-		mov	ovlmemblk,ax		; memory block to use
-		mov	ds,ax
-		mov	dx,ovlfiloff		; where in the file is it?
-		mov	cl,dh
-		mov	dh,dl
-		xor	ch,ch
-		xor	dl,dl
-		shl	dx,1
-		rcl	cx,1			; cx:dx = dx * 512
-		mov	ax,ovlhdrsiz
-		push	cx
-		push	dx
-		add	dx,ax
-		adc	cx,0			; position to code
-		mov	ah,DOSSEEK		; lseek to code
-		mov	al,0			; from beginning of file
-		mov	bl,ovlflg
-		and	bx,MASK file
-		mov	bx,ovlfilhdl[bx] 	; never closing handle
-		int	DOS
-		jc	burnhead		; oops!
-		xor	dx,dx			; buf = ds:0
-		mov	cx,ovlsiz		; number of paragraphs to load
-		shl	cx,1
-		shl	cx,1
-		shl	cx,1
-		shl	cx,1			; * 16 = number of bytes
-		mov	ah,DOSREAD		; prevent random DOS behaviour
-		int	DOS			; read in code
-		jc	burnhead		; double oops!
-		pop	dx
-		pop	cx			; position of hdr
-		mov	ah,DOSSEEK		; lseek to hdr
-		mov	al,0			; from beginning of file
-		mov	bl,ovlflg
-		and	bx,MASK file
-		mov	bx,ovlfilhdl[bx] 	; never closing handle
-		int	DOS
-		jc	burnhead		; oops!
-		mov	cx,EXEHDRTMPSIZ 	; reloc buffer size
-		mov	dx,OFFSET hdr
-		push	ds
-		mov	ax,cs
-		mov	ds,ax
-		mov	ah,DOSREAD		; prevent random DOS behaviour
-		int	DOS			; read in header
-		pop	ds
-		jc	burnhead		; double oops!
-
-		call	ovlrlc			; perform relocation normally done by DOS EXE loader
-		pop	es			; retrieve ovl tbl entry
-		pop	ds
-
-		ASSUME	DS:ovltbl,ES:NOTHING
-
-		or	ovlflg,MASK loaded	; because it is now
-IFDEF i386
-		OP32
-		popa
-ELSE
-		pop	di
-		pop	si
-		pop	bp
-		pop	bx
-		pop	dx
-		pop	cx
-		pop	ax
-ENDIF
-		ret
-
-burnhead:
-		mov	al,FILEIOERR		; some kind of I/O error
-		jmp	putserr
-
-loadoverlay	ENDP
-
-;-------------------------------------------------------------------------------
-
-ovlrlc		PROC	NEAR			; ds:0 -> the overlay to relocate
-
-		ASSUME	DS:NOTHING,ES:ovltbl
-
-		mov	si,OFFSET hdr
-		mov	bp,si
-		add	bp,EXEHDRTMPSIZ 	; ^ to end of buf+1
-		mov	cx,cs:[si.relocitems]	; roto-count
-		jcxz	relocdone		; not such a good idea, after all
-		mov	di,ds
-		sub	di,ovlrootcode		; segment fixup value
-		add	si,cs:[si.reloctbloff]	; ^ relocation table
-dorelocs:					; labels don't GET comments
-		cmp	si,bp			; past the end ?
-		jc	getoffsetl
-		call	getnxtreloc		; get another hunk
-getoffsetl:
-		mov	bl,cs:[si]		; offset into load module
-		inc	si
-		cmp	si,bp			; past the end ?
-		jc	getoffseth
-		call	getnxtreloc		; get another hunk
-getoffseth:
-		mov	bh,cs:[si]		; offset into load module
-		inc	si
-		cmp	si,bp			; past the end ?
-		jc	getsegmentl
-		call	getnxtreloc		; get another hunk
-getsegmentl:
-		mov	al,cs:[si]		; segment in load module (zero reference)
-		inc	si
-		cmp	si,bp			; past the end ?
-		jc	getsegmenth
-		call	getnxtreloc		; get another hunk
-getsegmenth:
-		mov	ah,cs:[si]		; segment in load module (zero reference)
-		inc	si
-		add	ax,pspadd		; now it is psp relative
-		add	ax,di			; and now it is relative to the actual load address
-		mov	ds,ax
-		mov	ax,[bx]			; pickup item to relocate
-		add	ax,pspadd		; make it psp relative
-		cmp	ax,ovlrootcode		; is it below the OVERLAY_AREA?
-		jc	reloccomputed		; yup. it's relocated
-		cmp	ax,ovldata		; is it above OVERLAY_AREA
-		jnc	reloccomputed		; yup. it's relocated
-		add	ax,di			; it's in OVERLAY_AREA, this one's ours.
-reloccomputed:
-		mov	[bx],ax			; RAM it home!?!
-		loop	dorelocs		; what goes around, comes around.
-relocdone:	ret
-
-ovlrlc		ENDP
-
-;-------------------------------------------------------------------------------
-
-getnxtreloc	PROC	NEAR
-
-		ASSUME	DS:NOTHING,ES:ovltbl
-
-		push	bx
-		push	cx
-		push	di
-		push	bp
-		push	ds
-		push	es
-		mov	cx,EXEHDRTMPSIZ 	; reloc buffer size
-		mov	dx,OFFSET hdr
-		mov	ax,cs
-		mov	ds,ax
-		mov	bl,ovlflg
-		and	bx,MASK file
-		mov	bx,ovlfilhdl[bx] 	; never closing handle
-		mov	ah,DOSREAD		; prevent random DOS behaviour
-		int	DOS			; read in header
-		jnc	nxtrelocok
-		jmp	burnhead		; double oops!
-nxtrelocok:
-		mov	si,OFFSET hdr
-		pop	es
-		pop	ds
-		pop	bp
-		pop	di
-		pop	cx
-		pop	bx
-		ret
-
-getnxtreloc	ENDP
-
-;-------------------------------------------------------------------------------
-
-getvictim	PROC	NEAR			; select a victim to discard (and free up some memory)
-
-		ASSUME	DS:ovltbl,ES:NOTHING
-
-		push	bx
-		push	cx
-		push	dx
-		push	si
-		push	di
-		push	bp
-		push	ds
-		mov	ds,ovltblbse		; ^ ovl tbl
-IFDEF i386
-		OP32
-ENDIF
-		xor	ax,ax			; will contain the low word of lru
-IFDEF i386
-		OP32
-ENDIF
-		mov	dx,ax			; will contain the high word of lru
-		mov	bp,ax			; will contain ovl tbl entry
-		mov	bx,ax			; ovl tbl ptr
-		mov	cx,ovlcnt
-foon1:
-		test	ovlflg[bx],MASK locked
-		jnz	skip1
-		test	ovlflg[bx],MASK ems
-		jnz	foon2
-		test	ovlflg[bx],MASK loaded
-		jz	skip1
-foon2:
-IFDEF i386
-		OP32
-ENDIF
-		mov	si,WORD PTR ovltim
-IFNDEF i386
-		mov	di,WORD PTR ovltim+2
-ENDIF
-IFDEF i386
-		OP32
-ENDIF
-		sub	si,WORD PTR ovllrudat[bx]
-IFNDEF i386
-		sbb	di,WORD PTR ovllrudat[bx+2]
-ENDIF
-IFDEF i386
-		OP32
-		cmp	dx,si
-ELSE
-		cmp	dx,di
-ENDIF
-IFDEF i386
-		jnc	skip1
-ELSE
-		jc	better1
-		jnz	skip1
-		cmp	ax,si
-		jnc	skip1
-ENDIF
-better1:
-IFDEF i386
-		OP32
-		mov	dx,si
-ELSE
-		mov	ax,si
-		mov	dx,di
-ENDIF
-		mov	bp,bx
-skip1:
-		add	bx,OVLSEGSIZ
-		loop	foon1
-		or	bp,bp			; were we more successful this time?
-		jnz	gotvictim		; now we got one.
-nomoremem:
-		mov	al,VICTIMERR		; were really %$# now!
-		jmp	putserr
-gotvictim:
-		shr	bp,1			; convert offset to segment
-		shr	bp,1
-		shr	bp,1
-		shr	bp,1
-		mov	ax,ds
-		add	ax,bp
-		pop	ds
-		pop	bp
-		pop	di
-		pop	si
-		pop	dx
-		pop	cx
-		pop	bx
-		ret
-
-getvictim	ENDP
-
-;-------------------------------------------------------------------------------
-
-int21		PROC	FAR
-
-; free almost all overlay memory if app. tries to call the DOS exec function.
-
-		cmp	ah,DOSEXEC
-		jz	freeall
-		cmp	ah,TERMINATE
-		jz	saybyebye
-notours:
-		jmp	cs:oldint21
-saybyebye:
-		mov	al,NOERR		; return code 0
-		jmp	putserr
-freeall:
-		or	al,al			; is it load and exec?
-		jnz	notours
-		push	ax
-		push	cx
-		push	dx
-		push	bx
-		push	bp
-		push	si
-		push	di
-		push	es
-		push	ds			; preserve calling env.
-
-		ASSUME	DS:NOTHING,ES:ovltbl
-
-		mov	es,ovltblbse
-		mov	cx,ovlcnt		; unload all overlays that are
-		mov	bx,OVLSEGSIZ		; in EMS or are in alloced mem.
-		dec	cx
-memunloadlp:
-		test	[bx.ovlflg],MASK ems
-		jnz	memunload
-		test	[bx.ovlflg],MASK loaded
-		jz	nxtmemunload
-		mov	ax,[bx.ovlmemblk]
-		sub	ax,MEMCTLBLKSIZ
-		cmp	ax,memblks		; allocated memory ?
-		jc	nxtmemunload
-memunload:
-		and	[bx.ovlflg],NOT MASK loaded ; you're outta there!
-nxtmemunload:
-		add	bx,OVLSEGSIZ
-		loop	memunloadlp
-
-		mov	curemshandle,-1 	; no current handle anymore
-
-		mov	ax,memblks
-		cmp	ax,-1
-		jz	nosecondblk
-		mov	es,ax			; ^ to second mem blk
-		mov	es,es:memblkprv 	; get previous pointer
-		mov	es:memblknxt,0		; no other blocks after this one
-nosecondblk:
-		mov	cx,16			; do all allocated mem blocks
-		mov	si,OFFSET memblks
-freememblklp:
-		mov	ax,cs:[si]		; get memory blk segment
-		cmp	ax,-1			; was one ever allocated?
-		jz	nxtmemblklp		; nope
-		mov	es,ax
-		mov	ah,DOSFREE		; must free it.
-		int	DOS
-		mov	WORD PTR cs:[si],-1
-nxtmemblklp:
-		add	si,2
-		loop	freememblklp
-
-		call	rstvectors		; restore all int vectors
-
-		mov	bp,sp
-		push	[bp+22] 		; ensure returned flags are based on user's!
-		popf
-		pop	ds
-		pop	es
-		pop	di
-		pop	si
-		pop	bp
-		pop	bx
-		pop	dx
-		pop	cx
-		pop	ax
-
-		mov	ssreg,ss		; preserve these due to a
-		mov	spreg,sp		; DOS bug.
-
-		int	DOS			; allow DOS to continue!
-
-		mov	ss,ssreg
-		mov	sp,spreg
-
-		push	ax
-		push	cx
-		push	dx
-		push	bx
-		push	bp
-		push	si
-		push	di
-		push	es
-		push	ds			; preserve calling env.
-		mov	bp,sp
-		pushf
-		pop	[bp+22] 		; fix return flags
-
-		call	getmoreram		; re-allocate our memory
-		call	setvectors		; patch vectors again
-
-		pop	ds
-		pop	es
-		pop	di
-		pop	si
-		pop	bp
-		pop	bx
-		pop	dx
-		pop	cx
-		pop	ax
-		iret
-
-int21		ENDP
-
-;-------------------------------------------------------------------------------
-
-releasepages	PROC	NEAR			; Arg in es, result in ax
-
-; release any memory (and overlays) where this overlay should reside
-
-		ASSUME	DS:NOTHING,ES:ovltbl
-
-		mov	bx,ovlmemblk		; start of memory to release
-		sub	bx,MEMCTLBLKSIZ
-		mov	dx,bx
-		add	dx,es:ovlsiz
-		add	dx,MEMCTLBLKSIZ 	; end of memory to release
-		mov	ax,ovlemshdl
-		cmp	ax,-1
-		jz	doitagain
-		call	mappage
-		or	ovlflg,MASK ems
-		mov	ax,emsframe
-		jmp	dvart
-doitagain:
-		mov	ax,memblk1st		; first memory blk
-		jmp	dvart
-dvartloop:
-		mov	ds,ax			; memory blk to check
-		cmp	bx,ax			; does it start below the memory to release?
-		jnc	dvartsmaller		; yup
-		cmp	ax,dx			; does it start above?
-		jnc	dvartnocore		; yup
-		call	killmem 		; it's in the way. Zap it.
-		jmp	dvartloop
-dvartsmaller:
-		add	ax,ds:memblksiz 	; end of this memory blk
-		cmp	bx,ax			; does it end below the memory to release?
-		jnc	dvartsilly		; yup
-		test	ds:memblkflg,MASK_used
-		jz	dvartfree
-		call	killmem 		; Oh well, zap it too.
-		add	ax,ds:memblksiz 	; end of this memory blk
-dvartfree:
-		cmp	ax,dx			; does it end in the memory to be released?
-		jc	dvartsilly
-dvartgotblk:
-		mov	ax,ds			; this is it!
-		mov	cx,bx
-		sub	cx,ax			; # of paragraphs between start of memory to release and mem blk
-		jz	unsplit
-		push	es
-		call	splitblk
-		or	es:memblkflg,MASK_used	; set high block used
-		call	mergemem		; merge remaining free memory
-		mov	ax,es
-		mov	ds,ax
-		pop	es
-unsplit:
-		mov	cx,es:ovlsiz
-		add	cx,MEMCTLBLKSIZ 	; paragraphs needed to load ovl
-		jmp	splitblklow		; split remaining block
-dvartsilly:
-		mov	ax,ds:memblknxt
-dvart:
-		or	ax,ax			; end of mem list?
-		jz	dvartnocore
-		jmp	dvartloop		; play it again Sam.
-dvartnocore:
-		mov	al,RELERR		; super OOPS!
-		jmp	putserr
-
-releasepages	ENDP
-
-;-------------------------------------------------------------------------------
-
-getpages	PROC	NEAR			; get enough memory to load ovl
-
-		ASSUME	DS:NOTHING,ES:ovltbl
-
-		mov	ovlemshdl,-1		; clear any EMS stuff
-		and	ovlflg,NOT MASK ems
-		mov	cx,ax
-		add	cx,MEMCTLBLKSIZ 	; total paragraphs needed
-dorkagain:
-		call	largestmem		; find largest free blk
-		cmp	dx,cx			; large enough?
-		jnc	gotdork 		; yup.
-		call	getemsmem		; try to allocate ems
-		cmp	dx,cx			; any available ?
-		jnc	gotdork
-dorkkill:
-		call	getvictim		; select a victim to release
-		call	killovl 		; kill the selected victim
-		jmp	dorkagain
-gotdork:
-		jmp	splitblklow		; split the free blk
-
-getpages	ENDP
-
-;-------------------------------------------------------------------------------
-
-splitblklow	PROC	NEAR
-
-; split a block of memory returning the lower one to be used.
-
-		ASSUME	DS:NOTHING,ES:NOTHING
-
-		push	es
-		or	ds:memblkflg,MASK_used	; set low block used
-		call	splitblk
-		jc	splitlowdone
-		push	ds
-		mov	ax,es
-		mov	ds,ax
-		call	mergemem		; merge remaining free memory
-		pop	ds
-splitlowdone:
-		pop	es
-		mov	ds:memblkovl,es 	; fix ptr to ovl
-		mov	ax,ds			; return lower blk segment
-		ret
-
-splitblklow	ENDP
-
-;-------------------------------------------------------------------------------
-
-splitblk	PROC	NEAR
-
-		ASSUME	DS:NOTHING,ES:NOTHING
-
-		mov	ax,ds
-		add	ax,cx
-		mov	es,ax			; ^ to upper blk to be created
-		mov	ax,ds:memblksiz
-		sub	ax,cx
-		jbe	nofix			; must be at least 1 para remaining to split
-		mov	ds:memblksiz,cx 	; fix blk sizes
-		mov	es:memblksiz,ax
-		mov	ax,ds:memblknxt 	; fix pointers
-		mov	es:memblknxt,ax
-		mov	ds:memblknxt,es
-		mov	es:memblkprv,ds
-		mov	es:memblkflg,0		; set upper to not used
-		mov	ax,es:memblknxt
-		or	ax,ax
-		jz	nofix
-		push	ds
-		mov	ds,ax			; fix blk after upper to point to upper
-		mov	ds:memblkprv,es
-		pop	ds
-		clc
-		ret
-nofix:
-		stc
-		ret
-
-splitblk	ENDP
-
-;-------------------------------------------------------------------------------
-
-largestmem	PROC	NEAR	; returns seg in ax, size in dx
-				; retruns first block that's large enough if possible
-
-		ASSUME	DS:NOTHING,ES:ovltbl
-
-		mov	ax,memblk1st		; first mem blk
-		xor	dx,dx			; largest size found
-		jmp	gook
-gookloop:
-		mov	ds,ax
-		test	ds:memblkflg,MASK_used	; is this blk used?
-		jnz	gookme			; yup
-		cmp	ds:memblksiz,cx 	; is it large enough?
-		jc	gookme			; nope
-		mov	dx,ds:memblksiz 	; got one!
-		ret
-gookme:
-		mov	ax,ds:memblknxt
-gook:
-		or	ax,ax			; end of list?
-		jnz	gookloop		; around and around
-		ret
-
-largestmem	ENDP
-
-;-------------------------------------------------------------------------------
-
-killmem 	PROC	NEAR
-
-		ASSUME	DS:NOTHING,ES:ovltbl
-
-		test	ds:memblkflg,MASK_used	; is it used?
-		jz	memnotused		; don't kill ovl
-		push	es
-		mov	es,ds:memblkovl
-		and	ovlflg,NOT MASK loaded	; zap ovl associated with this blk
-		and	ovlflg,NOT MASK ems
-		pop	es
-memnotused:
-		jmp	mergemem		; merge free memory
-
-killmem 	ENDP
-
-;-------------------------------------------------------------------------------
-
-killovl 	PROC	NEAR		; preserves bx
-
-		ASSUME	DS:ovltbl,ES:NOTHING
-
-		mov	ds,ax
-		and	ovlflg,NOT MASK loaded	; ovl no longer loaded
-		test	ovlflg,MASK ems 	; was it in ems ?
-		jz	noemskill
-		and	ovlflg,NOT MASK ems	; no longer in ems
-		mov	ax,ovlemshdl
-		call	mappage
-noemskill:
-		mov	ax,ovlmemblk		; get mem blk
-		sub	ax,MEMCTLBLKSIZ
-		mov	ds,ax
-		jmp	mergemem		; merge free memory
-
-killovl 	ENDP
-
-;-------------------------------------------------------------------------------
-
-mergemem	PROC	NEAR
-
-; merge physically adjacent free memory blocks. Preserves es. ds -> a free block.
-
-		ASSUME	DS:NOTHING,ES:NOTHING
-
-		push	dx
-		push	es
-		and	ds:memblkflg,NOT MASK_used ; set current free
-		mov	ax,ds:memblkprv 	; get previous blk
-		or	ax,ax			; was there a previous blk?
-		jz	gibber			; nope
-		mov	es,ax
-		test	es:memblkflg,MASK_used	; is the previous blk used?
-		jnz	gibber			; yup
-		add	ax,es:memblksiz 	; end of previous blk
-		mov	dx,ds
-		cmp	dx,ax			; physically adjacent?
-		jnz	gibber			; nope
-		mov	ax,ds:memblksiz
-		add	es:memblksiz,ax 	; adjust size of new larger blk
-		mov	ax,ds:memblknxt 	; fix pointers
-		mov	es:memblknxt,ax
-		or	ax,ax
-		jz	almostgibber
-		mov	ds,ax			; fix pointer of next blk
-		mov	ds:memblkprv,es
-almostgibber:
-		mov	ax,es
-		mov	ds,ax			; new blk segment
-gibber:
-		mov	ax,ds:memblknxt 	; get next blk
-		or	ax,ax			; was there a next blk?
-		jz	killdone		; nope
-		mov	es,ax
-		test	es:memblkflg,MASK_used	; is the nxt blk used?
-		jnz	killdone		; yup
-		mov	ax,ds
-		add	ax,ds:memblksiz 	; end of this blk
-		mov	dx,es
-		cmp	ax,dx			; physically adjacent?
-		jnz	killdone		; nope
-		mov	ax,es:memblksiz
-		add	ds:memblksiz,ax 	; adjust size of new larger blk
-		mov	ax,es:memblknxt 	; fix pointers
-		mov	ds:memblknxt,ax
-		or	ax,ax
-		jz	killdone
-		mov	es,ax			; fix pointer of blk after nxt
-		mov	es:memblkprv,ds
-killdone:
-		and	ds:memblkflg,NOT MASK_used ; make sure it's free
-		pop	es
-		pop	dx
-		mov	ax,ds
-		ret
-
-mergemem	ENDP
-
-;-------------------------------------------------------------------------------
-
-getmoreram	PROC	NEAR			; try to alloc remaining pieces
-						; of memory if any
-		ASSUME	DS:NOTHING,ES:NOTHING	; return dx = biggest block
-
-		push	cx
-		push	bx
-		push	si
-		push	di
-		push	ds
-		push	es
-		xor	dx,dx
-		mov	ax,memblk1st
-nxtlowblk:
-		mov	ds,ax
-		mov	ax,ds:memblknxt
-		or	ax,ax
-		jnz	nxtlowblk
-
-		mov	si,OFFSET memblks	; a place to store the handles
-		mov	di,OFFSET tempmem	; a place to store the rejects
-		mov	cx,16			; 16 more max
-getramlp:
-		mov	ah,DOSALLOC
-		mov	bx,0ffffh		; Everything
-		int	DOS
-		cmp	bx,10h			; nothing smaller than .25k please
-		jc	gotallram
-		mov	ah,DOSALLOC		; allocate our own memory
-		int	DOS
-		jc	gotallram		; oops!
-		cmp	ax,ovltblbse		; is it after our first mem blk?
-		jc	releaseblk
-		cmp	dx,bx
-		jnc	notbigger
-		mov	dx,bx
-notbigger:
-		mov	cs:[si],ax		; save it
-		mov	es,ax
-		mov	es:memblkflg,0		; clear mem flags
-		mov	es:memblknxt,0		; set next to nothing
-		mov	es:memblkovl,0		; no overlays loaded
-		mov	es:memblkprv,ds 	; point to previous
-		mov	es:memblksiz,bx 	; allocated memory block size
-		mov	ds:memblknxt,es 	; point to next
-		add	si,2
-		mov	ds,ax
-		jmp	short getnxtram
-releaseblk:
-		mov	cs:[di],ax
-		add	di,2
-getnxtram:
-		loop	getramlp
-gotallram:
-		mov	si,OFFSET tempmem
-		mov	cx,16
-releaselp:
-		mov	ax,cs:[si]
-		cmp	ax,-1
-		jz	relnext
-		mov	es,ax
-		mov	ah,DOSFREE
-		int	DOS
-		mov	WORD PTR cs:[si],-1
-relnext:
-		add	si,2
-		loop	releaselp
-		pop	es
-		pop	ds
-		pop	di
-		pop	si
-		pop	bx
-		pop	cx
-		ret
-
-getmoreram	ENDP
-
-;-------------------------------------------------------------------------------
-
-getemsmem	PROC	NEAR
-
-		ASSUME	DS:NOTHING,ES:ovltbl
-
-		xor	dx,dx			; no ems memory
-		cmp	emmflg,-1
-		jz	testemsslots
-		ret
-testemsslots:
-		mov	curemshandle,-1
-		mov	di,OFFSET emsmemblks
-		mov	bx,cx
-		mov	cx,16
-emsfreeslot:
-		mov	ax,cs:[di]
-		cmp	ax, -1
-		jz	gotemsslot
-		call	mappage
-		cmp	ax,bx
-		jnc	foundpage
-		add	di,2
-		loop	emsfreeslot
-		mov	cx,bx
-		xor	dx,dx
-		ret
-gotemsslot:
-		mov	cx,bx
-		mov	bx,4
-		mov	ah,EMMALLOC
-		push	cx			; paranoia ! shouldn't be necessary.
-		push	di
-		push	es
-		int	EMM
-		pop	es
-		pop	di
-		pop	cx
-		or	ah,ah
-		jz	gotsomeems
-		xor	dx,dx
-		ret
-gotsomeems:
-		mov	cs:[di],dx
-		mov	ovlemshdl,dx
-		or	ovlflg,MASK ems
-		mov	ax,dx
-		call	mapemspages
-		mov	ax,emsframe
-		mov	ds,ax
-		mov	ds:memblkflg,0		; clear mem flags
-		mov	ds:memblknxt,0		; set next to nothing
-		mov	ds:memblkprv,0		; set previous to nothing
-		mov	ds:memblkovl,0		; no overlay loaded
-		mov	dx,1000h
-		mov	ds:memblksiz,dx
-		ret
-
-foundpage:
-		mov	cx,bx
-		mov	ds,si
-		mov	dx,ax
-		mov	ax,cs:[di]
-		mov	ovlemshdl,ax
-		or	ovlflg,MASK ems
-		ret
-
-getemsmem	ENDP
-
-;-------------------------------------------------------------------------------
-
-mappage 	PROC	NEAR			; map a 64K block of EMS mem.
-
-		ASSUME	DS:NOTHING,ES:ovltbl
-
-		cmp	ax,curemshandle
-		jnz	doems
-		ret
-doems:
-		push	bx
-		push	dx
-		push	ds
-		push	es
-		call	mapemspages
-		mov	ax,emsframe
-		xor	dx,dx
-		xor	si,si
-emsset:
-		mov	ds,ax
-		test	ds:memblkflg,MASK_used	; mem blk used ?
-		jz	emsfreeblk
-		mov	es,ds:memblkovl
-		or	ovlflg,MASK ems OR MASK loaded
-		jmp	emsnext
-emsfreeblk:
-		mov	ax,ds:memblksiz
-		cmp	dx,ax
-		jnc	emsnext
-		mov	dx,ax
-		mov	si,ds
-emsnext:
-		mov	ax,ds:memblknxt
-		or	ax,ax
-		jnz	emsset
-
-		mov	ax,dx
-		pop	es
-		pop	ds
-		pop	dx
-		pop	bx
-		ret
-
-mappage 	ENDP
-
-;-------------------------------------------------------------------------------
-
-mapemspages	PROC	NEAR
-
-		ASSUME	DS:NOTHING,ES:ovltbl
-
-		push	es
-		push	bx
-		push	cx
-		push	dx
-		mov	curemshandle,ax
-		mov	dx,ax
-		mov	ah,EMMMAP
-		xor	al,al			; physical page 0
-		xor	bx,bx			; logical page 0
-		push	dx
-		int	EMM
-		pop	dx
-		or	ah,ah
-		jnz	emmerror
-		mov	ah,EMMMAP
-		mov	al,1			; physical page 1
-		mov	bx,1			; logical page 1
-		push	dx
-		int	EMM
-		pop	dx
-		or	ah,ah
-		jnz	emmerror
-		mov	ah,EMMMAP
-		mov	al,2			; physical page 2
-		mov	bx,2			; logical page 2
-		push	dx
-		int	EMM
-		pop	dx
-		or	ah,ah
-		jnz	emmerror
-		mov	ah,EMMMAP
-		mov	al,3			; physical page 3
-		mov	bx,3			; logical page 3
-		int	EMM
-		or	ah,ah
-		jnz	emmerror
-		mov	es,ovltblbse
-		mov	cx,ovlcnt
-		xor	bx,bx
-testems:
-		test	ovlflg[bx],MASK ems
-		jz	nxttestems
-		and	ovlflg[bx],NOT MASK loaded
-nxttestems:
-		add	bx,OVLSEGSIZ
-		loop	testems
-		pop	dx
-		pop	cx
-		pop	bx
-		pop	es
-		ret
-
-emmerror:
-		mov	al,EMSERR		; ems manager error
-		jmp	putserr
-
-mapemspages	ENDP
-
-;-------------------------------------------------------------------------------
-
-gethdr		PROC	NEAR			; read EXE header from handle
-
-		ASSUME	DS:NOTHING,ES:NOTHING
-
-		mov	dx,OFFSET hdr		; a place to put it
-		mov	bx,si
-		shl	bx,1
-		mov	bx,ovlfilhdl[bx] 	; the file handle
-readagain:
-		mov	cx,TYPE EXEHDR		; header size in bytes
-		mov	ah,DOSREAD
-		int	DOS			; read from file
-		jc	exegone 		; oops?
-		cmp	ax,cx			; got correct number of bytes?
-		je	gothdr
-IFNDEF NOSPLIT
-		cmp	ax,0			; Anything?
-		je	gotonxtfil
-ENDIF
-		jmp	exerotten
-IFNDEF NOSPLIT
-gotonxtfil:
-		inc	si
-		cmp	si,MAXFILES+1
-		je	exegone			; We're out of files!
-		mov	bx,si
-		shl	bx,1
-		cmp	ovlfilhdl[bx],-1	; Any more files?
-		je	gotonxtfil		; not here.
-
-		mov	bx,ovlfilhdl[bx]	; Slide in new handle
-		xor	bp,bp			; reset file offset
-		jmp	readagain
-ENDIF
-gothdr:
-		cmp	hdr.exesign,EXESIGNUM	; sanity check
-		jne	exerotten
-
-		ret				; Wow, it worked!
-exegone:
-		mov	al,NOHDRERR		; missing overlays!
-		jmp	putserr			; You lose!
-IFNDEF NOSPLIT
-exerotten:
-		mov	al,HDRERR		; corruption!
-		jmp	putserr			; You lose!
-ENDIF
-
-gethdr		ENDP
-
-;-------------------------------------------------------------------------------
-
-openfiles	PROC	NEAR			; Find our cohorts in crime
-
-		push	es
-IFNDEF NOSPLIT
-		mov	ah,DOSGETDTA		; Pick up DTA
-		int	DOS			; and
-		mov	dtaseg,es		; store
-		mov	dtaoffset,bx		; it
-
-		push	ds
-		mov	dx,OFFSET ovldta	; Set new DTA for file search
-		mov	ax,cs
-		mov	ds,ax			; point to the right seg
-		mov	ah,DOSSETDTA
-		int	DOS
-		pop	ds			; set this back for upcoming lodsb
-ENDIF
-		mov	cx,MAXNAMESIZE/2
-		mov	bx,cs
-		mov	es,bx
-		mov	di, OFFSET filestring
-
-		rep     movsw	    		; load path from si to di
-IFNDEF NOSPLIT
-		mov	di, OFFSET filestring
-		mov	al,0
-		mov	cx,MAXNAMESIZE
-		cld
-		repne	scasb			; search null for end of string
-
-		sub	cx,MAXNAMESIZE
-		neg	cx
-		mov	bx,cx
-
-		cmp	cx,MAXNAMESIZE
-		je	checkslash
-
-		dec	bx			; keep string length
-		dec	di			; cause were past null now
-
-		cmp	bx,7
-		jle	patherr			; "C:\.EXE" = 7
-checkslash:
-		mov	ax,DOSGETSWITCH		; divine switchar
-		int	DOS			; it influences the path
-
-		mov	al,'\'			; if swichar = '/' pathsep = '\'
-		cmp	dl,'/'
-		je	searchslash	
-		mov	al,'/'			; else pathsep = '/'
-searchslash:
-		std
-		repne	scasb			; search back for '\'
-		cld
-
-		mov	dx,bx
-		sub	dx,cx			; keep file name length
-		dec	dx
-
-		mov	cx,0			; reset for upcoming loop
-		mov	pathlen,bx		; hold these for recall
-		mov	namelen,dx
-		cmp	dx,12			; "LONGNAME.EXE" = 12
-		jle	openroot		; Path name too long?
-patherr:
-		mov	al,NAMERR		; real problems here.
-		jmp	putserr
-openroot:
-ENDIF
-		mov	ax,cs
-		mov	ds,ax			; set ds to code
-
-		mov	dx, OFFSET filestring	; open root code
-		mov	al,0			; access code
-		mov	ah,DOSOPEN
-		int	DOS			; open sez me
-		jnc	dontdie
-
-		mov	al,FILEERR		; can't open root
-		jmp	putserr
-dontdie:
-		mov	ovlfilhdl[0],ax		; save handle in array
-IFNDEF NOSPLIT
-		cmp	namelen,11		; Max sized exe name (8.3)?
-		jg	bigfilename		; if not
-		inc	pathlen			; add one to path length
-		inc	namelen
-bigfilename:
-		mov	di,OFFSET filestring	; es is still code
-		add	di,pathlen
-		sub	di,5			; append
-		mov	si,OFFSET ovlext	; wildcard extension
-		mov	cx,6			; and null
-		rep	movsb			; to filestring
-
-		mov	cx,0			; Match "normal" files
-		mov	dx,OFFSET filestring
-		mov	ah,DOSSEARCH
-		int	DOS			; Set DTA with Wildcard.
-		jc	aok			; Not a single match
-		mov	cx,MAXFILES		; set upcoming loop
-		mov	dx,namelen
-		sub	pathlen,dx		; shorten absolute path
-openloop:
-		push	cx
-		mov	bx,pathlen
-		mov	di,OFFSET filestring	; es is still in code
-		add	di,bx
-		mov	si,OFFSET ovldta.file_name
-		mov	cx,namelen 		; since this *should* be
-		rep	movsb
-		pop	cx
-
-		mov	dx,OFFSET filestring	; path to overlay file
-		mov	al,0			; access code
-		mov	ah,DOSOPEN
-		int	DOS			; open overlay file
-		jnc	dontdie2
-fileopenerr:
-		call	itoa
-
-		mov	al,OVLERR		; can't open file!
-		jmp	putserr
-dontdie2:
-		mov	bx,cx			; put file number in bx
-		shl	bx,1			; 2 * bx for array index
-		mov	ovlfilhdl[bx],ax	; save handle in array
-
-		mov	ah,DOSNEXTFILE		; Look for more files
-		int	DOS
-		jc	aok
-
-		loop	openloop		; open only 15 overlays
-aok:
-		mov	dx,dtaoffset		; Time to unset DTA
-		mov	ds,dtaseg
-		mov	ah,DOSSETDTA
-		int	DOS
-ENDIF
-		pop	es
-
-		ret
-
-openfiles	ENDP
-
-;-------------------------------------------------------------------------------
-
-putserr 	PROC	NEAR
-
-; display error msg, close file, restore int vectors, free mem and return to DOS.
-
-		ASSUME	DS:NOTHING,ES:NOTHING
-
-		xor	ah,ah
-		push	ax			; keep return code for later
-		push	cs
-		pop	ds
-		mov	bx,ax
-		shl	bx,1
-		add	bx,OFFSET errortbl
-		mov	dx,[bx]
-		cmp	dx,-1
-		jz	freeints
-		push	dx
-		mov	dx,OFFSET msghead
-		mov	ah,PRINT
-		int	DOS
-		pop	dx
-		mov	ah,PRINT
-		int	DOS			; display error msg
-
-		mov	ah,PRINT
-		mov	dx,OFFSET diag
-		int	DOS
-		pop	ax
-		push	ax
-		call	itoa			; error number
-		mov	ah,DOSPUTC
-		mov	dl,':'
-		int	DOS
-		mov	ax,VERSION
-		call	itoa			; version number
-		mov	ah,DOSPUTC
-		mov	dl,':'
-		int	DOS
-		mov	ax,0a000h
-		sub	ax,ovltblbse		; conventional memory
-		call	itoa
-		mov	ah,DOSPUTC
-		mov	dl,':'
-		int	DOS
-		mov	si,OFFSET emsmemblks
-		mov	cx,16
-		xor	ax,ax
-emstotlp:
-		cmp	WORD PTR cs:[si],-1
-		jz	gotemstot
-		add	ax,emmframesiz
-		add	si,2
-		loop	emstotlp
-gotemstot:
-		call	itoa			; ems usage in blocks
-		mov	ah,DOSPUTC
-		mov	dl,')'
-		int	DOS
-
-		mov	dx,OFFSET msgtail
-		mov	ah,PRINT
-		int	DOS
-freeints:
-		call	rstvectors		; restore all int vectors
-
-		mov	ax,ovltblbse
-		cmp	ax,-1
-		jz	freememblks
-		mov	es,ax
-		mov	ah,DOSFREE
-		int	DOS
-freememblks:
-		mov	cx,16			; do all allocated mem blocks
-		mov	si,OFFSET memblks
-freememlp:
-		mov	ax,cs:[si]		; get memory blk segment
-		cmp	ax,-1			; was one ever allocated?
-		jz	nxtmemlp		; nope
-		mov	es,ax
-		mov	ah,DOSFREE		; must free it.
-		int	DOS
-nxtmemlp:
-		add	si,2
-		loop	freememlp
-		mov	cx,16			; do all allocated ems blocks
-		mov	si,OFFSET emsmemblks
-freeemsmemlp:
-		mov	dx,cs:[si]		; get memory blk segment
-		cmp	dx,-1			; was one ever allocated?
-		jz	nxtemsmemlp		; nope
-		mov	ah,EMMFREE		; must free it.
-		int	EMM
-nxtemsmemlp:
-		add	si,2
-		loop	freeemsmemlp
-closefile:
-IFNDEF NOSPLIT
-		mov	cx,MAXFILES+1
-nextfile:
-		mov	bx,cx
-		dec	bx
-		shl	bx,1
-		mov	bx,ovlfilhdl[bx] 	; get file handle
-ELSE
-		mov	bx,ovlfilhdl[0]
-ENDIF
-		cmp	bx,-1			; was the file ever opened?
-		jz	byebye			; nope
-		mov	ah,DOSCLOSE		; close it
-		int	DOS
-byebye:
-IFNDEF NOSPLIT
-		loop	nextfile
-ENDIF
-		pop	ax			; return code in al
-		mov	ah,TERMINATE
-		int	DOS			; terminate this process
-
-putserr 	ENDP
-
-;-------------------------------------------------------------------------------
-
-itoa		PROC	NEAR
-
-		push	ax
-		xchg	ah,al
-		call	putbyte
-		pop	ax
-		jmp	putbyte
-
-itoa		ENDP
-
-;-------------------------------------------------------------------------------
-
-putbyte 	PROC	NEAR
-
-		push	ax
-		shr	al,1
-		shr	al,1
-		shr	al,1
-		shr	al,1
-		call	nibble
-		pop	ax
-		jmp	nibble
-
-putbyte 	ENDP
-
-;-------------------------------------------------------------------------------
-
-nibble		PROC	NEAR
-
-		push	ax
-		and	al,0fh
-		add	al,30h
-		cmp	al,3ah
-		jc	nibok
-		add	al,7
-nibok:
-		push	dx
-		mov	dl,al
-		mov	ah,DOSPUTC
-		int	DOS
-		pop	dx
-		pop	ax
-		ret
-
-nibble		ENDP
-
-;-------------------------------------------------------------------------------
-
-setvectors	PROC	NEAR
-
-		push	ds
-		xor	ax,ax
-		mov	ds,ax
-		mov	si,cs:intnum
-		cli
-		mov	ax,[si]
-		mov	WORD PTR cs:oldvec,ax	; save original vector
-		mov	ax,[si+2]
-		mov	WORD PTR cs:oldvec+2,ax
-		mov	ax,OFFSET ovlmgr	; point to ovlmgr
-		mov	[si],ax 		; set int vector
-		mov	[si+2],cs
-
-		mov	si,DOS*4
-		mov	ax,[si]
-		mov	WORD PTR cs:oldint21,ax ; save original vector
-		mov	ax,[si+2]
-		mov	WORD PTR cs:oldint21+2,ax
-		mov	ax,OFFSET int21 	; point to new int21
-		mov	[si],ax 		; set int vector
-		mov	[si+2],cs
-		sti
-		pop	ds
-		ret
-
-setvectors	ENDP
-
-;-------------------------------------------------------------------------------
-
-rstvectors	PROC	NEAR
-
-		push	ds
-		xor	ax,ax
-		mov	ds,ax
-		mov	si,DOS*4
-		cli
-		mov	ax,WORD PTR cs:oldint21 ; put back dos vector
-		cmp	ax,-1
-		jz	rstvec
-		mov	[si],ax
-		mov	ax,WORD PTR cs:oldint21+2
-		mov	[si+2],ax
-rstvec:
-		mov	si,cs:intnum
-		mov	ax,WORD PTR cs:oldvec	; put back ovlmgr vector
-		cmp	ax,-1
-		jz	rstdone
-		mov	[si],ax
-		mov	ax,WORD PTR cs:oldvec+2
-		mov	[si+2],ax
-		sti
-rstdone:
-		pop	ds
-		ret
-
-rstvectors	ENDP
-
-code		ENDS
-
-		END
diff -Naurd ../nethack-3.3.1/sys/msdos/old/ovlmgr.doc ./sys/msdos/old/ovlmgr.doc
--- ../nethack-3.3.1/sys/msdos/old/ovlmgr.doc Sat Apr 4 03:22:52 1998
+++ ./sys/msdos/old/ovlmgr.doc Thu Jan 1 01:00:00 1970
@@ -1,393 +0,0 @@
-    SCCS Id: @(#)ovlmgr.doc		 3.1		91/02/02
-    Copyright (c) 1989, 1990, 1991, 1992, 1993 Pierre G Martineau and
-    Stephen P Spackman.  All Rights Reserved.
-    NetHack may be freely redistributed.  See license for details.
-		 ====================================
-		 Brief notes about ovlmgr.asm [v30a0]
-		 ====================================
-		       (revised 1991february02)
-
-OVLMGR.ASM is a multiple-residency overlay manager for use with the
-Microsoft Overlay Linker.  It is functionally compatible with the one
-in the MSC library _except_:
-
-- it usually accesses the disk less often and is a lot faster in some
-  applications.
-- it permits overlays to be stored in the .EXE file and/or in separate
-  .OVL files.
-- it has different tuning characteristics.
-- you must (of course) link OVLMGR.OBJ into the root overlay (that is,
-  outside any parentheses in the link command).
-
-See also the notes below.
-
-	As with other Microsoft-compatible overlay handlers you must
-be *very* careful never to call a function in an overlay through a
-pointer, unless the initiator of the call resides in the *same*
-physical overlay as the target (This is, of course, *not* the same
-thing as the called function being declared static, since the static
-declaration affects only the visibility of the name of the function,
-not the distribution of pointers to it.) (1).  Furthermore, setjmp()
-and longjmp() are not supported.
-
-	Unlike the Microsoft system, most of the available memory is
-used to hold overlays.	Care must be taken to ensure that enough space
-is reserved for the C heap.  This can be accomplished through
-information stored in the .EXE file (currently the minalloc parameter,
-as described below).
-
-	Furthermore, expanded memory support (EMS) is now an integral
-part of the overlay manager.  LIM EMS versions 3.2 and 4.0 are
-supported.  Note that the page frame must be 4 pages long (64K bytes) to
-be able to operate correctly (most drivers allocate a 64K frame by
-default).  The overlay manager will use as much EMS as is necessary in
-64K chunks, up to a limit of 16 chunks (1 Meg).  Both hardware and
-software EMS drivers have been tested and found to be completely
-compatible.
-
-	Starting with version 30a0, overlays are not restricted to
-being stored in the main .EXE files (as they are with Microsoft's
-overlay manager).  Using the utility EXESMURF arbitrary contiguous
-sequences of overlays can be unloaded into external overlay files.
-Although EXESMURF provides some flexibility in naming these files,
-OVLMGR presently only supports its default option, whereby the
-overlays of a programme PROGRAM.EXE must match the pattern
-PROGRAM?.OVL (if the basename had eight characters, as FILENAME.EXE,
-then the last character is replaced: FILENAM?.EXE) and reside in the
-*same* directory as the .EXE (not even a path search is performed).
-This mechanism permits large applications to be represented with small
-files, resulting in a slight performance improvement (due to less and
-shorter disk seeking) and easier transfer with floppy disks, at the
-cost of a heavier demand for file-handles.
-
-				~ * ~
-
-	OVLMGR.ASM currently has three assembly-time options, which are
-specified with the assembler's /D<symbol> option (or compatible).  They
-are:
-
-	/DNOEMS   Disable EMS support.
-		  OVLMGR normally detects the presence of EMS memory
-		  and makes use of it whenever it is present.  This
-		  flag instructs ovlmgr to ignore EMS and operate only
-		  out of conventional memory.  It should be used when
-		  overlaying programmes which expect to use EMS
-		  themselves.
-
-	/Di386	  Use 80386-specific instruction sequences.
-		  Use of this flag will make ovlmgr perform better on
-		  machines with 80386 processors.  However, the
-		  resulting programme will not run at all on machines
-		  with less capable CPUs.  Use this option with
-		  caution, especially in the case of distribution
-		  code.
-
-	/DNOSPLIT Do not provide for external .OVL files.
-		  If this flag is NOT set, OVLMGR will look for
-		  overlays for the programme PROGRAM.EXE in all files
-		  matching the pattern PROGRAM?.OVL, as well as in the
-		  .EXE file itself.  This arrangement may be slightly
-		  faster and will result in more, smaller files, but
-		  is obviously less robust, since mismatched .OVL
-		  files can cause mayhem.  .OVL files can be generated
-		  with our EXESMURF .EXE file manipulation utility.
-
-				~ * ~
-
-	Although using the overlay manager is in essence much like using
-Microsoft's, they operate on a slightly different principle, and tuning
-for them is rather different.  Technical part begins.
-
-	When overlay linking is requested (see your linker manual), the
-MS overlay linker changes all far calls into overlays from the (normal,
-8086) format:
-
-	offset	contents
-	------	--------
-	:0000	CALL
-	:0001	target-offset
-	:0003	target-segment
-
-to this:
-	:0000	INT
-	:0001	int#	target-mod#
-	:0003	target-offset
-
-(note that here we are looking at the actual layout of the machine
-code, not at the assembly code as such) and relocates the code parts
-of all the different overlays into the *same* physical area.  The
-overlaid code is all actually placed at the end of the .EXE file,
-after the 'normal' executable image, along with all its administrative
-data (fixups etc.).
-
-	When this altered 'call' is executed, of course, the interrupt
-handler int# is invoked.  Its job is to ensure that the target overlay
-module is in memory (reading it from the tail of the .EXE file if it
-isn't already loaded) and then transfer to the given offset within it,
-'faking up' the effect of the 'real' far call that would normally have
-occurred.  Something similar must be done when the call returns, to
-ensure that the thing being returned *into* is still (or is once more)
-loaded.
-
-	The Microsoft linker, as we have said, relocates all the
-overlays to the same load address; and, in fact, it allocates am empty
-block of memory there that is at least as large as the largest
-overlay.  Into this area all the overlays are loaded without further
-change; thus, there can only ever be one overlay in memory at one
-time.  Transferring from one overlay to another causes one overlay to
-replace the other in the allocated overlay swap area.
-
-	Our overlay manager does not use the space allocated by the
-linker in the same way.  Rather, it allocates almost all of the memory
-available from MS-DOS (including the original overlay area and any high
-DOS memory) as well as EMS memory if some is available and that option
-is being used.	As overlays are needed, they are loaded wherever they
-will fit, and dynamically relocated to that address.  Thus, many more
-than one overlay may be loaded at any given time, greatly increasing
-potential performance.	Management of space is more or less according to
-an LRU policy - once all of memory is full, the least recently used
-overlay is selected as the most likely candidate for replacement.
-
-	The implications of this difference are as follows:  while with
-the conventional (default) overlay manager, the best strategy is to
-group object modules together in an overlay whenever they are known to
-be used in rapid succession, to make each overlay as big as possible
-(all things being equal) in order to take advantage of all available
-memory, and to make as few overlays as possible (to reduce the amount of
-disk access), the best strategy with our overlay manager is almost the
-reverse.  Having a lot of small overlays will increase the amount of
-useful stuff that can be resident in memory at the same time; all of
-memory will automatically be employed; and there is no advantage at all
-to uniformity of size (except perhaps in the unlikely case of *exact*
-uniformity!).
-
-	Although ovlmgr allocates all available memory while it is
-active, you will find that the DOS exec() call works normally.	The
-memory that is allocated for administering the overlay system is freed
-before the exec call is made and reallocated afterwards (we trap the DOS
-function request vector to do this, which isn't very nice as a
-programming practise but makes the existence of the overlay manager far
-more transparent).  There is, however, one circumstance under which this
-can be problematic:  if you use the exec() call to load a TSR
-application, thereby causing memory that the overlay manager was using
-to become unavailable, you may make it impossible for the overlaid
-application to proceed.  This is because code that is nominally
-'running' (i.e. is currently on the stack) cannot be relocated and must
-be reloaded at the *same address* that previously held it.  If another
-process now owns that area of memory, there is nothing we can do.  We
-believe that this should not be a serious concern in normal use.
-
-				~ * ~
-
-	Since all available memory is potentially used by ovlmgr, there
-is one additional concern in using it with C programmes:  the allocation
-of sufficient space for the C heap (2).  While previous versions of
-ovlmgr.asm required the change of an internal constant and re-assembly
-of ovlmgr to change the amount of space pre-allocated for this purpose,
-the current version uses the DOS minalloc parameter in the executable
-file to hold the size of the desired heap area.  This parameter can be
-set at any time after the link process with either Microsoft's exemod
-utility or with the supplied utility, exesmurf.
-
-				~ * ~
-
-NOTA BENE: This is an early version of the overlay manager, but by now
-it should be fairly well debugged. If you are considering upgrading it
-please be aware that the following improvements are planned for the
-next version (though who knows when delivery will occur):
-
-      - compatible versions of setjmp() and longjmp()
-      - integral malloc() to eliminate the heap size guesswork
-      - support for swapped data areas (read-only and read/write)
-      - improved performance through dynamic link-loading (maybe)
-      - interlocking to permit floppy disk juggling use
-      - XMS support and improved EMS support
-      - support for divergent-functionality overlays (such as
-	  hardware-specific modules)
-      - enabling the overlay locking code
-      - more flexibility in naming and locating external overlay files
-      - Major code revamping
-
-Swap On!
-
-------------------------------------------------------------------------
-MESSAGES
-
-OVLMGR: EMS memory manager error.
-
-	An error occurred during an EMS access.  Either the hardware has
-	reported a bug, the software driver has detected an anomaly or
-	the page frame is not 64K bytes in length.
-
-OVLMGR: Executable or overlay header missing or damaged.
-
-	The end of a file was reached unexpectedly during
-	initialisation, while trying to locate the overlays.  This is a
-	very bad sign (though I am concerned that it might be triggered
-	spuriously by debug information or other non-executable tails on
-	files).
-
-OVLMGR: File I/O error.
-
-	An error occurred while trying to load an overlay.  We don't
-	want this.
-
-OVLMGR: Inaccessible EXE file. Can't load overlays.
-
-	For some reason ovlmgr could not locate or read the original
-	.EXE file in which the overlays reside.  This could be due to
-	your attempting to use a very old version of DOS,
-	an abject shortage of file handles, some strange event causing
-	the file to be deleted, a disk error, or the diskette that
-	contained the executable being removed.
-
-OVLMGR: Inaccessible OVL file. Can't load overlays.
-
-	An error was reported while attempting to open an .OVL file
-	which was expected (from its name) to contain external overlays.
-	The possible causes are similar to those of the previous
-	message.
-
-OVLMGR: Incomplete executable.  OVL files missing?
-
-	OVLMGR was unable to locate all of its overlays for some reason.
-	This could be due to I/O errors on the disk drive, but is more
-	likely caused by an external .OVL file not being present in the
-	same directory as the .EXE.
-
-OVLMGR: Incorrect DOS version. Must be 3.00 or later.
-
-	The current version of ovlmgr does not support versions of DOS
-	prior to 3.0 because of the difficulty of locating the
-	executable file (and hence the overlays) at runtime.
-
-OVLMGR: Internal memory allocation failure.
-
-	Either an internal error has occurred in ovlmgr or the
-	application programme, or some event has caused memory that
-	ovlmgr believed it could count on becoming unavailable.  A
-	typical example of the latter would be the result of
-	attempting to load a TSR while an overlaid application is
-	running.
-
-OVLMGR: Not enough free memory left to run this program.
-
-	Although DOS successfully loaded the programme, it proved
-	impossible to allocate enough additional contiguous memory to
-	load one or more of the overlays.  Either reduce the
-	RAM-loading of the application by reducing the size of either
-	the root or the largest overlays, or increase the amount of
-	memory available by unloading TSRs and/or simplifying your
-	CONFIG.SYS.
-
-OVLMGR: Unable to resolve overlay file names.
-
-	Apparently the name reported to OVLMGR as being that of the
-	executable file is ill-formed, and it is thus not possible to
-	intuit what external overlay files would be called.  It is
-	possible that this indicates that DOS has gone bonkers, but more
-	likely (I guess) that the .EXE was not invoked by DOS as we know
-	it.  Either way, you have entered the Twilight Zone....
-
-(xxxx:xxxx:xxxx:xxxx)
-
-	This is a diagnostic code composed of the following fields:
-		- error code
-		- version number
-		- available conventional memory
-		- EMS memory usage
-	Please note it in any bug reports or correspondence with the
-	development team.
-
-------------------------------------------------------------------------
-KNOWN BUGS
-
-The present version cannot always be used as a direct replacement for
-Microsoft's overlay manager (even granted the documented differences)
-because the minimum size required for an overlaid programme to run is at
-least the size of the root plus TWICE the size of the largest overlay.
-If a programme has previously had its overlay structure tuned to take
-best advantage of Microsoft overlays, this may well cause a problem.
-The overlays themselves will need to be split up.
-
-When the MicroSoft linker discovers that an overlay as requested
-contains NO instructions at all (this can happen by mistake if you give
-a source file that winds up holding only data declarations its own
-overlay), it does not emit an overlay record for it at all - there is
-simply a gap in the overlay sequence in the file.  The current version
-of OVLMGR detects this as an error, since it assumes that such a gap
-should have been filled by an external .OVL file.  It is presently your
-responsibility to ensure that this does not occur.
-
-Files containing overlays are kept open all the time the application
-is running.  Particularly if multiple external .OVL files are used,
-this can result in less file handles being available to the user
-programme than would otherwise be expected.
-
-ALL files that match the pattern for potential overlay files are
-opened, regardless of whether they actually contain overlays.
-
-The names of external overlay files have a very restricted form, and
-they must reside in the same directory with the .EXE.  These
-limitations cause them to be useful for little else besides making
-distribution easier.
-
-Transfers between overlays are very slow in machine terms, even if both
-overlays happen to reside in memory at the time (still significantly
-faster than Microsoft's, though).  This means that overlay patterns
-must be chosen on the basis of more than just logical dependency.
-
-Locking overlays into memory is not really implemented even though
-reading the source code might make you think it was.  Actually, reading
-the source code itself isn't very well implemented right now.  Comments
-and stuff would help.  Yup, yup.
-
-Due to limitations in the LIM EMS standard (to 4.0), programmes that
-themselves use EMS memory cannot be overlaid with ovlmgr unless ovlmgr's
-own EMS support is disabled.  This is accomplished by assembling with
-the /DNOEMS flag.
-
-------------------------------------------------------------------------
-BUG ALERT
-
-To repeat a point made above, if you ever try to call a function in an
-overlay through a pointer, you *may* die with the Microsoft overlay
-manager.  If you ever try to call a function in an overlay through a
-pointer, you *will* die with ours.  Nothing in an overlay ever ends up
-in the same segment as the linker anticipated.	You have been warned!
-
-------------------------------------------------------------------------
-FOOTNOTES
-
-(1) This problem can be circumvented through the use of surrogate
-'trampoline' functions:  functions that reside in the root overlay and
-simply pass right through to the 'real', overlaid, implementations.
-This can even be made transparent to the source code through the use
-of the C macro preprocessor, with a locution of the form
-	#define foo(x) foo_(x)
-visible everywhere except at the actual definition point of the
-trampoline.  This method was implemented in NetHack 3.0, and remains today.
-
-(2) If you should get a message to the effect that NetHack can't
-allocate 28000 and some bytes when entering a maze level, that
-isn't our problem!  In all probability you forgot to rebuild your
-special level files when you changed the compiler flags.  We got
-that one, too, at one point.  The same applies to similar messages when
-reading bones files or saved games:  it is more likely that you forgot
-to discard them after recompiling your game than that the memory
-allowance is so greatly incorrect.
-
-----------------------------------------------------------------------
-NOTICE
-
-OVLMGR.ASM is brought to you by Pierre Martineau and Stephen Spackman.
-It, and this document, are copyright.  They are, however, provided as
-part of NetHack and may be freely distributed as described in the
-NetHack license.
-
-----------------------------------------------------------------------
-Stephen P Spackman			     stephen@tira.uchicago.edu
-Pierre G Martineau		   pierre%ozrout.uucp@altitude.cam.org
-----------------------------------------------------------------------
-    Copyright (c) 1989, 1990 Pierre G Martineau and Stephen P Spackman
-    All Rights Reserved.
diff -Naurd ../nethack-3.3.1/sys/msdos/old/ovlmgr.uu ./sys/msdos/old/ovlmgr.uu
--- ../nethack-3.3.1/sys/msdos/old/ovlmgr.uu Sat Apr 4 03:22:53 1998
+++ ./sys/msdos/old/ovlmgr.uu Thu Jan 1 01:00:00 1970
@@ -1,152 +0,0 @@
-begin 644 ovlmgr.obj
-M@`P`"F]V;&UG<BYA<VUDEA4```904U!314<&3U9,5$),!$-/1$6%F`H`````,
-M`"P``@$!+I@*```````0``,!`4F8!P!HO1P$`0$:C$8`!R0D24Y43D\`"20DT
-M3U9,0D%310`*)"1-4$=33D]63``+)"1-4$=33D)!4T4`!B0D34%)3@`&)"1#O
-M1U-.``8D)$-/5DP`T9`0```#"20D3U9,24Y)5/D/`-^(!```H@'1H!0``@``0
-M`````````````````````$J@'``#`````````````/__________````````=
-M``!)H@\``Q@`#P`!``$````"__\CH`8``S8`__\CH@\``S@`$``!``$````"`
-M__\"H`8``U@```#_H@\``UH`$``!``$````"___@H!(``WH`__\`````````F
-M``````#3H`8``X@$``#+G`@`Q````P.*!`2B#P`#B@H0``$``0````+__Z:@V
-M!@`#J@H``*.B9@`#K`H!`````DU:`0````(```$````"```!`````@```0``B
-M``(```$````"```!`````@```0````(```$````"```!`````@```0````(`&
-M``$````"```!`````@```0````(``&ZB#@`#K`Q0``$``0````$`0J`(``/\8
-M#`````!-HDD``P`-%0`!``$````!``$````!``$````"```!`````@```0``5
-M``0`````"0`!``$````!``,``0`!`````0!6``$``0````$`=:``!`.`#0``=
-M``#__P```````````````````````````````````````$5-35A86%@P```$G
-M```S.#8@<W!E8VEF:6,@8V]D92!E;F%B;&5D+@T*)$-O;G9E;G1I;VYA;"!M0
-M96UO<GD@879A:6QA8FQE.B`D2"!P87)A9W)A<&AS+@T*)$5-4R!M96UO<GD@A
-M879A:6QA8FQE.B`D2"`Q-DLM<&%G97,N#0HD26YC;W)R96-T($1/4R!V97)S/
-M:6]N+B!-=7-T(&)E(#,N,#`@;W(@;&%T97(N)$EN86-C97-S:6)L92!%6$4@'
-M9FEL92X@0V%N)W0@;&]A9"!O=F5R;&%Y<RXD3F]T(&5N;W5G:"!F<F5E(&UE)
-M;6]R>2!L969T('1O(')U;B!T:&ES('!R;V=R86TN)$9I;&4@22]/(&5R<F]R+
-M+B1);G1E<FYA;"!M96UO<GD@86QL;V-A=&EO;B!F86EL=7)E+B1%35,@;65M0
-M;W)Y(&UA;F%G97(@97)R;W(N)$5X96-U=&%B;&4@;W(@;W9E<FQA>2!H96%DI
-M97(@;6ES<VEN9R!O<B!D86UA9V5D+B15;F%B;&4@=&\@<F5S;VQV92!O=F5RF
-M;&%Y(&9I;&4@;F%M97,N)$EN86-C97-S:6)L92!/5DP@9FEL92X@0V%N)W0@T
-M;&]A9"!O=F5R;&%Y<RXD26YC;VUP;&5T92!E>&5C=71A8FQE+B`@3U9,(&9IR
-M;&5S(&UI<W-I;F<_)%5N:VYO=VX@97)R;W(A)!M;,&T;6TL-"AM;2QM;,6U/F
-M5DQ-1U(Z&ULP;2`D&UM+#0H;6TL@("`@("`@("@D&UM+#0H;6TL')#\N3U9,1
-M`%!345)65U4>!OR,V`40`"ZC``"T,,TA/`-S!;`!Z0``CAX``+[__T:#/`!US
-M^H/&!.@``+0UL&?-(8S(CMB_"@"^``"Y"`#SIK``=0*P_RZB``!U$K1!S6<N+
-MB1X``+1"S6<NB1X``+@``"ZC``"X``".V(L>```NB1X``(L>```NB1X``+1(+
-MS2%S`^D``"ZC```NBPX``([`)L8&````)L8&````)L<&`````";'!@`````FA
-MQP8`````)L<&``#__R;'!@`````FQP8`````)L<&`````$#BOHS(CM@S[3/_V
-M,_;H```NH0``+@,&``".P(O.T>$FB`X``"ZA``#1X-'@T>#1X-'@+HL6```+[
-MTG0.T>K1ZM'JT>I"+2```\(N*P8``":C```N@SX```!T!CO'<@*+^"ZA``#1$
-MX-'@T>#1X":C```FB2X``"X#+@``B]6*SHKR,NTRTM'BT=&P`+1"S2$NBPX`*
-M`"ZA``!)`\&.P":*'@``@^,>@_L`=0LF@SX``&R<D`'$!@`#`R0.Q`@``P-2H
-M#L0*``,#?@[$#``#`Z\.Q`X``P._#L00``,#OP[$$@`#`^,.Q!0``P/]#L064
-M``,#+@_$&``#`U0/Q!H``P.`#\0<``,#JP_$'@`#`ZL/Q"```P.K#\0B``,#$
-MJP_&B@`#`X0`AI<``P-'&\:;``$!+`"&J@`#`S\:QKH``P.D#<;)``,#L`W&<
-MU``#`X8`QMT``P.L#<K@)@("QN0``P.``,KG)@<'QNTF!@;&\@`#`WX`QO8F?
-M!P?&^P`#`WP`AP0``P,)$L<(``,#-@#'#0`#`WP`QQ0$`@+'&@`"`@$`QR``"
-M`@("`,<G``("!`#'+@`"`@8`QS4``@((`,<\``(""@#'0P`"`@P`QTH``@(.*
-M`(=<``,#[QG'8``#`S8`QV4``P/&"L=P!`("QW0``P.P"L>#``,#K@K'F@`#@
-M`[0*QYX``@(,`,>C``,#Q@K'L``#`[0*Q[P``@(.`,?!``(""@#'Q@`#`[`*;
-MQ]\``P-\`,?C``,#-@#'[00"`L?Z``(""@"RH``$`WP1`'4#Z0``2.+C+J$`,
-M`"ZC``".P";&!@```";'!@(````FQP8$````)L<&!@```":)/@@``\<NHP``=
-M5RZ.!@``Z```)L<&``#__R:`)@``OU+H``!87PO`=05'.]=R+R['!@`````N.
-MQP8`````OP``+L<%__^#QP8NH0``+HD%+HD^``".P";&!@``H.L%L`/I``"X(
-M``".V*```#+DT>#1X"ZC``#H```NBPX``+@``([`C,B.V+L``+X``+\``":*,
-M!#+D`P8``(D%)HL'*P8``(E%`H/'!(/#`D;BX@<?75]>6EE;6.H`````+HDV\
-M```NC!X``%X?4%/\K#+DB]BM+J,``(O&+HLV``"#Q@8NC%S\+HE$_M'CT>.!N
-MPP``+HX?+HM'`BZ,'"Z)-@``+HLV``!&+HDV``")-@``+HLV``!T?XDV``#V'
-M!@``('1]_@8```,&```NHP``+HLV```NCAX``%M8G2[_'@``G"Z,'@``+HDV3
-M```NBS8``"Z.'/X.``"#[@8NCAPN_W0"+O]T!"Z)-@``+HLV``!&+HDV``")C
-M-@``+HLV``!T-XDV``#V!@``('0T+HLV```NCAX``,]&+HDV``#I``#V!@``D
-M0'0+4*$``.@``%CI``#H``#I``!&+HDV``#KP?8&``!`=`I0H0``Z```6.N[O
-MZ```Z[9045)35597'@:,V([`)H`^````=0HFH0``Z```ZP20Z```!0$`)J,`S
-M`([8)HL6``"*SHKR,NTRTM'BT=$FH0``45(#T(/1`+1"L``FBAX``(/C'BZ+2
-MGP``S2%R4#/2)HL.``#1X='AT>'1X;0_S2%R.UI9M$*P`":*'@``@^,>+HN?4
-M``#-(7(DN0`"N@``'HS(CMBT/\TA'W(2Z```!Q^`#@``(%]>75M:65C#L`3I2
-M``"^``"+[H'%``(NBTP&XUN,WRXK/@``+@-T&#OU<@/H```NBAQ&._5R`^@`&
-M`"Z*/$8[]7(#Z```+HH$1COU<@/H```NBB1&+@,&```#QX[8BP<N`P8``"X[-
-M!@``<@DN.P8``',"`\>)!^*PPU-15U4>!KD``KH``(S(CM@FBAX``(/C'BZ+4
-MGP``M#_-(7,#Z0``O@``!Q]=7UE;PU-14E9751XNCAX``#/`B]"+Z(O8+HL.:
-M``#VAP``@'4P]H<``$!U!_:'```@="(NBS8``"Z+/@``*[<``!N_```[UW(&M
-M=0H[QG,&B\:+UXOK@\,0XL0+[74%L`7I``#1[='MT>W1[8S8`\4?75]>6EE;;
-MPX#\2W0/@/Q,=`4N_RX``+``Z0``"L!U\E!14E-55E<&'BZ.!@``+HL.``"[B
-M$`!))O:'``!`=1<F]H<``"!T99P,`X0$``,#VQ#$"P`#`X``Q`\``P-8`,0W)
-M``,#@@#$/0`#`S8`A$```P.H&,1%``(""`#$3`0"`H11``,#$!C$800#`\1HC
-M``,#`@#$;0`#`XH$Q'D``P,V`,2!``,#B`3$B`0"`H20``,#1QO(DR8!`<28X
-M)@$!Q*(``P.J"H2E``,#31S$J@`#`WX`R*TF!`3$MB8$!,2Y)@,#Q+P``P.([
-M`,3%``,#-@#$S@`#`X``S.8F!07$[0`#`Q``Q/(``P,2`,4!``,#!`#%"``#S
-M`X@$Q1L``P.(`,4J``,#B`3%+P0#`\4U!`,#Q3D``@($`,4^``,#`@#%1``""
-M`@8`Q4@$`@+%3P`"`@$`Q5,``@("`,57``,#!@#%7``#`Q``Q6$``P,2`,5I4
-M``,#!`#%;P`#`Q(`Q70``P,0`,5Y``,#B`3%@``"`@$`Q9,``P.(!,68!`,#3
-MQ9X$`P/%H@`"`@0`Q:<``P,"`,6M``("!@#%L00"`L6Y``,#$`#%O@`#`Q(`:
-MQ<4``P,"`(7(``,#OA+%S`0"`L73``(""`"%U@`#`ST9A=H``P/)$H7=``,#8
-M?!.%X``#`\D2Q>8``P,"`,7L!`("Q?,``@((`(7V``,#/1F%_``#`WP3QA``H
-M`@(!`,87``("#`"&&@`#`Z06AB```P,6%L8G``("`@#&+@`"`@H`QCX``@(.Q
-M`,9.!`("QE8``P,8`,9A``("#`#&>@0"`L:"``,#&`#&C``#`ZP*AIL``P,M+
-M%,:A!`("AJ\``P-'&\:R``,#K`K&Q0`#`X``AM```P.8%(;;``,#F!2&Y@`#H
-M`Y@4AO$``P.8%,;Z``,#A`#'!0`#`X0`QPH``P.``,<1``,#@@#')@`#`ZP*,
-MQR\$`@+'-P`#`Q@`AT```P,H%,=#``,#K`K'5@`#`S8`QV,``P-\`,=G!`("&
-MQVX$`@+'=00"`L=]!`,#QX(``P,"`,>&``("!`#'B@`"`@8`AZ@``P-'&\?+%
-M``,##`"'T``#`T<;Q^(``P,V`,?G``,#?`#'\`0"`L?X!`(";J``!`-X%14FG
-MBX<``"T!`"X[!@``<@8F@*<``-^#PQ#BUB['!@``__\NH0``/?__=`Z.P":.<
-M!@0`)L<&`@```+D0`+X``"Z+!#W__W0+CL"T2<TA+L<$__^#Q@+BZ.@``(OLC
-M_W86G1\'7UY=6UI96"Z,%@``+HDF``#-(2Z.%@``+HLF``!045)35597!AZ+!
-M[)R/1A;H``#H```?!U]>75M:65C/)HL>``"#ZP&+TR8#%@``@\(!)J$``#W_;
-M_W00Z```)H`.``!`+J$``.M9D"ZA``#K4I".V#O8<PD[PG--Z```Z_$#!@@`P
-M.]AS-_8&```!=`?H```#!@@`.\)R)8S8B\LKR'02!N@``":`#@```>@``(S`Z
-MCM@')HL.``"#P0'K.I"A`@`+P'0"ZZFP!ND``";'!@``__\F@"8``+^+R(/!!
-M`>@``#O1<P_H```[T7,(Z```Z```Z^KK`9`&@`X```'H``!R"1Z,P([8Z```'
-M'P>,!@8`C-C#C-@#P8[`H0@`*\%V,(D."``FHP@`H0(`)J,"`(P&`@`FC!X$J
-M`";&!@```":A`@`+P'0*'H[8C`8$`!_XP_G#+J$``#/2ZQB0CMCV!@```74+)
-M.0X(`'(%BQ8(`,.A`@`+P'7EP_8&```!=!(&C@8&`":`)@``WR:`)@``OP?KS
-M)9".V(`F``#?]@8``$!T"X`F``"_H0``Z```H0``+0$`CMCK`9!2!H`F``#^J
-MH00`"\!T,H[`)O8&```!=2@F`P8(`(S:.]!U':$(`"8!!@@`H0(`)J,"``O`5
-M=`:.V(P&!`",P([8H0(`"\!T,([`)O8&```!=2:,V`,&"`",PCO"=1HFH0@`Q
-M`08(`":A`@"C`@`+P'0'CL`FC!X$`(`F``#^!UJ,V,-14U97'@8STBZA``".G
-MV*$"``O`=?>^``"_``"Y$`"T2+O__\TA@_L0<DFT2,TA<D,N.P8``'(T.]-SD
-M`HO3+HD$CL`FQ@8````FQP8"````)L<&!@```":,'@0`)HD>"`",!@(`@\8"]
-MCMCK!BZ)!8/'`N*KO@``N1``+HL$/?__=`N.P+1)S2$NQP3__X/&`N+H!Q]?&
-M7EM9PS/2+H`^``#_=`'#+L<&``#__[\``(O9N1``+HL%/?__=!'H```[PW-8D
-M@\<"XNR+RS/2PXO+NP0`M$-15P;-9P=?60KD=`,STL,NB14FB18``":`#@``6
-M0(O"Z```+J$``([8Q@8```#'!@(```#'!@0```#'!@8```"Z`!")%@@`PXO+@
-MCMZ+T"Z+!2:C```F@`X``$##+CL&``!U`<-34AX&Z```+J$``#/2,_:.V/8&:
-M```!=`V.!@8`)H`.``!@ZPR0H0@`.]!S!(O0C(N<G0'$!``"`@(`Q`P``P,X]
-M`,03!`("Q!X``P-Z`,0D``,#.`#$/0`#`S@`A%@``P.(',1L``,#%`#$<0`#:
-M`Q8`Q'@``P,4`,1]``,#%@"$CP`#`Q`8A)(``P--',2A``("`@#$JP`"`@P`#
-MQ+(``@((`(2Z``,#/1G$OP0"`L3$``,#A@#$RP`#`U@`A-L``P-/%X3O``,#;
-M3Q>%`P`#`^L6A0P``P./%\46``("#`"%*@`#`T<;Q2\``@((`,4V!`("A3\`?
-M`P,J%X5&``,#J!B%30`#`\@4A5```P-K%X5>``,#ZQ:%:``#`X\7Q;0``P-8U
-M`,7F!`("Q>P$`@+%]P0"`L7\!`("Q@,$`@+&!P`"`@@`A@H``P,]&<8-``("(
-M`@#&H@`#`U@`QJX``P,X`,:Q``,#B@K&RP`#`S8`QPP``P.*"L<U``,#L`W'J
-M/@`#`WH`QT,``P-:`(=3``,#/1G'?P`"`@@`QX0$`@*'B@`#`X,9QXX``P.&T
-M`,>\``(""`#'P00"`L?(``,#>@"'T@`#`X,9Q]8``P.&`,?L!`("0:!-`P-T`
-M&=ZA`@`+P'78B\(''UI;PP9345(NHP``B]"T1#+`,]M2S6=:"N1U3[1$L`&[!
-M`0!2S6=:"N1U0+1$L`*[`@!2S6=:"N1U,;1$L`.[`P#-9PKD=20NC@8``"Z+[
-M#@``,]LF]H<``$!T!B:`IP``WX/#$.+M6EE;!\.P!^D``+H``(O>T>,NBY\`=
-M`+D<`+0_S2%R,3O!=",]``!T`^LKD$:#_@]T'XO>T>,N@[\``/]T[BZ+GP``?
-M,^WKT"Z!/@``35IU!L.P"^D``+`(Z0``!K0OS2$NC`8``"Z)'@``'KH``(S(D
-MCMBT&LTA'[DH`(S+CL._``#SI;\``+``N5``_/*N@^E0]]F+V8/Y4'0'2T^#T
-M^P=^';!<_?*N_(O3*]%*N0``+HD>```NB18``(/Z#'X%L`GI``",R([8N@``F
-ML`"T/<TA<P6P`ND``"ZC```N@SX```M_"B[_!@``+O\&``"_```N`SX``(/OE
-M!;X``+D&`/.DN0``N@``M$[-(7)'N0X`+HL6```N*18``%$NBQX``+\```/[=
-MO@``+HL.``#SI%FZ``"P`+0]S2%S".@``+`*ZR*0B]G1XRZ)AP``M$_-(7("-
-MXL8NBQ8``"Z.'@``M!K-(0?#,N10#A^+V-'C@<,``(L7@_K_=&12N@``M`G-L
-M(5JT"<TAM`FZ``#-(5A0Z```M`*R.LTAN*`PZ```M`*R.LTAN`"@+BL&``#H_
-M``"T`K(ZS2&^``"Y$``SP"Z#//]T"BX#!@``@\8"XO#H``"T`K(IS2&Z``"TQ
-M"<TAZ```+J$``#W__W0&CL"T2<TAN1``O@``+HL$/?__=`:.P+1)S2&#Q@+BV
-M[;D0`+X``"Z+%(/Z_W0$M$7-9X/&`N+ON0\`B]E+T>,NBY\``(/[_W0$M#[-7
-M(>+K6+1,S2%0AN#H``!8ZP&04-#HT.C0Z-#HZ```6.L!D%`D#P0P/#IR`@0'I
-M4HK0M`+-(5I8PQXSP([8+HLV``#ZBP0NHP``BT0"+J,``+@``(D$C$P"OH0`O
-MBP0NHP``BT0"+J,``+@``(D$C$P"^Q_#'C/`CMB^A`#Z+J$``#W__W0)B00NN
-MH0``B40"+HLV```NH0``/?__=`J)!"ZA``")1`+['\,PG/4!Q!4``P-Z`,15P
-M``,#-@#$6@`#`WP`Q&$$`@+$:00"`H1Y``,#1QO$?``#`ZP*Q(4``P,8`,2I!
-M``,#&`#$L0`#`Q@`Q+H``P.L"H3$``,#1QN$R0`#`T<;Q-,``P.`#<38``,#/
-M@@W$W``#`P`-Q.\``P.L#,3T``,#K`S%(@`#`_P,Q2<``P/^#(4Q``,#1QO%V
-M.``#`ZP,A44``P-'&\5)``,#&`#%3@`#`_X,Q58``P/\#,5;``,#_@S%7@`#"
-M`ZP,Q6,``P/\#,5I``,#\P_%=``#`ZP,Q8(``P/^#,6'``,#_`S%C0`#`_P,7
-MQ9```P.L#,65``,#'@W%F@`#`_X,Q:```P.L#(6K``,#'AS%N0`#`Q@`Q<8`3
-M`P."#<7+``,#@`W%W@`#`X0-Q>D``P.Z#\7W``,#UP^%_@`#`QX<A@H``P,>T
-M',88``,#-@"&&P`#`QX<QB0``P-:`,8T``,#K@V&/``#`QX<QD4``P/I#X9,U
-M``,#B!S&4``#`S8`QF$``P,X`,9Z``,#6@#&F``#`Q@`AJX``P,H'(:^``,#@
-M.!S&X0`#`ZH*QN@``P,(`,;O``,#"@#&\@`#`V82QP```P,,`,<'``,##@#'E
-M"@`#`SH5QQ\``P,,`,<J``,##@#',@`#`ZH*QS8``P,(`,=!``,#"@"8B@(`C
-"`'0`7
-``
-end
-sum -r/size 34565/9296 section (from "begin" to "end")
diff -Naurd ../nethack-3.3.1/sys/msdos/old/README.old ./sys/msdos/old/README.old
--- ../nethack-3.3.1/sys/msdos/old/README.old Sat Apr 4 03:22:45 1998
+++ ./sys/msdos/old/README.old Thu Jan 1 01:00:00 1970
@@ -1,29 +0,0 @@
-
-
-The files in this directory are what remains of some utilities and
-documentation used in past versions of NetHack.  They are generally
-workarounds for various bugs and limitations of MSDOS compilers.  Should
-you be stuck with a compiler whose version is not supported by the current
-NetHack release, perhaps these files can help you.  Otherwise, they make
-interesting historical and somewhat humorous reading.
-
-Files in this directory:
-
-README.OLD    -  This file
-
-
---- Files for Microsoft C prior to version 7.0 ---
-exesmurf.c    -  Source for program to split single overlaid executable
-		 into smaller files.  Make transporting by floppy feasible.
-
-exesmurf.doc  -  Documentation for above.
-
-trampoli.c    - Files relating to the "trampoli" overlay schema devised
-trampoli.h    - to overcome a Microsoft C limitation whereby function
-	      - pointers could not cross overlay boundaries.
-ovlmgr.asm    - Assembly source for our own overlay manager.
-ovlmgr.doc    - Documentation for the overlay manager.
-ovlmgr.uu     - UUencoded object file for the overlay manager.
-
-maintovl.doc  - Documentation for the above.
-
diff -Naurd ../nethack-3.3.1/sys/msdos/old/schema.old ./sys/msdos/old/schema.old
--- ../nethack-3.3.1/sys/msdos/old/schema.old Sat Apr 4 03:22:48 1998
+++ ./sys/msdos/old/schema.old Thu Jan 1 01:00:00 1970
@@ -1,216 +0,0 @@
-SCCS Id: @(#)schema.old		3.2	 95/10/25
-Copyright (c) NetHack PC Development Team 1994.
-#
-# NetHack Overlay Schema
-# NetHack "classic" overlay schema.
-# This was moved to the msdos/old directory for 3.2 because
-# that version can no longer use this schema. Preserved
-# there for historical reasons.
-
-[ root ]
-alloc.o    attrib.0   dbridge.0  decl.o     display.o  dlb.o
-dogmove.0  dungeon.0  engrave.0  explode.0  hack.3     hacklib.0  hacklib.1
-invent.0   light.3    mkobj.0    mkroom.0   mondata.0  monmove.0  monst.o
-msdos.0    muse.o     objects.o  pcmain.0   pcmain.1   pcmain.b   pctiles.0
-random.o   rect.o     rnd.0      sound.o    teleport.o termcap.0  tile.o
-trap.0     video.0    vidtxt.0   vidvga.0   vidvga.1   vis_tab.o  vision.o
-wintty.o   zap.0      shk.0
-
-# These could use to go in root, but are in OVL1 to make
-# the game loadable in under 512 free ram.
-[ rhack and friends ]
-allmain.0  artifact.0 attrib.1   botl.1     cmd.1      do.1       do.3
-eat.0      engrave.2  explode.1  getline.1  hack.1     hack.2     sounds.0
-timeout.0  track.1    vault.0    wizard.0
-
-[ startup ]
-dungeon.1  files.o    monstr.o   msdos.b
-
-[ main monster code ]
-cmd.0      engrave.1  mondata.1  mthrowu.0  priest.0   track.0    trap.1
-trap.2     were.0
-
-[ monster movement ]
-mon.0      mon.1      monmove.1
-
-[ pet monster movement ]
-dog.1      dogmove.b
-
-[ advanced monsters 1 ]
-mcastu.0   minion.o
-
-[ advanced monsters 2 ]
-priest.b   shk.1      shk.2	  shk.3     shk.b
-
-[ advanced monsters 3 ]
-were.b
-
-[ advanced monsters 4 ]
-wizard.b
-
-[ advanced monsters 5 ]
-worm.o
-
-# around the movement loop
-[ domove and friends ]
-apply.0    do_wear.1  lock.0
-
-[ ]
-detect.o
-
-[ ]
-attrib.2   attrib.b   exper.o
-
-[ ]
-eat.1      invent.1
-
-[ ]
-makemon.0  makemon.1  makemon.2  mkobj.1
-
-[ ]
-makemon.b  mkobj.b    mplayer.o
-
-[ ]
-mhitm.b
-
-[ ]
-mthrowu.1
-
-[ ]
-mthrowu.b
-
-[ ]
-allmain.1  mhitm.0    mhitu.0    mhitu.1    rnd.1      weapon.0   weapon.1
-
-[ ]
-mon.2      mon.b
-
-[ ]
-artifact.1 uhitm.o    weapon.b
-
-[ ]
-do_wear.0  mhitu.b
-
-[ ]
-steal.0    steal.1
-
-[ ]
-monmove.2  monmove.b  steal.b
-
-[ ]
-rnd.b
-
-[ ]
-do_wear.2  mondata.2  objnam.0   objnam.1   polyself.0 polyself.1
-
-[ ]
-do_name.0  
-
-[ ]
-hacklib.2  hacklib.b  objnam.b   
-
-[ ]
-pager.o
-
-[ ]
-botl.0     
-
-[ ]
-botl.b     termcap.1  topl.b     windows.o  
-
-[ ]
-topl.1     topl.2     
-
-[ ]
-termcap.b  video.b    vidtxt.b   vidvga.b
-
-[ ]
-quest.o    questpgr.o
-
-[ ]
-invent.b
-
-[ ]
-hack.b
-
-[ ]
-dog.b      mondata.b  sounds.b   timeout.1  timeout.b
-
-[ ]
-do.0       invent.3   
-
-[ ]
-cmd.b      getline.2  write.o    
-
-[ ]
-apply.b    
-
-[ ]
-do.b       drawing.o  
-
-[ ]
-dokick.o
-
-[ ]
-dothrow.o  
-
-[ ]
-eat.b
-
-[ ]
-invent.2   pickup.o   
-
-[ ]
-lock.b     
-
-[ ]
-polyself.b 
-
-[ ]
-pray.o
-
-[ ]
-read.b     spell.o
-
-[ ]
-ball.o
-
-[ clothing stuff ]
-do_wear.b  wield.o    worn.o
-
-[ zappage 1 ]
-zap.1      zap.2      zap.3      zap.b
-
-[ zappage 2 ]
-dbridge.1  dbridge.b
-
-[ zappage 3 ]
-trap.3     trap.b
-
-[ unusual circumstances ]
-artifact.b do_name.2  do_name.b  fountain.o music.o    rumors.o   sit.o
-vault.b
-
-[ uppers and downers 1 ]
-apply.1    bones.o    mklev.o    mkmap.o    mkmaze.o   mkroom.b   restore.o
-save.o
-
-[ uppers and downers 2 ]
-allmain.b  end.o      engrave.b  o_init.o   options.o  rip.o      shknam.0
-topten.o   tty.o      u_init.o
-
-[ levelling ]
-do.2       dog.2      extralev.o sp_lev.o   track.b
-
-[ ]
-dig.o
-
-[ ]
-mail.0     mail.b     mcastu.b   pcunix.b   pline.b    potion.b   shknam.b
-sys.o      version.o
-
-[ ]
-pctiles.b
-
-[ ]
-video.1 
diff -Naurd ../nethack-3.3.1/sys/msdos/old/trampoli.c ./sys/msdos/old/trampoli.c
--- ../nethack-3.3.1/sys/msdos/old/trampoli.c Sat Apr 4 03:22:49 1998
+++ ./sys/msdos/old/trampoli.c Thu Jan 1 01:00:00 1970
@@ -1,638 +0,0 @@
-/*	SCCS Id: @(#)trampoli.c 	3.1	95/06/01	  */
-/* Copyright (c) 1989 - 1993 by Norm Meluch and Stephen Spackman  */
-/* NetHack may be freely redistributed.  See license for details. */
-
-#include "hack.h"
-
-/****************************************************************************/
-/*									    */
-/*	This file contains a series of definitions of "one liner"	    */
-/*	functions corresponding to *all* functions that NetHack calls	    */
-/*	via pointers.							    */
-/*	     IF ANY CALLS TO FUNCTIONS VIA POINTERS ARE ADDED		    */
-/*	     TO THE CODE, AN ENTRY FOR THE FUNCTION CALLED MUST		    */
-/*	     BE ADDED TO THIS FILE AND TO TRAMPOLI.H.			    */
-/*	This mess is necessary for the Microsoft Compiler implementation    */
-/*	of overlaid code (v5.1 - 6.0ax).				    */
-/*									    */
-/*	The original function (eg foo) has been #defined to be foo_	    */
-/*	via double inclusion of trampoli.h in hack.h, and		    */
-/*	now the definition of foo is placed in this file calling foo	    */
-/*	directly.  This module is _never_ placed in an overlay so	    */
-/*	calls via pointers to these functions will not cause difficulties.  */
-/*									    */
-/*	This leads to what could be called a "trampoline" effect, and	    */
-/*	hence the silly name for these files. :-)			    */
-/*									    */
-/****************************************************************************/
-
-#ifdef OVERLAY
-
-/* ### apply.c ### */
-#undef dig
-#undef doapply
-#undef dojump
-#undef dorub
-
-int dig()		{ return dig_(); }
-int doapply()		{ return doapply_(); }
-int dojump()		{ return dojump_(); }
-int dorub()		{ return dorub_(); }
-
-
-/* ### artifact.c ### */
-#undef doinvoke
-
-int doinvoke()		{ return doinvoke_(); }
-
-
-/* ### cmd.c ### */
-#undef doextcmd
-#undef doextlist
-#undef doprev_message
-
-#undef domonability
-
-#undef enter_explore_mode
-
-int enter_explore_mode()	{ return enter_explore_mode_(); }
-
-#undef timed_occupation
-
-#undef wiz_attributes
-
-#ifdef WIZARD
-#undef wiz_detect
-#undef wiz_genesis
-#undef wiz_identify
-#undef wiz_level_tele
-#undef wiz_map
-#undef wiz_where
-#undef wiz_wish
-#endif
-
-int doextcmd()		{ return doextcmd_(); }
-int doextlist()		{ return doextlist_(); }
-int doprev_message()	{ return doprev_message_(); }
-
-int domonability()	{ return domonability_(); }
-
-int timed_occupation()	{ return timed_occupation_(); }
-
-int wiz_attributes()	{ return wiz_attributes_(); }
-
-#ifdef WIZARD
-int wiz_detect()	{ return wiz_detect_(); }
-int wiz_genesis()	{ return wiz_genesis_(); }
-int wiz_identify()	{ return wiz_identify_(); }
-int wiz_level_tele()	{ return wiz_level_tele_(); }
-int wiz_map()		{ return wiz_map_(); }
-int wiz_where()		{ return wiz_where_(); }
-int wiz_wish()		{ return wiz_wish_(); }
-#endif
-
-
-/* ### do.c ### */
-#undef doddrop
-#undef dodown
-#undef dodrop
-#undef donull
-#undef doup
-#undef dowipe
-#undef drop
-#undef wipeoff
-
-int doddrop()			{ return doddrop_(); }
-int dodown()			{ return dodown_(); }
-int dodrop()			{ return dodrop_(); }
-int donull()			{ return donull_(); }
-int doup()			{ return doup_(); }
-int dowipe()			{ return dowipe_(); }
-int drop(obj)
-  register struct obj *obj;	{ return drop_(obj); }
-int wipeoff()			{ return wipeoff_(); }
-
-
-/* ### do_name.c ### */
-#undef ddocall
-#undef do_mname
-
-int ddocall()		{ return ddocall_(); }
-int do_mname()		{ return do_mname_(); }
-
-
-/* ### do_wear.c ### */
-#undef Armor_off
-#undef Boots_off
-#undef Gloves_off
-#undef Helmet_off
-#undef Armor_on
-#undef Boots_on
-#undef Gloves_on
-#undef Helmet_on
-#undef doddoremarm
-#undef doputon
-#undef doremring
-#undef dotakeoff
-#undef dowear
-#undef select_off
-#undef take_off
-
-int Armor_off()		{ return Armor_off_(); }
-int Boots_off()		{ return Boots_off_(); }
-int Gloves_off()	{ return Gloves_off_(); }
-int Helmet_off()	{ return Helmet_off_(); }
-int Armor_on()		{ return Armor_on_(); }
-int Boots_on()		{ return Boots_on_(); }
-int Gloves_on()		{ return Gloves_on_(); }
-int Helmet_on()		{ return Helmet_on_(); }
-int doddoremarm()	{ return doddoremarm_(); }
-int doputon()		{ return doputon_(); }
-int doremring()		{ return doremring_(); }
-int dotakeoff()		{ return dotakeoff_(); }
-int dowear()		{ return dowear_(); }
-int select_off(otmp)
-  struct obj *otmp;	{ return select_off_(otmp); }
-int take_off()		{ return take_off_(); }
-
-
-/* ### dogmove.c ### */
-#undef wantdoor
-
-void wantdoor(x, y, dummy)
-  int x, y; genericptr_t dummy; { wantdoor_(x, y, dummy); }
-
-
-/* ### dokick.c ### */
-#undef dokick
-
-int dokick()		{ return dokick_(); }
-
-
-/* ### dothrow.c ### */
-#undef dothrow
-
-int dothrow()		{ return dothrow_(); }
-
-
-/* ### eat.c ### */
-#undef Hear_again
-#undef eatmdone
-#undef doeat
-#undef eatfood
-#undef opentin
-#undef unfaint
-
-int Hear_again()	{ return Hear_again_(); }
-int eatmdone()		{ return eatmdone_(); }
-int doeat()		{ return doeat_(); }
-int eatfood()		{ return eatfood_(); }
-int opentin()		{ return opentin_(); }
-int unfaint()		{ return unfaint_(); }
-
-
-/* ### end.c ### */
-#undef done1
-#undef done2
-#undef done_intr
-#if defined(UNIX) || defined(VMS)
-#undef done_hangup
-#endif
-
-void done1(sig) int sig; { done1_(sig); }
-int done2()		{ return done2_(); }
-void done_intr(sig) int sig; { done_intr_(sig); }
-#if defined(UNIX) || defined(VMS)
-void done_hangup(sig) int sig; { done_hangup_(sig); }
-#endif
-
-
-/* ### engrave.c ### */
-#undef doengrave
-
-int doengrave()		{ return doengrave_(); }
-
-
-/* ### fountain.c ### */
-#undef gush
-
-void gush(x, y, poolcnt)
-  int x, y; genericptr_t poolcnt; { gush_(x, y, poolcnt); }
-
-
-/* ### hack.c ### */
-#undef dopickup
-#undef identify
-
-int dopickup()		{ return dopickup_(); }
-int identify(otmp)
-  struct obj *otmp;	{ return identify_(otmp); }
-
-
-/* ### invent.c ### */
-#undef ckunpaid
-#undef ddoinv
-#undef dolook
-#undef dopramulet
-#undef doprarm
-#undef doprgold
-#undef doprring
-#undef doprtool
-#undef doprwep
-#undef dotypeinv
-#undef doorganize
-
-int ckunpaid(obj)
-  struct obj *obj;	{ return ckunpaid_(obj); }
-int ddoinv()		{ return ddoinv_(); }
-int dolook()		{ return dolook_(); }
-int dopramulet()	{ return dopramulet_(); }
-int doprarm()		{ return doprarm_(); }
-int doprgold()		{ return doprgold_(); }
-int doprring()		{ return doprring_(); }
-int doprtool()		{ return doprtool_(); }
-int doprwep()		{ return doprwep_(); }
-int dotypeinv()		{ return dotypeinv_(); }
-int doorganize()	{ return doorganize_(); }
-
-
-/* ### ioctl.c ### */
-#ifdef UNIX
-# ifdef SUSPEND
-#undef dosuspend
-
-int dosuspend()		{ return dosuspend_(); }
-# endif /* SUSPEND */
-#endif /* UNIX */
-
-
-/* ### lock.c ### */
-#undef doclose
-#undef doforce
-#undef doopen
-#undef forcelock
-#undef picklock
-
-int doclose()		{ return doclose_(); }
-int doforce()		{ return doforce_(); }
-int doopen()		{ return doopen_(); }
-int forcelock()		{ return forcelock_(); }
-int picklock()		{ return picklock_(); }
-
-
-/* ### mklev.c ### */
-#undef do_comp
-
-int do_comp(vx, vy)
-  genericptr_t vx, vy;	{ return comp_(vx, vy); }
-
-
-/* ### mondata.c ### */
-/* canseemon() is only called by a macro e_boolean.  If e_boolean ever does
-   become a function, this may need to return. */
-
-/* #undef canseemon */
-
-/* boolean canseemon(x) struct monst *x; { return canseemon_(x); } */
-
-
-/* ### muse.c ### */
-#undef mbhitm
-
-int mbhitm(mtmp, otmp)
-  struct monst *mtmp; struct obj *otmp; { return mbhitm_(mtmp, otmp); }
-
-
-/* ### o_init.c ### */
-#undef dodiscovered
-
-int dodiscovered()	{ return dodiscovered_(); }
-
-
-/* ### objnam.c ### */
-#undef doname
-#undef xname
-
-char *doname(obj)
-  struct obj *obj;	{ return doname_(obj); }
-char *xname(obj)
-  struct obj *obj;	{ return xname_(obj); }
-
-
-/* ### options.c ### */
-#undef doset
-#undef dotogglepickup
-
-int doset()		{ return doset_(); }
-int dotogglepickup()	{ return dotogglepickup_(); }
-
-
-/* ### pager.c ### */
-#undef dohelp
-#undef dohistory
-#undef dowhatdoes
-#undef dowhatis
-#undef doquickwhatis
-
-int dohelp()		{ return dohelp_(); }
-int dohistory()		{ return dohistory_(); }
-int dowhatdoes()	{ return dowhatdoes_(); }
-int dowhatis()		{ return dowhatis_(); }
-int doquickwhatis()	{ return doquickwhatis_(); }
-
-
-/* ### pcsys.c ### */
-#ifdef SHELL
-#undef dosh
-
-int dosh()		{ return dosh_(); }
-#endif /* SHELL */
-
-
-/* ### pickup.c ### */
-#undef ck_bag
-#undef doloot
-#undef in_container
-#undef out_container
-
-int ck_bag(obj)
-  struct obj *obj;	{ return ck_bag_(obj);  }
-int doloot()		{ return doloot_(); }
-int in_container(obj)
-  struct obj *obj;	{ return in_container_(obj); }
-int out_container(obj)
-  struct obj *obj;	{ return out_container_(obj); }
-
-
-/* ### potion.c ### */
-#undef dodrink
-#undef dodip
-
-int dodrink()		{ return dodrink_(); }
-int dodip()		{ return dodip_(); }
-
-
-/* ### pray.c ### */
-#undef doturn
-#undef dopray
-#undef prayer_done
-#undef dosacrifice
-
-int doturn()		{ return doturn_(); }
-int dopray()		{ return dopray_(); }
-int prayer_done()	{ return prayer_done_(); }
-int dosacrifice()	{ return dosacrifice_(); }
-
-
-/* ### print.c ### */
-#undef doredraw
-
-int doredraw()		{ return doredraw_(); }
-
-
-/* ### read.c ### */
-#undef doread
-#undef set_lit
-
-int doread()		{ return doread_(); }
-void set_lit(x, y, val)
-  int x, y; genericptr_t val; { set_lit_(x, y, val); }
-
-
-/* ### rip.c ### */
-#undef genl_outrip
-
-void genl_outrip(tmpwin, how)
-  winid tmpwin; int how; { genl_outrip_(tmpwin, how); }
-
-
-/* ### save.c ### */
-#undef dosave
-#if defined(UNIX) || defined(VMS)
-#undef hangup
-#endif
-
-int dosave()		{ return dosave_(); }
-#if defined(UNIX) || defined(VMS)
-void hangup(sig) int sig; { hangup_(sig); }
-#endif
-
-
-/* ### search.c ### */
-#undef findone
-#undef openone
-#undef doidtrap
-#undef dosearch
-
-void findone(zx, zy, num)
-  int zx, zy; genericptr_t num; { findone_(zx, zy, num); }
-void openone(zx, zy, num)
-  int zx, zy; genericptr_t num; { openone_(zx, zy, num); }
-int doidtrap()		{ return doidtrap_(); }
-int dosearch()		{ return dosearch_(); }
-
-
-/* ### shk.c ### */
-#undef dopay
-
-int dopay()		{ return dopay_(); }
-
-
-/* ### sit.c ### */
-#undef dosit
-
-int dosit()		{ return dosit_(); }
-
-
-/* ### sounds.c ### */
-#undef dotalk
-
-int dotalk()		{ return dotalk_(); }
-
-
-/* ### spell.c ### */
-#undef learn
-#undef docast
-#undef dovspell
-
-int learn()		{ return learn_(); }
-int docast()		{ return docast_(); }
-int dovspell()		{ return dovspell_(); }
-
-
-/* ### steal.c ### */
-#undef stealarm
-
-int stealarm()		{ return stealarm_(); }
-
-
-/* ### trap.c ### */
-#undef dotele
-#undef dountrap
-#undef float_down
-
-int dotele()		{ return dotele_(); }
-int dountrap()		{ return dountrap_(); }
-int float_down()	{ return float_down_(); }
-
-
-/* ### version.c ### */
-#undef doversion
-#undef doextversion
-
-int doversion()		{ return doversion_(); }
-int doextversion()	{ return doextversion_(); }
-
-
-/* ### wield.c ### */
-#undef dowield
-
-int dowield()		{ return dowield_(); }
-
-
-/* ### zap.c ### */
-#undef bhitm
-#undef bhito
-#undef dozap
-
-int bhitm(mtmp, otmp)
-  struct monst *mtmp; struct obj *otmp; { return bhitm_(mtmp, otmp); }
-int bhito(obj, otmp)
-  struct obj *obj, *otmp; { return bhito_(obj,  otmp); }
-int dozap()		{ return dozap_(); }
-
-
-/*
- * Window Implementation Specific Functions.
- */
-
-/* ### getline.c ### */
-#undef tty_getlin
-#undef tty_get_ext_cmd
-
-int tty_get_ext_cmd()		{ return tty_get_ext_cmd_(); }
-void tty_getlin(query,bufp)
-  const char *query; char *bufp;{ tty_getlin_(query,bufp); }
-
-
-/* ### termcap.c ### */
-#undef tty_nhbell
-#undef tty_number_pad
-#undef tty_delay_output
-#undef tty_start_screen
-#undef tty_end_screen
-
-void tty_nhbell()		{ tty_nhbell_(); }
-void tty_number_pad(state)
-  int state;			{ tty_number_pad_(state); }
-void tty_delay_output()		{ tty_delay_output_(); }
-/* other defs that really should go away (they're tty specific) */
-void tty_start_screen()		{ tty_start_screen_(); }
-void tty_end_screen()		{ tty_end_screen_(); }
-
-
-/* ### topl.c ### */
-#undef tty_doprev_message
-#undef tty_yn_function
-
-int tty_doprev_message()	{ return tty_doprev_message_(); }
-char tty_yn_function(query,resp,def)
-  const char *query, *resp; char def;
-				{ return tty_yn_function_(query,resp,def); }
-
-
-/* ### wintty.c ### */
-#undef tty_init_nhwindows
-#undef tty_player_selection
-#undef tty_askname
-#undef tty_get_nh_event
-#undef tty_exit_nhwindows
-#undef tty_suspend_nhwindows
-#undef tty_resume_nhwindows
-#undef tty_create_nhwindow
-#undef tty_clear_nhwindow
-#undef tty_display_nhwindow
-#undef tty_destroy_nhwindow
-#undef tty_curs
-#undef tty_putstr
-#undef tty_display_file
-#undef tty_start_menu
-#undef tty_add_menu
-#undef tty_end_menu
-#undef tty_select_menu
-#undef tty_update_inventory
-#undef tty_mark_synch
-#undef tty_wait_synch
-#ifdef CLIPPING
-#undef tty_cliparound
-#endif
-#ifdef POSITIONBAR
-#undef tty_update_positionbar
-#endif
-#undef tty_print_glyph
-#undef tty_raw_print
-#undef tty_raw_print_bold
-#undef tty_nhgetch
-#undef tty_nh_poskey
-
-void tty_init_nhwindows(argcp,argv)
-	int *argcp; char **argv;
-				{ tty_init_nhwindows_(argcp,argv); }
-void tty_player_selection()	{ tty_player_selection_(); }
-void tty_askname()		{ tty_askname_(); }
-void tty_get_nh_event()		{ tty_get_nh_event_(); }
-void tty_exit_nhwindows(str)
-  const char *str;		{ tty_exit_nhwindows_(str); }
-void tty_suspend_nhwindows(str)
-  const char *str;		{ tty_suspend_nhwindows_(str); }
-void tty_resume_nhwindows()	{ tty_resume_nhwindows_(); }
-winid tty_create_nhwindow(type)
-  int type;			{ return tty_create_nhwindow_(type); }
-void tty_clear_nhwindow(window)
-  winid window;			{ tty_clear_nhwindow_(window); }
-void tty_display_nhwindow(window, blocking)
-  winid window; boolean blocking;
-				{ tty_display_nhwindow_(window,blocking); }
-void tty_destroy_nhwindow(window)
-  winid window;			{ tty_destroy_nhwindow_(window); }
-void tty_curs(window,x,y)
-  winid window; int x,y;	{ tty_curs_(window,x,y); }
-void tty_putstr(window,attr,str)
-  winid window; int attr; const char *str;
-				{ tty_putstr_(window,attr,str); }
-void tty_display_file(fname, complain)
-  const char *fname; boolean complain;
-				{ tty_display_file_(fname,complain); }
-void tty_start_menu(window)
-  winid window;			{ tty_start_menu_(window); }
-void tty_add_menu(window,ch,attr,str)
-  winid window; char ch; int attr; const char *str;
-				{ tty_add_menu_(window,ch,attr,str); }
-void tty_end_menu(window,ch,str,morestr)
-  winid window; char ch; const char *str, *morestr;
-				{ tty_end_menu_(window,ch,str,morestr); }
-char tty_select_menu(window)
-  winid window;			{ return tty_select_menu_(window); }
-void tty_update_inventory()	{ tty_update_inventory_(); }
-void tty_mark_synch()		{ tty_mark_synch_(); }
-void tty_wait_synch()		{ tty_wait_synch_(); }
-#ifdef CLIPPING
-void tty_cliparound(x,y)
-  int x,y;			{ tty_cliparound_(x,y); }
-#endif
-#ifdef POSITIONBAR
-void tty_update_positionbar(str)
-  char *str;			{ tty_update_positionbar_(str); }
-#endif
-void tty_print_glyph(window,x,y,glyph)
-  winid window; xchar x,y; int glyph;
-				{ tty_print_glyph_(window,x,y,glyph); }
-void tty_raw_print(str)
-  const char *str;		{ tty_raw_print_(str); }
-void tty_raw_print_bold(str)
-  const char *str;		{ tty_raw_print_bold_(str); }
-int tty_nhgetch()		{ return tty_nhgetch_(); }
-int tty_nh_poskey(x,y,pos)
-  int *x,*y,*pos;		{ return tty_nh_poskey_(x,y,pos); }
-
-#endif /* OVERLAY */
diff -Naurd ../nethack-3.3.1/sys/msdos/compwarn.lst ./sys/msdos/compwarn.lst
--- ../nethack-3.3.1/sys/msdos/compwarn.lst Thu Jan 1 01:00:00 1970
+++ ./sys/msdos/compwarn.lst Fri Mar 22 14:40:55 2002
@@ -0,0 +1,16 @@
+/*	SCSS Id:    @(#)compwarn.lst	3.4	1992/10/08	    */
+/* Copyright (c) Paul Winner, 1992				    */
+/* NetHack may be freely redistributed.  See license for details.   */
+
+This file contains a list of compiler warnings generated by Microsoft
+C version 7.0, compiled with the /W4 switch, and any known reasons for
+the warning.  You can safely ignore any warning your compile gives if
+it appears on this list.
+
+C4127 (4):  Conditional expression is constant
+	    The While(1) statements used in the code cause this warning.
+	    For the sake of making more easily readable code, this is the
+	    preferred construct for NetHack.
+C4131 (4):  function: uses old-style declarator
+	    In order to make the code as portable as possible, all func-
+	    tions in NetHack use the old-style declarator.
diff -Naurd ../nethack-3.3.1/sys/msdos/def2mak.c ./sys/msdos/def2mak.c
--- ../nethack-3.3.1/sys/msdos/def2mak.c Thu Jan 1 01:00:00 1970
+++ ./sys/msdos/def2mak.c Fri Mar 22 14:40:55 2002
@@ -0,0 +1,383 @@
+/*	SCCS Id: @(#)def2mak.c	3.4	1995/03/19	*/
+/* Copyright (c) NetHack PC Development Team, 1994. */
+/* NetHack may be freely redistributed.  See license for details. */
+
+#include "config.h"
+#include <malloc.h>
+#include <ctype.h>
+#ifndef _MSC_VER
+#include <stdlib.h>
+#else
+int __cdecl _strcmpi(const char *, const char *);
+int __cdecl _stricmp(const char *, const char *);
+int __cdecl _strnicmp(const char *, const char *,size_t);
+#endif
+
+#define	MALLOC(type)	(type *)malloc(sizeof(type))
+
+#define MACROID_SIZ	50
+#define MACROVAL_SIZ	300
+
+typedef unsigned char bool;
+
+struct MacroNode * FDECL(AddMacro, (struct MacroNode *, char *, char *));
+char * FDECL(ApplyMacros, (char *, struct MacroNode *));
+struct MacroNode * FDECL(DelMacro, (struct MacroNode *));
+struct MacroNode * FDECL(DelMacroList, (struct MacroNode *));
+void FDECL(COMPILER, (bool, char *, char *, FILE *));
+void FDECL(SaveNewLine, (char *, char *));
+struct ListItem * FDECL(AddItem, (struct ListItem *, char *));
+struct ListItem * FDECL(ReadList, (FILE *, int));
+void FDECL(LINKLIST, (bool, struct ListItem *, char *, char *));
+struct ListTable * FDECL(AddList, (struct ListTable *, struct ListItem *,
+    char *));
+struct ListItem * FDECL(DelTableList, (struct ListItem *));
+struct ListTable * FDECL(DelTable, (struct ListTable *));
+struct ListItem * FDECL(FindList, (struct ListTable *, char *));
+
+#ifdef strcmpi
+# undef strcmpi		/* don't want to drag in hacklib.c */
+#endif
+
+#ifdef _MSC_VER
+#define stricmp _strcmpi
+#define strnicmp _strnicmp
+#endif
+
+int
+strcmpi(s1, s2)
+char *s1, *s2;
+{
+	char t1, t2;
+
+	while (*s1 || *s2) {
+		if (!*s2) return 1;		/* s1 > s2 */
+		else if (!*s1) return -1;	/* s1 < s2 */
+		if (isupper(*s1)) t1 = tolower(*s1); else t1 = *s1;
+		if (isupper(*s2)) t2 = tolower(*s2); else t2 = *s2;
+		if (t1 != t2) return (t1 > t2) ? 1 : -1;
+		s1++; s2++;
+	}
+	return 0;				/* s1 == s2 */
+}
+
+struct MacroNode {
+	char Name[MACROID_SIZ];
+	char Val[MACROVAL_SIZ];
+	struct MacroNode *Next;
+};
+
+struct MacroNode *
+AddMacro (List, MID, MVal)
+struct MacroNode *List;
+char *MID;
+char *MVal;
+{
+	struct MacroNode *Tmp;
+	Tmp = MALLOC (struct MacroNode);
+	strncpy (Tmp->Name, MID, MACROID_SIZ);
+	strncpy (Tmp->Val, MVal, MACROVAL_SIZ);
+	Tmp->Next = List;
+        return Tmp;
+}
+
+char *
+ApplyMacros (Line, List)
+char *Line;
+struct MacroNode *List;
+{
+	static char TotalLine[MACROVAL_SIZ + 100];
+	char TmpLine[MACROVAL_SIZ + 100];
+	int AfterLine;
+        char MacroName[MACROID_SIZ];
+	struct MacroNode *TmpList;
+
+	strcpy (TotalLine, "");
+	strcpy (TmpLine, Line);
+        if (sscanf (TmpLine, "%[^?]?[%[^]]]%n", TotalLine, MacroName,
+		&AfterLine) <= 1) return Line;
+        for (TmpList = List; TmpList; TmpList = TmpList->Next)
+	    if (!strcmp(TmpList->Name, MacroName)) {
+		strcat (TotalLine, TmpList->Val);
+		break;
+	    }
+	strcat (TotalLine, TmpLine + AfterLine);
+	return TotalLine;
+}
+
+struct MacroNode *
+DelMacro (List)
+struct MacroNode *List;
+{
+	struct MacroNode *tmp;
+
+        tmp = List->Next;
+        free (List);
+        return tmp;
+}
+
+struct MacroNode *
+DelMacroList (List)
+struct MacroNode *List;
+{
+	while (List != NULL)
+            List = DelMacro (List);
+	return List;
+}
+
+void
+COMPILER (display, SavedNewLine, EndString, input)
+bool display;
+char *SavedNewLine;
+char *EndString;
+FILE *input;
+{
+        char buffer[100];
+
+        fgets (buffer, 100, input);
+        while (strnicmp(buffer, EndString, strlen(EndString))) {
+            if (display)
+                SaveNewLine(buffer, SavedNewLine);
+            fgets (buffer, 100, input);
+        };
+}
+
+void
+SaveNewLine (Line, NewLine)
+char *Line;
+char *NewLine;
+{
+	char tempNewLine[2];
+
+	strcpy (tempNewLine, "");
+	if (Line[strlen(Line)-1] == '\n') {
+        	Line[strlen(Line)-1] = '\0';
+                strcpy (tempNewLine, "\n");
+	};
+        printf ("%s%s", NewLine, Line);
+        strcpy (NewLine, tempNewLine);
+}
+
+struct ListItem {
+	char Item[40];
+	struct ListItem *next;
+};
+
+struct ListTable {
+	char name[40];
+	struct ListItem *List;
+	struct ListTable *next;
+};
+
+struct ListItem *
+AddItem (List, Item)
+struct ListItem *List;
+char Item[40];
+{
+	struct ListItem *temp;
+
+	temp = MALLOC(struct ListItem);
+	temp->next = List;
+	strncpy (temp->Item, Item, 39);
+	return temp;
+}
+
+struct ListItem *
+ReadList (input, LinePos)
+FILE *input;
+int LinePos;
+{
+	char Item[40];
+	char buffer[100];
+	struct ListItem *List;
+
+	List = NULL;
+	fscanf (input, "%39s", Item);
+	while (strncmp(Item, "?ENDLIST?", 9)) {
+	    if (LinePos > 60) {
+		LinePos = 18;
+		printf ("\\\n\t\t");
+	    }
+	    List = AddItem(List, Item);
+	    printf ("%s ", Item);
+	    LinePos += 1 + strlen(Item);
+	    fscanf (input, "%39s", Item);
+	}
+	printf ("\n");
+	fgets (buffer, 100, input);
+	return List;
+}
+
+void
+LINKLIST (BC, List, Listname, SavedNewLine)
+bool BC;
+struct ListItem *List;
+char *Listname;
+char *SavedNewLine;
+{
+	int LinePos;
+
+	printf ("%s\t\t", SavedNewLine);
+	strcpy (SavedNewLine, "");
+
+        if (!BC) {
+            printf ("$(%s:^\t=+^\n\t\t)\n", Listname);
+	    return;
+        };
+
+	if (List == NULL) return;
+
+	LinePos = 18;
+	while (List != NULL) {
+	    if (LinePos > 60) {
+		LinePos = 18;
+		printf ("+\n\t\t");
+	    }
+	    printf ("%s ", List->Item);
+	    LinePos += 1 + strlen(List->Item);
+	    List = List->next;
+	}
+	printf ("\n");
+}
+
+struct ListTable *
+AddList (Table, List, Name)
+struct ListTable *Table;
+struct ListItem *List;
+char *Name;
+{
+	struct ListTable *temp;
+	temp = MALLOC (struct ListTable);
+	temp->next = Table;
+	temp->List = List;
+	strncpy (temp->name, Name, 39);
+	return temp;
+}
+
+struct ListItem *
+DelTableList (List)
+struct ListItem *List;
+{
+	struct ListItem *temp;
+
+	while (List != NULL) {
+	    temp = List->next;
+	    free (List);
+	    List = temp;
+	};
+	return List;
+}
+
+struct ListTable *
+DelTable (Table)
+struct ListTable *Table;
+{
+	struct ListTable *temp;
+
+	while (Table != NULL) {
+	    temp = Table->next;
+	    Table->List = DelTableList(Table->List);
+	    free(Table);
+	    Table=temp;
+	};
+	return Table;
+}
+
+struct ListItem *
+FindList (Table, Item)
+struct ListTable *Table;
+char *Item;
+{
+	while (Table != NULL) {
+	    if (!stricmp(Table->name, Item)) return Table->List;
+	    Table = Table->next;
+	}
+	return NULL;
+}
+
+int
+main (argc, argv)
+int argc;
+char *argv[];
+{
+        FILE *makfile;
+        char buffer[100];
+        char SavedNewLine[2];
+	char Listname[40];
+	struct ListTable *Table;
+        time_t timer;
+        bool MSC, BC;
+	struct MacroNode *MacroList = NULL;
+	char MacroName[MACROID_SIZ];
+	char MacroVal[MACROVAL_SIZ];
+
+        if (argc < 3) {
+		printf ("Too few arguments.  Correct usage is:\n");
+		printf ("\t%s {/MSC || /BC} template\n\n", "def2mak");
+		printf ("\t{/MSC || /BC} indicate the compiler to use.\n");
+		printf ("\ttemplate is the template file to process.\n\n");
+		printf ("The output makefile goes to standard output.\n");
+        	return 1;
+	};
+	Table = NULL;
+	if (!strcmpi(argv[1], "/MSC") || !strcmpi(argv[1], "-MSC")) {
+            MSC = TRUE;
+            BC = FALSE;
+	} else if (!strcmpi(argv[1], "/BC") || !strcmpi(argv[1], "-BC")) {
+            MSC = FALSE;
+            BC = TRUE;
+	} else {
+            fprintf (stderr, "Unknown compiler format: %s\n", argv[1]);
+            return 1;
+	};
+
+        strcpy (SavedNewLine, "");
+        if ((makfile = fopen (argv[2], "r")) == NULL)
+        	return 2;
+	COMPILER (0, SavedNewLine, "?BEGIN?", makfile);
+	while (!feof(makfile)) {
+            if (fgets(buffer, 100, makfile) == NULL)
+		break;
+	    if (!strnicmp(buffer, "?SCCS?", 6)) {
+		time (&timer);
+	      printf ("%s#\tSCCS Id: @(#)Makefile.%s\t3.4\t%02d/%02d/%02d\n",
+                    SavedNewLine,
+		    MSC ? "MSC" : BC ? "BC" : "???",
+		    localtime(&timer)->tm_year,
+		    localtime(&timer)->tm_mon + 1,
+		    localtime(&timer)->tm_mday);
+		printf ("# Copyright (c) %s, %d.\n",
+		    BC ? "Yitzhak Sapir" : "NetHack PC Development Team",
+		    localtime(&timer)->tm_year + 1900);
+		printf ("# NetHack may be freely distributed.  ");
+		printf ("See license for details.\n#\n\n");
+		strcpy (SavedNewLine, "");
+            } else if (MSC ? sscanf (buffer, "?MSCMACRO:%[^=]=%[^?]?",
+			MacroName, MacroVal) :
+			BC ? sscanf (buffer, "?BCMACRO:%[^=]=%[^?]?",
+			MacroName, MacroVal) : 0)
+		MacroList = AddMacro(MacroList, MacroName, MacroVal);
+	    else if (!strnicmp(buffer, "?BC?", 4))
+                COMPILER(BC, SavedNewLine, "?ENDBC?", makfile);
+            else if (!strnicmp(buffer, "?MSC?", 5))
+                COMPILER(MSC, SavedNewLine, "?ENDMSC?", makfile);
+            else if (!strnicmp(buffer, "?COMMENT?", 9))
+                COMPILER(FALSE, SavedNewLine, "?ENDCOMMENT?", makfile);
+	    else if (sscanf(buffer, "?LIST:%[^?]?", Listname)
+		    == 1) {
+		printf ("%s%s\t=", SavedNewLine, Listname);
+		Table = AddList (Table, ReadList (makfile, 18), Listname);
+		strcpy (SavedNewLine, "");
+	    } else if (sscanf(buffer, "?LINKLIST:%[^?]?", Listname)
+		    == 1)
+		LINKLIST (BC, FindList(Table, Listname), Listname,
+		    SavedNewLine);
+            else if (buffer[0] != '?')
+                SaveNewLine(ApplyMacros(buffer, MacroList), SavedNewLine);
+        };
+	printf ("%s", SavedNewLine);
+        fclose (makfile);
+	Table = DelTable(Table);
+	MacroList = DelMacroList (MacroList);
+	return 0;
+}
diff -Naurd ../nethack-3.3.1/sys/msdos/genschem.l ./sys/msdos/genschem.l
--- ../nethack-3.3.1/sys/msdos/genschem.l Thu Jan 1 01:00:00 1970
+++ ./sys/msdos/genschem.l Fri Mar 22 14:40:55 2002
@@ -0,0 +1,326 @@
+%{
+
+#include "config.h"
+#include <stdlib.h>
+#include <ctype.h>
+
+#define	MALLOC(type)	(type *)malloc(sizeof(type))
+
+typedef unsigned char bool;
+
+struct OvlNode {
+	char FileName[13];
+	char Comment[80];
+	int  OvlNumber;
+        struct OvlNode *Next;
+};
+
+int linenumber = 1;
+int OvlNum = -1;
+FILE *outf = NULL;
+char *ovldesc = NULL;
+struct OvlNode *List = NULL;
+char *CommentTemplate;
+
+struct OvlNode * FDECL(AddNode, (struct OvlNode *, struct OvlNode *));
+struct OvlNode * FDECL(DelNode, (struct OvlNode *));
+struct OvlNode * FDECL(ReverseList, (struct OvlNode *));
+struct OvlNode * FDECL(SortList, (struct OvlNode *));
+int NDECL (yylex);
+
+#ifndef	yywrap
+int NDECL (yywrap);
+#endif
+
+#ifdef exit
+#undef exit
+#endif
+
+%}
+
+FILECH	[A-Za-z0-9_]
+FILE	{FILECH}{1,8}("."{FILECH}{0,3})?
+SCCS	[Ss][Cc][Cc][Ss].*\n
+COPYR	[Cc][Oo][Pp][Yy][Rr][Ii][Gg][Hh][Tt].*\n
+
+%%
+
+{SCCS}	{ linenumber ++; }
+{COPYR}	{ linenumber ++; }
+^#.*\n	{
+	    if (OvlNum < 0) {
+		yytext[yyleng - 1] = 0;
+		fprintf (outf, CommentTemplate, yytext+1);
+	    }
+	    linenumber ++;
+	}
+\n	{ linenumber ++; }
+[ \t]+	;	/* skip trailing tabs & spaces */
+\[.*\]	{
+	    yytext[yyleng-1] = 0; /* Discard the trailing \] */
+	    if (ovldesc) free (ovldesc);
+	    ovldesc = (char *) malloc(strlen(yytext+1)+1);
+	    strcpy(ovldesc, yytext+1); /* Discard the first \[ */
+	    OvlNum++;
+	}
+{FILE}	{
+	    struct OvlNode *Tmp;
+
+	    Tmp = MALLOC (struct OvlNode);
+	    strcpy (Tmp->FileName, yytext);
+	    Tmp->OvlNumber = OvlNum;
+	    strncpy (Tmp->Comment, ovldesc, 80);
+	    List = AddNode (List, Tmp);
+	}
+.	{
+	    printf ("Line %d: Received character '%c' (%02x)\n",
+			linenumber, *yytext, *yytext);
+	}
+
+
+%%
+
+#ifndef yywrap
+int
+yywrap()
+{
+	return 1;
+}
+#endif
+
+#if defined(UNIX) || defined(_MSC_VER)
+char *
+strlwr(s)
+char *s;
+{
+	char *p;
+	for (p = s; *p; p++)
+		if (isupper(*p)) *p = tolower(*p);
+	return s;
+}
+
+char *
+strupr(s)
+char *s;
+{
+	char *p;
+	for (p = s; *p; p++)
+		if (islower(*p)) *p = toupper(*p);
+	return s;
+}
+#endif
+
+struct OvlNode *
+SortList (List)
+struct OvlNode *List;
+{
+	struct OvlNode *List1 = NULL;
+	struct OvlNode *List2 = NULL;
+	struct OvlNode *Tmp;
+
+	if (List == NULL) return NULL;
+	if (List->Next == NULL) return List;
+
+	while (List != NULL) {
+	    if (List != NULL) {
+		Tmp = List->Next;
+		List1 = AddNode (List1, List);
+		List = Tmp;
+	    }
+	    if (List != NULL) {
+		Tmp = List->Next;
+		List2 = AddNode (List2, List);
+		List = Tmp;
+	    }
+	}
+
+	List1 = SortList (List1);
+	List2 = SortList (List2);
+
+	while (List1 != NULL || List2 != NULL) {
+	    while (List1 != NULL && List2 == NULL) {
+		Tmp = List1->Next;
+		List = AddNode (List, List1);
+		List1 = Tmp;
+	    }
+	    while (List1 != NULL &&
+		    strcmp(List1->FileName, List2->FileName) <= 0) {
+		Tmp = List1->Next;
+		List = AddNode (List, List1);
+		List1 = Tmp;
+	    }
+	    while (List2 != NULL && List1 == NULL) {
+		Tmp = List2->Next;
+		List = AddNode (List, List2);
+		List2 = Tmp;
+	    }
+	    while (List2 != NULL &&
+		    strcmp(List1->FileName, List2->FileName) >= 0) {
+		Tmp = List2->Next;
+		List = AddNode (List, List2);
+		List2 = Tmp;
+	    }
+	}
+
+	return ReverseList (List);
+}
+
+struct OvlNode *
+AddNode (List, ToAdd)
+struct OvlNode *List;
+struct OvlNode *ToAdd;
+{
+	ToAdd->Next = List;
+        return ToAdd;
+}
+
+struct OvlNode *
+DelNode (List)
+struct OvlNode *List;
+{
+	struct OvlNode *tmp;
+
+        tmp = List->Next;
+        free (List);
+        return tmp;
+}
+
+struct OvlNode *
+DelOvlList (List)
+struct OvlNode *List;
+{
+	while (List != NULL)
+            List = DelNode (List);
+	return List;
+}
+
+struct OvlNode *
+ReverseList (List)
+struct OvlNode *List;
+{
+	struct OvlNode *Temp, *Last;
+
+	Last = NULL; Temp = List;
+	while (Temp) {
+	    Temp = List->Next;
+	    List->Next = Last;
+	    Last = List;
+	    List = Temp;
+	}
+	return Last;
+}
+
+/*
+ * Deletes all nodes with filename equal to that of the first node, except
+ * for the first node, itself, which it keeps.
+ */
+
+void
+DelFile (List)
+struct OvlNode *List;
+{
+	struct OvlNode *tmp;
+
+        tmp = List;
+        while (tmp->Next != NULL) {
+	    if (!stricmp(List->FileName, tmp->Next->FileName))
+                tmp->Next = DelNode (tmp->Next);
+            else
+                tmp = tmp->Next;
+        };
+}
+
+int
+InList (List, ToFind)
+struct OvlNode *List;
+struct OvlNode *ToFind;
+{
+        while (List != NULL) {
+            if (!stricmp(List->FileName, ToFind->FileName))
+                return 1;
+            List = List->Next;
+        };
+        return 0;
+}
+
+int
+main (argc, argv)
+int argc;
+char *argv[];
+{
+        bool MSC, BC;
+	char *Header, *Header2, *Header3, *RootLine, *OvlLine;
+	char *c;
+	char FileName[9];
+	time_t timer;
+	struct tm *curtim;
+
+        if (argc < 3) {
+
+	printf ("Too few arguments.  Correct usage is:\n");
+	printf ("\t%s {/MSC || /BC} schemafile deffile\n\n", "genschem");
+	printf ("\t{/MSC || /BC} indicate the compiler to use.\n");
+	printf ("\tschemafile is the schema file to process.\n");
+	printf ("\tdeffile is the definition file to produce.\n");
+	printf ("\t\tif deffile is missing, stdout is assumed.\n\n");
+        	return 1;
+	};
+	if (!stricmp(argv[1], "/MSC") || !stricmp(argv[1], "-MSC")) {
+            MSC = TRUE;
+            BC = FALSE;
+	} else if (!stricmp(argv[1], "/BC") || !stricmp(argv[1], "-BC")) {
+            MSC = FALSE;
+            BC = TRUE;
+	} else {
+            fprintf (stderr, "Unknown compiler format: %s\n", argv[1]);
+            return 1;
+	};
+
+	Header = BC ? "/* SCCS Id: @(#)%s\t3.4\t %02d/%02d/%02d */\n" :
+	    "; SCCS Id: @(#)%s\t3.4\t %02d/%02d/%02d\n";
+	Header2 = BC ? "/* Copyright (c) Yitzhak Sapir, %d */\n" :
+	    "; Copyright (c) NetHack PC Development Team, %d\n";
+	Header3 = BC ? "\n\n" : ";\n\nSEGMENTS\n\n";
+	RootLine = BC ? "-zC%s\n" :
+	    "\"%s\" OVL:0\n";
+	OvlLine = BC ?
+	    "-zC%s -zAOVLY -zCOVL%d\n" :
+	    "\"%s\" OVL:%d\n";
+	CommentTemplate = BC ? "/* %s */\n" : ";%s\n";
+
+	yyin = fopen (argv[2], "r");
+
+	if (yyin == NULL) {
+	    fprintf (stderr, "Error: Input file incorrect\n");
+	    exit (1);
+	}
+
+	outf = fopen (argv[3], "w");
+
+	if (outf == NULL)
+	    if (argc == 4) {
+		fprintf (stderr, "Error: Output file incorrect\n");
+		exit (1);
+	    } else outf = stdout;
+
+	time (&timer);
+	curtim = localtime(&timer);
+	fprintf (outf, Header, argv[3], curtim->tm_year, curtim->tm_mon + 1,
+		curtim->tm_mday);
+	fprintf (outf, Header2, curtim->tm_year +1900);
+	yylex();
+
+	fprintf (outf, Header3);
+
+	for (List = SortList (List); List != NULL; List = DelNode (List)) {
+	    if (BC) {
+		for (c = strlwr(List->FileName); *c; c++)
+		    if (*c == '.') *c = '_';
+	    } else strupr(List->FileName);
+	    if (List->OvlNumber)
+		fprintf (outf, OvlLine, List->FileName, List->OvlNumber);
+	    else fprintf (outf, RootLine, List->FileName, List->FileName);
+	}
+	fclose (outf);
+
+}
diff -Naurd ../nethack-3.3.1/sys/msdos/Install.dos ./sys/msdos/Install.dos
--- ../nethack-3.3.1/sys/msdos/Install.dos Thu Aug 3 21:49:30 2000
+++ ./sys/msdos/Install.dos Fri Mar 22 14:40:55 2002
@@ -1,15 +1,15 @@
-	SCCS Id: @(#)Install.dos	 3.3		2000/08/02
+	SCCS Id: @(#)Install.dos	 3.4		2000/08/02
 
 	   Copyright (c) NetHack PC Development Team 1990-2000.
        NetHack may be freely redistributed.  See license for details.
        ==============================================================
               Instructions for compiling and installing
-		     NetHack 3.3 on a DOS system
+		     NetHack 3.4 on a DOS system
          ======================================================
-                   (or, How to make PC NetHack 3.3)
+                   (or, How to make PC NetHack 3.4)
                     Last revision: August 2, 2000
 
-Credit for a runnable full PC NetHack 3.3 goes to the PC Development team
+Credit for a runnable full PC NetHack 3.4 goes to the PC Development team
 of Paul Winner, Kevin Smolkowski, Michael Allison, Yitzhak Sapir, Bill Dyer, 
 Timo Hakulinen, Yamamoto Keizo, Mike Threepoint, Mike Stephenson, 
 Stephen White, Ken Washikita and Janet Walz.  The present port is based
diff -Naurd ../nethack-3.3.1/sys/msdos/Makefile.BC ./sys/msdos/Makefile.BC
--- ../nethack-3.3.1/sys/msdos/Makefile.BC Mon Dec 13 01:30:35 1999
+++ ./sys/msdos/Makefile.BC Fri Mar 22 14:40:55 2002
@@ -1,9 +1,9 @@
-#	SCCS Id: @(#)Makefile.BC	3.3	1999/11/06
-# Copyright (c) Yitzhak Sapir, 1999.
+#	SCCS Id: @(#)Makefile.BC	3.4	2002/03/17
+# Copyright (c) Yitzhak Sapir, 1999-2002.
 # NetHack may be freely distributed.  See license for details.
 #
 
-# PC NetHack 3.3 Makefile for Borland C++ 3.1 and 4.5.
+# PC NetHack 3.4 Makefile for Borland C++ 3.1 and 4.5.
 #
 # Nota Bene:	Before you get to here you should have already read
 # 		the Install.dos file located in the sys/msdos directory.
@@ -23,7 +23,7 @@
 #
 
 GAME	= NetHack
-GAMEDIR = c:\games\nethack
+GAMEDIR = ..\binary
 
 #
 #
@@ -764,7 +764,7 @@
 #
 
 OBJ01 =	$(O)alloc.o	$(RANDOM)	$(O)decl.o     	$(O)objects.o	\
-	$(O)muse.o	$(O)display.o	$(O)vision.o	\
+	$(O)muse.o	$(O)display.o	$(O)vision.o	$(O)mapglyph.o  \
 	$(O)rect.o	$(O)vis_tab.o	$(O)monst.o	$(O)wintty.o	\
 	$(O)files.o	$(O)sys.o	$(O)monstr.o	$(O)minion.o	\
 	$(O)worm.o	$(O)detect.o 	$(O)exper.o	$(O)mplayer.o	\
@@ -1823,6 +1823,7 @@
 $(O)extralev.o:  $(PCHO) $(SRC)\extralev.c $(HACK_H)
 $(O)files.o:	 $(PCHO) $(SRC)\files.c    $(HACK_H) $(DLB_H)
 $(O)fountain.o:  $(PCHO) $(SRC)\fountain.c $(HACK_H)
+$(O)mapglyph.o:  $(PCHO) $(SRC)\mapglyph.c $(HACK_H)
 $(O)minion.o:    $(PCHO) $(SRC)\minion.c   $(HACK_H) $(EMIN_H) $(EPRI_H)
 $(O)mklev.o:     $(PCHO) $(SRC)\mklev.c    $(HACK_H)
 $(O)mkmap.o:     $(PCHO) $(SRC)\mkmap.c    $(HACK_H) $(SP_LEV_H)
diff -Naurd ../nethack-3.3.1/sys/msdos/Makefile.GCC ./sys/msdos/Makefile.GCC
--- ../nethack-3.3.1/sys/msdos/Makefile.GCC Sun Mar 5 00:11:04 2000
+++ ./sys/msdos/Makefile.GCC Fri Mar 22 14:40:55 2002
@@ -1,9 +1,9 @@
-#	SCCS Id: @(#)Makefile.GCC	      3.3     1999/11/06
-#	Copyright (c) NetHack PC Development Team 1996.
-#	PC NetHack 3.3 Makefile for djgpp V2
+#	SCCS Id: @(#)Makefile.GCC	      3.4     2002/03/17
+#	Copyright (c) NetHack PC Development Team 1996-2002.
+#	PC NetHack 3.4 Makefile for djgpp V2
 #
 #	Gnu gcc compiler for msdos (djgpp)
-#	Requires Gnu Make utility (V3.73 or greater) supplied with djgpp V2
+#	Requires Gnu Make utility (V3.79 or greater) supplied with djgpp
 #
 #	For questions or comments: devteam@nethack.org
 #
@@ -23,7 +23,7 @@
 
 GAME = nethack
 # The GNU Make has a problem if you include a drive spec below (unfortunately).
-GAMEDIR = \games\nethackd
+GAMEDIR =..\binary
 
 #
 # Directories, gcc likes unix style directory specs
@@ -225,7 +225,7 @@
 VOBJ05 = drawing.o  dungeon.o  eat.o	  end.o	     engrave.o
 VOBJ06 = exper.o    explode.o  extralev.o files.o    fountain.o
 VOBJ07 = getline.o  hack.o     hacklib.o  invent.o   lock.o
-VOBJ08 = mail.o	    main.o     makemon.o  mcastu.o   mhitm.o
+VOBJ08 = mail.o	    main.o     makemon.o  mapglyph.o mcastu.o   mhitm.o
 VOBJ09 = mhitu.o    minion.o   mkmap.o	  mklev.o    mkmaze.o
 VOBJ10 = mkobj.o    mkroom.o   mon.o	  mondata.o  monmove.o
 VOBJ11 = monst.o    monstr.o   mplayer.o  mthrowu.o  muse.o
@@ -1069,6 +1069,7 @@
 mail.o:	     $(HACK_H) $(INCL)\mail.h
 makemon.o:   $(HACK_H) $(EPRI_H) $(EMIN_H) $(INCL)\edog.h
 mcastu.o:    $(HACK_H)
+mapglyph.o:  $(HACK_H)
 mhitm.o:     $(HACK_H) $(INCL)\artifact.h $(INCL)\edog.h
 mhitu.o:     $(HACK_H) $(INCL)\artifact.h $(INCL)\edog.h
 minion.o:    $(HACK_H) $(EMIN_H) $(EPRI_H)
diff -Naurd ../nethack-3.3.1/sys/msdos/Makefile.MSC ./sys/msdos/Makefile.MSC
--- ../nethack-3.3.1/sys/msdos/Makefile.MSC Thu Aug 3 21:49:25 2000
+++ ./sys/msdos/Makefile.MSC Fri Mar 22 14:40:55 2002
@@ -1,6 +1,6 @@
-#	SCCS Id: @(#)Makefile.MSC	      3.3     2000/08/02
-#	Copyright (c) NetHack PC Development Team 1997, 2000.
-#	PC NetHack 3.3 Makefile for MSC
+#	SCCS Id: @(#)Makefile.MSC	      3.4     2002/03/17
+#	Copyright (c) NetHack PC Development Team 1997 - 2002.
+#	PC NetHack 3.4 Makefile for MSC
 #
 #	For questions or comments: nethack-bugs@nethack.org
 #
@@ -17,7 +17,7 @@
 # NOTE: Make sure GAMEDIR exists before make is started.
 
 GAME = nethack
-GAMEDIR = \games\nethack
+GAMEDIR =..\binary
 
 #
 # Directories
@@ -64,7 +64,7 @@
 #
 # Uncomment this line if you want to include support for ALT-numeric
 # sequences, such as ALT-2 for toggling #twoweapon mode.  
-# Note that this code did not get a thorough testing prior to 3.3.1
+# Note that this code did not get a thorough testing prior to 3.4.0
 #NEWALT=/DNEW_ALT
 
 #############################################################################
@@ -205,7 +205,7 @@
 VOBJ05 = drawing.o  dungeon.o  eat.o	  end.o	     engrave.o
 VOBJ06 = exper.o    explode.o  extralev.o files.o    fountain.o
 VOBJ07 = getline.o  hack.o     hacklib.o  invent.o   lock.o
-VOBJ08 = mail.o	    main.o     makemon.o  mcastu.o   mhitm.o
+VOBJ08 = mail.o	    main.o     makemon.o  mapglyph.o mcastu.o   mhitm.o
 VOBJ09 = mhitu.o    minion.o   mkmap.o	  mklev.o    mkmaze.o
 VOBJ10 = mkobj.o    mkroom.o   mon.o	  mondata.o  monmove.o
 VOBJ11 = monst.o    monstr.o   mplayer.o  mthrowu.o  muse.o
@@ -471,7 +471,7 @@
 
 $(GAMEFILE) :  $(LNKOPT) $(ALLOBJ)
 	@echo Linking....
-	$(LINK) $(LFLAGS) /SE:1000 /DYNAMIC:2120 /NOE /ST:6000 @<<$(GAME).lnk
+	$(LINK) $(LFLAGS) /SE:1000 /DYNAMIC:2135 /NOE /ST:6000 @<<$(GAME).lnk
 		$(ALLOBJ:^	=+^
 		)
 		$(GAMEFILE)
@@ -1035,6 +1035,7 @@
 mail.o: mail.c $(HACK_H) $(INCL)\mail.h
 makemon.o: makemon.c $(HACK_H) $(INCL)\epri.h $(INCL)\emin.h \
 		$(INCL)\edog.h
+mapglyph.o: mapglyph.c $(HACK_H)
 mcastu.o: mcastu.c $(HACK_H)
 mhitm.o: mhitm.c $(HACK_H) $(INCL)\artifact.h $(INCL)\edog.h
 mhitu.o: mhitu.c $(HACK_H) $(INCL)\artifact.h $(INCL)\edog.h
diff -Naurd ../nethack-3.3.1/sys/msdos/Makefile.SC ./sys/msdos/Makefile.SC
--- ../nethack-3.3.1/sys/msdos/Makefile.SC Tue Dec 7 20:25:46 1999
+++ ./sys/msdos/Makefile.SC Fri Mar 22 14:40:55 2002
@@ -1,10 +1,10 @@
-#	SCCS Id :  @(#)Makefile.SC	      3.3     96/10/14
+#	SCCS Id :  @(#)Makefile.SC	      3.4     1996/10/14
 #	Copyright (c) NetHack Development Team 1996.
 #
 #	Symantec C compiler V7.2
 #	Written for Symantec SMAKE utility
 #
-#	NOTE: This Makefile has not been tested for NetHack 3.3.0
+#	NOTE: This Makefile has not been tested for NetHack 3.4.0
 #
 #	For questions or comments :  nethack-bugs@linc.cis.upenn.edu
 #
diff -Naurd ../nethack-3.3.1/sys/msdos/msdos.c ./sys/msdos/msdos.c
--- ../nethack-3.3.1/sys/msdos/msdos.c Thu Aug 3 21:08:04 2000
+++ ./sys/msdos/msdos.c Fri Mar 22 14:40:55 2002
@@ -1,4 +1,4 @@
-/*	SCCS Id: @(#)msdos.c	 3.3	 2000/07/30		          */
+/*	SCCS Id: @(#)msdos.c	 3.4	 2000/07/30		          */
 /* Copyright (c) NetHack PC Development Team 1990, 1991, 1992, 1993, 1994 */
 /* NetHack may be freely redistributed.  See license for details.         */
 
@@ -43,7 +43,7 @@
  */
 #define READCHAR    0x00    /* Read Character from Keyboard */
 #define GETKEYFLAGS 0x02    /* Get Keyboard Flags */
-/*#define KEY_DEBUG	    /* print values of unexpected key codes - devel*/
+/*#define KEY_DEBUG	 */   /* print values of unexpected key codes - devel*/
 
 void FDECL(get_cursor,(int *, int *));
 
@@ -53,7 +53,9 @@
 
 static char NDECL(DOSgetch);
 static char NDECL(BIOSgetch);
+#ifndef __GO32__
 static char * NDECL(getdta);
+#endif
 static unsigned int FDECL(dos_ioctl, (int,int,unsigned));
 #ifdef USE_TILES
 extern boolean FDECL(pckeys,(unsigned char, unsigned char));	/* pckeys.c */
diff -Naurd ../nethack-3.3.1/sys/msdos/msdoshlp.txt ./sys/msdos/msdoshlp.txt
--- ../nethack-3.3.1/sys/msdos/msdoshlp.txt Thu May 11 03:11:16 2000
+++ ./sys/msdos/msdoshlp.txt Fri Mar 22 14:40:55 2002
@@ -1,4 +1,4 @@
-            MSDOS specific help file for NetHack 3.3.0
+            MSDOS specific help file for NetHack 3.4.0
 		  (Last Revision: December 4, 1999)
 
 Copyright (c) NetHack PC Development Team 1993-1999.
diff -Naurd ../nethack-3.3.1/sys/msdos/NHAccess.nh ./sys/msdos/NHAccess.nh
--- ../nethack-3.3.1/sys/msdos/NHAccess.nh Sat Jan 1 00:10:29 2000
+++ ./sys/msdos/NHAccess.nh Fri Mar 22 14:40:55 2002
@@ -1,4 +1,4 @@
-#	SCSS Id: @(#)NHAccess.nh	3.3	    1999/11/28
+#	SCSS Id: @(#)NHAccess.nh	3.4	    1999/11/28
 #	Copyright (c) NetHack PC Development Team 1993, 1996, 1999
 #	NetHack may be freely redistributed.  See license for details.
 #
diff -Naurd ../nethack-3.3.1/sys/msdos/ovlinit.c ./sys/msdos/ovlinit.c
--- ../nethack-3.3.1/sys/msdos/ovlinit.c Thu Oct 28 02:48:36 1999
+++ ./sys/msdos/ovlinit.c Fri Mar 22 14:40:55 2002
@@ -1,4 +1,4 @@
-/*	SCCS Id: @(#)ovlinit.c	3.3	94/03/20	          */
+/*	SCCS Id: @(#)ovlinit.c	3.4	1994/03/20	          */
 /* Copyright (c) NetHack PC Development Team 1995                 */
 /* NetHack may be freely redistributed.  See license for details. */
 
diff -Naurd ../nethack-3.3.1/sys/msdos/pckeys.c ./sys/msdos/pckeys.c
--- ../nethack-3.3.1/sys/msdos/pckeys.c Thu Oct 28 02:48:37 1999
+++ ./sys/msdos/pckeys.c Fri Mar 22 14:40:55 2002
@@ -1,4 +1,4 @@
-/*	SCCS Id: @(#)pckeys.c	 3.3	 96/05/11		  */
+/*	SCCS Id: @(#)pckeys.c	 3.4	 1996/05/11		  */
 /* Copyright (c) NetHack PC Development Team 1996                 */
 /* NetHack may be freely redistributed.  See license for details. */
 
diff -Naurd ../nethack-3.3.1/sys/msdos/pctiles.c ./sys/msdos/pctiles.c
--- ../nethack-3.3.1/sys/msdos/pctiles.c Thu Oct 28 02:48:37 1999
+++ ./sys/msdos/pctiles.c Fri Mar 22 14:40:55 2002
@@ -1,4 +1,4 @@
-/*   SCCS Id: @(#)pctiles.c   3.3     95/07/31		     */
+/*   SCCS Id: @(#)pctiles.c   3.4     1995/07/31		     */
 /*   Copyright (c) NetHack PC Development Team 1993, 1994           */
 /*   NetHack may be freely redistributed.  See license for details. */
 /*                                                                  */
@@ -90,7 +90,6 @@
 char *tilefilename;
 boolean filestyle;
 {
-	FILE *x;
 #ifdef TILES_IN_RAM
 	int k;
 #endif
diff -Naurd ../nethack-3.3.1/sys/msdos/pctiles.h ./sys/msdos/pctiles.h
--- ../nethack-3.3.1/sys/msdos/pctiles.h Thu Oct 28 02:48:37 1999
+++ ./sys/msdos/pctiles.h Fri Mar 22 14:40:55 2002
@@ -1,4 +1,4 @@
-/*   SCCS Id: @(#)pctiles.h   3.3     94/04/04                        */
+/*   SCCS Id: @(#)pctiles.h   3.4     1994/04/04                        */
 /*   Copyright (c) NetHack PC Development Team 1993, 1994             */
 /*   NetHack may be freely redistributed.  See license for details.   */
 /*                                                                    */
diff -Naurd ../nethack-3.3.1/sys/msdos/pcvideo.h ./sys/msdos/pcvideo.h
--- ../nethack-3.3.1/sys/msdos/pcvideo.h Tue Dec 7 20:25:47 1999
+++ ./sys/msdos/pcvideo.h Fri Mar 22 14:40:55 2002
@@ -1,4 +1,4 @@
-/*   SCCS Id: @(#)pcvideo.h   3.3     94/06/07                      */
+/*   SCCS Id: @(#)pcvideo.h   3.4     1994/06/07                      */
 /*   Copyright (c) NetHack PC Development Team 1993, 1994           */
 /*   NetHack may be freely redistributed.  See license for details. */
 /*                                                                  */
@@ -269,7 +269,7 @@
 E void FDECL(vga_WriteStr, (char *, int, int, int, int));
 E void FDECL(vga_xputs, (const char *, int, int));
 E void FDECL(vga_xputc, (CHAR_P, int));
-E void FDECL(vga_xputg, (int, int));
+E void FDECL(vga_xputg, (int, int, unsigned));
 E void FDECL(vga_userpan, (BOOLEAN_P));
 E void FDECL(vga_overview, (BOOLEAN_P));
 E void FDECL(vga_traditional, (BOOLEAN_P));
diff -Naurd ../nethack-3.3.1/sys/msdos/portio.h ./sys/msdos/portio.h
--- ../nethack-3.3.1/sys/msdos/portio.h Thu Oct 28 02:48:38 1999
+++ ./sys/msdos/portio.h Fri Mar 22 14:40:55 2002
@@ -1,4 +1,4 @@
-/*   SCCS Id: @(#)portio.h   3.3     95/08/05                       */
+/*   SCCS Id: @(#)portio.h   3.4     1995/08/05                       */
 /*   Copyright (c) NetHack PC Development Team 1995                 */
 /*   NetHack may be freely redistributed.  See license for details. */
 /*                                                                  */
diff -Naurd ../nethack-3.3.1/sys/msdos/prebuild.mak ./sys/msdos/prebuild.mak
--- ../nethack-3.3.1/sys/msdos/prebuild.mak Thu Jan 1 01:00:00 1970
+++ ./sys/msdos/prebuild.mak Fri Mar 22 14:40:55 2002
@@ -0,0 +1,67 @@
+#       SCCS Id: @(#)prebuild.mak       3.4     1997/09/28
+#
+# Makefile for building the genschem utility, the .def files and
+# the Makefiles for distribution.
+#
+
+NHINCL     =..\..\include
+
+!       IF "$(MAKE)"=="NMAKE"
+CC        =cl
+MODEL     =L
+CEXENAM   =/Fe                  # name the .EXE file
+CFLAGS    =/A$(MODEL) /Zp1 /nologo /F 1400 /D__STDC__ /I$(NHINCL)
+!       ELSE                    #       Assume Borland
+CC        =bcc                  # TARGSTRING
+MODEL     =h
+BCTOP     =c:\borlandc          # main Borland C directory
+BCINCL    =$(BCTOP)\include     # include directory for main BC headers
+CEXENAM   =-e                   # name the .EXE file
+CFLAGS    =-I$(BCINCL) -I$(NHINCL) -m$(MODEL) -DSTRNCMPI
+!       ENDIF
+
+LEX = flex
+#LEX = flex -Sc:\tools16\flex.ske
+# LEX = lex
+
+# these are the names of the output files from LEX. Under MS-DOS
+# and similar systems, they may differ
+LEXYYC = lex.yy.c
+#LEXYYC = lexyy.c
+
+
+SCHEMAS = schema1.BC schema2.BC 
+MAKES = Makefile.BC
+
+all: $(SCHEMAS)
+
+genschem.exe: genschem.c
+	$(CC) $(CFLAGS) $(CEXENAM)$@ genschem.c
+
+genschem.c: genschem.l
+	$(LEX) $(FLEXSKEL) genschem.l
+	copy $(LEXYYC) $@
+	@del $(LEXYYC)
+
+schema1.BC: genschem.exe schema1
+	genschem /BC schema1 schema1.BC
+schema2.BC: genschem.exe schema2
+	genschem /BC schema2 schema2.BC
+#
+# NOTE: MSC no longer uses these overlay definitions
+# since switching to the use of packaged functions
+#
+#schema1.MSC: genschem.exe schema1
+#	genschem /MSC schema1 schema1.MSC
+#schema2.MSC: genschem.exe schema2
+#	genschem /MSC schema2 schema2.MSC
+#schema3.MSC: genschem.exe schema3
+#	genschem /MSC schema3 schema3.MSC
+
+def2mak.exe: def2mak.c
+	$(CC) $(CFLAGS) $(CEXENAM)$@ def2mak.c
+
+#Makefile.BC: def2mak.exe template.mak
+#	def2mak /BC template.mak >Makefile.BC
+#Makefile.MSC: def2mak.exe template.mak
+#	def2mak /MSC template.mak >Makefile.MSC
diff -Naurd ../nethack-3.3.1/sys/msdos/schema1 ./sys/msdos/schema1
--- ../nethack-3.3.1/sys/msdos/schema1 Thu Jan 1 01:00:00 1970
+++ ./sys/msdos/schema1 Fri Mar 22 14:40:55 2002
@@ -0,0 +1,606 @@
+SCCS Id: @(#)schema1		3.3	 95/10/25
+Copyright (c) NetHack PC Development Team 1993, 1994, 1995
+#
+# NetHack Overlay Schema
+# Minimal extended memory available, lots of 640K base RAM free
+# Overlay buffer size will be (20 + 20 + 19) = 59K (sum of 3 largest overlays).
+# Requires about 490K (for exe load plus overlay buffer), but
+# an additional 70K free (minimum) will be needed for malloc calls,
+# bringing the total requirement to about 560K.
+# Optimized for minimal overlay turns.
+#
+
+[ root ]
+pcmain.0   sound.o    tile.o     pctiles.0  pctiles.b
+vidvga.1   vidvga.0   vidvga.b   video.0   video.1   video.b
+hack.3     vidtxt.0   vidtxt.b	 botl.0    monmove.0 display.o
+dungeon.0  hacklib.0  wintty.o   trap.0    attrib.0  detect.o
+mon.0      cmd.0      vision.o   hack.1    msdos.0   pckeys.o
+random.o   rnd.0      alloc.o    ovlinit.o
+dbridge.0  monmove.1 engrave.0 invent.0
+monmove.2  mondata.0
+hacklib.1  hacklib.2
+dogmove.b
+
+[ ]
+allmain.0
+
+[ ]
+allmain.1  
+
+[ ]
+allmain.b  
+
+[ ]
+apply.0    
+
+[ ]
+apply.1    
+
+[ ]
+apply.b    
+
+[ ]
+artifact.0 
+
+[ ]
+artifact.1 
+
+[ ]
+artifact.b 
+
+[ ]
+attrib.1
+
+[ ]
+attrib.2   
+
+[ ]
+attrib.b   
+
+[ ]
+ball.o     
+
+[ ]
+bones.o    
+
+[ ]
+botl.1     
+
+[ ]
+botl.b     
+
+[ ]
+cmd.1      
+
+[ ]
+cmd.b      
+
+[ ]
+dbridge.1  
+
+[ ]
+dbridge.b  
+
+[ ]
+decl.o     
+
+[ ]
+dig.o
+
+[ ]
+dlb.o
+
+[ ]
+do.0
+
+[ ]
+do.1
+
+[ ]
+do.2
+
+[ ]
+do.3
+
+[ ]
+do.b
+
+[ ]
+do_name.0  
+
+[ ]
+do_name.2  
+
+[ ]
+do_name.b  
+
+[ ]
+do_wear.0  
+
+[ ]
+do_wear.1  
+
+[ ]
+do_wear.2  
+
+[ ]
+do_wear.b  
+
+[ ]
+dog.1      
+
+[ ]
+dog.2
+
+[ ]
+dog.b
+
+[ ]
+dogmove.0
+
+[ ]
+dokick.o
+
+[ ]
+dothrow.o
+
+[ ]
+drawing.o
+
+[ ]
+dungeon.1
+
+[ ]
+eat.0      
+
+[ ]
+eat.1      
+
+[ ]
+eat.b      
+
+[ ]
+end.o      
+
+[ ]
+engrave.1  
+
+[ ]
+engrave.2
+
+[ ]
+engrave.b  
+
+[ ]
+exper.o    
+
+[ ]
+explode.0
+
+[ ]
+explode.1
+
+[ ]
+extralev.o 
+
+[ ]
+files.o    
+
+[ ]
+fountain.o 
+
+[ ]
+getline.1  
+
+[ ]
+getline.2  
+
+[ ]
+hack.2     
+
+[ ]
+hack.b     
+
+[ ]
+hacklib.b
+
+[ ]
+invent.1
+
+[ ]
+invent.2
+
+[ ]
+invent.3
+
+[ ]
+invent.b   
+
+[ ]
+light.3
+
+[ ]
+lock.0     
+
+[ ]
+lock.b     mail.0     
+
+[ ]
+mail.b
+
+[ ]
+makemon.0
+
+[ ]
+makemon.1
+
+[ ]
+makemon.2
+
+[ ]
+makemon.b
+
+[ ]
+mcastu.0
+
+[ ]
+mcastu.b
+
+[ ]
+mhitm.0    
+
+[ ]
+mhitm.b    
+
+[ ]
+mhitu.0    
+
+[ ]
+mhitu.1    
+
+[ ]
+mhitu.b    
+
+[ ]
+minion.o   
+
+[ ]
+mklev.o    
+
+[ ]
+mkmap.o    
+
+[ ]
+mkmaze.o   
+
+[ ]
+mkobj.0    
+
+[ ]
+mkobj.1    
+
+[ ]
+mkobj.b    
+
+[ ]
+mkroom.0   
+
+[ ]
+mkroom.b
+
+[ ]
+mon.1      
+
+[ ]
+mon.2      
+
+[ ]
+mon.b      
+
+[ ]
+mondata.1  
+
+[ ]
+mondata.2  
+
+[ ]
+mondata.b  
+
+[ ]
+monmove.b  
+
+[ ]
+monst.o    
+
+[ ]
+monstr.o   
+
+[ ]
+mplayer.o
+
+[ ]
+msdos.b    
+
+[ ]
+mthrowu.0  
+
+[ ]
+mthrowu.1  
+
+[ ]
+mthrowu.b  
+
+[ ]
+muse.o     
+
+[ ]
+music.o    
+
+[ ]
+o_init.o   
+
+[ ]
+objects.o  
+
+[ ]
+objnam.0   
+
+[ ]
+objnam.1   
+
+[ ]
+objnam.b   
+
+[ ]
+options.o  
+
+[ ]
+pager.o    
+
+[ ]
+pcmain.1 role.o
+
+[ ]
+pcmain.b
+
+[ ]
+pcunix.b
+
+[ ]
+pickup.o
+
+[ ]
+pline.b
+
+[ ]
+polyself.0
+
+[ ]
+polyself.1 
+
+[ ]
+polyself.b 
+
+[ ]
+potion.b   
+
+[ ]
+pray.o
+
+[ ]
+priest.0
+
+[ ]
+priest.b
+
+[ ]
+quest.o
+
+[ ]
+questpgr.o
+
+[ ]
+read.b
+
+[ ]
+rect.o
+
+[ ]
+region.o
+
+[ ]
+restore.o
+
+[ ]
+rip.o
+
+[ ]
+rnd.1      
+
+[ ]
+rnd.b      
+
+[ ]
+rumors.o
+
+[ ]
+save.o
+
+[ ]
+shk.0
+
+[ ]
+shk.1
+
+[ ]
+shk.2
+
+[ ]
+shk.3
+
+[ ]
+shk.b
+
+[ ]
+shknam.0
+
+[ ]
+shknam.b
+
+[ ]
+sit.o
+
+[ ]
+sounds.0
+
+[ ]
+sounds.b
+
+[ ]
+sp_lev.o
+
+[ ]
+spell.o    
+
+[ ]
+steal.0    
+
+[ ]
+steal.1    
+
+[ ]
+steal.b    
+
+[ ]
+sys.o      
+
+[ ]
+teleport.o
+
+[ ]
+termcap.0  
+
+[ ]
+termcap.1  
+
+[ ]
+termcap.b  
+
+[ ]
+timeout.0  
+
+[ ]
+timeout.1  
+
+[ ]
+timeout.b  
+
+[ ]
+topl.1
+
+[ ]
+topl.2
+
+[ ]
+topl.b
+
+[ ]
+topten.o
+
+[ ]
+track.0
+
+[ ]
+track.1
+
+[ ]
+track.b
+
+[ ]
+trap.1
+
+[ ]
+trap.2
+
+[ ]
+trap.3
+
+[ ]
+trap.b
+
+[ ]
+tty.o      
+
+[ ]
+u_init.o   
+
+[ ]
+uhitm.o    
+
+[ ]
+vault.0
+
+[ ]
+vault.b    
+
+[ ]
+version.o  
+
+[ ]
+vidvga.2
+
+[ ]
+vis_tab.o  
+
+[ ]
+weapon.0   
+
+[ ]
+weapon.1   
+
+[ ]
+weapon.b   
+
+[ ]
+were.0
+
+[ ]
+were.b     
+
+[ ]
+wield.o    
+
+[ ]
+windows.o  
+
+[ ]
+wizard.0   
+
+[ ]
+wizard.b   
+
+[ ]
+worm.o     
+
+[ ]
+steed.o worn.o
+
+[ ]
+write.o    
+
+[ ]
+zap.0      
+
+[ ]
+zap.1      
+
+[ ]
+zap.2      
+
+[ ]
+zap.3      
+
+[ ]
+zap.b
+
diff -Naurd ../nethack-3.3.1/sys/msdos/schema1.BC ./sys/msdos/schema1.BC
--- ../nethack-3.3.1/sys/msdos/schema1.BC Sat Nov 13 21:18:11 1999
+++ ./sys/msdos/schema1.BC Fri Mar 22 14:40:55 2002
@@ -1,4 +1,4 @@
-/* SCCS Id: @(#)schema1.BC	3.3	 99/10/28 */
+/* SCCS Id: @(#)schema1.BC	3.4	 1999/10/28 */
 /* Copyright (c) Yitzhak Sapir, 1999 */
 /*  */
 /*  NetHack Overlay Schema */
diff -Naurd ../nethack-3.3.1/sys/msdos/schema2 ./sys/msdos/schema2
--- ../nethack-3.3.1/sys/msdos/schema2 Thu Jan 1 01:00:00 1970
+++ ./sys/msdos/schema2 Fri Mar 22 14:40:55 2002
@@ -0,0 +1,669 @@
+SCCS Id: @(#)schema2		3.3	 95/10/25
+Copyright (c) NetHack PC Development Team 1993, 1994, 1995
+#
+# NetHack Overlay Schema
+# Small Root footprint, with extended memory available for caching.
+# Almost everything is overlaid.
+#
+
+[ root ]
+pcmain.0   sound.o    tile.o     pctiles.0  pctiles.b
+vidvga.1   vidvga.0   vidvga.b   video.0   video.1   video.b
+hack.3     vidtxt.0   vidtxt.b   alloc.o   ovlinit.o
+
+[ ]
+allmain.0
+
+[ ]
+allmain.1
+
+[ ]
+allmain.b
+
+[ ]
+apply.0    
+
+[ ]
+apply.1    
+
+[ ]
+apply.b    
+
+[ ]
+artifact.0 
+
+[ ]
+artifact.1 
+
+[ ]
+artifact.b 
+
+[ ]
+attrib.0   
+
+[ ]
+attrib.1
+
+[ ]
+attrib.2   
+
+[ ]
+attrib.b   
+
+[ ]
+ball.o     
+
+[ ]
+bones.o    
+
+[ ]
+botl.0     
+
+[ ]
+botl.1     
+
+[ ]
+botl.b     
+
+[ ]
+cmd.0      
+
+[ ]
+cmd.1      
+
+[ ]
+cmd.b      
+
+[ ]
+dbridge.0  
+
+[ ]
+dbridge.1  
+
+[ ]
+dbridge.b  
+
+[ ]
+decl.o     
+
+[ ]
+detect.o
+
+[ ]
+dig.o
+
+[ ]
+display.o
+
+[ ]
+dlb.o
+
+[ ]
+do.0
+
+[ ]
+do.1
+
+[ ]
+do.2
+
+[ ]
+do.3
+
+[ ]
+do.b
+
+[ ]
+do_name.0  
+
+[ ]
+do_name.2  
+
+[ ]
+do_name.b  
+
+[ ]
+do_wear.0  
+
+[ ]
+do_wear.1  
+
+[ ]
+do_wear.2  
+
+[ ]
+do_wear.b  
+
+[ ]
+dog.1      
+
+[ ]
+dog.2
+
+[ ]
+dog.b
+
+[ ]
+dogmove.0
+
+[ ]
+dogmove.b
+
+[ ]
+dokick.o
+
+[ ]
+dothrow.o
+
+[ ]
+drawing.o
+
+[ ]
+dungeon.0
+
+[ ]
+dungeon.1
+
+[ ]
+eat.0      
+
+[ ]
+eat.1      
+
+[ ]
+eat.b      
+
+[ ]
+end.o      
+
+[ ]
+engrave.0  
+
+[ ]
+engrave.1  
+
+[ ]
+engrave.2
+
+[ ]
+engrave.b  
+
+[ ]
+exper.o    
+
+[ ]
+explode.0
+
+[ ]
+explode.1
+
+[ ]
+extralev.o 
+
+[ ]
+files.o    
+
+[ ]
+fountain.o 
+
+[ ]
+getline.1  
+
+[ ]
+getline.2  
+
+[ ]
+hack.1     
+
+[ ]
+hack.2     
+
+[ ]
+hack.b     
+
+[ ]
+hacklib.0
+
+[ ]
+hacklib.1
+
+[ ]
+hacklib.2
+
+[ ]
+hacklib.b
+
+[ ]
+invent.0
+
+[ ]
+invent.1
+
+[ ]
+invent.2
+
+[ ]
+invent.3
+
+[ ]
+invent.b   
+
+[ ]
+light.3
+
+[ ]
+lock.0     
+
+[ ]
+lock.b     mail.0     
+
+[ ]
+mail.b
+
+[ ]
+makemon.0
+
+[ ]
+makemon.1
+
+[ ]
+makemon.2
+
+[ ]
+makemon.b
+
+[ ]
+mcastu.0
+
+[ ]
+mcastu.b
+
+[ ]
+mhitm.0    
+
+[ ]
+mhitm.b    
+
+[ ]
+mhitu.0    
+
+[ ]
+mhitu.1    
+
+[ ]
+mhitu.b    
+
+[ ]
+minion.o   
+
+[ ]
+mklev.o    
+
+[ ]
+mkmap.o    
+
+[ ]
+mkmaze.o   
+
+[ ]
+mkobj.0    
+
+[ ]
+mkobj.1    
+
+[ ]
+mkobj.b    
+
+[ ]
+mkroom.0   
+
+[ ]
+mkroom.b
+
+[ ]
+mon.0
+
+[ ]
+mon.1      
+
+[ ]
+mon.2      
+
+[ ]
+mon.b      
+
+[ ]
+mondata.0  
+
+[ ]
+mondata.1  
+
+[ ]
+mondata.2  
+
+[ ]
+mondata.b  
+
+[ ]
+monmove.0  
+
+[ ]
+monmove.1  
+
+[ ]
+monmove.2  
+
+[ ]
+monmove.b  
+
+[ ]
+monst.o    
+
+[ ]
+monstr.o   
+
+[ ]
+mplayer.o
+
+[ ]
+msdos.0 pckeys.o
+
+[ ]
+msdos.b
+
+[ ]
+mthrowu.0  
+
+[ ]
+mthrowu.1  
+
+[ ]
+mthrowu.b  
+
+[ ]
+muse.o     
+
+[ ]
+music.o    
+
+[ ]
+o_init.o   
+
+[ ]
+objects.o  
+
+[ ]
+objnam.0   
+
+[ ]
+objnam.1   
+
+[ ]
+objnam.b   
+
+[ ]
+options.o  
+
+[ ]
+pager.o    
+
+[ ]
+pcmain.1 role.o
+
+[ ]
+pcmain.b
+
+[ ]
+pcunix.b
+
+[ ]
+pickup.o
+
+[ ]
+pline.b
+
+[ ]
+polyself.0
+
+[ ]
+polyself.1 
+
+[ ]
+polyself.b 
+
+[ ]
+potion.b   
+
+[ ]
+pray.o
+
+[ ]
+priest.0
+
+[ ]
+priest.b
+
+[ ]
+quest.o
+
+[ ]
+questpgr.o
+
+[ ]
+random.o
+
+[ ]
+read.b
+
+[ ]
+rect.o
+
+[ ]
+region.o
+
+[ ]
+restore.o
+
+[ ]
+rip.o
+
+[ ]
+rnd.0      
+
+[ ]
+rnd.1      
+
+[ ]
+rnd.b      
+
+[ ]
+rumors.o
+
+[ ]
+save.o
+
+[ ]
+shk.0
+
+[ ]
+shk.1
+
+[ ]
+shk.2
+
+[ ]
+shk.3
+
+[ ]
+shk.b
+
+[ ]
+shknam.0
+
+[ ]
+shknam.b
+
+[ ]
+sit.o
+
+[ ]
+sounds.0
+
+[ ]
+sounds.b
+
+[ ]
+sp_lev.o
+
+[ ]
+spell.o    
+
+[ ]
+steal.0    
+
+[ ]
+steal.1    
+
+[ ]
+steal.b
+
+[ ]
+steed.o worn.o
+
+[ ]
+sys.o      
+
+[ ]
+teleport.o
+
+[ ]
+termcap.0  
+
+[ ]
+termcap.1  
+
+[ ]
+termcap.b  
+
+[ ]
+timeout.0  
+
+[ ]
+timeout.1  
+
+[ ]
+timeout.b  
+
+[ ]
+topl.1
+
+[ ]
+topl.2
+
+[ ]
+topl.b
+
+[ ]
+topten.o
+
+[ ]
+track.0
+
+[ ]
+track.1
+
+[ ]
+track.b
+
+[ ]
+trap.0
+
+[ ]
+trap.1
+
+[ ]
+trap.2
+
+[ ]
+trap.3
+
+[ ]
+trap.b
+
+[ ]
+tty.o      
+
+[ ]
+u_init.o   
+
+[ ]
+uhitm.o    
+
+[ ]
+vault.0
+
+[ ]
+vault.b    
+
+[ ]
+version.o  
+
+[ ]
+vidvga.2
+
+[ ]
+vis_tab.o  
+
+[ ]
+vision.o   
+
+[ ]
+weapon.0   
+
+[ ]
+weapon.1   
+
+[ ]
+weapon.b   
+
+[ ]
+were.0
+
+[ ]
+were.b     
+
+[ ]
+wield.o    
+
+[ ]
+windows.o  
+
+[ ]
+wintty.o   
+
+[ ]
+wizard.0
+
+[ ]
+wizard.b   
+
+[ ]
+worm.o     
+
+[ ]
+write.o    
+
+[ ]
+zap.0      
+
+[ ]
+zap.1      
+
+[ ]
+zap.2      
+
+[ ]
+zap.3      
+
+[ ]
+zap.b
diff -Naurd ../nethack-3.3.1/sys/msdos/schema2.BC ./sys/msdos/schema2.BC
--- ../nethack-3.3.1/sys/msdos/schema2.BC Sat Nov 13 21:18:40 1999
+++ ./sys/msdos/schema2.BC Fri Mar 22 14:40:55 2002
@@ -1,4 +1,4 @@
-/* SCCS Id: @(#)schema2.BC	3.3	 99/10/28 */
+/* SCCS Id: @(#)schema2.BC	3.4	 1999/10/28 */
 /* Copyright (c) Yitzhak Sapir, 1999 */
 /*  */
 /*  NetHack Overlay Schema */
diff -Naurd ../nethack-3.3.1/sys/msdos/schema3 ./sys/msdos/schema3
--- ../nethack-3.3.1/sys/msdos/schema3 Thu Jan 1 01:00:00 1970
+++ ./sys/msdos/schema3 Fri Mar 22 14:40:55 2002
@@ -0,0 +1,600 @@
+SCCS Id: @(#)schema3		3.3	 95/10/25
+Copyright (c) NetHack PC Development Team 1993, 1994, 1995
+#
+# NetHack Overlay Schema
+# Minimal extended memory available, lots of 640K base RAM free
+# This schema is for use with a patched moveinit.c (see Makefile
+# or Install.dos for information.
+#
+
+[ root ]
+pcmain.0   sound.o    tile.o     pctiles.0  pctiles.b
+vidvga.1   vidvga.0   vidvga.b   video.0   video.1   video.b
+hack.3     vidtxt.0   vidtxt.b	 botl.0    monmove.0 display.o
+dungeon.0  hacklib.0  wintty.o   trap.0    attrib.0  detect.o
+mon.0      cmd.0      vision.o   hack.1    msdos.0   
+random.o   rnd.0      alloc.o
+dbridge.0  monmove.1 engrave.0 invent.0 
+monmove.2  mondata.0
+hacklib.1  hacklib.2
+dogmove.b
+
+[ ]
+allmain.0  
+
+[ ]
+allmain.1  
+
+[ ]
+allmain.b  
+
+[ ]
+apply.0    
+
+[ ]
+apply.1    
+
+[ ]
+apply.b    
+
+[ ]
+artifact.0 
+
+[ ]
+artifact.1 
+
+[ ]
+artifact.b 
+
+[ ]
+attrib.1
+
+[ ]
+attrib.2   
+
+[ ]
+attrib.b   
+
+[ ]
+ball.o     
+
+[ ]
+bones.o    
+
+[ ]
+botl.1     
+
+[ ]
+botl.b     
+
+[ ]
+cmd.1      
+
+[ ]
+cmd.b      
+
+[ ]
+dbridge.1  
+
+[ ]
+dbridge.b  
+
+[ ]
+decl.o     
+
+[ ]
+dig.o
+
+[ ]
+dlb.o
+
+[ ]
+do.0
+
+[ ]
+do.1
+
+[ ]
+do.2
+
+[ ]
+do.3
+
+[ ]
+do.b
+
+[ ]
+do_name.0  
+
+[ ]
+do_name.2  
+
+[ ]
+do_name.b  
+
+[ ]
+do_wear.0  
+
+[ ]
+do_wear.1  
+
+[ ]
+do_wear.2  
+
+[ ]
+do_wear.b  
+
+[ ]
+dog.1      
+
+[ ]
+dog.2
+
+[ ]
+dog.b
+
+[ ]
+dogmove.0
+
+[ ]
+dokick.o
+
+[ ]
+dothrow.o
+
+[ ]
+drawing.o
+
+[ ]
+dungeon.1
+
+[ ]
+eat.0      
+
+[ ]
+eat.1      
+
+[ ]
+eat.b      
+
+[ ]
+end.o      
+
+[ ]
+engrave.1  
+
+[ ]
+engrave.2
+
+[ ]
+engrave.b  
+
+[ ]
+exper.o    
+
+[ ]
+explode.0
+
+[ ]
+explode.1
+
+[ ]
+extralev.o 
+
+[ ]
+files.o    
+
+[ ]
+fountain.o 
+
+[ ]
+getline.1  
+
+[ ]
+getline.2  
+
+[ ]
+hack.2     
+
+[ ]
+hack.b     
+
+[ ]
+hacklib.b
+
+[ ]
+invent.1
+
+[ ]
+invent.2
+
+[ ]
+invent.3
+
+[ ]
+invent.b   
+
+[ ]
+light.3
+
+[ ]
+lock.0     
+
+[ ]
+lock.b     mail.0     
+
+[ ]
+mail.b
+
+[ ]
+makemon.0
+
+[ ]
+makemon.1
+
+[ ]
+makemon.2
+
+[ ]
+makemon.b
+
+[ ]
+mcastu.0
+
+[ ]
+mcastu.b
+
+[ ]
+mhitm.0    
+
+[ ]
+mhitm.b    
+
+[ ]
+mhitu.0    
+
+[ ]
+mhitu.1    
+
+[ ]
+mhitu.b    
+
+[ ]
+minion.o   
+
+[ ]
+mklev.o    
+
+[ ]
+mkmap.o    
+
+[ ]
+mkmaze.o   
+
+[ ]
+mkobj.0    
+
+[ ]
+mkobj.1    
+
+[ ]
+mkobj.b    
+
+[ ]
+mkroom.0   
+
+[ ]
+mkroom.b
+
+[ ]
+mon.1      
+
+[ ]
+mon.2      
+
+[ ]
+mon.b      
+
+[ ]
+mondata.1  
+
+[ ]
+mondata.2  
+
+[ ]
+mondata.b  
+
+[ ]
+monmove.b  
+
+[ ]
+monst.o    
+
+[ ]
+monstr.o   
+
+[ ]
+mplayer.o
+
+[ ]
+msdos.b    
+
+[ ]
+mthrowu.0  
+
+[ ]
+mthrowu.1  
+
+[ ]
+mthrowu.b  
+
+[ ]
+muse.o     
+
+[ ]
+music.o    
+
+[ ]
+o_init.o   
+
+[ ]
+objects.o  
+
+[ ]
+objnam.0   
+
+[ ]
+objnam.1   
+
+[ ]
+objnam.b   
+
+[ ]
+options.o  
+
+[ ]
+pager.o    
+
+[ ]
+pcmain.1
+
+[ ]
+pcmain.b
+
+[ ]
+pcunix.b
+
+[ ]
+pickup.o
+
+[ ]
+pline.b
+
+[ ]
+polyself.0
+
+[ ]
+polyself.1 
+
+[ ]
+polyself.b 
+
+[ ]
+potion.b   
+
+[ ]
+pray.o
+
+[ ]
+priest.0
+
+[ ]
+priest.b
+
+[ ]
+quest.o
+
+[ ]
+questpgr.o
+
+[ ]
+read.b
+
+[ ]
+rect.o
+
+[ ]
+restore.o
+
+[ ]
+rip.o
+
+[ ]
+rnd.1      
+
+[ ]
+rnd.b      
+
+[ ]
+rumors.o
+
+[ ]
+save.o
+
+[ ]
+shk.0
+
+[ ]
+shk.1
+
+[ ]
+shk.2
+
+[ ]
+shk.3
+
+[ ]
+shk.b
+
+[ ]
+shknam.0
+
+[ ]
+shknam.b
+
+[ ]
+sit.o
+
+[ ]
+sounds.0
+
+[ ]
+sounds.b
+
+[ ]
+sp_lev.o
+
+[ ]
+spell.o    
+
+[ ]
+steal.0    
+
+[ ]
+steal.1    
+
+[ ]
+steal.b    
+
+[ ]
+sys.o      
+
+[ ]
+teleport.o
+
+[ ]
+termcap.0  
+
+[ ]
+termcap.1  
+
+[ ]
+termcap.b  
+
+[ ]
+timeout.0  
+
+[ ]
+timeout.1  
+
+[ ]
+timeout.b  
+
+[ ]
+topl.1
+
+[ ]
+topl.2
+
+[ ]
+topl.b
+
+[ ]
+topten.o
+
+[ ]
+track.0
+
+[ ]
+track.1
+
+[ ]
+track.b
+
+[ ]
+trap.1
+
+[ ]
+trap.2
+
+[ ]
+trap.3
+
+[ ]
+trap.b
+
+[ ]
+tty.o      
+
+[ ]
+u_init.o   
+
+[ ]
+uhitm.o    
+
+[ ]
+vault.0
+
+[ ]
+vault.b    
+
+[ ]
+version.o  
+
+[ ]
+vidvga.2
+
+[ ]
+vis_tab.o  
+
+[ ]
+weapon.0   
+
+[ ]
+weapon.1   
+
+[ ]
+weapon.b   
+
+[ ]
+were.0
+
+[ ]
+were.b     
+
+[ ]
+wield.o    
+
+[ ]
+windows.o  
+
+[ ]
+wizard.0   
+
+[ ]
+wizard.b   
+
+[ ]
+worm.o     
+
+[ ]
+worn.o     
+
+[ ]
+write.o    
+
+[ ]
+zap.0      
+
+[ ]
+zap.1      
+
+[ ]
+zap.2      
+
+[ ]
+zap.3      
+
+[ ]
+zap.b
+
diff -Naurd ../nethack-3.3.1/sys/msdos/schema3.MSC ./sys/msdos/schema3.MSC
--- ../nethack-3.3.1/sys/msdos/schema3.MSC Thu Aug 3 21:33:13 2000
+++ ./sys/msdos/schema3.MSC Fri Mar 22 14:40:55 2002
@@ -1,4 +1,4 @@
-; SCCS Id: @(#)schema3.MSC	3.3	 2000/07/31
+; SCCS Id: @(#)schema3.MSC	3.4	 2000/07/31
 ; Copyright (c) NetHack PC Development Team, 2000
 ;
 ; NetHack Overlay Schema
@@ -19,19 +19,20 @@
 functions:0 _monsndx _m_move _lcase _tty_create_nhwindow _tty_delay_output _tty_destroy_nhwindow 
 functions:0 _tty_dismiss_nhwindow _gender _genl_outrip _get_cost _get_free_room_loc _get_level 
 functions:0 _get_location _get_map _get_mleash
+;
 functions:1 _move_update _movebubbles _movecmd _movemon _moverock _movobj _mpickgold
-functions:1 _doaltarobj _doapply _dobreathe _docall _docast 
-functions:1 _display_artifact_score _display_warning _dlb_fgetc _doattributes _dochug _dochugw
-functions:1 _fill_point _fill_room _fill_zoo _fillholetyp _find_ac _find_branch _find_branch_room _find_defensive
+functions:1 _doaltarobj _doapply _dobreathe _docall _docast
 ;
 functions:2 _do_vicinity_map
 functions:3 _pcmain
+functions:4 _spell_let_to_idx _cursed_book _deadbook _learn _getspell _spelltypemnemonic
+functions:5 _dospellmenu _percent_success _throwspell _cast_protection _isqrt
 ;
 functions:6 _a_gname _a_gname_at _a_monnam _abon _abuse_dog _accessible _activate_statue_trap
 functions:7 _add_branch _add_damage _add_debug_extended_commands _add_door _add_id_mapping _add_level
 functions:8 _add_menu_cmd_alias _add_one_tobill _add_rect _add_room _add_subroom _add_to_billobjs _add_to_buried _add_to_container
 functions:9 _add_to_migration _add_to_minv _add_valid_menu_class _add_weapon_skill _addinv _addtobill _addtopl _addupbill
-functions:10 _Adjmonnam 
+functions:10 _Adjmonnam
 functions:11 _align_gname
 functions:12 _altar_wrath _Amonnam _amulet _Amulet_off _Amulet_on _An _an _angry_guards
 functions:13 _angry_priest _angry_shk_exists _any_light_source _aobjnam _append_slash _append_str _Armor_gone _Armor_off
@@ -82,7 +83,7 @@
 functions:57 _vga_xputg _vga_xputs _video_update_positionbar _view_from _view_init _visctrl _vision_init _vision_recalc
 functions:58 _do_oname _do_osshock _do_play_instrument _do_reset_eat _do_room_or_subroom _do_storms _do_takeoff
 functions:60 _doclose _doconfuse _doconsult _docorner _docrt _doddoremarm _doddrop _dodip
-;functions:61 
+functions:61 _adjust_prefix _build_plselection_prompt _duplicate_opt_detection _enter_explore_mode _maybe_wail
 functions:62 _doextcmd _doextlist _doextversion _dofindgem _dofiretrap _doforce _dog_eat _dog_goal
 functions:63 _dog_hunger _dog_invent _dog_move _dog_nutrition _dogfood _dogushforth _dohelp _dohide
 functions:64 _dohistory _doidtrap _doinvbill _doinvoke _dojump _dokick _dolook _doloot
@@ -106,7 +107,7 @@
 functions:82 _exclam _exepath _exerchk _exercise _exerper _exist_artifact _expels _experience
 functions:83 _explmm _explmu _explode _explum _expulsion _ext_cmd_getlin_hook _extend_spine _extract_nexthere
 functions:84 _extract_nobj _fall_asleep _fall_through _feel_cockatrice _feel_location _fightm _filesize_nh _fill_pit
-;functions:85 
+functions:85 _nh_getenv _promptsep _rigid_role_checks _set_duplicate_opt_detection _tool_in_use
 functions:86 _find_drawbridge _find_hell _find_lev_obj _find_level _find_mac _find_mid _find_misc _find_offensive
 functions:87 _find_oid _find_roll_to_hit _find_skates _find_unpaid _finddpos _findfirst_file _findgd _findit
 functions:88 _findnext_file _findone _findpriest _finish_map _finish_paybill _fix_stair_rooms _fix_worst_trouble _fixup_special
@@ -116,7 +117,8 @@
 functions:92 _fprefx _fracture_rock _free_dungeons _free_rooms _free_ttlist _free_window_info _freediskspace _freedynamicdata
 functions:93 _freefruitchn _freehand _freeinv _friday_13th _fruitadd _fry_by_god _fully_identify_obj _g_at
 functions:94 _gainstr _gameDiskPrompt _gazemm _gazemu _gd_move _gd_sound _gem_accept
-;functions:95 
+functions:95 _display_artifact_score _display_warning _dlb_fgetc _doattributes _dochug _dochugw
+functions:96 _fill_point _fill_room _fill_zoo _fillholetyp _find_ac _find_branch _find_branch_room _find_defensive
 functions:96 _get_mon_location _get_mplname _get_obj_location _get_rect _get_rect_ind _get_room_loc _get_scr_size _get_shop_item
 functions:97 _get_uchars _get_unused_cs _get_valuables _get_wall_for_db _get_wet _get_wormno _getbones _getdir
 functions:98 _gethungry 
@@ -143,7 +145,7 @@
 functions:119 _sticks _still_chewing _stock_room _stolen_container _stolen_value _stone_luck _stoned_dialogue _stop_occupation
 functions:120 _kick_monster _kick_object _kickdmg _kickstr _kill_egg _kill_eggs _kill_genocided_monsters _killed
 functions:121 _kind_name _known_hitum _kops_gone _l_monnam _lantern_message _launch_obj _lava_effects 
-functions:122 _ldrname _leader_speaks _leaderless _learn _learn_egg_type _ledger_no _ledger_to_dlev _ledger_to_dnum
+functions:122 _ldrname _leader_speaks _leaderless _learn_egg_type _ledger_no _ledger_to_dlev _ledger_to_dnum
 functions:123 _left_side _lesshungry _let_to_name _letter _lev_by_name _level_difficulty _level_distance _level_range
 functions:124 _level_tele _level_tele_trap _levl_follower _lifesaved_monster _lift_object _light_cocktail _light_region _lined_up
 functions:125 _linedup _list_genocided _list_vanquished _litroom _litter _little_to_big _llord _lminion
@@ -225,7 +227,7 @@
 functions:202 _savelev _savelev0 _savelevchn _savelife _savemonchn _savenames _saveobjchn _savestateinlock
 functions:203 _savetrapchn _scatter _schedule_goto _score_wanted _search_door _search_special _searches_for_item _see_lamp_flicker
 functions:204 _see_monsters _see_objects _see_traps _see_wsegs _seemimic _seetrap _seffects _select_hwep
-functions:205 _select_off _select_rwep _self_pronoun _selftouch _sellobj _sellobj_state _sengr_at _sense_trap
+functions:205 _select_off _select_rwep _selftouch _sellobj _sellobj_state _sengr_at _sense_trap
 functions:206 _set_all_on_page _set_apparxy _set_artifact_intrinsic _set_bc _set_bonesfile_name _set_bonestemp_name _set_corn _set_cost
 functions:207 _set_crosswall _set_entity _set_item_state _set_itimeout _set_levelfile_name _set_lit _set_lock_and_bones _set_malign
 functions:208 _set_mimic_blocking _set_mimic_sym _set_mon_data _set_moreluck _set_occupation _set_repo_loc _set_residency _set_savefile_name
@@ -417,9 +419,9 @@
 functions:381 _validrole _violated_vegetarian _walk_path _warning_opts _wary_dog _welcome
 functions:382 _write_timer _yyyymmdd _zap_steed
 functions:383 _getprice _getreturn _getrumor _gettrack
-;functions:384 
+functions:384 _ini_inv _knows_object _knows_class _restricted_spell_discipline _ready_weapon
 functions:385 _doname _Doname2
-functions:386 _minwater 
+functions:386 _minliquid 
 functions:387 _missmm 
 functions:388 _missmu 
 functions:389 _missum 
diff -Naurd ../nethack-3.3.1/sys/msdos/setup.bat ./sys/msdos/setup.bat
--- ../nethack-3.3.1/sys/msdos/setup.bat Sat Apr 4 03:22:27 1998
+++ ./sys/msdos/setup.bat Fri Mar 22 14:40:55 2002
@@ -1,10 +1,10 @@
 @echo off
-REM    SCCS Id: @(#)setup.bat   97/09/28
-REM    Copyright (c) NetHack PC Development Team 1990 - 1997
+REM    SCCS Id: @(#)setup.bat   2002/03/17
+REM    Copyright (c) NetHack PC Development Team 1990 - 2002
 REM    NetHack may be freely redistributed.  See license for details.
 
 echo.
-echo   Copyright (c) NetHack PC Development Team 1990 - 1997
+echo   Copyright (c) NetHack PC Development Team 1990 - 2002
 echo   NetHack may be freely redistributed.  See license for details.
 echo.
 REM setup batch file for msdos, see Install.dos for details.
@@ -22,6 +22,9 @@
 if not exist ..\share\lev_yacc.c   goto err_dir
 echo Directories OK.
 
+if not exist ..\..\binary\* mkdir ..\..\binary
+if NOT exist ..\..\binary\license copy ..\..\dat\license ..\..\binary\license >nul
+
 if exist ..\..\dat\data.bas goto long1ok
 if exist ..\..\dat\data.base goto long1a
 if exist ..\..\dat\data~1.bas goto long1b
diff -Naurd ../nethack-3.3.1/sys/msdos/sound.c ./sys/msdos/sound.c
--- ../nethack-3.3.1/sys/msdos/sound.c Thu Oct 28 02:48:41 1999
+++ ./sys/msdos/sound.c Fri Mar 22 14:40:55 2002
@@ -1,4 +1,4 @@
-/*   SCCS Id: @(#)sound.c   3.3     96/02/19                        */
+/*   SCCS Id: @(#)sound.c   3.4     1996/02/19                        */
 /*   Copyright (c) NetHack PC Development Team 1993,1995            */
 /*   NetHack may be freely redistributed.  See license for details. */
 /*                                                                  */
diff -Naurd ../nethack-3.3.1/sys/msdos/template.mak ./sys/msdos/template.mak
--- ../nethack-3.3.1/sys/msdos/template.mak Thu Jan 1 01:00:00 1970
+++ ./sys/msdos/template.mak Fri Mar 22 14:40:55 2002
@@ -0,0 +1,2232 @@
+# SCCS Id: @(#)template.mak	3.4	1996/10/25
+# Copyright (c) NetHack PC Development Team 1996
+#
+?BEGIN?
+?SCCS?
+?MSC?
+# PC NetHack 3.4 Makefile for Microsoft(tm) "C" >= 7.0 and MSVC >= 1.0
+?ENDMSC?
+?BC?
+# PC NetHack 3.4 Makefile for Borland C++ 3.1.
+?ENDBC?
+#
+# Nota Bene:	Before you get to here you should have already read
+# 		the Install.dos file located in the sys/msdos directory.
+?BC?
+#		Additionally, you should run this makefile with the -N
+#		Microsoft Compatibility option.
+#
+# This Makefile is for use with Borland C++ version 3.1.
+#
+# This Makefile is specific to Borland's MAKE which is supplied with the
+# compiler.  It supports only one overlay management facility - VROOMM.
+# (This Makefile won't work with make45l or NDMAKE)
+?ENDBC?
+?MSC?
+#
+# This Makefile is for use with Microsoft C version 7 and Microsoft Visual C++
+# Professional Edition (MSVC) version 1.0 or greater.
+#
+# This Makefile is specific to Microsoft's NMAKE which is supplied with the
+# more recent Microsoft C compilers.
+# It supports only one overlay management facility - MOVE.
+# (This Makefile won't work with make45l or NDMAKE)
+#
+#	In addition to your C compiler,
+#
+#	if you want to change		you will need a
+#	files with suffix		workalike for
+#	       .y			    yacc   (such as bison or byacc)
+#	       .l			    lex    (such as flex)
+?ENDMSC?
+
+#
+# Game Installation Variables.
+# NOTE: Make sure GAMEDIR exists before nmake is started.
+#
+
+GAME	= NetHack
+GAMEDIR = c:\games\nethack
+
+#
+#
+# Directories
+#
+
+DAT	= ..\dat
+DOC	= ..\doc
+INCL	= ..\include
+SRC	= ..\src
+OBJ	= o
+MSYS	= ..\sys\msdos
+SYS	= ..\sys\share
+UTIL	= ..\util
+WTTY	= ..\win\tty
+WSHR	= ..\win\share
+
+
+#
+# Compiler File Info.
+# ($(MAKE) macro is often predefined, so we use $(MAKEBIN) instead.)
+#
+
+?MSC?
+CC	 = cl		# Compiler
+LINK	 = link		# Linker
+ASM	 = masm		# Assembler (not currently needed for MSC 7 and > )
+MAKEBIN  = nmake
+UUDECODE = uudecode	# Unix style uudecoder
+?ENDMSC?
+?BC?
+CC	 = bcc		# Compiler
+LINK	 = tlink	# Linker
+ASM	 = tasm		# Assembler (not currently needed for BC)
+MAKEBIN  = make
+UUDECODE = uudecode	# Unix style uudecoder
+
+#BCTOP	 = c:\borlandc	# main Borland C++ directory
+BCTOP	 = c:\bc31
+?ENDBC?
+
+#
+# Yacc/Lex ... if you got 'em.
+#
+# If you have yacc and lex programs (or work-alike such as bison
+# and flex), comment out the upper two lines below, and uncomment
+# the lower two.
+?BC?
+#
+# On Borland C++, the newest versions of flex and bison provide
+# problems when run from MAKE.
+?ENDBC?
+#
+
+DO_YACC = YACC_MSG
+DO_LEX  = LEX_MSG
+#DO_YACC  = YACC_ACT
+#DO_LEX   = LEX_ACT
+
+#
+# - Specify your yacc and lex programs (or work-alikes for each) here.
+#
+
+YACC	= bison -y
+#YACC   = yacc
+#YACC   = byacc
+
+LEX     = flex
+#LEX    = lex
+
+#
+# - Specify your flex skeleton file (if needed).
+#
+FLEXSKEL =
+#FLEXSKEL = -Sc:\tools16\flex.ske
+
+#
+# - Your yacc (or work-alike) output files
+#
+YTABC	= y_tab.c
+YTABH	= y_tab.h
+#YTABC  = ytab.c
+#YTABH  = ytab.h
+
+#
+# - Your lex (or work-alike) output files
+#
+LEXYYC	= lexyy.c
+#LEXYYC	= lex.yy.c
+
+#
+# Optional high-quality BSD random number generation routines
+# (see pcconf.h). Set to nothing if not used.
+#
+
+RANDOM	= $(OBJ)\random.o
+#RANDOM	=
+
+#
+# If TERMLIB is #defined in the source (in include\pcconf.h),
+# comment out the upper line and uncomment the lower.  Make sure
+# that TERMLIB contains the full pathname to the termcap library.
+
+TERMLIB =
+#TERMLIB = $(SYS)\termcap.lib
+
+#
+# MEMORY USAGE AND OVERLAYING
+#
+# Overlay Schema 1
+#
+#   - Minimal extended memory available, lots of 640K base RAM free
+#     Minimize overlay turns. Requires that a minimum of
+?MSC?
+#     560K RAM be free as follows:
+#     430K  Executable load requirement
+#      60K  Overlay buffer
+#      70K  for malloc() calls
+#     560K  Total memory requirement
+?ENDMSC?
+?BC?
+#     607K RAM be free as follows:
+#     462K  Executable load requirement
+#     115K  for malloc() calls
+#      30K  Overlay buffer
+#     607K  Total memory requirement
+?ENDBC?
+#
+# Overlay Schema 2
+#
+#   - Favor small load size, requires extended memory for bearable performance.
+#     If you have very little base 640K RAM available, but lots of extended
+#     memory for caching overlays, you might try this. (eg. A machine with
+#     lots of TSR's or network drivers).  Do not try to set SCHEMA = 2
+#     without a disk cache and extended memory.
+?BC?
+#     381K  Executable load requirement
+#     115K  for malloc() calls
+#      30K  Overlay buffer
+#     526K  Total memory requirement
+?ENDBC?
+?MSC?
+#     360K  Executable load requirement
+#      60K  Overlay buffer
+#      70K  for malloc() calls
+#     419K  Total memory requirement
+#
+# Overlay Schema 3
+#
+#   - Minimal extended memory available, lots of 640K base RAM free
+#     Similar to schema1, but the overlay buffer is twice as large, so
+#     in theory more overlays can be resident at the same time. The cost is
+#     that the base memory requirement goes up considerably.
+#     This requires that you obtain the moveinit.c and moveapi.h files from
+#     your Microsoft C source/move directory, and place them into the src
+#     directory.  Then apply the patch moveinit.pat file found in sys/msdos.
+#     Requirements:
+#     360K  Executable load requirement
+#      95K  Overlay buffer
+#      70K  for malloc() calls
+#     525K  Total memory requirement
+?ENDMSC?
+#
+?BC?
+# On Borland C++, you have to make a full rebuild of all object modules each
+# time you change schemas.
+#
+?ENDBC?
+
+SCHEMA	= 1
+
+#
+# OPTIONAL TILE SUPPORT.
+#
+#	This release of NetHack allows you to build a version of NetHack
+#	that will draw 16x16 color tiles on the display to represent
+#	NetHack maps, objects, monsters, etc. on machines with appropriate
+#	display hardware.  Currently the only supported video hardware is
+#	VGA.
+#
+#	Note:  You can build NetHack with tile support and then choose
+#	whether to use it or not at runtime via the defaults.nh file option
+#	"video".
+#
+
+TILESUPPORT = Y
+
+#
+#  C COMPILER AND LINKER SETTINGS
+#
+#   For debugging ability, comment out the upper three
+#   macros and uncomment the lower three.  You can also
+#   uncomment only either LDFLAGSU or LDFLAGSN if you
+#   want to include debug information only in the utilities
+#   or only in the game file.
+?BC?
+
+#   On Borland C++, you cannot include debug information for
+#   all the object modules because the linker cannot handle
+#   it.
+?ENDBC?
+
+#CDFLAGS  =
+?MSC?
+#LDFLAGSN =
+?ENDMSC?
+?BC?
+LDFLAGSN  =
+?ENDBC?
+#LDFLAGSU =
+
+?MSC?
+CDFLAGS   = /Zi			# use debug info (compiler)
+LDFLAGSN  = /CO			# use debug info (linker - game)
+LDFLAGSU  = /CO			# use debug info (linker - utilities)
+?ENDMSC?
+?BC?
+CDFLAGS	  = -v -vi		# use debug info (compiler)
+#LDFLAGSN = /v			# use debug info (linker - game)
+LDFLAGSU  = /v			# use debug info (linker - utilities)
+?ENDBC?
+
+#
+?MSC?
+# - Force a change in the C warning level for all builds.
+#   (Its W0 setting in the CL environment variable will take
+#   precedence if left blank here).
+?ENDMSC?
+?BC?
+# - Don't warn about unreachable code because flex generates a whole bunch
+#   of unreachable code warnings, which stops the compile process.
+?ENDBC?
+#
+
+?MSC?
+CW =
+#CW =/W3
+?ENDMSC?
+?BC?
+CW = -w-rch
+?ENDBC?
+
+#
+#   Select whether to use pre-compiled headers or not.
+#   Set PRECOMPHEAD to Y to use pre-compiled headers, set it to anything
+#   else and pre-compiled headers will not be used.
+#   (Pre-compiled headers speed up compiles, but require a bit more
+#   disk space during the build.  The pre-compiled headers can be deleted
+#   afterwards via DEL *.PCH if desired).
+#
+
+PRECOMPHEAD = N
+
+#
+#   C Compiler Flags
+#
+?MSC?
+# Note:
+#
+#    CL environment variable should already be set to:
+#    CL= /AL /G2 /Oo /Gs /Gt16 /Zp1 /W0 /I..\include /nologo /DMOVERLAY
+#
+?ENDMSC?
+
+?MSC?
+CFLAGS = /c
+?ENDMSC?
+?BC?
+CFLAGS = -c
+?ENDBC?
+
+#  Uncomment the line below if you want to store all the level files,
+#  help files, etc. in a single library file (recommended).
+
+USE_DLB = Y
+
+#
+########################################################################
+########################################################################
+#
+#  Nothing below here should have to be changed.
+#
+########################################################################
+########################################################################
+#
+#  Warning:
+#
+#  Changing anything below here means that you should be *very*
+#  familiar with your compiler's workings, *very* knowledgeable
+#  about the overlay structure and mechanics of NetHack, and *very*
+#  confident in your understanding of Makefiles and Make utilities.
+#
+########################################################################
+#
+# Default Make Procedure
+#
+
+default: $(GAME)
+
+#
+########################################################################
+# Tile preparation
+#
+
+! IF ("$(TILESUPPORT)"=="Y")
+
+TILEGAME  = $(OBJ)\tile.o	$(OBJ)\pctiles.0	$(OBJ)\pctiles.b
+
+#
+#   -  VGA Tile Support, uncomment these three lines.
+#
+
+TILEVGA    = $(OBJ)\vidvga.0 $(OBJ)\vidvga.1 $(OBJ)\vidvga.2 $(OBJ)\vidvga.b
+PLANAR_TIB = NetHack1.tib
+OVERVIEW_TIB = NetHacko.tib
+
+#
+# Leave this line uncommented and unchanged.
+TILEUTIL  =  $(TILEGAME) $(TILEVGA) $(UTIL)\tile2bin.exe $(UTIL)\til2bin2.exe \
+		 $(PLANAR_TIB) $(OVERVIEW_TIB)
+
+! ENDIF
+
+! IF ("$(USE_DLB)"=="Y")
+DLB = nhdat
+! ELSE
+DLB =
+! ENDIF
+
+#
+#############################################################################
+#
+# General Overlay Schema Settings
+#
+
+?MSC?
+LNKOPT  = schema$(SCHEMA).def
+?ENDMSC?
+?BC?
+!include schema$(SCHEMA).bc
+OVLINIT =$(OBJ)\ovlinit.o
+?ENDBC?
+
+?MSC?
+#
+# - Specific Overlay Schema Settings
+#
+
+! IF ($(SCHEMA)==1)
+INTOVL = /DYNAMIC:1250 /NOE
+OVLINIT =
+! ENDIF
+
+! IF ($(SCHEMA)==2)
+INTOVL = /DYNAMIC:1380	/NOE
+OVLINIT =
+! ENDIF
+
+! IF ($(SCHEMA)==3)
+INTOVL = /DYNAMIC:1170
+OVLINIT = $(OBJ)\moveinit.o $(OBJ)\ovlinit.o
+! ENDIF
+?ENDMSC?
+
+#
+#############################################################################
+#
+# C Compiler and Linker Setup Options
+# (To Maintainer; modify only if absolutely necessary)
+#
+
+?BC?
+BCINCL	 = $(BCTOP)\include	# include directory for main BC headers
+BCLIB	 = $(BCTOP)\lib		# library directory for main BC libraries
+BCCFG	 = nethack.cfg		# name of the nethack configuration file
+?ENDBC?
+
+#
+# Model
+#
+
+?MSC?
+MODEL	 = L
+?ENDMSC?
+?BC?
+MODEL	 = h
+?ENDBC?
+
+#
+# - Optional C library specifier for those with non-standard
+#   libraries or a multiple-target library setup.
+#
+
+CLIB    =
+?MSC?
+#CLIB    = llibcer /nod
+?ENDMSC?
+
+?BC?
+#
+# Borland C++ libraries
+#
+
+BCOVL	= $(BCLIB)\OVERLAY
+BCMDL	= $(BCLIB)\C$(MODEL)
+
+?ENDBC?
+#
+# Compiler Options
+#
+
+?MSC?
+CNOLNK	= /c			# just generate .OBJ
+CPCHUSE	= /YuHACK.H		# use precompiled headers
+CPCHGEN	= /YcHACK.H		# generate precompiled headers
+CPCHNAM	= /Fp			# set the name of the precompiled header file
+CPCHEXT = .PCH			# precompiled header extension
+CDEFINE	= /D			# define a macro
+CCSNAM	= /NT			# set the code segment name
+COBJNAM	= /Fo			# name the .OBJ file
+CNOOPT  = /f- /Od		# disable optimizations (must be first in line)
+				# /f- = don't use the "fast" compiler,its buggy
+?ENDMSC?
+?MSCMACRO:CSNAMOA= ?
+?MSCMACRO:CSNAMOB=$(CCSNAM)$(@F) ?
+?MSCMACRO:CSNAM0=$(CCSNAM)$(@F) ?
+?MSCMACRO:CSNAM1=$(CCSNAM)$(@F) ?
+?MSCMACRO:CSNAM2=$(CCSNAM)$(@F) ?
+?MSCMACRO:CSNAM3=$(CCSNAM)$(@F) ?
+?MSCMACRO:CSNAMB=$(CCSNAM)$(@F) ?
+?BC?
+CNOLNK	= -c			# just generate .OBJ
+CPCHUSE	= -Hu			# use precompiled headers
+CPCHGEN	= -H			# generate precompiled headers
+CPCHNAM	= -H=			# set the name of the precompiled header file
+CPCHEXT = .PCH			# precompiled header extension
+CDEFINE	= -D			# define a macro
+CSTKSZ	= -DSTKSIZ=		# set stack size
+CCSNAM	= -zC			# set the code segment name
+COBJNAM	= -o			# name the .OBJ file
+?ENDBC?
+?BCMACRO:CSNAMOA=$$($(@B)_o) ?
+?BCMACRO:CSNAMOB=$$($(@B)_o) ?
+?BCMACRO:CSNAM0=$$($(@B)_0) ?
+?BCMACRO:CSNAM1=$$($(@B)_1) ?
+?BCMACRO:CSNAM2=$$($(@B)_2) ?
+?BCMACRO:CSNAM3=$$($(@B)_3) ?
+?BCMACRO:CSNAMB=$$($(@B)_b) ?
+
+#
+# Linker Options
+#
+
+?MSC?
+LWCASE	= /NOI			# treat case as significant
+LMAP	= /MAP			# create map file
+LSTKSZ	= /ST:			# set stack size
+LMAXSEG	= /SE:400		# maximum number of segments allowed
+LMAXALL	= /CPARM:1		# maximum program memory allocation (?)
+LINFO	= /INFO			# display link information while processing
+?ENDMSC?
+?BC?
+LWCASE	= /c			# treat case as significant
+LMAP	= /m			# create map file
+LINIT	= $(BCLIB)\C0$(MODEL)	# initialization object file
+LOVL	= /oOVLY		# overlay all needed segments
+?ENDBC?
+
+#
+# Stack Sizes
+#
+
+STKSUTL	= 4096			# Utilities Stack Size
+STKSNRM = 5120			# Normal Stack Size
+
+?MSC?
+LUSTACK	= $(LSTKSZ)$(STKSUTL)	# Utilities Stack Set for Linker
+LNSTACK	= $(LSTKSZ)$(STKSNRM)	# Normal Stack Set for Linker
+?ENDMSC?
+?BC?
+CUSTACK	= $(CSTKSZ)$(STKSUTL)	# Utilities Stack Set for Compiler
+CNSTACK	= $(CSTKSZ)$(STKSNRM)	# Normal Stack Set for Compiler
+?ENDBC?
+
+
+#
+########################################################################
+# DLB preparation
+#
+
+! IF ("$(USE_DLB)"=="Y")
+DLBFLG = $(CDEFINE)DLB
+! ELSE
+DLBFLG =
+! ENDIF
+
+#
+########################################################################
+# tile preparation
+#
+
+! IF ("$(TILESUPPORT)"=="Y")
+TILFLG = $(CDEFINE)USE_TILES
+! ELSE
+TILFLG =
+! ENDIF
+
+#############################################################################
+#
+# Overlay switches
+#
+
+COVL0	= $(CDEFINE)OVL0
+COVL1	= $(CDEFINE)OVL1
+COVL2	= $(CDEFINE)OVL2
+COVL3	= $(CDEFINE)OVL3
+COVLB	= $(CDEFINE)OVLB
+
+#
+# Flags
+#
+
+FLAGOPT = $(DLBFLG) $(TILFLG)
+
+#
+# Precompiled Header Section
+#
+
+?BC?
+#common options (placed in $(BCCFG))
+CFLGTOT = $(CDFLAGS) $(CFLAGS) $(FLAGOPT) $(CW)
+#util builds
+CFLAGSU	= +$(BCCFG) $(CUSTACK)
+#normal build, no PCH
+CFLAGSN = +$(BCCFG) $(CNSTACK)
+?ENDBC?
+?MSC?
+#util builds
+CFLAGSU	= $(CDFLAGS) $(CFLAGS) $(CW) $(FLAGOPT) $(CUSTACK)
+#normal build, no PCH
+CFLAGSN = $(CDFLAGS) $(CFLAGS) $(CW) $(FLAGOPT) $(CNSTACK)
+?ENDMSC?
+#no optimizations
+CFLAGNO = $(CNOOPT) $(CFLAGSN)
+
+! IF ("$(PRECOMPHEAD)"!="Y")
+
+CFLAGCO = $(COVLO)
+CFLAGUO = $(COVLO)
+CFLAGC0 = $(COVL0)
+CFLAGU0 = $(COVL0)
+CFLAGC1 = $(COVL1)
+CFLAGU1 = $(COVL1)
+CFLAGC2 = $(COVL2)
+CFLAGU2 = $(COVL2)
+CFLAGC3 = $(COVL3)
+CFLAGU3 = $(COVL3)
+CFLAGCB = $(COVLB)
+CFLAGUB = $(COVLB)
+PCHO =
+PCH0 =
+PCH1 =
+PCH2 =
+PCH3 =
+PCHB =
+
+precomp.msg:
+	@echo Not using precompiled headers...
+
+! ELSE
+
+# .o files
+CFLAGUO	= $(CPCHUSE) $(CPCHNAM)PHO$(CPCHEXT) $(COVLO)
+CFLAGCO	= $(CPCHGEN) $(CPCHNAM)PHO$(CPCHEXT) $(COVLO)
+PCHO = PHO$(CPCHEXT)
+# .0 files
+CFLAGU0	= $(CPCHUSE) $(CPCHNAM)PH0$(CPCHEXT) $(COVL0)
+CFLAGC0	= $(CPCHGEN) $(CPCHNAM)PH0$(CPCHEXT) $(COVL0)
+PCH0 = PH0$(CPCHEXT)
+# .1 files
+CFLAGU1	= $(CPCHUSE) $(CPCHNAM)PH1$(CPCHEXT) $(COVL1)
+CFLAGC1	= $(CPCHGEN) $(CPCHNAM)PH1$(CPCHEXT) $(COVL1)
+PCH1 = PH1$(CPCHEXT)
+# .2 files
+CFLAGU2	= $(CPCHUSE) $(CPCHNAM)PH2$(CPCHEXT) $(COVL2)
+CFLAGC2	= $(CPCHGEN) $(CPCHNAM)PH2$(CPCHEXT) $(COVL2)
+PCH2 = PH2$(CPCHEXT)
+# .3 files
+CFLAGU3	= $(CPCHUSE) $(CPCHNAM)PH3$(CPCHEXT) $(COVL3)
+CFLAGC3	= $(CPCHGEN) $(CPCHNAM)PH3$(CPCHEXT) $(COVL3)
+PCH3 = PH3$(CPCHEXT)
+# .B files
+CFLAGUB	= $(CPCHUSE) $(CPCHNAM)PHB$(CPCHEXT) $(COVLB)
+CFLAGCB	= $(CPCHGEN) $(CPCHNAM)PHB$(CPCHEXT) $(COVLB)
+PCHB = PHB$(CPCHEXT)
+
+precomp.msg:
+	@echo Using precompiled headers...
+
+! ENDIF
+
+
+?BC?
+FLAGCO  = $(CNSTACK) +CFLAGCO.CFG
+FLAGUO  = $(CNSTACK) +CFLAGUO.CFG
+FLAGC0  = $(CNSTACK) +CFLAGC0.CFG
+FLAGU0  = $(CNSTACK) +CFLAGU0.CFG
+FLAGC1  = $(CNSTACK) +CFLAGC1.CFG
+FLAGU1  = $(CNSTACK) +CFLAGU1.CFG
+FLAGC2  = $(CNSTACK) +CFLAGC2.CFG
+FLAGU2  = $(CNSTACK) +CFLAGU2.CFG
+FLAGC3  = $(CNSTACK) +CFLAGC3.CFG
+FLAGU3  = $(CNSTACK) +CFLAGU3.CFG
+FLAGCB  = $(CNSTACK) +CFLAGCB.CFG
+FLAGUB  = $(CNSTACK) +CFLAGUB.CFG
+?ENDBC?
+?MSC?
+FLAGCO  = $(CFLAGSN) $(CFLAGCO)
+FLAGUO  = $(CFLAGSN) $(CFLAGUO)
+FLAGC0  = $(CFLAGSN) $(CFLAGC0)
+FLAGU0  = $(CFLAGSN) $(CFLAGU0)
+FLAGC1  = $(CFLAGSN) $(CFLAGC1)
+FLAGU1  = $(CFLAGSN) $(CFLAGU1)
+FLAGC2  = $(CFLAGSN) $(CFLAGC2)
+FLAGU2  = $(CFLAGSN) $(CFLAGU2)
+FLAGC3  = $(CFLAGSN) $(CFLAGC3)
+FLAGU3  = $(CFLAGSN) $(CFLAGU3)
+FLAGCB  = $(CFLAGSN) $(CFLAGCB)
+FLAGUB  = $(CFLAGSN) $(CFLAGUB)
+?ENDMSC?
+
+# End of Pre-compiled header section
+#===========================================================================
+
+?MSC?
+#
+# Controls whether MOVE tracing is enabled in the executable
+# This should be left commented unless you are tinkering with the
+# overlay structure of NetHack.  The executable runs _very_
+# slowly when the movetr.lib is linked in.
+#
+
+#MOVETR= movetr.lib
+
+# do not change this
+! IF ("$(MOVETR)"!="")
+MVTRCL = $(CDEFINE)MOVE_PROF
+! ELSE
+MVTRCL =
+! ENDIF
+
+?ENDMSC?
+#
+# Linker options for building various things.
+#
+
+LFLAGSU	= $(LDFLAGSU) $(LUSTACK) $(LINIT)
+LFLAGSN	= $(LDFLAGSN) $(LNSTACK) $(LWCASE) $(LMAXSEG) $(INTOVL) $(LMAXALL) \
+	  $(LINFO) $(LINIT) $(LOVL)
+
+#
+# Make Roolz dude.
+# Due to the inadequacy of some makes these must accord with a
+# topological sort of the generated-from relation... output on
+# the left, input on the right. Trust me.
+#
+
+.SUFFIXES:  .exe .0 .1 .2 .3 .B .o .til .uu .c .y .l
+
+#
+# Rules for files in src
+#
+
+
+.c{$(OBJ)}.o:
+	@$(CC) $(FLAGUO) ?[CSNAMOB]$(COBJNAM)$@ $<
+
+{$(SRC)}.c{$(OBJ)}.o:
+	$(CC) $(FLAGUO) ?[CSNAMOB]$(COBJNAM)$@  $<
+
+{$(SRC)}.c{$(OBJ)}.0:
+	$(CC) $(FLAGU0) ?[CSNAM0]$(COBJNAM)$@ $<
+
+{$(SRC)}.c{$(OBJ)}.1:
+	$(CC) $(FLAGU1) ?[CSNAM1]$(COBJNAM)$@ $<
+
+{$(SRC)}.c{$(OBJ)}.2:
+	$(CC) $(FLAGU2) ?[CSNAM2]$(COBJNAM)$@ $<
+
+{$(SRC)}.c{$(OBJ)}.3:
+	$(CC) $(FLAGU3) ?[CSNAM3]$(COBJNAM)$@ $<
+
+{$(SRC)}.c{$(OBJ)}.B:
+	$(CC) $(FLAGUB) ?[CSNAMB]$(COBJNAM)$@ $<
+
+#
+# Rules for files in sys\share
+#
+
+{$(SYS)}.c{$(OBJ)}.o:
+	$(CC) $(FLAGUO) ?[CSNAMOA]$(COBJNAM)$@  $<
+
+{$(SYS)}.c{$(OBJ)}.0:
+	$(CC) $(FLAGU0) ?[CSNAM0]$(COBJNAM)$@ $<
+
+{$(SYS)}.c{$(OBJ)}.1:
+	$(CC) $(FLAGU1) ?[CSNAM1]$(COBJNAM)$@ $<
+
+{$(SYS)}.c{$(OBJ)}.2:
+	$(CC) $(FLAGU2) ?[CSNAM2]$(COBJNAM)$@ $<
+
+{$(SYS)}.c{$(OBJ)}.3:
+	$(CC) $(FLAGU3) ?[CSNAM3]$(COBJNAM)$@ $<
+
+{$(SYS)}.c{$(OBJ)}.B:
+	$(CC) $(FLAGUB) ?[CSNAMB]$(COBJNAM)$@ $<
+
+#
+# Rules for files in sys\msdos
+#
+
+{$(MSYS)}.c{$(OBJ)}.o:
+	$(CC) $(FLAGUO) ?[CSNAMOA]$(COBJNAM)$@  $<
+
+{$(MSYS)}.c{$(OBJ)}.0:
+	$(CC) $(FLAGU0) ?[CSNAM0]$(COBJNAM)$@ $<
+
+{$(MSYS)}.c{$(OBJ)}.1:
+	$(CC) $(FLAGU1) ?[CSNAM1]$(COBJNAM)$@ $<
+
+{$(MSYS)}.c{$(OBJ)}.2:
+	$(CC) $(FLAGU2) ?[CSNAM2]$(COBJNAM)$@ $<
+
+{$(MSYS)}.c{$(OBJ)}.3:
+	$(CC) $(FLAGU3) ?[CSNAM3]$(COBJNAM)$@ $<
+
+{$(MSYS)}.c{$(OBJ)}.B:
+	$(CC) $(FLAGUB) ?[CSNAMB]$(COBJNAM)$@ $<
+
+{$(MSYS)}.h{$(INCL)}.h:
+	@copy $< $@
+
+#
+# Rules for files in util
+#
+
+{$(UTIL)}.c{$(OBJ)}.o:
+	$(CC) $(CFLAGSU) ?[CSNAMOB]$(COBJNAM)$@  $<
+
+#
+# Rules for files in win\share
+#
+
+{$(WSHR)}.c.o:
+	@$(CC) $(FLAGUO) ?[CSNAMOA]$(COBJNAM)$@ $<
+
+{$(WSHR)}.c{$(OBJ)}.o:
+	@$(CC) $(FLAGUO) ?[CSNAMOA]$(COBJNAM)$@ $<
+
+{$(WSHR)}.h{$(INCL)}.h:
+	@copy $< $@
+
+{$(WSHR)}.txt{$(DAT)}.txt:
+	@copy $< $@
+
+#
+# Rules for files in win\tty
+#
+
+{$(WTTY)}.c{$(OBJ)}.o:
+	$(CC) $(FLAGUO) ?[CSNAMOA]$(COBJNAM)$@  $<
+
+{$(WTTY)}.c{$(OBJ)}.0:
+	$(CC) $(FLAGU0) ?[CSNAM0]$(COBJNAM)$@ $<
+
+{$(WTTY)}.c{$(OBJ)}.1:
+	$(CC) $(FLAGU1) ?[CSNAM1]$(COBJNAM)$@ $<
+
+{$(WTTY)}.c{$(OBJ)}.2:
+	$(CC) $(FLAGU2) ?[CSNAM2]$(COBJNAM)$@ $<
+
+{$(WTTY)}.c{$(OBJ)}.3:
+	$(CC) $(FLAGU3) ?[CSNAM3]$(COBJNAM)$@ $<
+
+{$(WTTY)}.c{$(OBJ)}.B:
+	$(CC) $(FLAGUB) ?[CSNAMB]$(COBJNAM)$@ $<
+
+#
+# NETHACK OBJECTS
+#
+# This section creates shorthand macros for many objects
+# referenced later on in the Makefile.
+#
+
+#
+# Shorten up the location for some files
+#
+
+O  = $(OBJ)\				# comment so \ isn't last char
+
+U  = $(UTIL)\				# comment so \ isn't last char
+
+#
+# Utility Objects.
+#
+
+MAKESRC        = $(U)makedefs.c
+
+SPLEVSRC       = $(U)lev_yacc.c	$(U)lev_$(LEX).c $(U)lev_main.c  $(U)panic.c
+
+DGNCOMPSRC     = $(U)dgn_yacc.c	$(U)dgn_$(LEX).c $(U)dgn_main.c
+
+MAKEOBJS       = $(O)makedefs.o	$(O)monst.o	$(O)objects.o
+
+?LIST:SPLEVOBJS?
+		 $(O)lev_yacc.o	$(O)lev_$(LEX).o $(O)lev_main.o
+		 $(O)alloc.o	$(O)decl.o	$(O)drawing.o
+		 $(O)monst.o	$(O)objects.o	$(O)panic.o	$(O)stubvid.o
+?ENDLIST?
+
+?LIST:DGNCOMPOBJS?
+		 $(O)dgn_yacc.o	$(O)dgn_$(LEX).o $(O)dgn_main.o
+		 $(O)alloc.o	$(O)panic.o
+?ENDLIST?
+
+RECOVOBJS      = $(O)recover.o
+
+?LIST:GIFREADERS?
+		 $(O)gifread.o	$(O)alloc.o	$(O)panic.o
+?ENDLIST?
+
+?LIST:TEXT_IO?
+		 $(O)tiletext.o $(O)tiletxt.o	$(O)drawing.o
+		 $(O)decl.o	$(O)monst.o	$(O)objects.o
+		 $(O)stubvid.o
+?ENDLIST?
+
+PPMWRITERS     = $(O)ppmwrite.o	$(O)alloc.o	$(O)panic.o
+
+?LIST:GIFREAD2?
+		 $(O)gifread2.o	$(O)alloc.o	$(O)panic.o
+?ENDLIST?
+
+?LIST:TEXT_IO2?
+		 $(O)tiletex2.o $(O)tiletxt2.o	$(O)drawing.o
+		 $(O)decl.o	$(O)monst.o	$(O)objects.o
+		 $(O)stubvid.o
+?ENDLIST?
+
+PPMWRIT2       = $(O)ppmwrit2.o $(O)alloc.o	$(O)panic.o
+
+TILEFILES      = $(WSHR)\monsters.txt $(WSHR)\objects.txt $(WSHR)\other.txt
+
+TILEFILES2     = $(WSHR)\monthin.txt $(WSHR)\objthin.txt $(WSHR)\oththin.txt
+
+DLBOBJS        = $(O)dlb_main.o $(O)dlb.o $(O)alloc.o $(O)panic.o
+
+#
+#  Object files for the game itself.
+#
+
+OBJ01 =	$(O)alloc.o	$(RANDOM)	$(O)decl.o     	$(O)objects.o	\
+	$(O)muse.o	$(O)display.o	$(O)vision.o	\
+	$(O)rect.o	$(O)vis_tab.o	$(O)monst.o	$(O)wintty.o	\
+	$(O)files.o	$(O)sys.o	$(O)monstr.o	$(O)minion.o	\
+	$(O)worm.o	$(O)detect.o 	$(O)exper.o	$(O)mplayer.o	\
+	$(O)uhitm.o	$(O)pager.o 	$(O)windows.o	$(O)quest.o	\
+	$(O)questpgr.o 	$(O)write.o	$(O)drawing.o	$(O)dokick.o	\
+	$(O)dothrow.o 	$(O)pickup.o	$(O)pray.o	$(O)spell.o 	\
+	$(O)ball.o	$(O)wield.o	$(O)worn.o	$(O)fountain.o	\
+	$(O)music.o	$(O)rumors.o	$(O)dlb.o	$(O)sit.o 	\
+	$(O)bones.o	$(O)mklev.o	$(O)save.o	$(O)restore.o 	\
+	$(O)mkmaze.o	$(O)mkmap.o	$(O)end.o	$(O)o_init.o	\
+	$(O)options.o	$(O)rip.o       $(O)sound.o	$(O)teleport.o	\
+	$(O)topten.o	$(O)tty.o	$(O)u_init.o	$(O)extralev.o 	\
+	$(O)sp_lev.o	$(O)dig.o	$(O)pckeys.o	$(O)role.o	\
+	$(O)steed.o	$(O)region.o
+
+OVL0 =	$(O)allmain.0	$(O)apply.0	$(O)artifact.0	$(O)attrib.0  \
+	$(O)botl.0	$(O)cmd.0	$(O)dbridge.0	$(O)do.0      \
+	$(O)do_name.0	$(O)do_wear.0	$(O)dogmove.0	$(O)dungeon.0 \
+	$(O)eat.0	$(O)engrave.0	$(O)hacklib.0	$(O)invent.0  \
+	$(O)lock.0	$(O)pcmain.0	$(O)mail.0	$(O)makemon.0 \
+	$(O)mcastu.0	$(O)mhitm.0	$(O)mhitu.0	$(O)mkobj.0   \
+	$(O)mkroom.0	$(O)mon.0	$(O)mondata.0	$(O)monmove.0 \
+	$(O)mthrowu.0	$(O)objnam.0	$(O)polyself.0	$(O)priest.0  \
+	$(O)rnd.0	$(O)shknam.0	$(O)sounds.0	$(O)steal.0   \
+	$(O)timeout.0	$(O)track.0	$(O)trap.0	$(O)vault.0   \
+	$(O)weapon.0	$(O)were.0	$(O)wizard.0	$(O)msdos.0   \
+	$(O)termcap.0	$(O)video.0	$(O)vidtxt.0	$(O)zap.0     \
+	$(O)explode.0	$(O)shk.0
+
+OVL1 =	$(O)allmain.1	$(O)apply.1	$(O)artifact.1	$(O)attrib.1 \
+	$(O)botl.1	$(O)cmd.1	$(O)dbridge.1	$(O)do.1     \
+	$(O)do_wear.1	$(O)dog.1	$(O)dungeon.1	$(O)eat.1    \
+	$(O)engrave.1	$(O)hack.1	$(O)hacklib.1	$(O)invent.1 \
+	$(O)makemon.1	$(O)mhitu.1	$(O)mkobj.1	$(O)mon.1    \
+	$(O)mondata.1	$(O)monmove.1	$(O)mthrowu.1	$(O)objnam.1 \
+	$(O)pcmain.1	$(O)polyself.1	$(O)rnd.1	$(O)shk.1    \
+	$(O)steal.1	$(O)timeout.1	$(O)track.1	$(O)trap.1   \
+	$(O)weapon.1	$(O)getline.1	$(O)termcap.1	$(O)topl.1   \
+	$(O)video.1	$(O)zap.1	$(O)explode.1
+
+OVL2 =	$(O)attrib.2	$(O)do.2	$(O)do_name.2	$(O)do_wear.2 \
+	$(O)dog.2	$(O)engrave.2	$(O)hack.2	$(O)hacklib.2 \
+	$(O)invent.2	$(O)makemon.2	$(O)mon.2	$(O)mondata.2 \
+	$(O)monmove.2	$(O)getline.2	$(O)shk.2	$(O)topl.2    \
+	$(O)trap.2	$(O)zap.2
+
+OVL3 =	$(O)do.3	$(O)hack.3	$(O)invent.3	$(O)light.3   \
+	$(O)shk.3	$(O)trap.3	$(O)zap.3
+
+
+OVLB =	$(O)allmain.B	$(O)apply.B	$(O)artifact.B	$(O)attrib.B	\
+	$(O)botl.B	$(O)cmd.B	$(O)dbridge.B	$(O)do.B	\
+	$(O)do_name.B	$(O)do_wear.B	$(O)dog.B	$(O)dogmove.B	\
+	$(O)eat.B	$(O)engrave.B	$(O)hack.B	$(O)hacklib.B	\
+	$(O)invent.B	$(O)lock.B	$(O)mail.B	$(O)makemon.B	\
+	$(O)mcastu.B	$(O)mhitm.B	$(O)mhitu.B	$(O)mkobj.B	\
+	$(O)mkroom.B	$(O)mon.B	$(O)mondata.B	$(O)monmove.B	\
+	$(O)mthrowu.B	$(O)objnam.B	$(O)pcmain.B	$(O)pline.B	\
+	$(O)polyself.B	$(O)potion.B	$(O)priest.B	$(O)read.B	\
+	$(O)rnd.B	$(O)shk.B	$(O)shknam.B	$(O)sounds.B	\
+	$(O)steal.B	$(O)timeout.B	$(O)track.B	$(O)trap.B	\
+	$(O)vault.B	$(O)weapon.B	$(O)were.B	$(O)wizard.B	\
+	$(O)msdos.B	$(O)pcunix.B	$(O)termcap.B	$(O)topl.B	\
+	$(O)video.B	$(O)vidtxt.B	$(O)zap.B
+
+TILOBJ = $(TILEGAME) $(TILEVGA)
+
+VVOBJ =	$(O)version.o
+
+NVOBJ = $(OBJ01)	$(OVL0)		$(OVL1)		$(OVL2) \
+	$(OVL3) 	$(OVLB)		$(TILOBJ)
+
+ALLOBJ= $(NVOBJ) $(VVOBJ) $(OVLINIT)
+
+#
+# Header objects
+#
+
+# This comment copied from sys/unix/Makefile.src,
+# extern.h is ignored, even though its declared function types may affect the
+# compilation of all the .c files, since extern.h changes every time the
+# type of an external function does, and we would spend all our time recompiling
+# if we did not ignore it.
+#EXTERN_H    = $(INCL)\extern.h
+EXTERN_H    =
+PCCONF_H    = $(INCL)\pcconf.h $(INCL)\micro.h $(INCL)\system.h
+PERMONST_H  = $(INCL)\monattk.h $(INCL)\monflag.h $(INCL)\align.h
+YOUPROP_H   = $(INCL)\prop.h $(PERMONST_H) $(INCL)\pm.h $(INCL)\youprop.h \
+	      $(INCL)\mondata.h
+YOU_H	    = $(INCL)\attrib.h $(INCL)\monst.h $(YOUPROP_H) $(INCL)\align.h
+DECL_H      = $(INCL)\quest.h $(INCL)\spell.h $(INCL)\color.h \
+	      $(INCL)\obj.h $(YOU_H) $(INCL)\onames.h $(INCL)\pm.h
+
+CONFIG_H    = $(INCL)\tradstdc.h $(INCL)\coord.h $(PCCONF_H) $(INCL)\config.h
+HACK_H      = $(CONFIG_H) $(INCL)\dungeon.h $(INCL)\align.h $(INCL)\monsym.h \
+              $(INCL)\mkroom.h $(INCL)\objclass.h $(DECL_H) \
+	      $(INCL)\timeout.h $(INCL)\trap.h $(INCL)\flag.h $(INCL)\rm.h \
+	      $(INCL)\vision.h $(INCL)\mondata.h $(INCL)\wintype.h \
+	      $(INCL)\engrave.h $(INCL)\rect.h $(EXTERN_H) \
+	      $(INCL)\winprocs.h $(INCL)\trampoli.h $(INCL)\display.h
+TILE_H      = $(INCL)\tile.h $(INCL)\pctiles.h
+PCVIDEO_H   = $(INCL)\portio.h $(INCL)\pcvideo.h
+ALIGN_H     = $(INCL)\align.h
+ARTIFACT_H  = $(INCL)\artifact.h
+ARTILIST_H  = $(INCL)\artilist.h
+COLOR_H     = $(INCL)\color.h
+DATE_H      = $(INCL)\date.h
+DGN_FILE_H  = $(INCL)\dgn_file.h
+DLB_H	    = $(INCL)\dlb.h
+EMIN_H      = $(INCL)\emin.h
+EPRI_H      = $(INCL)\epri.h
+ESHK_H      = $(INCL)\eshk.h
+EDOG_H      = $(INCL)\edog.h
+FUNC_TAB_H  = $(INCL)\func_tab.h
+LEV_H       = $(INCL)\lev.h
+LEV_COMP_H  = $(INCL)\lev_comp.h
+MAIL_H      = $(INCL)\mail.h
+MFNDPOS_H   = $(INCL)\mfndpos.h
+MONSYM_H    = $(INCL)\monsym.h
+OBJ_H       = $(INCL)\obj.h
+OBJCLASS_H  = $(INCL)\objclass.h
+OBJECTS_H   = $(INCL)\objects.h
+PROP_H      = $(INCL)\prop.h
+QTEXT_H     = $(INCL)\qtext.h
+QUEST_H     = $(INCL)\quest.h
+SP_LEV_H    = $(INCL)\sp_lev.h
+TERMCAP_H   = $(INCL)\tcap.h
+VAULT_H     = $(INCL)\vault.h
+VIS_TAB_H   = $(INCL)\vis_tab.h
+WINTTY_H    = $(INCL)\wintty.h
+
+#
+# In the unix distribution this file is patchlevel.h, make it 8.3 here
+# to avoid an nmake warning under dos.
+#
+
+PATCHLEVEL_H   = $(INCL)\patchlev.h
+
+
+#
+#  The name of the game.
+#
+
+GAMEFILE = $(GAMEDIR)\$(GAME).exe
+
+#
+# make data.base an 8.3 filename to prevent an nmake warning
+#
+
+DATABASE = $(DAT)\data.bas
+
+#######################################################################
+#
+#  TARGETS
+
+#
+#  The main target.
+#
+
+$(GAME): obj.tag envchk $(U)utility.tag $(GAMEFILE)
+	@echo $(GAME) is up to date.
+
+#
+#  Everything
+#
+
+all :	install
+
+install: $(GAME) install.tag
+	@echo Done.
+
+
+install.tag: 	$(DAT)\data	$(DAT)\rumors	$(DAT)\dungeon \
+	 	$(DAT)\oracles	$(DAT)\quest.dat $(DAT)\sp_lev.tag $(DLB)
+! IF ("$(USE_DLB)"=="Y")
+	copy nhdat                $(GAMEDIR)
+	copy $(DAT)\license       $(GAMEDIR)
+! ELSE
+	copy $(DAT)\*.            $(GAMEDIR)
+	copy $(DAT)\*.dat         $(GAMEDIR)
+	copy $(DAT)\*.lev         $(GAMEDIR)
+	copy $(MSYS)\msdoshlp.txt $(GAMEDIR)
+	if exist $(GAMEDIR)\makefile del $(GAMEDIR)\makefile
+! ENDIF
+	copy $(SYS)\termcap       $(GAMEDIR)
+	if exist $(DOC)\guideb*.txt copy $(DOC)\guideb*.txt  $(GAMEDIR)
+	if exist $(DOC)\nethack.txt copy $(DOC)\nethack.txt  $(GAMEDIR)\NetHack.txt
+	if exist $(DOC)\recover.txt copy $(DOC)\recover.txt  $(GAMEDIR)
+	copy $(SYS)\nethack.cnf   $(GAMEDIR)\defaults.nh
+	copy $(U)recover.exe  $(GAMEDIR)
+	if exist *.tib copy *.tib $(GAMEDIR)
+	echo install done > $@
+
+$(DAT)\sp_lev.tag: $(U)utility.tag $(DAT)\bigroom.des  $(DAT)\castle.des \
+	$(DAT)\endgame.des $(DAT)\gehennom.des $(DAT)\knox.des   \
+	$(DAT)\medusa.des  $(DAT)\oracle.des   $(DAT)\tower.des  \
+	$(DAT)\yendor.des  $(DAT)\arch.des     $(DAT)\barb.des   \
+	$(DAT)\caveman.des $(DAT)\elf.des      $(DAT)\healer.des \
+	$(DAT)\knight.des  $(DAT)\priest.des   $(DAT)\rogue.des  \
+	$(DAT)\samurai.des $(DAT)\tourist.des  $(DAT)\valkyrie.des \
+	$(DAT)\wizard.des
+	cd $(DAT)
+	$(U)lev_comp bigroom.des
+	$(U)lev_comp castle.des
+	$(U)lev_comp endgame.des
+	$(U)lev_comp gehennom.des
+	$(U)lev_comp knox.des
+	$(U)lev_comp mines.des
+	$(U)lev_comp medusa.des
+	$(U)lev_comp oracle.des
+	$(U)lev_comp tower.des
+	$(U)lev_comp yendor.des
+	$(U)lev_comp arch.des
+	$(U)lev_comp barb.des
+	$(U)lev_comp caveman.des
+	$(U)lev_comp elf.des
+	$(U)lev_comp healer.des
+	$(U)lev_comp knight.des
+	$(U)lev_comp priest.des
+	$(U)lev_comp rogue.des
+	$(U)lev_comp samurai.des
+	$(U)lev_comp tourist.des
+	$(U)lev_comp valkyrie.des
+	$(U)lev_comp wizard.des
+	cd $(SRC)
+	echo sp_levs done > $(DAT)\sp_lev.tag
+
+$(U)utility.tag: envchk			$(INCL)\date.h	$(INCL)\onames.h \
+		$(INCL)\pm.h 		$(SRC)\monstr.c	$(SRC)\vis_tab.c \
+		$(U)lev_comp.exe	$(VIS_TAB_H) 	$(U)dgn_comp.exe \
+		$(U)recover.exe		$(TILEUTIL)
+             @echo utilities made >$@
+	     @echo utilities made.
+
+tileutil: $(U)gif2txt.exe $(U)txt2ppm.exe
+	@echo Optional tile development utilities are up to date.
+
+?MSC?
+#  The section for linking the NetHack image looks a little strange at
+#  first, especially if you are used to UNIX makes, or NDMAKE.  It is
+#  Microsoft nmake specific, and it gets around the problem of the link
+#  command line being too long for the linker.  An "in-line" linker
+#  response file is generated temporarily.
+#
+#  It takes advantage of the following features of nmake:
+?ENDMSC?
+#
+#  Inline files :
+#			Specifying the "<<" means to start an inline file.
+#                 	Another "<<" at the start of a line closes the
+#                 	inline file.
+#
+?MSC?
+#  Substitution within Macros:
+#                       $(mymacro:string1=string2) replaces every
+#                       occurrence of string1 with string2 in the
+#                       macro mymacro.  Special ascii key codes may be
+#                       used in the substitution text by preceding it
+#                       with ^ as we have done below.  Every occurrence
+#                       of a <tab> in $(ALLOBJ) is replaced by
+#                       <+><return><tab>.
+#
+?ENDMSC?
+#  DO NOT INDENT THE << below!
+#
+
+?MSC?
+$(GAMEFILE) :  $(LNKOPT) $(ALLOBJ)
+?ENDMSC?
+?BC?
+$(GAMEFILE) :  $(ALLOBJ)
+?ENDBC?
+	@echo Linking....
+	$(LINK) $(LFLAGSN) @<<$(GAME).lnk
+?BC?
+		$(ALLOBJ)
+?ENDBC?
+?MSC?
+		$(ALLOBJ:^	=+^
+		)
+?ENDMSC?
+		$(GAMEFILE)
+		$(GAME)
+		$(TERMLIB) $(MOVETR) $(CLIB) $(BCOVL) $(BCMDL)
+?MSC?
+		$(LNKOPT);
+?ENDMSC?
+<<
+	@if exist $(GAMEDIR)\$(GAME).bak del $(GAMEDIR)\$(GAME).bak
+
+#
+# Makedefs Stuff
+#
+
+$(U)makedefs.exe:	$(MAKEOBJS)
+	@$(LINK) $(LFLAGSU) $(MAKEOBJS), $@,, $(CLIB) $(BCMDL);
+
+$(O)makedefs.o: $(CONFIG_H)	    $(PERMONST_H)      $(OBJCLASS_H) \
+		 $(MONSYM_H)    $(QTEXT_H)	$(PATCHLEVEL_H) \
+		 $(U)makedefs.c
+	@$(CC) $(CFLAGSU) $(COBJNAM)$@ $(U)makedefs.c
+
+#
+#  date.h should be remade every time any of the source or include
+#  files is modified.
+#
+
+$(INCL)\date.h : $(U)makedefs.exe
+	$(U)makedefs -v
+	@echo A new $@ has been created.
+
+$(INCL)\onames.h : $(U)makedefs.exe
+	$(U)makedefs -o
+
+$(INCL)\pm.h : $(U)makedefs.exe
+	$(U)makedefs -p
+
+#$(INCL)\trap.h : $(U)makedefs.exe
+#	$(U)makedefs -t
+
+$(SRC)\monstr.c: $(U)makedefs.exe
+	$(U)makedefs -m
+
+$(INCL)\vis_tab.h: $(U)makedefs.exe
+	$(U)makedefs -z
+
+$(SRC)\vis_tab.c: $(U)makedefs.exe
+	$(U)makedefs -z
+
+#
+# Level Compiler Stuff
+#
+
+$(U)lev_comp.exe:  $(SPLEVOBJS)
+	@echo Linking $@...
+?MSC?
+	$(LINK) $(LFLAGSU) @<<$(@B).lnk
+?ENDMSC?
+?BC?
+	$(LINK) $(LFLAGSU) @&&!
+?ENDBC?
+?LINKLIST:SPLEVOBJS?
+		$@
+		$(@B)
+		$(BCMDL);
+?MSC?
+<<
+?ENDMSC?
+?BC?
+!
+?ENDBC?
+
+$(O)lev_yacc.o:  $(HACK_H)   $(SP_LEV_H) $(INCL)\lev_comp.h $(U)lev_yacc.c
+	@$(CC) $(CFLAGSU) $(COBJNAM)$@ $(U)lev_yacc.c
+
+$(O)lev_$(LEX).o:  $(HACK_H)   $(INCL)\lev_comp.h $(SP_LEV_H) \
+	$(U)lev_$(LEX).c
+	$(CC) $(CFLAGSU) $(COBJNAM)$@ $(U)lev_$(LEX).c
+
+$(O)lev_main.o:	$(U)lev_main.c $(HACK_H)   $(SP_LEV_H)
+	@$(CC) $(CFLAGSU) $(COBJNAM)$@ $(U)lev_main.c
+
+$(U)lev_yacc.c $(INCL)\lev_comp.h : $(U)lev_comp.y
+!	IF "$(DO_YACC)"=="YACC_ACT"
+	   $(YACC) -d -l $(U)lev_comp.y
+	   copy $(YTABC) $(U)lev_yacc.c
+	   copy $(YTABH) $(INCL)\lev_comp.h
+	   @del $(YTABC)
+	   @del $(YTABH)
+!	ELSE
+	   @echo.
+	   @echo $(U)lev_comp.y has changed.
+	   @echo To update $(U)lev_yacc.c and $(INCL)\lev_comp.h run $(YACC).
+	   @echo.
+	   @echo For now, we will copy the prebuilt lev_yacc.c
+	   @echo from $(SYS) to $(U)lev_yacc.c, and copy the prebuilt
+	   @echo lev_comp.h from $(SYS) to $(UTIL)\lev_comp.h
+	   @echo and use those.
+	   @echo.
+	   copy $(SYS)\lev_yacc.c $@ >nul
+	   touch $@
+	   copy $(SYS)\lev_comp.h $(INCL)\lev_comp.h >nul
+	   touch $(INCL)\lev_comp.h
+!	ENDIF
+
+$(U)lev_$(LEX).c:  $(U)lev_comp.l
+!	IF "$(DO_LEX)"=="LEX_ACT"
+	   $(LEX) $(FLEXSKEL) $(U)lev_comp.l
+	   copy $(LEXYYC) $@
+	   @del $(LEXYYC)
+!	ELSE
+	   @echo.
+	   @echo $(U)lev_comp.l has changed. To update $@ run $(LEX).
+	   @echo.
+	   @echo For now, we will copy a prebuilt lev_lex.c
+	   @echo from $(SYS) to $@ and use it.
+	   @echo.
+	   copy $(SYS)\lev_lex.c $@ >nul
+	   touch $@
+!	ENDIF
+
+#
+# Dungeon Stuff
+#
+
+$(U)dgn_comp.exe: $(DGNCOMPOBJS)
+    @echo Linking $@...
+?MSC?
+	$(LINK) $(LFLAGSU) @<<$(@B).lnk
+?ENDMSC?
+?BC?
+	$(LINK) $(LFLAGSU) @&&!
+?ENDBC?
+?LINKLIST:DGNCOMPOBJS?
+		$@
+		$(@B)
+		$(BCMDL);
+?MSC?
+<<
+?ENDMSC?
+?BC?
+!
+?ENDBC?
+
+$(O)dgn_yacc.o:	$(HACK_H)   $(DGN_FILE_H) $(INCL)\dgn_comp.h \
+	$(U)dgn_yacc.c
+	@$(CC) $(CFLAGSU) $(COBJNAM)$@ $(U)dgn_yacc.c
+
+$(O)dgn_$(LEX).o: $(HACK_H)   $(DGN_FILE_H)  $(INCL)\dgn_comp.h \
+	$(U)dgn_$(LEX).c
+	@$(CC) $(CFLAGSU) $(COBJNAM)$@ $(U)dgn_$(LEX).c
+
+$(O)dgn_main.o:	$(HACK_H) $(U)dgn_main.c
+	@$(CC) $(CFLAGSU) $(COBJNAM)$@ $(U)dgn_main.c
+
+$(U)dgn_yacc.c $(INCL)\dgn_comp.h : $(U)dgn_comp.y
+!	IF "$(DO_YACC)"=="YACC_ACT"
+	   $(YACC) -d -l $(U)dgn_comp.y
+	   copy $(YTABC) $(U)dgn_yacc.c
+	   copy $(YTABH) $(INCL)\dgn_comp.h
+	   @del $(YTABC)
+	   @del $(YTABH)
+!	ELSE
+	   @echo.
+	   @echo $(U)dgn_comp.y has changed. To update $@ and
+	   @echo $(INCL)\dgn_comp.h run $(YACC).
+	   @echo.
+	   @echo For now, we will copy the prebuilt dgn_yacc.c from
+	   @echo $(SYS) to $(U)dgn_yacc.c, and copy the prebuilt
+	   @echo dgn_comp.h from $(SYS) to $(INCL)\dgn_comp.h 
+	   @echo and use those.
+	   @echo.
+	   copy $(SYS)\dgn_yacc.c $@ >nul
+	   touch $@
+	   copy $(SYS)\dgn_comp.h $(INCL)\dgn_comp.h >nul
+	   touch $(INCL)\dgn_comp.h
+!	ENDIF
+
+$(U)dgn_$(LEX).c:  $(U)dgn_comp.l
+!	IF "$(DO_LEX)"=="LEX_ACT"
+	   $(LEX) $(FLEXSKEL)  $(U)dgn_comp.l
+	   copy $(LEXYYC) $@
+	   @del $(LEXYYC)
+!	ELSE
+	   @echo.
+	   @echo $(U)dgn_comp.l has changed. To update $@ run $(LEX).
+	   @echo.
+	   @echo For now, we will copy a prebuilt dgn_lex.c
+	   @echo from $(SYS) to $@ and use it.
+	   @echo.
+	   copy $(SYS)\dgn_lex.c $@ >nul
+	   touch $@
+!	ENDIF
+
+
+obj.tag:
+	@if not exist $(O)*.* mkdir $(OBJ)
+	@echo directory $(OBJ) created
+	@echo directory $(OBJ) created >$@
+
+?MSC?
+#
+#  The correct switches for the C compiler depend on the CL environment
+#  variable being set correctly.  This will check that it is.
+#  The correct setting needs to be:
+#    CL= /AL /G2 /Oo /Gs /Gt16 /Zp1 /W0 /I..\include /nologo /DMOVERLAY
+#
+
+?ENDMSC?
+envchk: precomp.msg
+?MSC?
+!	IF ("$(CL)"=="")
+!	   MESSAGE The CL environment variable is not defined!
+!	   MESSAGE You must CD $(MSYS) and execute the SETUP.BAT procedure
+!	   MESSAGE ie.        setup MSC
+!	   MESSAGE
+!	   ERROR
+!	ELSE
+	   @echo CL Environment variable is defined:
+	   @echo CL=$(CL)
+!	ENDIF
+?ENDMSC?
+?COMMENT?
+#    CL= /AL /G2 /Oo /Gs /Gt16 /Zp1 /W0 /I..\include /nologo /DMOVERLAY
+?ENDCOMMENT?
+?BC?
+#
+# Borland Configuration File Section
+#
+	@echo Making Borland configuration files...
+	@echo -Y -O -Z -Oe -Ob -Os -Ff -I$(BCINCL);$(INCL) > $(BCCFG)
+	@echo -m$(MODEL) -D__IO_H $(CFLGTOT) -DSTRNCMPI >> $(BCCFG)
+	@type $(BCCFG) > CFLAGCO.CFG
+	@type $(BCCFG) > CFLAGUO.CFG
+	@type $(BCCFG) > CFLAGC0.CFG
+	@type $(BCCFG) > CFLAGU0.CFG
+	@type $(BCCFG) > CFLAGC1.CFG
+	@type $(BCCFG) > CFLAGU1.CFG
+	@type $(BCCFG) > CFLAGC2.CFG
+	@type $(BCCFG) > CFLAGU2.CFG
+	@type $(BCCFG) > CFLAGC3.CFG
+	@type $(BCCFG) > CFLAGU3.CFG
+	@type $(BCCFG) > CFLAGCB.CFG
+	@type $(BCCFG) > CFLAGUB.CFG
+    	@echo -Y $(CFLAGCO) >> CFLAGCO.CFG
+	@echo -Y $(CFLAGUO) >> CFLAGUO.CFG
+	@echo -Y $(CFLAGC0) >> CFLAGC0.CFG
+	@echo -Y $(CFLAGU0) >> CFLAGU0.CFG
+	@echo -Y $(CFLAGC1) >> CFLAGC1.CFG
+	@echo -Y $(CFLAGU1) >> CFLAGU1.CFG
+	@echo -Y $(CFLAGC2) >> CFLAGC2.CFG
+	@echo -Y $(CFLAGU2) >> CFLAGU2.CFG
+	@echo -Y $(CFLAGC3) >> CFLAGC3.CFG
+	@echo -Y $(CFLAGU3) >> CFLAGU3.CFG
+	@echo -Y $(CFLAGCB) >> CFLAGCB.CFG
+	@echo -Y $(CFLAGUB) >> CFLAGUB.CFG
+?ENDBC?
+!	IF "$(TILEGAME)"==""
+	   @echo.
+	   @echo NOTE: This build will NOT include tile support.
+	   @echo.
+!	ELSE
+	   @echo.
+	   @echo This build includes tile support.
+	   @echo.
+!	ENDIF
+
+#
+# SECONDARY TARGETS
+#
+
+#
+# Header files NOT distributed in ..\include
+#
+
+$(INCL)\tile.h: $(WSHR)\tile.h
+	copy $(WSHR)\tile.h $@
+
+$(INCL)\pctiles.h: $(MSYS)\pctiles.h
+	copy $(MSYS)\pctiles.h $@
+
+$(INCL)\pcvideo.h: $(MSYS)\pcvideo.h
+	copy $(MSYS)\pcvideo.h $@
+
+$(INCL)\portio.h: $(MSYS)\portio.h
+	copy $(MSYS)\portio.h $@
+
+#
+#  Recover Utility
+#
+
+$(U)recover.exe: $(RECOVOBJS)
+	@$(LINK) $(LFLAGSU) $(RECOVOBJS),$@,, $(CLIB) $(BCMDL);
+
+#
+#  Tile Mapping
+#
+
+$(SRC)\tile.c: $(U)tilemap.exe
+	@echo A new $@ is being created.
+	@$(U)tilemap
+
+$(U)tilemap.exe: $(O)tilemap.o
+	@$(LINK) $(LFLAGSU) $(O)tilemap.o,$@,, $(CLIB) $(BCMDL);
+
+$(O)tilemap.o:  $(WSHR)\tilemap.c $(HACK_H)
+	$(CC) $(CFLAGSU) $(COBJNAM)$@ $(WSHR)\tilemap.c
+
+
+#
+# Tile Utilities
+#
+
+#
+#  Optional (for development)
+#
+
+
+
+#
+
+$(U)gif2txt.exe: $(GIFREADERS) $(TEXT_IO)
+	@$(LINK) $(LFLAGSU) $(GIFREADERS) $(TEXT_IO),$@,, \
+		$(CLIB) $(BCMDL);
+
+$(U)txt2ppm.exe: $(PPMWRITERS) $(TEXT_IO)
+	@$(LINK) $(LFLAGSU) $(PPMWRITERS) $(TEXT_IO),$@,, \
+		$(CLIB) $(BCMDL);
+
+$(U)gif2txt2.exe: $(GIFREAD2) $(TEXT_IO2)
+	@$(LINK) $(LFLAGSU) $(GIFREAD2) $(TEXT_IO2),$@,, \
+		$(CLIB) $(BCMDL);
+
+$(U)txt2ppm2.exe: $(PPMWRIT2) $(TEXT_IO2)
+	@$(LINK) $(LFLAGSU) $(PPMWRIT2) $(TEXT_IO2),$@,, \
+		$(CLIB) $(BCMDL);
+
+#
+#  Required for tile support
+#
+
+NetHack1.tib: $(TILEFILES) $(U)tile2bin.exe
+	@echo Creating binary tile files (this may take some time)
+	@$(U)tile2bin
+
+NetHackO.tib: thintile.tag $(TILEFILES2) $(U)til2bin2.exe
+	@echo Creating overview binary tile files (this may take some time)
+	@$(U)til2bin2
+
+thintile.tag: $(U)thintile.exe $(TILEFILES)
+	$(U)thintile
+	@echo thintiles created >thintile.tag
+
+$(U)tile2bin.exe: $(O)tile2bin.o $(TEXT_IO)
+    @echo Linking $@...
+?MSC?
+	$(LINK) $(LFLAGSU) @<<$(@B).lnk
+?ENDMSC?
+?BC?
+	$(LINK) $(LFLAGSU) @&&!
+?ENDBC?
+		$(O)tile2bin.o+
+?LINKLIST:TEXT_IO?
+		$@
+		$(@B)
+		$(BCMDL);
+?MSC?
+<<
+?ENDMSC?
+?BC?
+!
+?ENDBC?
+
+$(U)til2bin2.exe: $(O)til2bin2.o $(TEXT_IO2)
+    @echo Linking $@...
+?MSC?
+	$(LINK) $(LFLAGSU) @<<$(@B).lnk
+?ENDMSC?
+?BC?
+	$(LINK) $(LFLAGSU) @&&!
+?ENDBC?
+		$(O)til2bin2.o+
+?LINKLIST:TEXT_IO2?
+		$@
+		$(@B)
+		$(BCMDL);
+?MSC?
+<<
+?ENDMSC?
+?BC?
+!
+?ENDBC?
+
+
+$(U)thintile.exe: $(O)thintile.o
+	@$(LINK) $(LFLAGSU) $(O)thintile.o,$@,, $(CLIB) $(BCMDL);
+
+$(O)thintile.o:  $(HACK_H) $(INCL)\tile.h $(WSHR)\thintile.c
+	$(CC) $(CFLAGSU) $(COBJNAM)$@ $(WSHR)\thintile.c
+
+$(O)tile2bin.o:  $(HACK_H) $(TILE_H) $(PCVIDEO_H)
+	$(CC) $(CFLAGSU) $(COBJNAM)$@ $(MSYS)\tile2bin.c
+
+$(O)til2bin2.o:  $(HACK_H) $(TILE_H) $(PCVIDEO_H)
+	$(CC) $(CFLAGSU) $(CDEFINE)TILE_X=8 $(CDEFINE)OVERVIEW_FILE \
+		$(COBJNAM)$@ $(MSYS)\tile2bin.c
+
+?COMMENT?
+$(U)tile2btb.exe: $(O)tile2btb.o $(GIFREADERS)
+    @echo Linking $@...
+	$(LINK) $(LFLAGSU) @&&!
+		$(O)tile2btb.o+
+?LINKLIST:GIFREADERS?
+		$@
+		$(@B)
+		$(BCMDL) $(BGI_LIB);
+!
+
+$(O)tile2btb.o:  $(HACK_H) $(TILE_H) $(PCVIDEO_H) $(MSYS)\tile2btb.c
+	$(CC) -DBGI_FILE $(CFLAGSU) $(COBJNAM)$@ $(MSYS)\tile2btb.c
+?ENDCOMMENT?
+  
+#
+# DLB stuff
+#
+
+nhdat:	$(U)dlb_main.exe
+	@copy $(MSYS)\msdoshlp.txt $(DAT)
+	@cd $(DAT)
+	@echo data >dlb.lst
+	@echo oracles >>dlb.lst
+	@echo options >>dlb.lst
+	@echo quest.dat >>dlb.lst
+	@echo rumors >>dlb.lst
+	@echo help >>dlb.lst
+	@echo hh >>dlb.lst
+	@echo cmdhelp >>dlb.lst
+	@echo history >>dlb.lst
+	@echo opthelp >>dlb.lst
+	@echo wizhelp >>dlb.lst
+	@echo dungeon >>dlb.lst
+	@echo license >>dlb.lst
+	@echo msdoshlp.txt >>dlb.lst
+	@for %%N in (*.lev) do echo %%N >>dlb.lst
+	$(U)dlb_main cvIf dlb.lst $(SRC)\nhdat
+	@cd $(SRC)
+
+$(U)dlb_main.exe: $(DLBOBJS)
+	@$(LINK) $(LFLAGSU) $(DLBOBJS),$@,, $(CLIB) $(BCMDL);
+
+$(O)dlb_main.o: $(U)dlb_main.c $(INCL)\config.h $(DLB_H)
+	$(CC) $(CFLAGSU) $(COBJNAM)$@ $(U)dlb_main.c
+
+#
+# Housekeeping
+#
+
+spotless: clean
+	rmdir $(OBJ)
+	if exist $(DATE_H)    del $(DATE_H)
+	if exist $(INCL)\onames.h  del $(INCL)\onames.h
+	if exist $(INCL)\pm.h      del $(INCL)\pm.h
+	if exist $(VIS_TAB_H) del $(VIS_TAB_H)
+	if exist $(SRC)\vis_tab.c  del $(SRC)\vis_tab.c
+	if exist $(SRC)\tile.c     del $(SRC)\tile.c
+	if exist $(DAT)\rumors     del $(DAT)\rumors
+	if exist $(DAT)\data		del $(DAT)\data
+	if exist $(DAT)\dungeon		del $(DAT)\dungeon
+	if exist $(DAT)\dungeon.pdf	del $(DAT)\dungeon.pdf
+	if exist $(DAT)\options		del $(DAT)\options
+	if exist $(DAT)\oracles		del $(DAT)\oracles
+	if exist $(DAT)\rumors		del $(DAT)\rumors
+	if exist $(DAT)\quest.dat	del $(DAT)\quest.dat
+	if exist $(DAT)\*.lev		del $(DAT)\*.lev
+	if exist $(DAT)\sp_lev.tag	del $(DAT)\sp_lev.tag
+	if exist $(SRC)\monstr.c        del $(SRC)\monstr.c
+	if exist $(SRC)\vis_tab.c       del $(SRC)\vis_tab.c
+	if exist $(SRC)\$(PLANAR_TIB)   del $(SRC)\$(PLANAR_TIB)
+	if exist $(SRC)\$(OVERVIEW_TIB) del $(SRC)\$(OVERVIEW_TIB)
+	if exist $(U)recover.exe        del $(U)recover.exe
+
+clean:
+	if exist $(O)*.o del $(O)*.o
+	if exist $(O)*.0 del $(O)*.0
+	if exist $(O)*.1 del $(O)*.1
+	if exist $(O)*.2 del $(O)*.2
+	if exist $(O)*.3 del $(O)*.3
+	if exist $(O)*.b del $(O)*.b
+	if exist $(U)utility.tag   del $(U)utility.tag
+	if exist $(U)makedefs.exe  del $(U)makedefs.exe
+	if exist $(U)lev_comp.exe  del $(U)lev_comp.exe
+	if exist $(U)dgn_comp.exe  del $(U)dgn_comp.exe
+	if exist $(U)dlb_main.exe  del $(U)dlb_main.exe
+	if exist $(SRC)\*.lnk      del $(SRC)\*.lnk
+	if exist $(SRC)\*.map      del $(SRC)\*.map
+	if exist $(SRC)\*$(CPCHEXT) del $(SRC)\*$(CPCHEXT)
+?BC?
+	if exist $(SRC)\*.cfg      del $(SRC)\*.cfg
+?ENDBC?
+	if exist $(DAT)\dlb.lst    del $(DAT)\dlb.lst
+
+pch.c:	$(HACK_H)
+	@echo ^#include "hack.h" > $@
+	@echo main(int argc, char *argv[]) >> $@
+	@echo { >> $@
+	@echo } >> $@
+	@echo. >> $@
+
+#
+# OTHER DEPENDENCIES
+#
+
+#
+# Precompiled Header dependencies
+# (We need to force the generation of these at the beginning)
+#
+
+PHO$(CPCHEXT): $(HACK_H) pch.c
+	@echo Generating new precompiled header for .O files
+	@$(CC) $(FLAGCO) pch.c
+PH0$(CPCHEXT): $(HACK_H) pch.c
+	@echo Generating new precompiled header for .0 files
+	@$(CC) $(FLAGC0) pch.c
+PH1$(CPCHEXT): $(HACK_H) pch.c
+	@echo Generating new precompiled header for .1 files
+	@$(CC) $(FLAGC1) pch.c
+PH2$(CPCHEXT): $(HACK_H) pch.c
+	@echo Generating new precompiled header for .2 files
+	@$(CC) $(FLAGC2) pch.c
+PH3$(CPCHEXT): $(HACK_H) pch.c
+	@echo Generating new precompiled header for .3 files
+	@$(CC) $(FLAGC3) pch.c
+PHB$(CPCHEXT): $(HACK_H) pch.c
+	@echo Generating new precompiled header for .B files
+	@$(CC) $(FLAGCB) pch.c
+
+?MSC?
+#
+# Compiler supplied, manually moved file - MOVEINIT.C.
+# - This is only compiled if you selected the alternate overlay
+#   schema3. (MOVEAPI.H must reside in your include search list,
+#   and MOVEINIT.C must be in your src directory).  The patch
+#   in sys/msdos/moveinit.pat must be applied to moveinit.c
+#   MS will not allow us to distribute an already patched version.
+
+$(O)moveinit.o: $(SRC)\moveinit.c
+	$(CC) $(CFLAGSN) $(COBJNAM)$@ $(MVTRCL) $(SRC)\moveinit.c
+
+$(SRC)\moveinit.c:
+	@echo.
+	@echo * CANNOT COMPLETE THE BUILD *
+	@echo You must manually copy moveinit.c and moveinit.h
+	@echo from your Microsoft C Compiler directory tree
+	@echo source/move directory and apply the sys/msdos/moveinit.pat
+	@echo patch to moveinit.c after doing so.
+	@echo.
+?ENDMSC?
+
+?BC?
+# Overlay initialization routines used by pcmain() at startup to
+# determine EMS/XMS memory usage.
+
+# Comment out the following line if you don't want Borland C++ to check for
+# extended memory.
+RECOGNIZE_XMS = $(CDEFINE)RECOGNIZE_XMS
+
+?ENDBC?
+?MSC?
+# Overlay initialization routines used by MOVEINIT.C
+?ENDMSC?
+
+$(O)ovlinit.o: $(MSYS)\ovlinit.c $(HACK_H)
+	$(CC) $(CFLAGSN) $(RECOGNIZE_XMS) $(COBJNAM)$@ $(MSYS)\ovlinit.c
+
+#
+# dat dependencies
+#
+
+$(DAT)\data: $(U)utility.tag    $(DATABASE)
+	$(U)makedefs -d
+
+$(DAT)\rumors: $(U)utility.tag    $(DAT)\rumors.tru   $(DAT)\rumors.fal
+	$(U)makedefs -r
+
+$(DAT)\quest.dat: $(U)utility.tag  $(DAT)\quest.txt
+	$(U)makedefs -q
+
+$(DAT)\oracles: $(U)utility.tag    $(DAT)\oracles.txt
+	$(U)makedefs -h
+
+$(DAT)\dungeon: $(U)utility.tag  $(DAT)\dungeon.def
+	$(U)makedefs -e
+	cd $(DAT)
+	$(U)dgn_comp dungeon.pdf
+	cd $(SRC)
+
+#
+#  Util Dependencies.
+#
+
+$(O)panic.o:   $(U)panic.c $(CONFIG_H)
+	$(CC) $(CFLAGSU) $(COBJNAM)$@ $(U)panic.c
+
+$(O)recover.o: $(CONFIG_H) $(U)recover.c
+	$(CC) $(CFLAGSU) $(COBJNAM)$@ $(U)recover.c
+
+#
+#  from win\share
+#
+
+$(O)tiletxt.o:  $(WSHR)\tilemap.c $(HACK_H)
+	$(CC) $(CFLAGSU) $(CDEFINE)TILETEXT $(COBJNAM)$@ $(WSHR)\tilemap.c
+
+$(O)tiletxt2.o:  $(WSHR)\tilemap.c $(HACK_H)
+	$(CC) $(CFLAGSU) $(CDEFINE)TILETEXT \
+		$(CDEFINE)TILE_X=8 $(COBJNAM)$@ $(WSHR)\tilemap.c
+
+$(O)gifread.o:  $(WSHR)\gifread.c  $(CONFIG_H) $(INCL)\tile.h
+	$(CC) $(CFLAGSU) $(COBJNAM)$@ $(WSHR)\gifread.c
+
+$(O)gifread2.o:  $(WSHR)\gifread.c  $(CONFIG_H) $(INCL)\tile.h
+	$(CC) $(CFLAGSU) $(COBJNAM)$@ $(CDEFINE)TILE_X=8 $(WSHR)\gifread.c
+
+$(O)ppmwrite.o: $(WSHR)\ppmwrite.c $(CONFIG_H) $(INCL)\tile.h
+	$(CC) $(CFLAGSU) $(COBJNAM)$@ $(WSHR)\ppmwrite.c
+
+$(O)ppmwrit2.o: $(WSHR)\ppmwrite.c $(CONFIG_H) $(INCL)\tile.h
+	$(CC) $(CFLAGSU) $(COBJNAM)$@ $(CDEFINE)TILE_X=8 $(WSHR)\ppmwrite.c
+
+$(O)tiletext.o:   $(WSHR)\tiletext.c  $(CONFIG_H) $(INCL)\tile.h
+	$(CC) $(CFLAGSU) $(COBJNAM)$@ $(WSHR)\tiletext.c
+
+$(O)tiletex2.o:   $(WSHR)\tiletext.c  $(CONFIG_H) $(INCL)\tile.h
+	$(CC) $(CFLAGSU) $(CDEFINE)TILE_X=8 $(COBJNAM)$@ $(WSHR)\tiletext.c
+
+#
+#  from win\tty
+#
+
+$(O)getline.1:  $(PCH1) $(WTTY)\getline.c  $(HACK_H) $(WINTTY_H) $(FUNC_TAB_H)
+	$(CC) $(FLAGU1) ?[CSNAM1]$(COBJNAM)$@ $(WTTY)\getline.c
+
+$(O)getline.2:  $(PCH2) $(WTTY)\getline.c  $(HACK_H) $(WINTTY_H) $(FUNC_TAB_H)
+	$(CC) $(FLAGU2) ?[CSNAM2]$(COBJNAM)$@ $(WTTY)\getline.c
+
+$(O)termcap.0:  $(PCH0) $(WTTY)\termcap.c  $(HACK_H) $(WINTTY_H) $(TERMCAP_H)
+	$(CC) $(FLAGU0) ?[CSNAM0]$(COBJNAM)$@ $(WTTY)\termcap.c
+
+$(O)termcap.1:  $(PCH1) $(WTTY)\termcap.c  $(HACK_H) $(WINTTY_H) $(TERMCAP_H)
+	$(CC) $(FLAGU1) ?[CSNAM1]$(COBJNAM)$@ $(WTTY)\termcap.c
+
+$(O)termcap.B:  $(PCHB) $(WTTY)\termcap.c  $(HACK_H) $(WINTTY_H) $(TERMCAP_H)
+	$(CC) $(FLAGUB) ?[CSNAMB]$(COBJNAM)$@ $(WTTY)\termcap.c
+
+$(O)topl.1:     $(PCH1) $(WTTY)\topl.c     $(HACK_H) $(TERMCAP_H) $(WINTTY_H)
+	$(CC) $(FLAGU1) ?[CSNAM1]$(COBJNAM)$@ $(WTTY)\topl.c
+
+$(O)topl.2:     $(PCH2) $(WTTY)\topl.c     $(HACK_H) $(TERMCAP_H) $(WINTTY_H)
+	$(CC) $(FLAGU2) ?[CSNAM2]$(COBJNAM)$@ $(WTTY)\topl.c
+
+$(O)topl.B:     $(PCHB) $(WTTY)\topl.c     $(HACK_H) $(TERMCAP_H) $(WINTTY_H)
+	$(CC) $(FLAGUB) ?[CSNAMB]$(COBJNAM)$@ $(WTTY)\topl.c
+
+$(O)wintty.o: $(PCHO) $(CONFIG_H) $(WTTY)\wintty.c $(PATCHLEVEL_H)
+	$(CC) $(FLAGUO) ?[CSNAMOB]$(COBJNAM)$@ $(WTTY)\wintty.c
+
+#
+# from sys\share
+#
+
+$(O)pcmain.0:   $(PCH0) $(HACK_H) $(SYS)\pcmain.c
+	$(CC)  $(FLAGU0) ?[CSNAM0]$(COBJNAM)$@ $(SYS)\pcmain.c
+
+$(O)pcmain.1:   $(PCH1) $(HACK_H) $(SYS)\pcmain.c
+	$(CC)  $(FLAGU1) ?[CSNAM1]$(COBJNAM)$@ $(SYS)\pcmain.c
+
+$(O)pcmain.B:   $(PCHB) $(HACK_H) $(SYS)\pcmain.c
+	$(CC)  $(FLAGUB) ?[CSNAMB]$(COBJNAM)$@ $(SYS)\pcmain.c
+
+$(O)pcunix.B:   $(PCHB) $(SYS)\pcunix.c   $(HACK_H)
+	$(CC) $(FLAGUB) ?[CSNAMB]$(COBJNAM)$@ $(SYS)\pcunix.c
+
+$(O)tty.o:     $(HACK_H) $(WINTTY_H) $(SYS)\pctty.c
+	$(CC)  $(CFLAGSN) ?[CSNAMOB]$(COBJNAM)$@  $(SYS)\pctty.c
+
+$(O)sys.o:    $(HACK_H) $(SYS)\pcsys.c
+	$(CC)  $(CFLAGSN) ?[CSNAMOB]$(COBJNAM)$@ $(SYS)\pcsys.c
+
+$(O)random.o: $(PCHO) $(HACK_H) $(SYS)\random.c
+	$(CC) $(FLAGUO) ?[CSNAMOB]$(COBJNAM)$@ $(SYS)\random.c
+
+#
+# from sys\msdos
+#
+
+$(O)msdos.0: $(MSYS)\msdos.c   $(HACK_H) $(PCVIDEO_H)
+?BC?
+	$(CC) $(CFLAGSN) $(COVL0) $$($(@B)_0) $(COBJNAM)$@ $(MSYS)\msdos.c
+?ENDBC?
+?MSC?
+	$(CC) $(FLAGU0) $(CCSNAM)$(@F) $(COBJNAM)$@ $(MSYS)\msdos.c
+?ENDMSC?
+?COMMENT?
+	$(CC) $(CFLAGSN) $(COVL0) ?[CSNAM0]$(COBJNAM)$@ $(MSYS)\vidtxt.c
+?ENDCOMMENT?
+
+$(O)msdos.B: $(MSYS)\msdos.c   $(HACK_H) $(PCVIDEO_H)
+?BC?
+	$(CC) $(CFLAGSN) $(COVLB) $$($(@B)_b) $(COBJNAM)$@ $(MSYS)\msdos.c
+?ENDBC?
+?MSC?
+	$(CC) $(FLAGUB) $(CCSNAM)$(@F) $(COBJNAM)$@ $(MSYS)\msdos.c
+?ENDMSC?
+?COMMENT?
+	$(CC) $(CFLAGSN) $(COVLB) ?[CSNAMB]$(COBJNAM)$@ $(MSYS)\vidtxt.c
+?ENDCOMMENT?
+
+$(O)pctiles.0: $(PCH0) $(MSYS)\pctiles.c $(HACK_H) $(TILE_H) $(PCVIDEO_H)
+	$(CC) $(FLAGU0) ?[CSNAM0]$(COBJNAM)$@ $(MSYS)\pctiles.c
+
+$(O)pctiles.B: $(PCHB) $(MSYS)\pctiles.c $(HACK_H) $(TILE_H) $(PCVIDEO_H)
+	$(CC) $(FLAGUB) ?[CSNAMB]$(COBJNAM)$@ $(MSYS)\pctiles.c
+
+$(O)sound.o: $(PCH0) $(MSYS)\sound.c   $(HACK_H) $(INCL)\portio.h
+	$(CC) $(FLAGUO) ?[CSNAMOB]$(COBJNAM)$@ $(MSYS)\sound.c
+
+$(O)pckeys.o: $(PCHO) $(MSYS)\pckeys.c   $(HACK_H) $(PCVIDEO_H)
+	$(CC) $(FLAGUO) ?[CSNAMOB]$(COBJNAM)$@ $(MSYS)\pckeys.c
+
+$(O)stubvid.o : $(MSYS)\video.c $(HACK_H)
+	$(CC) $(FLAGUO) $(CDEFINE)STUBVIDEO ?[CSNAMOB]$(COBJNAM)$@ $(MSYS)\video.c
+
+$(O)video.0: $(PCH0) $(MSYS)\video.c   $(HACK_H) $(WINTTY_H) $(PCVIDEO_H) \
+                $(TILE_H)
+	$(CC) $(FLAGU0) ?[CSNAM0]$(COBJNAM)$@ $(MSYS)\video.c
+
+$(O)video.1: $(PCH1) $(MSYS)\video.c   $(HACK_H) $(WINTTY_H) $(PCVIDEO_H) \
+                $(TILE_H)
+	$(CC) $(FLAGU1) ?[CSNAM1]$(COBJNAM)$@ $(MSYS)\video.c
+
+$(O)video.B: $(PCHB) $(MSYS)\video.c   $(HACK_H) $(WINTTY_H) $(PCVIDEO_H) \
+                $(TILE_H)
+	$(CC) $(FLAGUB) ?[CSNAMB]$(COBJNAM)$@ $(MSYS)\video.c
+
+$(O)vidtxt.0: $(MSYS)\vidtxt.c  $(HACK_H) $(WINTTY_H) $(PCVIDEO_H)
+?BC?
+	$(CC) $(CFLAGSN) $(COVL0) $$($(@B)_0) $(COBJNAM)$@ $(MSYS)\vidtxt.c
+?ENDBC?
+?MSC?
+	$(CC) $(FLAGU0) $(CCSNAM)$(@F) $(COBJNAM)$@ $(MSYS)\vidtxt.c
+?ENDMSC?
+?COMMENT?
+	$(CC) $(CFLAGSN) $(COVL0) ?[CSNAM0]$(COBJNAM)$@ $(MSYS)\vidtxt.c
+?ENDCOMMENT?
+
+$(O)vidtxt.B: $(MSYS)\vidtxt.c  $(HACK_H) $(WINTTY_H) $(PCVIDEO_H)
+?BC?
+	$(CC) $(CFLAGSN) $(COVLB) $$($(@B)_b) $(COBJNAM)$@ $(MSYS)\vidtxt.c
+?ENDBC?
+?MSC?
+	$(CC) $(FLAGUB) $(CCSNAM)$(@F) $(COBJNAM)$@ $(MSYS)\vidtxt.c
+?ENDMSC?
+?COMMENT?
+	$(CC) $(CFLAGSN) $(COVLB) ?[CSNAMB]$(COBJNAM)$@ $(MSYS)\vidtxt.c
+?ENDCOMMENT?
+
+$(O)vidvga.0: $(PCH0) $(MSYS)\vidvga.c  $(HACK_H) $(WINTTY_H) $(PCVIDEO_H) \
+		$(TILE_H)
+	$(CC) $(FLAGU0) ?[CSNAM0]$(COBJNAM)$@ $(MSYS)\vidvga.c
+
+$(O)vidvga.1: $(PCH1) $(MSYS)\vidvga.c  $(HACK_H) $(WINTTY_H) $(PCVIDEO_H) \
+		$(TILE_H)
+	$(CC) $(FLAGU1) ?[CSNAM0]$(COBJNAM)$@ $(MSYS)\vidvga.c
+
+$(O)vidvga.2: $(PCH2) $(MSYS)\vidvga.c  $(HACK_H) $(WINTTY_H) $(PCVIDEO_H) \
+		$(TILE_H)
+	$(CC) $(FLAGU2) ?[CSNAM0]$(COBJNAM)$@ $(MSYS)\vidvga.c
+
+$(O)vidvga.B: $(PCHB) $(MSYS)\vidvga.c  $(HACK_H) $(WINTTY_H) $(PCVIDEO_H) \
+		$(TILE_H)
+	$(CC) $(FLAGUB) ?[CSNAMB]$(COBJNAM)$@ $(MSYS)\vidvga.c
+
+#
+# from src
+#
+
+$(O)alloc.o:     $(SRC)\alloc.c    $(CONFIG_H)
+	$(CC) $(CFLAGSN) ?[CSNAMOB]$(COBJNAM)$@ $(SRC)\alloc.c
+$(O)ball.o:      $(PCHO) $(SRC)\ball.c     $(HACK_H)
+$(O)bones.o:     $(PCHO) $(SRC)\bones.c    $(HACK_H) $(LEV_H)
+$(O)decl.o:      $(PCHO) $(SRC)\decl.c     $(HACK_H) $(QUEST_H)
+$(O)detect.o:    $(PCHO) $(SRC)\detect.c   $(HACK_H) $(ARTIFACT_H)
+$(O)dig.o:	 $(PCHO) $(SRC)\dig.c	   $(HACK_H) $(EDOG_H) # check dep
+$(O)display.o:	 $(PCHO) $(SRC)\display.c  $(HACK_H)
+$(O)dlb.o:	 $(SRC)\dlb.c	   $(DLB_H) $(HACK_H)
+	$(CC) $(CFLAGSN) ?[CSNAMOB]$(COBJNAM)$@ $(SRC)\dlb.c
+$(O)dokick.o:    $(PCHO) $(SRC)\dokick.c   $(HACK_H) $(ESHK_H)
+$(O)dothrow.o:   $(PCHO) $(SRC)\dothrow.c  $(HACK_H)
+$(O)drawing.o:   $(SRC)\drawing.c  $(HACK_H) $(TERMCAP_H)
+	$(CC) $(CFLAGSN) ?[CSNAMOB]$(COBJNAM)$@ $(SRC)\drawing.c
+$(O)end.o:       $(SRC)\end.c      $(HACK_H) $(ESHK_H) $(DLB_H)
+	$(CC) $(CFLAGSN) ?[CSNAMOB]$(COBJNAM)$@ $(SRC)\end.c
+$(O)exper.o:     $(PCHO) $(SRC)\exper.c    $(HACK_H)
+$(O)extralev.o:  $(PCHO) $(SRC)\extralev.c $(HACK_H)
+$(O)files.o:	 $(PCHO) $(SRC)\files.c    $(HACK_H) $(DLB_H)
+$(O)fountain.o:  $(PCHO) $(SRC)\fountain.c $(HACK_H)
+$(O)minion.o:    $(PCHO) $(SRC)\minion.c   $(HACK_H) $(EMIN_H) $(EPRI_H)
+$(O)mklev.o:     $(PCHO) $(SRC)\mklev.c    $(HACK_H)
+$(O)mkmap.o:     $(PCHO) $(SRC)\mkmap.c    $(HACK_H) $(SP_LEV_H)
+$(O)mkmaze.o:	 $(PCHO) $(SRC)\mkmaze.c   $(HACK_H) $(SP_LEV_H) $(LEV_H)
+$(O)monst.o:     $(SRC)\monst.c    $(CONFIG_H) $(PERMONST_H) $(MONSYM_H) \
+		 $(ESHK_H) $(EPRI_H) $(COLOR_H) $(ALIGN_H)
+	$(CC) $(CFLAGSN) ?[CSNAMOB]$(COBJNAM)$@ $(SRC)\monst.c
+$(O)monstr.o:    $(SRC)\monstr.c   $(CONFIG_H)
+	$(CC) $(CFLAGSN) ?[CSNAMOB]$(COBJNAM)$@ $(SRC)\monstr.c
+$(O)mplayer.o:   $(PCHO) $(SRC)\mplayer.c  $(HACK_H)
+$(O)muse.o:      $(PCHO) $(SRC)\muse.c     $(HACK_H)
+$(O)music.o:     $(PCHO) $(SRC)\music.c    $(HACK_H)
+$(O)o_init.o:	 $(PCHO) $(SRC)\o_init.c   $(HACK_H) $(LEV_H)
+$(O)objects.o:   $(SRC)\objects.c  $(CONFIG_H) $(OBJ_H) $(OBJCLASS_H) \
+                 $(PROP_H) $(COLOR_H)
+	$(CC) $(CFLAGSN) ?[CSNAMOB]$(COBJNAM)$@ $(SRC)\objects.c
+$(O)options.o:	 $(SRC)\options.c  $(HACK_H) $(TERMCAP_H) $(OBJCLASS_H)
+	$(CC) $(CFLAGSN) ?[CSNAMOB]$(COBJNAM)$@ $(SRC)\options.c
+$(O)pager.o:	 $(SRC)\pager.c    $(HACK_H) $(DLB_H)
+	$(CC) $(CFLAGNO) $(COBJNAM)$@ ?[CSNAMOA]$(SRC)\pager.c
+$(O)pickup.o:    $(PCHO) $(SRC)\pickup.c   $(HACK_H)
+$(O)pray.o:      $(PCHO) $(SRC)\pray.c     $(HACK_H) $(EPRI_H)
+$(O)quest.o:     $(PCHO) $(SRC)\quest.c    $(HACK_H) $(QUEST_H) $(QTEXT_H)
+$(O)questpgr.o:  $(PCHO) $(SRC)\questpgr.c $(HACK_H) $(QTEXT_H) $(DLB_H)
+$(O)rect.o:      $(PCHO) $(SRC)\rect.c     $(HACK_H)
+$(O)region.o:    $(PCHO) $(SRC)\region.c   $(HACK_H)
+$(O)restore.o:   $(PCHO) $(SRC)\restore.c  $(HACK_H) $(LEV_H) $(TERMCAP_H) \
+		 $(QUEST_H)
+$(O)rip.o:       $(PCHO) $(SRC)\rip.c      $(HACK_H)
+$(O)role.o:	   $(PCHO) $(SRC)\role.c     $(HACK_H)
+$(O)rumors.o:	 $(PCHO) $(SRC)\rumors.c   $(HACK_H) $(DLB_H)
+$(O)save.o:      $(PCHO) $(SRC)\save.c     $(HACK_H) $(LEV_H) $(QUEST_H)
+$(O)sit.o:       $(PCHO) $(SRC)\sit.c      $(HACK_H) $(ARTIFACT_H)
+$(O)steed.o:	   $(PCHO) $(SRC)\steed.c    $(HACK_H)
+$(O)sp_lev.o:	 $(PCHO) $(SRC)\sp_lev.c   $(HACK_H) $(SP_LEV_H) $(DLB_H)
+$(O)spell.o:     $(PCHO) $(SRC)\spell.c    $(HACK_H)
+$(O)teleport.o:  $(PCHO) $(SRC)\teleport.c $(HACK_H)	# check dep
+$(O)tile.o:      $(PCHO) $(SRC)\tile.c     $(HACK_H)
+$(O)topten.o:	 $(PCHO) $(SRC)\topten.c   $(HACK_H) $(DLB_H) $(PATCHLEVEL_H)
+$(O)u_init.o:    $(PCHO) $(SRC)\u_init.c   $(HACK_H)
+$(O)uhitm.o:     $(PCHO) $(SRC)\uhitm.c    $(HACK_H)
+$(O)version.o:   $(PCHO) $(SRC)\version.c  $(HACK_H) $(PATCHLEVEL_H)
+$(O)vision.o:    $(PCHO) $(SRC)\vision.c   $(HACK_H) $(VIS_TAB_H)
+$(O)vis_tab.o:   $(SRC)\vis_tab.c  $(HACK_H) $(VIS_TAB_H)
+	$(CC) $(CFLAGSN) ?[CSNAMOB]$(COBJNAM)$@ $(SRC)\vis_tab.c
+$(O)wield.o:     $(PCHO) $(SRC)\wield.c    $(HACK_H)
+$(O)windows.o:   $(PCHO) $(SRC)\windows.c  $(HACK_H) $(WINTTY_H)
+$(O)worm.o:      $(PCHO) $(SRC)\worm.c     $(HACK_H) $(LEV_H)
+$(O)worn.o:      $(PCHO) $(SRC)\worn.c     $(HACK_H)
+$(O)write.o:     $(PCHO) $(SRC)\write.c    $(HACK_H)
+
+#
+# Overlays
+#
+
+# OVL0
+#
+
+$(O)allmain.0:  $(PCH0) $(SRC)\allmain.c  $(HACK_H)
+$(O)apply.0:    $(PCH0) $(SRC)\apply.c    $(HACK_H) $(EDOG_H)
+$(O)artifact.0: $(PCH0) $(SRC)\artifact.c $(HACK_H) $(ARTIFACT_H) $(ARTILIST_H)
+$(O)attrib.0:   $(PCH0) $(SRC)\attrib.c   $(HACK_H)
+$(O)botl.0:     $(PCH0) $(SRC)\botl.c     $(HACK_H)
+$(O)cmd.0:      $(PCH0) $(SRC)\cmd.c      $(HACK_H) $(FUNC_TAB_H)
+$(O)dbridge.0:  $(PCH0) $(SRC)\dbridge.c  $(HACK_H)
+$(O)do.0:       $(PCH0) $(SRC)\do.c       $(HACK_H) $(LEV_H)
+$(O)do_name.0:  $(PCH0) $(SRC)\do_name.c  $(HACK_H)
+$(O)do_wear.0:  $(PCH0) $(SRC)\do_wear.c  $(HACK_H)
+$(O)dogmove.0:  $(PCH0) $(SRC)\dogmove.c  $(HACK_H) $(MFNDPOS_H) $(EDOG_H)
+$(O)dungeon.0:	$(PCH0) $(SRC)\dungeon.c  $(HACK_H) $(ALIGN_H) $(DGN_FILE_H) \
+		$(DLB_H)
+$(O)eat.0:      $(PCH0) $(SRC)\eat.c      $(HACK_H)
+$(O)engrave.0:  $(PCH0) $(SRC)\engrave.c  $(HACK_H) $(LEV_H)
+$(O)explode.0:  $(PCH0) $(SRC)\explode.c  $(HACK_H)
+$(O)hacklib.0:  $(PCH0) $(SRC)\hacklib.c  $(HACK_H)
+$(O)invent.0:   $(PCH0) $(SRC)\invent.c   $(HACK_H) $(ARTIFACT_H)
+$(O)lock.0:     $(PCH0) $(SRC)\lock.c     $(HACK_H)
+$(O)mail.0:     $(PCH0) $(SRC)\mail.c     $(HACK_H) $(MAIL_H) $(PATCHLEVEL_H)
+$(O)makemon.0:  $(PCH0) $(SRC)\makemon.c  $(HACK_H) $(EPRI_H) $(EMIN_H)
+$(O)mcastu.0:   $(PCH0) $(SRC)\mcastu.c   $(HACK_H)
+$(O)mhitm.0:    $(PCH0) $(SRC)\mhitm.c    $(HACK_H) $(ARTIFACT_H) $(EDOG_H)
+$(O)mhitu.0:    $(PCH0) $(SRC)\mhitu.c    $(HACK_H) $(ARTIFACT_H) $(EDOG_H)
+$(O)mkobj.0:    $(PCH0) $(SRC)\mkobj.c    $(HACK_H) $(ARTIFACT_H) $(PROP_H)
+$(O)mkroom.0:   $(PCH0) $(SRC)\mkroom.c   $(HACK_H)
+$(O)mon.0:      $(PCH0) $(SRC)\mon.c      $(HACK_H) $(MFNDPOS_H) $(EDOG_H)
+$(O)mondata.0:  $(PCH0) $(SRC)\mondata.c  $(HACK_H) $(ESHK_H) $(EPRI_H)
+$(O)monmove.0:  $(PCH0) $(SRC)\monmove.c  $(HACK_H) $(MFNDPOS_H) $(ARTIFACT_H)
+$(O)mthrowu.0:  $(PCH0) $(SRC)\mthrowu.c  $(HACK_H)
+$(O)objnam.0:   $(PCH0) $(SRC)\objnam.c   $(HACK_H)
+$(O)polyself.0: $(PCH0) $(SRC)\polyself.c $(HACK_H)
+$(O)priest.0:   $(PCH0) $(SRC)\priest.c   $(HACK_H) $(MFNDPOS_H) $(ESHK_H) \
+		$(EPRI_H) $(EMIN_H)
+$(O)rnd.0:      $(PCH0) $(SRC)\rnd.c      $(HACK_H)
+$(O)shk.0:      $(PCH0) $(SRC)\shk.c      $(HACK_H) $(ESHK_H)
+$(O)shknam.0:   $(PCH0) $(SRC)\shknam.c   $(HACK_H) $(ESHK_H)
+$(O)sounds.0:   $(PCH0) $(SRC)\sounds.c   $(HACK_H) $(EDOG_H)
+$(O)steal.0:    $(PCH0) $(SRC)\steal.c    $(HACK_H)
+$(O)timeout.0:	$(PCH0) $(SRC)\timeout.c  $(HACK_H) $(LEV_H)
+$(O)track.0:    $(PCH0) $(SRC)\track.c    $(HACK_H)
+$(O)trap.0:     $(PCH0) $(SRC)\trap.c     $(HACK_H)
+$(O)vault.0:    $(PCH0) $(SRC)\vault.c    $(HACK_H) $(VAULT_H)
+$(O)weapon.0:   $(PCH0) $(SRC)\weapon.c   $(HACK_H)
+$(O)were.0:     $(PCH0) $(SRC)\were.c     $(HACK_H)
+$(O)wizard.0:   $(PCH0) $(SRC)\wizard.c   $(HACK_H) $(QTEXT_H)
+$(O)zap.0:      $(PCH0) $(SRC)\zap.c      $(HACK_H)
+
+#
+# OVL1
+#
+
+$(O)allmain.1:  $(PCH1) $(SRC)\allmain.c  $(HACK_H)
+$(O)apply.1:    $(PCH1) $(SRC)\apply.c    $(HACK_H) $(EDOG_H)
+$(O)artifact.1: $(PCH1) $(SRC)\artifact.c $(HACK_H) $(ARTIFACT_H) $(ARTILIST_H)
+$(O)attrib.1:   $(PCH1) $(SRC)\attrib.c   $(HACK_H)
+$(O)botl.1:     $(PCH1) $(SRC)\botl.c     $(HACK_H)
+$(O)cmd.1:      $(PCH1) $(SRC)\cmd.c      $(HACK_H) $(FUNC_TAB_H)
+$(O)dbridge.1:  $(PCH1) $(SRC)\dbridge.c  $(HACK_H)
+$(O)do.1:       $(PCH1) $(SRC)\do.c       $(HACK_H) $(LEV_H)
+$(O)do_wear.1:  $(PCH1) $(SRC)\do_wear.c  $(HACK_H)
+$(O)dog.1:      $(PCH1) $(SRC)\dog.c      $(HACK_H) $(EDOG_H)
+$(O)dungeon.1:	$(PCH1) $(SRC)\dungeon.c  $(HACK_H) $(ALIGN_H) $(DGN_FILE_H) $(DLB_H)
+$(O)eat.1:      $(PCH1) $(SRC)\eat.c      $(HACK_H)
+$(O)engrave.1:  $(PCH1) $(SRC)\engrave.c  $(HACK_H) $(LEV_H)
+$(O)explode.1:  $(PCH1) $(SRC)\explode.c  $(HACK_H)
+$(O)hack.1:     $(PCH1) $(SRC)\hack.c     $(HACK_H)
+$(O)hacklib.1:  $(PCH1) $(SRC)\hacklib.c  $(HACK_H)
+$(O)invent.1:   $(PCH1) $(SRC)\invent.c   $(HACK_H) $(ARTIFACT_H)
+$(O)makemon.1:  $(PCH1) $(SRC)\makemon.c  $(HACK_H) $(EPRI_H) $(EMIN_H)
+$(O)mhitu.1:    $(PCH1) $(SRC)\mhitu.c    $(HACK_H) $(ARTIFACT_H) $(EDOG_H)
+$(O)mkobj.1:    $(PCH1) $(SRC)\mkobj.c    $(HACK_H) $(ARTIFACT_H) $(PROP_H)
+$(O)mon.1:      $(PCH1) $(SRC)\mon.c      $(HACK_H) $(MFNDPOS_H) $(EDOG_H)
+$(O)mondata.1:  $(PCH1) $(SRC)\mondata.c  $(HACK_H) $(ESHK_H) $(EPRI_H)
+$(O)monmove.1:  $(PCH1) $(SRC)\monmove.c  $(HACK_H) $(MFNDPOS_H) $(ARTIFACT_H)
+$(O)mthrowu.1:  $(PCH1) $(SRC)\mthrowu.c  $(HACK_H)
+$(O)objnam.1:   $(PCH1) $(SRC)\objnam.c   $(HACK_H)
+$(O)polyself.1: $(PCH1) $(SRC)\polyself.c $(HACK_H)
+$(O)rnd.1:      $(PCH1) $(SRC)\rnd.c      $(HACK_H)
+$(O)shk.1:      $(PCH1) $(SRC)\shk.c      $(HACK_H) $(ESHK_H)
+$(O)steal.1:    $(PCH1) $(SRC)\steal.c    $(HACK_H)
+$(O)timeout.1:	$(PCH1) $(SRC)\timeout.c  $(HACK_H) $(LEV_H)
+$(O)track.1:    $(PCH1) $(SRC)\track.c    $(HACK_H)
+$(O)trap.1:     $(PCH1) $(SRC)\trap.c     $(HACK_H)
+$(O)weapon.1:   $(PCH1) $(SRC)\weapon.c   $(HACK_H)
+$(O)zap.1:      $(PCH1) $(SRC)\zap.c      $(HACK_H)
+
+#
+# OVL2
+#
+
+$(O)attrib.2:   $(PCH2) $(SRC)\attrib.c   $(HACK_H)
+$(O)do.2:       $(PCH2) $(SRC)\do.c       $(HACK_H) $(LEV_H)
+$(O)do_name.2:  $(PCH2) $(SRC)\do_name.c  $(HACK_H)
+$(O)do_wear.2:  $(PCH2) $(SRC)\do_wear.c  $(HACK_H)
+$(O)dog.2:      $(PCH2) $(SRC)\dog.c      $(HACK_H) $(EDOG_H)
+$(O)engrave.2:  $(PCH2) $(SRC)\engrave.c  $(HACK_H) $(LEV_H)
+$(O)hack.2:     $(PCH2) $(SRC)\hack.c     $(HACK_H)
+$(O)hacklib.2:  $(PCH2) $(SRC)\hacklib.c  $(HACK_H)
+$(O)invent.2:   $(PCH2) $(SRC)\invent.c   $(HACK_H) $(ARTIFACT_H)
+$(O)makemon.2:  $(PCH2) $(SRC)\makemon.c  $(HACK_H) $(EPRI_H) $(EMIN_H)
+$(O)mon.2:      $(PCH2) $(SRC)\mon.c      $(HACK_H) $(MFNDPOS_H) $(EDOG_H)
+$(O)mondata.2:  $(PCH2) $(SRC)\mondata.c  $(HACK_H) $(ESHK_H) $(EPRI_H)
+$(O)monmove.2:  $(PCH2) $(SRC)\monmove.c  $(HACK_H) $(MFNDPOS_H) $(ARTIFACT_H)
+$(O)shk.2:      $(PCH2) $(SRC)\shk.c      $(HACK_H) $(ESHK_H)
+$(O)trap.2:     $(PCH2) $(SRC)\trap.c     $(HACK_H)
+$(O)zap.2:      $(PCH2) $(SRC)\zap.c      $(HACK_H)
+
+#
+# OVL3
+#
+
+$(O)do.3:       $(PCH3) $(SRC)\do.c       $(HACK_H) $(LEV_H)
+$(O)hack.3:     $(PCH3) $(SRC)\hack.c     $(HACK_H)
+$(O)invent.3:	$(PCH3) $(SRC)\invent.c   $(HACK_H) $(ARTIFACT_H)
+$(O)light.3:	$(PCH3) $(SRC)\light.c	  $(HACK_H)
+$(O)shk.3:      $(PCH3) $(SRC)\shk.c      $(HACK_H) $(ESHK_H)
+$(O)trap.3:     $(PCH3) $(SRC)\trap.c     $(HACK_H)
+$(O)zap.3:      $(PCH3) $(SRC)\zap.c      $(HACK_H)
+
+#
+# OVLB
+#
+
+$(O)allmain.B:  $(PCHB) $(SRC)\allmain.c  $(HACK_H)
+$(O)apply.B:    $(PCHB) $(SRC)\apply.c    $(HACK_H) $(EDOG_H)
+$(O)artifact.B: $(PCHB) $(SRC)\artifact.c $(HACK_H) $(ARTIFACT_H) $(ARTILIST_H)
+$(O)attrib.B:   $(PCHB) $(SRC)\attrib.c   $(HACK_H)
+$(O)botl.B:     $(PCHB) $(SRC)\botl.c     $(HACK_H)
+$(O)cmd.B:      $(PCHB) $(SRC)\cmd.c      $(HACK_H) $(FUNC_TAB_H)
+$(O)dbridge.B:  $(PCHB) $(SRC)\dbridge.c  $(HACK_H)
+$(O)do.B:       $(PCHB) $(SRC)\do.c       $(HACK_H) $(LEV_H)
+$(O)do_name.B:  $(PCHB) $(SRC)\do_name.c  $(HACK_H)
+$(O)do_wear.B:  $(PCHB) $(SRC)\do_wear.c  $(HACK_H)
+$(O)dog.B:      $(PCHB) $(SRC)\dog.c      $(HACK_H) $(EDOG_H)
+$(O)dogmove.B:  $(PCHB) $(SRC)\dogmove.c  $(HACK_H) $(MFNDPOS_H) $(EDOG_H)
+$(O)eat.B:      $(PCHB) $(SRC)\eat.c      $(HACK_H)
+$(O)engrave.B:  $(PCHB) $(SRC)\engrave.c  $(HACK_H) $(LEV_H)
+$(O)hack.B:     $(PCHB) $(SRC)\hack.c     $(HACK_H)
+$(O)hacklib.B:  $(PCHB) $(SRC)\hacklib.c  $(HACK_H)
+$(O)invent.B:   $(PCHB) $(SRC)\invent.c   $(HACK_H) $(ARTIFACT_H)
+$(O)lock.B:     $(PCHB) $(SRC)\lock.c     $(HACK_H)
+$(O)mail.B:     $(PCHB) $(SRC)\mail.c     $(HACK_H) $(MAIL_H) $(PATCHLEVEL_H)
+$(O)makemon.B:  $(PCHB) $(SRC)\makemon.c  $(HACK_H) $(EPRI_H) $(EMIN_H)
+$(O)mcastu.B:   $(PCHB) $(SRC)\mcastu.c   $(HACK_H)
+$(O)mhitm.B:    $(PCHB) $(SRC)\mhitm.c    $(HACK_H) $(ARTIFACT_H) $(EDOG_H)
+$(O)mhitu.B:    $(PCHB) $(SRC)\mhitu.c    $(HACK_H) $(ARTIFACT_H) $(EDOG_H)
+$(O)mkobj.B:    $(PCHB) $(SRC)\mkobj.c    $(HACK_H) $(ARTIFACT_H) $(PROP_H)
+$(O)mkroom.B:   $(PCHB) $(SRC)\mkroom.c   $(HACK_H)
+$(O)mon.B:      $(PCHB) $(SRC)\mon.c      $(HACK_H) $(MFNDPOS_H) $(EDOG_H)
+$(O)mondata.B:  $(PCHB) $(SRC)\mondata.c  $(HACK_H) $(ESHK_H) $(EPRI_H)
+$(O)monmove.B:  $(PCHB) $(SRC)\monmove.c  $(HACK_H) $(MFNDPOS_H) $(ARTIFACT_H)
+$(O)mthrowu.B:  $(PCHB) $(SRC)\mthrowu.c  $(HACK_H)
+$(O)objnam.B:   $(PCHB) $(SRC)\objnam.c   $(HACK_H)
+$(O)pline.B:    $(SRC)\pline.c    $(HACK_H) $(EPRI_H)
+	$(CC) $(CFLAGSN) ?[CSNAMB]$(COBJNAM)$@ $(SRC)\pline.c
+$(O)polyself.B: $(PCHB) $(SRC)\polyself.c $(HACK_H)
+$(O)potion.B:   $(PCHB) $(SRC)\potion.c   $(HACK_H)
+$(O)priest.B:   $(PCHB) $(SRC)\priest.c   $(HACK_H) $(MFNDPOS_H) $(ESHK_H) \
+		$(EPRI_H) $(EMIN_H)
+$(O)read.B:     $(PCHB) $(SRC)\read.c     $(HACK_H)
+$(O)rnd.B:      $(PCHB) $(SRC)\rnd.c      $(HACK_H)
+$(O)shk.B:      $(PCHB) $(SRC)\shk.c      $(HACK_H) $(ESHK_H)
+$(O)shknam.B:   $(PCHB) $(SRC)\shknam.c   $(HACK_H) $(ESHK_H)
+$(O)sounds.B:   $(PCHB) $(SRC)\sounds.c   $(HACK_H) $(EDOG_H)
+$(O)steal.B:    $(PCHB) $(SRC)\steal.c    $(HACK_H)
+$(O)timeout.B:	$(PCHB) $(SRC)\timeout.c  $(HACK_H) $(LEV_H)
+$(O)track.B:    $(PCHB) $(SRC)\track.c    $(HACK_H)
+$(O)trap.B:     $(PCHB) $(SRC)\trap.c     $(HACK_H)
+$(O)vault.B:    $(PCHB) $(SRC)\vault.c    $(HACK_H) $(VAULT_H)
+$(O)weapon.B:   $(PCHB) $(SRC)\weapon.c   $(HACK_H)
+$(O)were.B:     $(PCHB) $(SRC)\were.c     $(HACK_H)
+$(O)wizard.B:   $(PCHB) $(SRC)\wizard.c   $(HACK_H) $(QTEXT_H)
+$(O)zap.B:      $(PCHB) $(SRC)\zap.c      $(HACK_H)
+
+# end of file
diff -Naurd ../nethack-3.3.1/sys/msdos/tile2bin.c ./sys/msdos/tile2bin.c
--- ../nethack-3.3.1/sys/msdos/tile2bin.c Thu Oct 28 02:48:42 1999
+++ ./sys/msdos/tile2bin.c Fri Mar 22 14:40:55 2002
@@ -1,4 +1,4 @@
-/*   SCCS Id: @(#)tile2bin.c   3.3     95/01/26                     */
+/*   SCCS Id: @(#)tile2bin.c   3.4     1995/01/26                     */
 /*   Copyright (c) NetHack PC Development Team 1993, 1994, 1995     */
 /*   NetHack may be freely redistributed.  See license for details. */
 
@@ -169,7 +169,7 @@
 #  endif
 	
 	strncpy(tibheader.ident,
-		"NetHack 3.3 MSDOS Port binary tile file", 80);
+		"NetHack 3.4 MSDOS Port binary tile file", 80);
 	strncpy(tibheader.timestamp, asctime(newtime), 24);
 	tibheader.timestamp[25] = '\0';
 	tibheader.tilecount = tilecount;
diff -Naurd ../nethack-3.3.1/sys/msdos/video.c ./sys/msdos/video.c
--- ../nethack-3.3.1/sys/msdos/video.c Tue Dec 7 20:25:48 1999
+++ ./sys/msdos/video.c Fri Mar 22 14:40:55 2002
@@ -1,15 +1,16 @@
-/*   SCCS Id: @(#)video.c   3.3     95/08/05			    */
-/*   Copyright (c) NetHack PC Development Team 1993, 1994	    */
+/*   SCCS Id: @(#)video.c   3.4     2001/04/07			    */
+/*   Copyright (c) NetHack PC Development Team 1993, 1994, 2001	    */
 /*   NetHack may be freely redistributed.  See license for details. */
 /*								    */
 /*
  * video.c - Hardware video support front-ends
  *
  *Edit History:
- *     Initial Creation 	     M. Allison      93/04/04
- *     Add djgpp support	     K. Smolkowski   93/04/26
- *     Add txt/graphics mode support M. Allison      93/10/30
- *     Add graphics mode cursor sim. M. Allison      94/02/19
+ *     Initial Creation 	     M. Allison      1993/04/04
+ *     Add djgpp support	     K. Smolkowski   1993/04/26
+ *     Add txt/graphics mode support M. Allison      1993/10/30
+ *     Add graphics mode cursor sim. M. Allison      1994/02/19
+ *     Add hooks for decals on vga   M. Allison      2001/04/07
  */
 
 #include "hack.h"
@@ -585,15 +586,16 @@
 }
 
 void
-xputg(glyphnum,ch)	/* write out a glyph picture at current location */
+xputg(glyphnum,ch,special)	/* write out a glyph picture at current location */
 int glyphnum;
 int ch;
+unsigned special;
 {
 	if (!iflags.grmode || !iflags.tile_view) {
 		xputc((char)ch);
 #  ifdef SCREEN_VGA
 	} else {
-		vga_xputg(glyphnum, ch);
+		vga_xputg(glyphnum, ch, special);
 #  endif
 	}
 }
@@ -748,7 +750,7 @@
 {
 	char choices[120];
 	char *cptr, *cvalue[3];
-	int i,icolor;
+	int i,icolor = CLR_WHITE;
 
 	strcpy(choices,choiceptr);
 	cvalue[0] = choices;
@@ -895,12 +897,8 @@
  *	getch();
  */
 	iflags.grmode  = 0;
-	iflags.hasvesa = 0;
 	iflags.hasvga  = 0;
-	iflags.has8514 = 0;
-	iflags.usevesa = 0;
 	iflags.usevga  = 0;
-	iflags.use8514 = 0;
 
 	if (strncmpi(sopt,"def",3) == 0) {              /* default */
 		/* do nothing - default */
@@ -937,11 +935,9 @@
 #  endif
 	/*
 	 * Auto-detect Priorities (arbitrary for now):
-	 *	VESA, 8514, VGA
+	 *	VGA
 	 */
-		if (iflags.hasvesa) iflags.usevesa = 1;
-		else if (iflags.has8514) iflags.use8514 = 1;
-		else if (iflags.hasvga)	{
+		if (iflags.hasvga)	{
 			iflags.usevga  = 1;
 			/* VGA depends on BIOS to enable function keys*/
 			iflags.BIOS = 1;
diff -Naurd ../nethack-3.3.1/sys/msdos/vidtxt.c ./sys/msdos/vidtxt.c
--- ../nethack-3.3.1/sys/msdos/vidtxt.c Thu Oct 28 02:48:42 1999
+++ ./sys/msdos/vidtxt.c Fri Mar 22 14:40:55 2002
@@ -1,4 +1,4 @@
-/*   SCCS Id: @(#)vidtxt.c   3.3     94/04/04                       */
+/*   SCCS Id: @(#)vidtxt.c   3.4     1994/04/04                     */
 /*   Copyright (c) NetHack PC Development Team 1993                 */
 /*   NetHack may be freely redistributed.  See license for details. */
 /*                                                                  */
@@ -31,9 +31,8 @@
 # endif
 #endif
 
-/* void FDECL(txt_xputc,(char, int)); /* write out character (and attribute) */
+/* void FDECL(txt_xputc,(char, int)); */ /* write out character (and attribute) */
 
-STATIC_VAR char buf[BUFSZ];
 extern int attrib_text_normal;	/* text mode normal attribute */
 extern int attrib_gr_normal;	/* graphics mode normal attribute */
 extern int attrib_text_intense;	/* text mode intense attribute */
diff -Naurd ../nethack-3.3.1/sys/msdos/vidvga.c ./sys/msdos/vidvga.c
--- ../nethack-3.3.1/sys/msdos/vidvga.c Thu Oct 28 02:48:43 1999
+++ ./sys/msdos/vidvga.c Fri Mar 22 14:40:55 2002
@@ -1,4 +1,4 @@
-/*   SCCS Id: @(#)vidvga.c   3.3     96/02/16			    */
+/*   SCCS Id: @(#)vidvga.c   3.4     1996/02/16			  */
 /*   Copyright (c) NetHack PC Development Team 1995                 */
 /*   NetHack may be freely redistributed.  See license for details. */
 /*
@@ -108,7 +108,7 @@
 # include <conio.h>
 # endif
 
-/* STATIC_DCL void FDECL(vga_NoBorder, (int)); /* */
+/* STATIC_DCL void FDECL(vga_NoBorder, (int));  */
 void FDECL(vga_gotoloc, (int,int));  /* This should be made a macro */
 void NDECL(vga_backsp);
 #ifdef SCROLLMAP
@@ -116,6 +116,7 @@
 #endif
 STATIC_DCL void FDECL(vga_redrawmap,(BOOLEAN_P));
 void FDECL(vga_cliparound,(int, int));
+STATIC_OVL void FDECL(decal_planar,(struct planar_cell_struct *, unsigned));
 
 #ifdef POSITIONBAR
 STATIC_DCL void NDECL(positionbar);
@@ -139,23 +140,25 @@
 
 STATIC_VAR unsigned char __far *font;
 STATIC_VAR char *screentable[SCREENHEIGHT];
-STATIC_VAR char tmp[SCREENWIDTH];
+
 STATIC_VAR char *paletteptr;
 STATIC_VAR struct map_struct {
 	int glyph;
 	int ch;
 	int attr;
+	unsigned special;
 }  map[ROWNO][COLNO];	/* track the glyphs */
 
 # define vga_clearmap() { int x,y; for (y=0; y < ROWNO; ++y) \
 	for (x=0; x < COLNO; ++x) { map[y][x].glyph = cmap_to_glyph(S_stone); \
-	map[y][x].ch = S_stone; map[y][x].attr = 0;} }
+	map[y][x].ch = S_stone; map[y][x].attr = 0; map[y][x].special = 0;} }
 # define TOP_MAP_ROW 1
 #  if defined(OVLB)
 STATIC_VAR int vgacmap[CLR_MAX] = {0,3,5,9,4,8,12,14,11,2,6,7,1,8,12,13};
 STATIC_VAR int viewport_size = 40;
-STATIC_VAR char masktable[8]={0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01};
-STATIC_VAR char bittable[8]= {0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80};
+/* STATIC_VAR char masktable[8]={0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01}; */
+/* STATIC_VAR char bittable[8]= {0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80}; */
+#if 0
 STATIC_VAR char defpalette[] = {	/* Default VGA palette         */
 	0x00, 0x00, 0x00,
 	0x00, 0x00, 0xaa,
@@ -174,6 +177,8 @@
 	0xff, 0x00, 0xff,
 	0xff, 0xff, 0xff
 	};
+#endif
+
 #   ifndef ALTERNATE_VIDEO_METHOD
 int vp[SCREENPLANES] = {8,4,2,1};
 #   endif
@@ -195,10 +200,10 @@
 
 # if defined(USE_TILES)
 STATIC_VAR struct tibhdr_struct tibheader;
-/* extern FILE *tilefile; /* Not needed in here most likely */
+/* extern FILE *tilefile; */ /* Not needed in here most likely */
 # endif
 
-/* STATIC_VAR int  g_attribute;		/* Current attribute to use */
+/* STATIC_VAR int  g_attribute;	*/	/* Current attribute to use */
 
 #ifdef OVLB
 void
@@ -378,29 +383,34 @@
 
 #  if defined(USE_TILES)
 void
-vga_xputg(glyphnum,ch)	/* Place tile represent. a glyph at current location */
+vga_xputg(glyphnum,ch, special)	/* Place tile represent. a glyph at current location */
 int glyphnum;
 int ch;
+unsigned special;	/* special feature: corpse, invis, detected, pet, ridden - hack.h */
 {
 	int col,row;
 	int attr;
+	int ry;
 
 	row = currow;
 	col = curcol;
 	if ((col < 0 || col >= COLNO) ||
 	    (row < TOP_MAP_ROW || row >= (ROWNO + TOP_MAP_ROW))) return;
-	map[row - TOP_MAP_ROW][col].glyph = glyphnum;
-	map[row - TOP_MAP_ROW][col].ch = ch;
+	ry = row - TOP_MAP_ROW;
+	map[ry][col].glyph = glyphnum;
+	map[ry][col].ch = ch;
+	map[ry][col].special = special;
 	attr = (g_attribute == 0) ? attrib_gr_normal : g_attribute;
-	map[row - TOP_MAP_ROW][col].attr = attr;
+	map[ry][col].attr = attr;
 	if (iflags.traditional_view) {
 	    vga_WriteChar((unsigned char)ch,col,row,attr);
 	} else if (!iflags.over_view) {
 	    if ((col >= clipx) && (col <= clipxmax)) {
-		if (!ReadPlanarTileFile(glyph2tile[glyphnum], &planecell))
+		if (!ReadPlanarTileFile(glyph2tile[glyphnum], &planecell)) {
+			if (map[ry][col].special) decal_planar(planecell, special);
 			vga_DisplayCell(planecell, 
 					col - clipx, row);
-		else
+		} else
 			pline("vga_xputg: Error reading tile (%d,%d) from file",
 					glyphnum,glyph2tile[glyphnum]);
 	    }
@@ -469,7 +479,7 @@
 	int j,x,y,t;
 	char __far *pch;
 	char volatile a;
-
+	
 	if (clearfirst) {
 		/* y here is in pixel rows */
 		outportb(0x3ce,5);
@@ -508,6 +518,8 @@
 			if (!iflags.over_view) {
 			  	if (!ReadPlanarTileFile(glyph2tile[t], 
 				    &planecell)) {
+				    	if (map[y][x].special)
+						decal_planar(planecell, map[y][x].special);
 					vga_DisplayCell(planecell,
 						x - clipx, y + TOP_MAP_ROW);
 		  	  	} else
@@ -648,7 +660,8 @@
 	for (y = 0; y < ROWNO; ++y) {
 	    for (x = i; x < j; x += 2) {
 		t = map[y][x].glyph;
-		if (!ReadPlanarTileFile(glyph2tile[t], &planecell)) 
+		if (!ReadPlanarTileFile(glyph2tile[t], &planecell))
+			if (map[y][x].special) decal_planar(planecell, map[y][x].special);
 			vga_DisplayCell(planecell, x - clipx, y + TOP_MAP_ROW);
 		else
 			pline("vga_shiftmap: Error reading tile (%d,%d)",
@@ -660,6 +673,18 @@
 # endif /* OVL2 */
 
 # ifdef OVLB
+STATIC_OVL void
+decal_planar(gp, special)
+struct planar_cell_struct *gp;
+unsigned special;
+{
+    if (special & MG_CORPSE) {
+    } else if (special & MG_INVIS)  {
+    } else if (special & MG_DETECT) {
+    } else if (special & MG_PET)    {
+    } else if (special & MG_RIDDEN) {
+    }
+}
 
 /*
  * Open tile files,
@@ -670,7 +695,7 @@
  */
 void vga_Init(void)
 {
-     int i, c;
+     int i;
 
 #   ifdef USE_TILES
      int tilefailure = 0;
@@ -692,7 +717,7 @@
 	iflags.over_view = FALSE;
 	CO = 80;
 	LI = 25;
-/*	clear_screen()	/* not vga_clear_screen() */
+/*	clear_screen()	*/ /* not vga_clear_screen() */
 	return;
      }
 #   endif
@@ -704,7 +729,7 @@
      }
      vga_SwitchMode(MODE640x480);
      windowprocs.win_cliparound = vga_cliparound;
-/*     vga_NoBorder(BACKGROUND_VGA_COLOR);   /* Not needed after palette mod */
+/*     vga_NoBorder(BACKGROUND_VGA_COLOR); */  /* Not needed after palette mod */
 #   ifdef USE_TILES
      paletteptr = tibheader.palette;
      iflags.tile_view = TRUE;
@@ -854,7 +879,7 @@
 {
 	int i;
 	int x,pixy;
-	int floc;
+
 	char volatile tc;
 	char __far *cp;
 	unsigned char __far *fp = font;
@@ -864,7 +889,7 @@
 
 	x = min(col,(CO-1));	       /* min() used protection from callers */
 	pixy = min(row,(LI-1)) * 16; /* assumes 8 x 16 char set */
-/*	if (chr < ' ') chr = ' ';    /* assumes ASCII set */
+/*	if (chr < ' ') chr = ' ';  */  /* assumes ASCII set */
 
 	outportb(0x3ce,5);
 	outportb(0x3cf,2);
@@ -1013,7 +1038,7 @@
 	}
 }
 
-/*static unsigned char colorbits[]={0x01,0x02,0x04,0x08}; /* wrong */
+/*static unsigned char colorbits[]={0x01,0x02,0x04,0x08}; */ /* wrong */
 static unsigned char colorbits[]={0x08,0x04,0x02,0x01}; 
 
 #ifdef POSITIONBAR
@@ -1042,7 +1067,7 @@
 	int feature, ucol;
 	int k, y, colour, row;
 	char __far *pch;
-	char bitblock;
+
 	int startk, stopk;
 	char volatile a;
 	boolean nowhere = FALSE;
@@ -1138,7 +1163,7 @@
 vga_special(chr,col,color)
 int chr,col,color;
 {
-	int i,y,pixx,pixy;
+	int i,y,pixy;
 	char __far *tmp_d;	/* destination pointer */
 	int vplane;
 	char fnt;
diff -Naurd ../nethack-3.3.1/src/dlb.c ./src/dlb.c
--- ../nethack-3.3.1/src/dlb.c Mon Apr 24 02:05:46 2000
+++ ./src/dlb.c Fri Mar 22 14:40:55 2002
@@ -350,6 +350,13 @@
     }
     *bp = '\0';
 
+#if defined(MSDOS) || defined(WIN32)
+    if ((bp = index(buf, '\r')) != 0) {
+	*bp++ = '\n';
+	*bp = '\0';
+    }
+#endif
+
     return buf;
 }
 
