diff -Naurd ../nethack-3.3.1/sys/share/NetHack.cnf ./sys/share/NetHack.cnf
--- ../nethack-3.3.1/sys/share/NetHack.cnf Fri Aug 4 23:34:11 2000
+++ ./sys/share/NetHack.cnf Fri Mar 22 14:40:55 2002
@@ -49,6 +49,8 @@
 #OPTIONS=nolegacy,noverbose
 #OPTIONS=menustyle:traditional
 
+# If you wish to change the symbol used to display boulders use:
+OPTIONS=boulder:0
 #
 # General options.  You might also set "silent" so as not to attract
 # the boss's attention.
@@ -58,7 +60,6 @@
 # If you want to get rid of "use #quit to quit..." use:
 #OPTIONS=suppress_alert:3.3.1
 #
-
 #
 #HACKDIR=c:\games\nethack
 # 
@@ -82,21 +83,12 @@
 # processing.
 #
 # ================================================
-# An example using the IBM graphics character set:
-#DUNGEON=  032 179 196 218 191 192 217 197 193 194 \
-#	   180 195 249 239 239 254 254 240 241 249 \
-#	   177 177 060 062 060 062 220 124 190 035 \
-#	   244 247 249 247 042 042 186 205 046 035 \
-#	   247
-#
-#TRAPS=    094 094 094 094 094 094 094 094 094 094 \
-#	   094 094 094 094 232 232 232 157 094 094 \
-#	   094 094
-#
-#EFFECTS=  179 196 092 047 042 033 041 040	   \
-#	   048 035 064 042			   \
-#	   047 045 092 058 058 092 045 047	   \
-#	   047 045 092 058 032 058 092 045 047
+# The defaults using the IBM graphics character set:
+#DUNGEON = 032 179 196 218 191 192 217 197 193 194 \
+#          180 195 250 254 254 043 043 240 241 250 \
+#          176 177 243 242 060 062 095 124 092 035 \
+#          244 247 250 247 250 250 035 035 032 035 \
+#          247
 #
 # ================================================
 # Some alternatives:
diff -Naurd ../nethack-3.3.1/sys/share/pcmain.c ./sys/share/pcmain.c
--- ../nethack-3.3.1/sys/share/pcmain.c Wed Aug 9 22:36:09 2000
+++ ./sys/share/pcmain.c Fri Mar 22 14:40:55 2002
@@ -235,8 +231,7 @@
 	u.ux = 0;	/* prevent flush_screen() */
 
 	/* chdir shouldn't be called before this point to keep the
-	 * code parallel to other ports which call gethdate just
-	 * before here.
+	 * code parallel to other ports.
 	 */
 #ifdef CHDIR
 	chdirx(hackdir,1);
@@ -427,6 +418,17 @@
 		argv++;
 		argc--;
 		switch(argv[0][1]){
+		case 'a':
+			if (argv[0][2]) {
+			    if ((i = str2align(&argv[0][2])) >= 0)
+			    	flags.initalign = i;
+			} else if (argc > 1) {
+				argc--;
+				argv++;
+			    if ((i = str2align(argv[0])) >= 0)
+			    	flags.initalign = i;
+			}
+			break;
 		case 'D':
 #ifdef WIZARD
 			/* If they don't have a valid wizard name, it'll be
@@ -467,6 +469,17 @@
 				switch_graphics(DEC_GRAPHICS);
 			break;
 #endif
+		case 'g':
+			if (argv[0][2]) {
+			    if ((i = str2gend(&argv[0][2])) >= 0)
+			    	flags.initgend = i;
+			} else if (argc > 1) {
+				argc--;
+				argv++;
+			    if ((i = str2gend(argv[0])) >= 0)
+			    	flags.initgend = i;
+			}
+			break;
 		case 'p': /* profession (role) */
 			if (argv[0][2]) {
 			    if ((i = str2role(&argv[0][2])) >= 0)
@@ -507,6 +520,9 @@
 			bigscreen = -1;
 			break;
 #endif
+		case '@':
+			flags.randomall = 1;
+			break;
 		default:
 			if ((i = str2role(&argv[0][1])) >= 0) {
 			    flags.initrole = i;
diff -Naurd ../nethack-3.3.1/sys/share/pcsys.c ./sys/share/pcsys.c
--- ../nethack-3.3.1/sys/share/pcsys.c Wed Aug 9 22:37:12 2000
+++ ./sys/share/pcsys.c Fri Mar 22 14:40:55 2002
@@ -45,9 +45,11 @@
 #define     __MOVE_PAUSE_CACHE	  4   /* Represents the cache memory */
 #endif /* MOVERLAY */
 
+#ifdef MFLOPPY
 STATIC_DCL boolean NDECL(record_exists);
-#ifndef TOS
+# ifndef TOS
 STATIC_DCL boolean NDECL(comspec_exists);
+# endif
 #endif
 
 #ifdef WIN32CON
@@ -78,11 +80,13 @@
 {
 	extern char orgdir[];
 	char *comspec;
+# ifndef __GO32__
 	int spawnstat;
+# endif
 #if defined(MSDOS) && defined(NO_TERMS)
-	int grmode;
+	int grmode = iflags.grmode;
 #endif
-	if (comspec = getcomspec()) {
+	if ((comspec = getcomspec())) {
 #  ifndef TOS	/* TOS has a variety of shells */
 		suspend_nhwindows("To return to NetHack, enter \"exit\" at the system prompt.\n");
 #  else
@@ -297,8 +301,6 @@
 	return 1;
 }
 
-# endif /* MFLOPPY */
-
 /* Return 1 if the record file was found */
 STATIC_OVL boolean
 record_exists()
@@ -312,10 +314,12 @@
 	}
 	return FALSE;
 }
+#endif /* MFLOPPY */
 
 # ifdef TOS
 #define comspec_exists() 1
 # else
+#  ifdef MFLOPPY
 /* Return 1 if the comspec was found */
 STATIC_OVL boolean
 comspec_exists()
@@ -323,15 +327,17 @@
 	int fd;
 	char *comspec;
 
-	if (comspec = getcomspec())
+	if ((comspec = getcomspec()))
 		if ((fd = open(comspec, O_RDONLY)) >= 0) {
 			(void) close(fd);
 			return TRUE;
 		}
 	return FALSE;
 }
+#  endif /* MFLOPPY */
 # endif
 
+
 # ifdef MFLOPPY
 /* Prompt for game disk, then check for record file.
  */
@@ -429,7 +435,7 @@
 	 */
 	(void) strncpy(buf, name, BUFSIZ - 1);
 	buf[BUFSIZ-1] = '\0';
-	if (fp = fopen(buf, mode))
+	if ((fp = fopen(buf, mode)))
 		return fp;
 	else {
 		int ccnt = 0;
@@ -445,8 +451,8 @@
 				ccnt++;
 			}
 			(void) strncpy(bp, name, (BUFSIZ - ccnt) - 2);
-			bp[BUFSIZ-1] = '\0';
-			if (fp = fopen(buf, mode))
+			bp[BUFSIZ - ccnt - 1] = '\0';
+			if ((fp = fopen(buf, mode)))
 				return fp;
 			if (*pp)
 				pp++;
diff -Naurd ../nethack-3.3.1/sys/share/pcunix.c ./sys/share/pcunix.c
--- ../nethack-3.3.1/sys/share/pcunix.c Wed Aug 9 18:56:43 2000
+++ ./sys/share/pcunix.c Fri Mar 22 14:40:55 2002
@@ -21,65 +21,17 @@
 
 #ifdef OVLB
 
+#if 0
 static struct stat buf;
+#endif
+
 # ifdef WANT_GETHDATE
 static struct stat hbuf;
 # endif
 
-void
-gethdate(name)
-char *name;
-{
-# ifdef WANT_GETHDATE
-/* old version - for people short of space */
-/*
-/* register char *np;
-/*      if(stat(name, &hbuf))
-/*	      error("Cannot get status of %s.",
-/*		      (np = rindex(name, '/')) ? np+1 : name);
-/*
-/* version using PATH from: seismo!gregc@ucsf-cgl.ARPA (Greg Couch) */
-
-/*
- * The problem with   #include  <sys/param.h> is that this include file
- * does not exist on all systems, and moreover, that it sometimes includes
- * <sys/types.h> again, so that the compiler sees these typedefs twice.
- */
-#define	 MAXPATHLEN      1024
-
-    register char *np, *path;
-    char filename[MAXPATHLEN+1], *getenv();
-    int pathlen;
-
-    if (index(name, '/') != (char *)0 || (path = getenv("PATH")) == (char *)0)
-	path = "";
-
-    for (;;) {
-	if ((np = index(path, ':')) == (char *)0)
-	    np = path + strlen(path);       /* point to end str */
-	pathlen = np - path;
-	if (pathlen > MAXPATHLEN)
-	    pathlen = MAXPATHLEN;
-	if (pathlen <= 1) {		     /* %% */
-	    (void) strncpy(filename, name, MAXPATHLEN);
-	} else {
-	    (void) strncpy(filename, path, pathlen);
-	    filename[pathlen] = '/';
-	    (void) strncpy(filename + pathlen + 1, name,
-				(MAXPATHLEN - 1) - pathlen);
-	}
-	filename[MAXPATHLEN] = '\0';
-	if (stat(filename, &hbuf) == 0)
-	    return;
-	if (*np == '\0')
-	path = "";
-	path = np + 1;
-    }
-    if (strlen(name) > BUFSZ/2)
-	name = name + strlen(name) - BUFSZ/2;
-    error("Cannot get status of %s.", (np = rindex(name, '/')) ? np+1 : name);
-# endif /* WANT_GETHDATE */
-}
+#ifdef PC_LOCKING
+static int NDECL(eraseoldlocks);
+#endif
 
 #if 0
 int
@@ -144,11 +96,11 @@
 void
 getlock()
 {
-	register int i = 0, fd, c, ci, ct;
+	register int fd, c, ci, ct;
 	char tbuf[BUFSZ];
 	const char *fq_lock;
 # if defined(MSDOS) && defined(NO_TERMS)
-	int grmode;
+	int grmode = iflags.grmode;
 # endif
 	
 	/* we ignore QUIT and INT at this point */
diff -Naurd ../nethack-3.3.1/sys/share/uudecode.c ./sys/share/uudecode.c
--- ../nethack-3.3.1/sys/share/uudecode.c Thu Jan 1 01:00:00 1970
+++ ./sys/share/uudecode.c Fri Mar 22 14:40:55 2002
@@ -0,0 +1,250 @@
+/*
+ * Copyright (c) 1983 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley.  The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+/*
+ * Modified 12 April 1990 by Mark Adler for use on MSDOS systems with
+ * Microsoft C and Turbo C.
+ *
+ * Modifed 13 February 1991 by Greg Roelofs for use on VMS systems.  As
+ * with the MS-DOS version, the setting of the file mode has been disabled.
+ * Compile and link normally (but note that the shared-image link option
+ * produces a binary only 6 blocks long, as opposed to the 137-block one
+ * produced by an ordinary link).  To set up the VMS symbol to run the
+ * program ("run uudecode filename" won't work), do:
+ *		uudecode :== "$disk:[directory]uudecode.exe"
+ * and don't forget the leading "$" or it still won't work.  The binaries
+ * produced by this program are in VMS "stream-LF" format; this makes no
+ * difference to VMS when running decoded executables, nor to VMS unzip,
+ * but other programs such as zoo or arc may or may not require the file
+ * to be "BILFed" (or "unBILFed" or whatever).  Also, unlike the other
+ * flavors, VMS files don't get overwritten (a higher version is created).
+ * 
+ * Modified 13 April 1991 by Gary Mussar to be forgiving of systems that
+ * appear to be stripping trailing blanks.
+ *
+ * Modified 28 February 2002 for use on WIN32 systems with Microsoft C.
+ */
+
+#ifndef lint
+static char sccsid[] = "@(#)uudecode.c	5.5 (Berkeley) 7/6/88";
+#endif /* not lint */
+
+#ifdef __MSDOS__        /* For Turbo C */
+#define MSDOS 1
+#endif
+
+#ifdef _WIN32
+#undef MSDOS
+#undef __MSDOS__
+#ifndef WIN32
+#define WIN32
+#endif
+#endif
+
+/*
+ * uudecode [input]
+ *
+ * create the specified file, decoding as you go.
+ * used with uuencode.
+ */
+#include <stdio.h>
+
+#ifdef VMS
+#  include <types.h>
+#  include <stat.h>
+#else
+#  if !defined(MSDOS) && !defined(WIN32)
+#    include <pwd.h>
+#  endif
+#  include <sys/types.h>   /* MSDOS, WIN32, or UNIX */
+#  include <sys/stat.h>
+#  include <string.h>
+#  include <stdlib.h>
+#endif
+
+static void decode(FILE *, FILE *);
+static void outdec(char *, FILE *, int);
+
+/* single-character decode */
+#define DEC(c)	(((c) - ' ') & 077)
+
+int main(argc, argv)
+int argc;
+char **argv;
+{
+	FILE *in, *out;
+	int mode;
+	char dest[128];
+	char buf[80];
+
+	/* optional input arg */
+	if (argc > 1) {
+		if ((in = fopen(argv[1], "r")) == NULL) {
+			perror(argv[1]);
+			exit(1);
+		}
+		argv++; argc--;
+	} else
+		in = stdin;
+
+	if (argc != 1) {
+		printf("Usage: uudecode [infile]\n");
+		exit(2);
+	}
+
+	/* search for header line */
+	for (;;) {
+		if (fgets(buf, sizeof buf, in) == NULL) {
+			fprintf(stderr, "No begin line\n");
+			exit(3);
+		}
+		if (strncmp(buf, "begin ", 6) == 0)
+			break;
+	}
+	(void)sscanf(buf, "begin %o %s", &mode, dest);
+
+#if !defined(MSDOS) && !defined(VMS) && !defined(WIN32)
+	/* handle ~user/file format */
+	if (dest[0] == '~') {
+		char *sl;
+		struct passwd *getpwnam();
+		struct passwd *user;
+		char dnbuf[100], *index(), *strcat(), *strcpy();
+
+		sl = index(dest, '/');
+		if (sl == NULL) {
+			fprintf(stderr, "Illegal ~user\n");
+			exit(3);
+		}
+		*sl++ = 0;
+		user = getpwnam(dest+1);
+		if (user == NULL) {
+			fprintf(stderr, "No such user as %s\n", dest);
+			exit(4);
+		}
+		strcpy(dnbuf, user->pw_dir);
+		strcat(dnbuf, "/");
+		strcat(dnbuf, sl);
+		strcpy(dest, dnbuf);
+	}
+#endif	/* !defined(MSDOS) && !defined(VMS) */
+
+	/* create output file */
+#if defined(MSDOS) || defined(WIN32)
+	out = fopen(dest, "wb");	/* Binary file */
+#else
+	out = fopen(dest, "w");
+#endif
+	if (out == NULL) {
+		perror(dest);
+		exit(4);
+	}
+#if !defined(MSDOS) && !defined(VMS) && !defined(WIN32)	/* i.e., UNIX */
+	chmod(dest, mode);
+#endif
+
+	decode(in, out);
+
+	if (fgets(buf, sizeof buf, in) == NULL || strcmp(buf, "end\n")) {
+		fprintf(stderr, "No end line\n");
+		exit(5);
+	}
+	exit(0);
+}
+
+/*
+ * copy from in to out, decoding as you go along.
+ */
+void
+decode(in, out)
+FILE *in;
+FILE *out;
+{
+	char buf[80];
+	char *bp;
+	int n, i, expected;
+
+	for (;;) {
+		/* for each input line */
+		if (fgets(buf, sizeof buf, in) == NULL) {
+			printf("Short file\n");
+			exit(10);
+		}
+		n = DEC(buf[0]);
+		if ((n <= 0) || (buf[0] == '\n'))
+			break;
+
+		/* Calculate expected # of chars and pad if necessary */
+		expected = ((n+2)/3)<<2;
+		for (i = strlen(buf)-1; i <= expected; i++) buf[i] = ' ';
+
+		bp = &buf[1];
+		while (n > 0) {
+			outdec(bp, out, n);
+			bp += 4;
+			n -= 3;
+		}
+	}
+}
+
+/*
+ * output a group of 3 bytes (4 input characters).
+ * the input chars are pointed to by p, they are to
+ * be output to file f.  n is used to tell us not to
+ * output all of them at the end of the file.
+ */
+void
+outdec(p, f, n)
+char *p;
+FILE *f;
+int n;
+{
+	int c1, c2, c3;
+
+	c1 = DEC(*p) << 2 | DEC(p[1]) >> 4;
+	c2 = DEC(p[1]) << 4 | DEC(p[2]) >> 2;
+	c3 = DEC(p[2]) << 6 | DEC(p[3]);
+	if (n >= 1)
+		putc(c1, f);
+	if (n >= 2)
+		putc(c2, f);
+	if (n >= 3)
+		putc(c3, f);
+}
+
+#if !defined(MSDOS) && !defined(VMS) && !defined(WIN32)
+/*
+ * Return the ptr in sp at which the character c appears;
+ * NULL if not found
+ */
+
+#ifndef NULL
+#define	NULL	0
+#endif
+
+char *
+index(sp, c)
+register char *sp, c;
+{
+	do {
+		if (*sp == c)
+			return(sp);
+	} while (*sp++);
+	return(NULL);
+}
+#endif
+

