These are the changes to the original source
archive (280). You don't need to apply them
if you can get the latest archive, which will
have them applied already.

*** ../old/src/main-emx.c	Sun Oct 13 23:17:38 1996
--- main-emx.c	Wed Oct 30 23:02:18 1996
***************
*** 31,41 ****
   * - run 'dmake -B -r -f makefile.emx clean'
   *
   *
!  * I use EMX 0.9b, but every EMX compiler since 0.8g or so should work
   * fine. EMX is available at ftp-os2.cdrom.com ("Hobbes"), as is dmake.
   *
!  *  dmake:    ftp://ftp-os2.cdrom.com/all/program/dmake38X.zip
!  *  EMX:      ftp://ftp-os2.cdrom.com/2_x/unix/emx???/   (most probably)
   *
   * Old savefiles must be renamed to follow the new "savefile" naming
   * conventions.  Either rename the savefile to "PLAYER", or start the
--- 31,42 ----
   * - run 'dmake -B -r -f makefile.emx clean'
   *
   *
!  * I use EMX 0.9c, but every EMX compiler since 0.8g or so should work
   * fine. EMX is available at ftp-os2.cdrom.com ("Hobbes"), as is dmake.
   *
!  *  dmake:    ftp://ftp-os2.cdrom.com/all/program/dmake???.zip
!  *  EMX:      ftp://ftp-os2.cdrom.com/2_x/unix/emx???/   
!  *            ftp://ftp.leo.org/pub/comp/os/os2/devtools/emx+gcc  (Europe)
   *
   * Old savefiles must be renamed to follow the new "savefile" naming
   * conventions.  Either rename the savefile to "PLAYER", or start the
***************
*** 74,79 ****
--- 75,87 ----
   *
   *   9.03.96   EK      2.7.9    Adjustable background color (PM)
   *                      v5      Added map window
+  * 
+  *  30.11.96   EK      2.8.0    Uploaded binaries to export.andrew.cmu.edu
+  *                              Removed map window (since main code provides
+  *                              a better way)
+  *                              Adjusted startwnd.cmd (in makefile.emx) to 
+  *                              new window/term handling.
+  *                              Updated to EMX 0.9c
   */
  
  #include <signal.h>
***************
*** 104,111 ****
  
  typedef struct
  {
! 	term t;
! 	FILE *out;                  /* used by the ..._pipe_emx stuff */
  } termPipe;
  
  /*
--- 112,119 ----
  
  typedef struct
  {
!     term t;
!     FILE *out;                  /* used by the ..._pipe_emx stuff */
  } termPipe;
  
  /*
***************
*** 114,125 ****
  
  enum
  {
! 	PIP_INIT,
! 	PIP_NUKE,
! 	PIP_XTRA,
! 	PIP_CURS,
! 	PIP_WIPE,
! 	PIP_TEXT,
  };
  
  
--- 122,133 ----
  
  enum
  {
!     PIP_INIT,
!     PIP_NUKE,
!     PIP_XTRA,
!     PIP_CURS,
!     PIP_WIPE,
!     PIP_TEXT,
  };
  
  
***************
*** 145,166 ****
   */
  static int colors[16]=
  {
! 	F_BLACK,                    /* Black */
! 	F_WHITE|INTENSITY,          /* White */
! 	F_WHITE,                    /* XXX Gray */
! 	F_RED|INTENSITY,            /* Orange */
! 	F_RED,                      /* Red */
! 	F_GREEN,                    /* Green */
! 	F_BLUE,                     /* Blue */
! 	F_BROWN,                    /* Brown */
! 	F_BLACK|INTENSITY,          /* Dark-grey */
! 	F_WHITE,                    /* XXX Light gray */
! 	F_MAGENTA,                  /* Purple */
! 	F_YELLOW|INTENSITY,         /* Yellow */
! 	F_RED|INTENSITY,            /* Light Red */
! 	F_GREEN|INTENSITY,          /* Light Green */
! 	F_BLUE|INTENSITY,           /* Light Blue */
! 	F_BROWN|INTENSITY           /* Light brown */
  };
  
  /*
--- 153,174 ----
   */
  static int colors[16]=
  {
!     F_BLACK,                                 /* Black */
!     F_WHITE|INTENSITY,                       /* White */
!     F_WHITE,                                 /* XXX Gray */
!     F_RED|INTENSITY,                         /* Orange */
!     F_RED,                                   /* Red */
!     F_GREEN,                                 /* Green */
!     F_BLUE,                                  /* Blue */
!     F_BROWN,                                 /* Brown */
!     F_BLACK|INTENSITY,                       /* Dark-grey */
!     F_WHITE,                                 /* XXX Light gray */
!     F_MAGENTA,                               /* Purple */
!     F_YELLOW|INTENSITY,                      /* Yellow */
!     F_RED|INTENSITY,                         /* Light Red */
!     F_GREEN|INTENSITY,                       /* Light Green */
!     F_BLUE|INTENSITY,                        /* Light Blue */
!     F_BROWN|INTENSITY                        /* Light brown */
  };
  
  /*
***************
*** 168,177 ****
   */
  static errr Term_curs_emx(int x, int y)
  {
! 	v_gotoxy(x, y);
! 	v_ctype(curs_start, curs_end);
  
! 	return (0);
  }
  
  /*
--- 176,185 ----
   */
  static errr Term_curs_emx(int x, int y)
  {
!     v_gotoxy(x, y);
!     v_ctype(curs_start, curs_end);
  
!     return (0);
  }
  
  /*
***************
*** 179,188 ****
   */
  static errr Term_wipe_emx(int x, int y, int n)
  {
! 	v_gotoxy(x, y);
! 	v_putn(' ', n);
  
! 	return (0);
  }
  
  /*
--- 187,196 ----
   */
  static errr Term_wipe_emx(int x, int y, int n)
  {
!     v_gotoxy(x, y);
!     v_putn(' ', n);
  
!     return (0);
  }
  
  /*
***************
*** 190,201 ****
   */
  static errr Term_text_emx(int x, int y, int n, unsigned char a, cptr s)
  {
! 	/* Convert the color and put the text */
! 	v_attrib(colors[a & 0x0F]);
! 	v_gotoxy(x, y);
! 	v_putm(s, n);
  
! 	return (0);
  }
  
  /*
--- 198,209 ----
   */
  static errr Term_text_emx(int x, int y, int n, unsigned char a, cptr s)
  {
!     /* Convert the color and put the text */
!     v_attrib(colors[a & 0x0F]);
!     v_gotoxy(x, y);
!     v_putm(s, n);
  
!     return (0);
  }
  
  /*
***************
*** 203,230 ****
   */
  static void Term_init_emx(term *t)
  {
! 	v_init();
! 	v_getctype(&curs_start, &curs_end);
! 	v_clear();
! 
! 	signal(SIGHUP, SIG_IGN);
! 	signal(SIGINT, SIG_IGN);
! 	signal(SIGQUIT, SIG_IGN);
! 	/*  signal(SIGILL,SIG_IGN);  */
! 	/*  signal(SIGTRAP,SIG_IGN); */
! 	/*  signal(SIGABRT,SIG_IGN); */
! 	/*  signal(SIGEMT,SIG_IGN);  */
! 	/*  signal(SIGFPE,SIG_IGN);  */
! 	/*  signal(SIGBUS,SIG_IGN);  */
! 	/*  signal(SIGSEGV,SIG_IGN); */
! 	/*  signal(SIGSYS,SIG_IGN);  */
! 	signal(SIGPIPE, SIG_IGN);
! 	signal(SIGALRM, SIG_IGN);
! 	/*  signal(SIGTERM,SIG_IGN); */
! 	signal(SIGUSR1, SIG_IGN);
! 	signal(SIGUSR2, SIG_IGN);
! 	signal(SIGCHLD, SIG_IGN);
! 	signal(SIGBREAK, SIG_IGN);
  }
  
  /*
--- 211,238 ----
   */
  static void Term_init_emx(term *t)
  {
!     v_init();
!     v_getctype(&curs_start, &curs_end);
!     v_clear();
! 
!     signal(SIGHUP, SIG_IGN);
!     signal(SIGINT, SIG_IGN);
!     signal(SIGQUIT, SIG_IGN);
!     /*  signal(SIGILL,SIG_IGN);  */
!     /*  signal(SIGTRAP,SIG_IGN); */
!     /*  signal(SIGABRT,SIG_IGN); */
!     /*  signal(SIGEMT,SIG_IGN);  */
!     /*  signal(SIGFPE,SIG_IGN);  */
!     /*  signal(SIGBUS,SIG_IGN);  */
!     /*  signal(SIGSEGV,SIG_IGN); */
!     /*  signal(SIGSYS,SIG_IGN);  */
!     signal(SIGPIPE, SIG_IGN);
!     signal(SIGALRM, SIG_IGN);
!     /*  signal(SIGTERM,SIG_IGN); */
!     signal(SIGUSR1, SIG_IGN);
!     signal(SIGUSR2, SIG_IGN);
!     signal(SIGCHLD, SIG_IGN);
!     signal(SIGBREAK, SIG_IGN);
  }
  
  /*
***************
*** 232,248 ****
   */
  static void Term_nuke_emx(term *t)
  {
! 	/* Move the cursor to bottom of screen */
! 	v_gotoxy(0, 23);
  
! 	/* Restore the cursor (not necessary) */
! 	v_ctype(curs_start, curs_end);
  
! 	/* Set attribute to gray on black */
! 	v_attrib(F_WHITE);
  
! 	/* Clear the screen */
! 	v_clear();
  }
  
  
--- 240,256 ----
   */
  static void Term_nuke_emx(term *t)
  {
!     /* Move the cursor to bottom of screen */
!     v_gotoxy(0, 23);
  
!     /* Restore the cursor (not necessary) */
!     v_ctype(curs_start, curs_end);
  
!     /* Set attribute to gray on black */
!     v_attrib(F_WHITE);
  
!     /* Clear the screen */
!     v_clear();
  }
  
  
***************
*** 270,279 ****
   * The screens
   */
  static termPipe term_screen_main,
! term_screen_recall,
! term_screen_choice,
! term_screen_mirror,
! term_screen_map;
  
  /*
   * Check for events -- called by "Term_scan_emx()"
--- 278,286 ----
   * The screens
   */
  static termPipe term_screen_main,
!     term_screen_recall,
!     term_screen_choice,
!     term_screen_mirror;
  
  /*
   * Check for events -- called by "Term_scan_emx()"
***************
*** 303,344 ****
   */
  static errr CheckEvents(int returnImmediately)
  {
! 	int k = 0, ke = 0;
  
! 	/* Get key */
! 	k=_read_kbd(0, returnImmediately?0:1, 0);
  
! 	/* Nothing ready */
! 	if (k < 0) return (1);
  
! 	/* Get an extended scan code */
! 	if (!k) ke = _read_kbd(0, 1, 0);
  
! 	/* Normal keypresses */
! 	if (k)
! 	{
! 		/* Enqueue the key */
! 		Term_keypress(k);
  
! 		/* Success */
! 		return (0);
! 	}
  
! 	/* Hack -- introduce a macro sequence */
! 	Term_keypress(31);
  
! 	/* XXX We're not able to extract shift/ctrl/alt key information here. */
  
! 	/* Hack -- send the key sequence */
! 	Term_keypress('0' + (ke % 1000) / 100);
! 	Term_keypress('0' + (ke % 100) / 10);
! 	Term_keypress('0' + (ke % 10));
  
! 	/* Hack --  end the macro sequence */
! 	Term_keypress(13);
  
! 	/* Success */
! 	return (0);
  }
  
  /*
--- 310,351 ----
   */
  static errr CheckEvents(int returnImmediately)
  {
!     int k = 0, ke = 0;
  
!     /* Get key */
!     k=_read_kbd(0, returnImmediately?0:1, 0);
  
!     /* Nothing ready */
!     if (k < 0) return (1);
  
!     /* Get an extended scan code */
!     if (!k) ke = _read_kbd(0, 1, 0);
  
!     /* Normal keypresses */
!     if (k)
!     {
!         /* Enqueue the key */
!         Term_keypress(k);
  
!         /* Success */
!         return (0);
!     }
  
!     /* Hack -- introduce a macro sequence */
!     Term_keypress(31);
  
!     /* XXX We're not able to extract shift/ctrl/alt key information here. */
  
!     /* Hack -- send the key sequence */
!     Term_keypress('0' + (ke % 1000) / 100);
!     Term_keypress('0' + (ke % 100) / 10);
!     Term_keypress('0' + (ke % 10));
  
!     /* Hack --  end the macro sequence */
!     Term_keypress(13);
  
!     /* Success */
!     return (0);
  }
  
  /*
***************
*** 346,520 ****
   */
  static errr Term_xtra_emx(int n, int v)
  {
! 	switch (n)
! 	{
! 		case TERM_XTRA_SHAPE:
! 		if (v)
! 		{
! 			v_ctype(curs_start, curs_end);
! 		}
! 		else
! 		{
! 			v_hidecursor();
! 		}
! 		return (0);
! 
! 		case TERM_XTRA_NOISE:
! 		DosBeep(440, 50);
! 		return (0);
! 
! 		case TERM_XTRA_FLUSH:
! 		while (!CheckEvents(TRUE));
! 		return 0;
! 
! 		case TERM_XTRA_EVENT:
! 
! 		/* Process an event */
! 		return (CheckEvents(!v));
! 
! 		/* Success */
! 		return (0);
! 
! 		case TERM_XTRA_CLEAR:
! 		v_clear();
! 		return (0);
! 	}
  
! 	return (1);
  }
  
  static errr Term_xtra_pipe_emx(int n, int v)
  {
! 	termPipe *tp=(termPipe*)Term;
  
! 	switch (n)
! 	{
! 		case TERM_XTRA_NOISE:
! 		DosBeep(440, 50);
! 		return (0);
  
! 		case TERM_XTRA_SHAPE:
! 		return (0);
  
! 		case TERM_XTRA_EVENT:
! 		return (CheckEvents(FALSE));
  
! 		case TERM_XTRA_CLEAR:
  
! 		if (!tp->out) return -1;
  
! 		fputc(PIP_XTRA, tp->out);
! 		fwrite(&n, sizeof(n), 1, tp->out);
! 		fwrite(&v, sizeof(v), 1, tp->out);
! 		fflush(tp->out);
  
! 		return (0);
! 	}
  
! 	return (1);
  }
  
  static errr Term_curs_pipe_emx(int x, int y)
  {
! 	termPipe *tp=(termPipe*)Term;
  
! 	if (!tp->out) return -1;
  
! 	fputc(PIP_CURS, tp->out);
! 	fwrite(&x, sizeof(x), 1, tp->out);
! 	fwrite(&y, sizeof(y), 1, tp->out);
! 	fflush(tp->out);
  
! 	return (0);
  }
  
  
  static errr Term_wipe_pipe_emx(int x, int y, int n)
  {
! 	termPipe *tp=(termPipe*)Term;
  
! 	if (!tp->out) return -1;
  
! 	fputc(PIP_WIPE, tp->out);
! 	fwrite(&x, sizeof(x), 1, tp->out);
! 	fwrite(&y, sizeof(y), 1, tp->out);
! 	fwrite(&n, sizeof(n), 1, tp->out);
! 	fflush(tp->out);
  
! 	return (0);
  }
  
  
  static errr Term_text_pipe_emx(int x, int y, int n, unsigned char a, cptr s)
  {
! 	termPipe *tp=(termPipe*)Term;
  
! 	if (!tp->out) return -1;
  
! 	fputc(PIP_TEXT, tp->out);
! 	fwrite(&x, sizeof(x), 1, tp->out);
! 	fwrite(&y, sizeof(y), 1, tp->out);
! 	fwrite(&n, sizeof(n), 1, tp->out);
! 	fwrite(&a, sizeof(a), 1, tp->out);
! 	fwrite(s, n, 1, tp->out);
! 	fflush(tp->out);
  
! 	return (0);
  }
  
  
  static void Term_init_pipe_emx(term *t)
  {
! 	termPipe *tp=(termPipe*)t;
  
! 	if (tp->out)
! 	{
! 		fputc(PIP_INIT, tp->out);
! 		fflush(tp->out);
! 	}
  }
  
  
  static void Term_nuke_pipe_emx(term *t)
  {
! 	termPipe *tp=(termPipe*)t;
  
! 	if (tp->out)
! 	{
! 		fputc(PIP_NUKE, tp->out); /* Terminate client */
! 		fflush(tp->out);
! 		fclose(tp->out);         /* Close Pipe */
! 		tp->out=NULL;            /* Paranoia */
! 	}
  }
  
  static void initPipeTerm(termPipe *pipe, char *name, term **termTarget)
  {
! 	term *t;
  
! 	t=(term*)pipe;
  
! 	if ((pipe->out=initPipe(name))!=NULL)
! 	{
! 		/* Initialize the term */
! 		term_init(t, 80, 24, 1);
! 
! 		/* Special hooks */
! 		t->init_hook = Term_init_pipe_emx;
! 		t->nuke_hook = Term_nuke_pipe_emx;
! 
! 		/* Add the hooks */
! 		t->text_hook = Term_text_pipe_emx;
! 		t->wipe_hook = Term_wipe_pipe_emx;
! 		t->curs_hook = Term_curs_pipe_emx;
! 		t->xtra_hook = Term_xtra_pipe_emx;
! 
! 		/* Save it */
! 		*termTarget = t;
! 
! 		/* Activate it */
! 		Term_activate(t);
! 	}
  }
  
  /*
--- 353,527 ----
   */
  static errr Term_xtra_emx(int n, int v)
  {
!     switch (n)
!     {
!         case TERM_XTRA_SHAPE:
!             if (v)
!             {
!                 v_ctype(curs_start, curs_end);
!             }
!             else
!             {
!                 v_hidecursor();
!             }
!             return (0);
! 
!         case TERM_XTRA_NOISE:
!             DosBeep(440, 50);
!             return (0);
! 
!         case TERM_XTRA_FLUSH:
!             while (!CheckEvents(TRUE));
!             return 0;
! 
!         case TERM_XTRA_EVENT:
! 
!             /* Process an event */
!             return (CheckEvents(!v));
! 
!             /* Success */
!             return (0);
! 
!         case TERM_XTRA_CLEAR:
!             v_clear();
!             return (0);
!     }
  
!     return (1);
  }
  
  static errr Term_xtra_pipe_emx(int n, int v)
  {
!     termPipe *tp=(termPipe*)Term;
  
!     switch (n)
!     {
!         case TERM_XTRA_NOISE:
!             DosBeep(440, 50);
!             return (0);
  
!         case TERM_XTRA_SHAPE:
!             return (0);
  
!         case TERM_XTRA_EVENT:
!             return (CheckEvents(FALSE));
  
!         case TERM_XTRA_CLEAR:
  
!             if (!tp->out) return -1;
  
!             fputc(PIP_XTRA, tp->out);
!             fwrite(&n, sizeof(n), 1, tp->out);
!             fwrite(&v, sizeof(v), 1, tp->out);
!             fflush(tp->out);
  
!             return (0);
!     }
  
!     return (1);
  }
  
  static errr Term_curs_pipe_emx(int x, int y)
  {
!     termPipe *tp=(termPipe*)Term;
  
!     if (!tp->out) return -1;
  
!     fputc(PIP_CURS, tp->out);
!     fwrite(&x, sizeof(x), 1, tp->out);
!     fwrite(&y, sizeof(y), 1, tp->out);
!     fflush(tp->out);
  
!     return (0);
  }
  
  
  static errr Term_wipe_pipe_emx(int x, int y, int n)
  {
!     termPipe *tp=(termPipe*)Term;
  
!     if (!tp->out) return -1;
  
!     fputc(PIP_WIPE, tp->out);
!     fwrite(&x, sizeof(x), 1, tp->out);
!     fwrite(&y, sizeof(y), 1, tp->out);
!     fwrite(&n, sizeof(n), 1, tp->out);
!     fflush(tp->out);
  
!     return (0);
  }
  
  
  static errr Term_text_pipe_emx(int x, int y, int n, unsigned char a, cptr s)
  {
!     termPipe *tp=(termPipe*)Term;
  
!     if (!tp->out) return -1;
  
!     fputc(PIP_TEXT, tp->out);
!     fwrite(&x, sizeof(x), 1, tp->out);
!     fwrite(&y, sizeof(y), 1, tp->out);
!     fwrite(&n, sizeof(n), 1, tp->out);
!     fwrite(&a, sizeof(a), 1, tp->out);
!     fwrite(s, n, 1, tp->out);
!     fflush(tp->out);
  
!     return (0);
  }
  
  
  static void Term_init_pipe_emx(term *t)
  {
!     termPipe *tp=(termPipe*)t;
  
!     if (tp->out)
!     {
!         fputc(PIP_INIT, tp->out);
!         fflush(tp->out);
!     }
  }
  
  
  static void Term_nuke_pipe_emx(term *t)
  {
!     termPipe *tp=(termPipe*)t;
  
!     if (tp->out)
!     {
!         fputc(PIP_NUKE, tp->out); /* Terminate client */
!         fflush(tp->out);
!         fclose(tp->out);         /* Close Pipe */
!         tp->out=NULL;            /* Paranoia */
!     }
  }
  
  static void initPipeTerm(termPipe *pipe, char *name, term **termTarget)
  {
!     term *t;
  
!     t=(term*)pipe;
  
!     if ((pipe->out=initPipe(name))!=NULL)
!     {
!         /* Initialize the term */
!         term_init(t, 80, 24, 1);
! 
!         /* Special hooks */
!         t->init_hook = Term_init_pipe_emx;
!         t->nuke_hook = Term_nuke_pipe_emx;
! 
!         /* Add the hooks */
!         t->text_hook = Term_text_pipe_emx;
!         t->wipe_hook = Term_wipe_pipe_emx;
!         t->curs_hook = Term_curs_pipe_emx;
!         t->xtra_hook = Term_xtra_pipe_emx;
! 
!         /* Save it */
!         *termTarget = t;
! 
!         /* Activate it */
!         Term_activate(t);
!     }
  }
  
  /*
***************
*** 522,711 ****
   */
  errr init_emx(void)
  {
! 	term *t;
  
! 	/* Initialize the pipe windows */
! 	initPipeTerm(&term_screen_recall, "recall", &term_recall);
! 	initPipeTerm(&term_screen_choice, "choice", &term_choice);
! 	initPipeTerm(&term_screen_mirror, "mirror", &term_mirror);
! 	initPipeTerm(&term_screen_map,   "map",   &term_map);
! 
! 	/* Initialize main window */
! 	t = (term*)(&term_screen_main);
! 
! 	/* Initialize the term -- big key buffer */
! 	term_init(t, 80, 24, 1024);
! 
! 	/* Special hooks */
! 	t->init_hook = Term_init_emx;
! 	t->nuke_hook = Term_nuke_emx;
! 
! 	/* Add the hooks */
! 	t->text_hook = Term_text_emx;
! 	t->wipe_hook = Term_wipe_emx;
! 	t->curs_hook = Term_curs_emx;
! 	t->xtra_hook = Term_xtra_emx;
  
! 	/* Save it */
! 	term_screen = t;
  
! 	/* Activate it */
! 	Term_activate(t);
  
! 	/* Success */
! 	return (0);
  }
  
  static FILE *initPipe(char *name)
  {
! 	char buf[256];
! 	FILE *fi;
  
! 	sprintf(buf, "\\pipe\\angband\\%s", name);   /* Name of pipe */
! 	fi=fopen(buf, "wb");                        /* Look for server */
! 	return fi;
  }
  
  #else /* __EMX__CLIENT__ */
  
  int main(int argc, char **argv)
  {
! 	int c, end = 0, lines = 25;
! 	int x, y, h, n, v;
  
! 	FILE *in=NULL;
! 	char a;
! 	char buf[160];
! 	HPIPE pipe;
! 	APIRET rc;
! 	char *target;
! 
! 	/* Check command line */
! 	if (argc!=2 && argc!=3)
! 	{
! 		printf("Usage: %s choice|recall|mirror [number of lines]\n"
! 		       "Start this before angband.exe\n", argv[0]);
! 		exit(1);
! 	}
! 
! 	if (argc==3) lines = atoi(argv[2]);
! 	if (lines <= 0) lines = 25;
! 
! 	printf("Looking for Angband... press ^C to abort\n");
! 
! 	target=strdup(argv[1]);
! 	for (c=0; c<strlen(target); c++) target[c]=tolower(target[c]);
! 
! 	sprintf(buf, "\\pipe\\angband\\%s", target);
! 
! 	do
! 	{
! 		rc=DosCreateNPipe((PSZ)buf,          /* Create pipe */
! 		                  &pipe,
! 		                  NP_ACCESS_INBOUND,
! 		                  NP_WAIT|NP_TYPE_BYTE|NP_READMODE_BYTE|1,
! 		                  1,                 /* No output buffer */
! 		                  1,                 /* No input buffer */
! 		                  -1);
! 
! 		if (rc)                              /* Pipe not created */
! 		{
! 			printf("DosCreateNPipe: rc=%ld, pipe=%ld\n", (long)rc, (long)pipe);
! 			break;
! 		}
! 
! 		do
! 		{
! 			rc=DosConnectNPipe(pipe);        /* Wait for angband to connect */
! 			if (!rc) break;
! 			_sleep2(500);                    /* Sleep for 0.5s  */
! 		} while (_read_kbd(0, 0, 0)==-1);      /* Until key pressed */
! 
! 		if (rc) break;
! 
! 		h=_imphandle(pipe);                  /* Register handle with io */
! 		setmode(h, O_BINARY);                 /* Make it binary */
! 		in=fdopen(h, "rb");                   /* Register handle with stdio */
! 
! 	} while (0);           /* We don't need no stinking exception handling <g> */
! 
! 	if (!in)
! 	{
! 		printf("Sorry, the pipe connection to Angband could not be established.\n");
! 		exit(1);
! 	}
! 
! 	printf("Connected.\n");
! 
! 	sprintf(buf, "mode co80,%d", lines);
! 	system(buf);
! 
! 	/* Infinite loop */
! 	while (!end)
! 	{
! 		/* Get command */
! 		c = fgetc(in);
! 
! 		switch (c)
! 		{
! 			case PIP_XTRA:
! 			if (!fread(&n, sizeof(x), 1, in) ||
! 			    !fread(&v, sizeof(y), 1, in))
! 				abort();
! 
! 			/* This hack prevents another hack */
! 			switch (n)
! 			{
! 				case TERM_XTRA_CLEAR:
! 				v_clear();
! 				break;
! 
! 				default:
! 				printf("Sorry, angband.exe and aclient.exe don't fit together.\n");
! 				exit(1);
! 			}
! 
! 			break;
! 
! 			case PIP_CURS:
! 			if (!fread(&x, sizeof(x), 1, in) ||
! 			    !fread(&y, sizeof(y), 1, in))
! 				abort();
! 			Term_curs_emx(x, y);
! 			break;
! 
! 			case PIP_WIPE:
! 			if (!fread(&x, sizeof(x), 1, in) ||
! 			    !fread(&y, sizeof(y), 1, in) ||
! 			    !fread(&n, sizeof(n), 1, in))
! 				abort();
! 			Term_wipe_emx(x, y, n);
! 			break;
! 
! 			case PIP_TEXT:
! 			if (!fread(&x, sizeof(x), 1, in) ||
! 			    !fread(&y, sizeof(y), 1, in) ||
! 			    !fread(&n, sizeof(n), 1, in) ||
! 			    !fread(&a, sizeof(a), 1, in) || (n > 160) ||
! 			    !fread(buf, n, 1, in))
! 				abort();
! 			Term_text_emx(x, y, n, a, buf);
! 			break;
! 
! 			case PIP_INIT:
! 			Term_init_emx(NULL);
! 			break;
! 
! 			case PIP_NUKE:
! 			case EOF:
! 			default:
! 			Term_nuke_emx(NULL);
! 			end=1;
! 			break;
! 		}
! 	}
  
! 	return 0;
  }
  
  #endif /* __EMX__CLIENT__ */
--- 529,717 ----
   */
  errr init_emx(void)
  {
!     term *t;
  
!     /* Initialize the pipe windows */
!     initPipeTerm(&term_screen_recall, "recall", &term_recall);
!     initPipeTerm(&term_screen_choice, "choice", &term_choice);
!     initPipeTerm(&term_screen_mirror, "mirror", &term_mirror);
  
!     /* Initialize main window */
!     t = (term*)(&term_screen_main);
  
!     /* Initialize the term -- big key buffer */
!     term_init(t, 80, 24, 1024);
  
!     /* Special hooks */
!     t->init_hook = Term_init_emx;
!     t->nuke_hook = Term_nuke_emx;
! 
!     /* Add the hooks */
!     t->text_hook = Term_text_emx;
!     t->wipe_hook = Term_wipe_emx;
!     t->curs_hook = Term_curs_emx;
!     t->xtra_hook = Term_xtra_emx;
! 
!     /* Save it */
!     term_screen = t;
! 
!     /* Activate it */
!     Term_activate(t);
! 
!     /* Success */
!     return (0);
  }
  
  static FILE *initPipe(char *name)
  {
!     char buf[256];
!     FILE *fi;
  
!     sprintf(buf, "\\pipe\\angband\\%s", name);   /* Name of pipe */
!     fi=fopen(buf, "wb");                        /* Look for server */
!     return fi;
  }
  
  #else /* __EMX__CLIENT__ */
  
  int main(int argc, char **argv)
  {
!     int c, end = 0, lines = 25;
!     int x, y, h, n, v;
  
!     FILE *in=NULL;
!     char a;
!     char buf[160];
!     HPIPE pipe;
!     APIRET rc;
!     char *target;
! 
!     /* Check command line */
!     if (argc!=2 && argc!=3)
!     {
!         printf("Usage: %s choice|recall|mirror [number of lines]\n"
!                "Start this before angband.exe\n", argv[0]);
!         exit(1);
!     }
! 
!     if (argc==3) lines = atoi(argv[2]);
!     if (lines <= 0) lines = 25;
! 
!     printf("Looking for Angband... press ^C to abort\n");
! 
!     target=strdup(argv[1]);
!     for (c=0; c<strlen(target); c++) target[c]=tolower(target[c]);
! 
!     sprintf(buf, "\\pipe\\angband\\%s", target);
! 
!     do
!     {
!         rc=DosCreateNPipe((PSZ)buf,          /* Create pipe */
!                           &pipe,
!                           NP_ACCESS_INBOUND,
!                           NP_WAIT|NP_TYPE_BYTE|NP_READMODE_BYTE|1,
!                           1,                 /* No output buffer */
!                           1,                 /* No input buffer */
!                           -1);
! 
!         if (rc)                              /* Pipe not created */
!         {
!             printf("DosCreateNPipe: rc=%ld, pipe=%ld\n", (long)rc, (long)pipe);
!             break;
!         }
! 
!         do
!         {
!             rc=DosConnectNPipe(pipe);        /* Wait for angband to connect */
!             if (!rc) break;
!             _sleep2(500);                    /* Sleep for 0.5s  */
!         } while (_read_kbd(0, 0, 0)==-1);      /* Until key pressed */
! 
!         if (rc) break;
! 
!         h=_imphandle(pipe);                  /* Register handle with io */
!         setmode(h, O_BINARY);                 /* Make it binary */
!         in=fdopen(h, "rb");                   /* Register handle with stdio */
! 
!     } while (0);           /* We don't need no stinking exception handling <g> */
! 
!     if (!in)
!     {
!         printf("Sorry, the pipe connection to Angband could not be established.\n");
!         exit(1);
!     }
! 
!     printf("Connected.\n");
! 
!     sprintf(buf, "mode co80,%d", lines);
!     system(buf);
! 
!     /* Infinite loop */
!     while (!end)
!     {
!         /* Get command */
!         c = fgetc(in);
! 
!         switch (c)
!         {
!             case PIP_XTRA:
!                 if (!fread(&n, sizeof(x), 1, in) ||
!                     !fread(&v, sizeof(y), 1, in))
!                     abort();
! 
!                 /* This hack prevents another hack */
!                 switch (n)
!                 {
!                     case TERM_XTRA_CLEAR:
!                         v_clear();
!                         break;
! 
!                     default:
!                         printf("Sorry, angband.exe and aclient.exe don't fit together.\n");
!                         exit(1);
!                 }
! 
!                 break;
! 
!             case PIP_CURS:
!                 if (!fread(&x, sizeof(x), 1, in) ||
!                     !fread(&y, sizeof(y), 1, in))
!                     abort();
!                 Term_curs_emx(x, y);
!                 break;
! 
!             case PIP_WIPE:
!                 if (!fread(&x, sizeof(x), 1, in) ||
!                     !fread(&y, sizeof(y), 1, in) ||
!                     !fread(&n, sizeof(n), 1, in))
!                     abort();
!                 Term_wipe_emx(x, y, n);
!                 break;
! 
!             case PIP_TEXT:
!                 if (!fread(&x, sizeof(x), 1, in) ||
!                     !fread(&y, sizeof(y), 1, in) ||
!                     !fread(&n, sizeof(n), 1, in) ||
!                     !fread(&a, sizeof(a), 1, in) || (n > 160) ||
!                     !fread(buf, n, 1, in))
!                     abort();
!                 Term_text_emx(x, y, n, a, buf);
!                 break;
! 
!             case PIP_INIT:
!                 Term_init_emx(NULL);
!                 break;
! 
!             case PIP_NUKE:
!             case EOF:
!             default:
!                 Term_nuke_emx(NULL);
!                 end=1;
!                 break;
!         }
!     }
  
!     return 0;
  }
  
  #endif /* __EMX__CLIENT__ */
***************
*** 741,748 ****
  
  typedef struct
  {
! 	term t;
! 	void *instance;                          /* Pointer to window */
  } termWindow;
  
  /*
--- 747,754 ----
  
  typedef struct
  {
!     term t;
!     void *instance;                          /* Pointer to window */
  } termWindow;
  
  /*
***************
*** 750,756 ****
   */
  static errr Term_curs_emx(int x, int y)
  {
! 	return emx_curs(((termWindow*)Term)->instance, x, y);
  }
  
  /*
--- 756,762 ----
   */
  static errr Term_curs_emx(int x, int y)
  {
!     return emx_curs(((termWindow*)Term)->instance, x, y);
  }
  
  /*
***************
*** 758,764 ****
   */
  static errr Term_wipe_emx(int x, int y, int n)
  {
! 	return emx_wipe(((termWindow*)Term)->instance, x, y, n);
  }
  
  /*
--- 764,770 ----
   */
  static errr Term_wipe_emx(int x, int y, int n)
  {
!     return emx_wipe(((termWindow*)Term)->instance, x, y, n);
  }
  
  /*
***************
*** 766,772 ****
   */
  static errr Term_text_emx(int x, int y, int n, unsigned char a, cptr s)
  {
! 	return emx_text(((termWindow*)Term)->instance, x, y, n, a, s);
  }
  
  /*
--- 772,778 ----
   */
  static errr Term_text_emx(int x, int y, int n, unsigned char a, cptr s)
  {
!     return emx_text(((termWindow*)Term)->instance, x, y, n, a, s);
  }
  
  /*
***************
*** 774,780 ****
   */
  static void Term_init_emx(term *t)
  {
! 	return emx_init(((termWindow*)t)->instance);
  }
  
  /*
--- 780,786 ----
   */
  static void Term_init_emx(term *t)
  {
!     return emx_init(((termWindow*)t)->instance);
  }
  
  /*
***************
*** 798,824 ****
   * The screens
   */
  static termWindow term_screen_main,
! term_screen_recall,
! term_screen_choice,
! term_screen_mirror,
! term_screen_map;
  
  /*
   * Check for events -- called by "Term_scan_emx()"
   */
  static errr CheckEvents(int returnImmediately)
  {
! 	/* Get key - Macro triggers are generated by emx_read_kbd() */
! 	int k=emx_read_kbd(((termWindow*)Term)->instance, returnImmediately?0:1);
  
! 	/* Nothing ready */
! 	if (k < 0) return (1);
  
! 	/* Enqueue the key */
! 	Term_keypress(k);
  
! 	/* Success */
! 	return (0);
  }
  
  /*
--- 804,829 ----
   * The screens
   */
  static termWindow term_screen_main,
!     term_screen_recall,
!     term_screen_choice,
!     term_screen_mirror;
  
  /*
   * Check for events -- called by "Term_scan_emx()"
   */
  static errr CheckEvents(int returnImmediately)
  {
!     /* Get key - Macro triggers are generated by emx_read_kbd() */
!     int k=emx_read_kbd(((termWindow*)Term)->instance, returnImmediately?0:1);
  
!     /* Nothing ready */
!     if (k < 0) return (1);
  
!     /* Enqueue the key */
!     Term_keypress(k);
  
!     /* Success */
!     return (0);
  }
  
  /*
***************
*** 826,890 ****
   */
  static errr Term_xtra_emx(int n, int v)
  {
! 	void *instance=((termWindow*)Term)->instance;
  
! 	switch (n)
! 	{
! 		case TERM_XTRA_SHAPE:
! 		if (v)
! 		{
! 			emx_showcursor(instance);
! 		}
! 		else
! 		{
! 			emx_hidecursor(instance);
! 		}
! 		return (0);
! 
! 		case TERM_XTRA_NOISE:
! 		DosBeep(440, 50);
! 		return (0);
! 
! 		case TERM_XTRA_FLUSH:
! 		while (!CheckEvents(TRUE));
! 		return 0;
! 
! 		case TERM_XTRA_EVENT:
! 		return (CheckEvents(!v));
! 
! 		case TERM_XTRA_CLEAR:
! 		emx_clear(instance);
! 		return (0);
! 
! 		case TERM_XTRA_DELAY:
! 		if (v > 0) _sleep2(v);
! 		return (0);
! 	}
  
! 	return (1);
  }
  
  void emx_init_term(termWindow *t, void *main_instance, term **angTerm, int n)
  {
! 	term *te=(term*)t;
  
! 	/* Initialize window */
! 	emx_init_window(&t->instance, main_instance, n);
  
! 	*angTerm=te;
  
! 	/* Initialize the term -- big key buffer */
! 	term_init(te, 80, 24, 1024);
  
! 	/* Special hooks */
! 	te->init_hook = Term_init_emx;
! 	te->nuke_hook = Term_nuke_emx;
  
! 	/* Add the hooks */
! 	te->text_hook = Term_text_emx;
! 	te->wipe_hook = Term_wipe_emx;
! 	te->curs_hook = Term_curs_emx;
! 	te->xtra_hook = Term_xtra_emx;
  }
  
  /*
--- 831,895 ----
   */
  static errr Term_xtra_emx(int n, int v)
  {
!     void *instance=((termWindow*)Term)->instance;
  
!     switch (n)
!     {
!         case TERM_XTRA_SHAPE:
!             if (v)
!             {
!                 emx_showcursor(instance);
!             }
!             else
!             {
!                 emx_hidecursor(instance);
!             }
!             return (0);
! 
!         case TERM_XTRA_NOISE:
!             DosBeep(440, 50);
!             return (0);
! 
!         case TERM_XTRA_FLUSH:
!             while (!CheckEvents(TRUE));
!             return 0;
! 
!         case TERM_XTRA_EVENT:
!             return (CheckEvents(!v));
! 
!         case TERM_XTRA_CLEAR:
!             emx_clear(instance);
!             return (0);
! 
!         case TERM_XTRA_DELAY:
!             if (v > 0) _sleep2(v);
!             return (0);
!     }
  
!     return (1);
  }
  
  void emx_init_term(termWindow *t, void *main_instance, term **angTerm, int n)
  {
!     term *te=(term*)t;
  
!     /* Initialize window */
!     emx_init_window(&t->instance, main_instance, n);
  
!     *angTerm=te;
  
!     /* Initialize the term -- big key buffer */
!     term_init(te, 80, 24, 1024);
  
!     /* Special hooks */
!     te->init_hook = Term_init_emx;
!     te->nuke_hook = Term_nuke_emx;
  
!     /* Add the hooks */
!     te->text_hook = Term_text_emx;
!     te->wipe_hook = Term_wipe_emx;
!     te->curs_hook = Term_curs_emx;
!     te->xtra_hook = Term_xtra_emx;
  }
  
  /*
***************
*** 892,1016 ****
   */
  errr init_emx(void)
  {
! 	/* Initialize the windows */
! 	emx_init_term(&term_screen_main,  NULL,                      &term_screen, 0);
! 	emx_init_term(&term_screen_recall, term_screen_main.instance, &term_recall, 1);
! 	emx_init_term(&term_screen_choice, term_screen_main.instance, &term_choice, 2);
! 	emx_init_term(&term_screen_mirror, term_screen_main.instance, &term_mirror, 3);
! 	emx_init_term(&term_screen_map, term_screen_main.instance, &term_map, 4);
  
! 	/* Activate main window */
! 	Term_activate(term_screen);
  
! 	/* Success */
! 	return (0);
  }
  
  static void init_stuff(void)
  {
! 	char path[1024];
! 	cptr tail;
  
! 	/* Get the environment variable */
! 	tail = getenv("ANGBAND_PATH");
  
! 	/* Use the angband_path, or a default */
! 	strcpy(path, tail ? tail : DEFAULT_PATH);
  
! 	/* Hack -- Add a path separator (only if needed) */
! 	if (!suffix(path, PATH_SEP)) strcat(path, PATH_SEP);
  
! 	/* Initialize */
! 	init_file_paths(path);
  }
  
  static void quit_hook(cptr s)
  {
! 	/* Shut down the term windows */
! 	if (term_choice)
! 	{
! 		term_nuke(term_choice);
! 		emx_nuke(((termWindow*)term_choice)->instance);
! 	}
! 	if (term_recall)
! 	{
! 		term_nuke(term_recall);
! 		emx_nuke(((termWindow*)term_recall)->instance);
! 	}
! 	if (term_mirror)
! 	{
! 		term_nuke(term_mirror);
! 		emx_nuke(((termWindow*)term_mirror)->instance);
! 	}
! 	if (term_map)
! 	{
! 		term_nuke(term_map);
! 		emx_nuke(((termWindow*)term_map)->instance);
! 	}
! 	if (term_screen)
! 	{
! 		term_nuke(term_screen);
! 		emx_nuke(((termWindow*)term_screen)->instance);
! 	}
  
! 	/* Shut down window system - doesn't return */
! 	emx_endPM(s);
  }
  
  void angbandThread(void *arg)
  {
! 	bool new_game = FALSE;
  
! 	int show_score = 0;
  
! 	/* Save the "program name" */
! 	argv0 = (char*)arg;
  
! 	/* Use the "main-emx.c" support */
! 	init_emx();
! 	ANGBAND_SYS = "ibm";
  
! 	/* Get the file paths */
! 	init_stuff();
  
! 	/* Assume "Wizard" permission */
! 	can_be_wizard = TRUE;
  
! 	if (!emx_options((char**)&ANGBAND_DIR_USER,
! 	                 (char**)&ANGBAND_DIR_SAVE,
! 	                 (char**)&ANGBAND_DIR_INFO,
! 	                 &arg_force_roguelike,
! 	                 &arg_force_original,
! 	                 &arg_fiddle,
! 	                 &arg_wizard,
! 	                 player_name)) quit(NULL);
  
! 	/* Process the player name */
! 	process_player_name(TRUE);
  
! 	/* Tell "quit()" to call "Term_nuke()" */
! 	quit_aux = quit_hook;
  
! 	/* If requested, display scores and quit */
! 	if (show_score > 0) display_scores(0, show_score);
  
! 	/* Catch nasty signals */
! 	signals_init();
  
! 	/* Display the 'news' file */
! 	show_news();
  
! 	/* Initialize the arrays */
! 	init_some_arrays();
  
! 	/* Wait for response */
! 	pause_line(23);
  
! 	/* Play the game */
! 	play_game(new_game);
  
! 	/* Quit */
! 	quit(NULL);
  }
  
  #endif /* EMXPM */
--- 897,1016 ----
   */
  errr init_emx(void)
  {
!     /* Initialize the windows */
!     emx_init_term(&term_screen_main,  NULL,                      &term_screen, 0);
!     emx_init_term(&term_screen_recall, term_screen_main.instance, &term_recall, 1);
!     emx_init_term(&term_screen_choice, term_screen_main.instance, &term_choice, 2);
!     emx_init_term(&term_screen_mirror, term_screen_main.instance, &term_mirror, 3);
  
!     /* Activate main window */
!     Term_activate(term_screen);
  
!     /* Success */
!     return (0);
  }
  
  static void init_stuff(void)
  {
!     char path[1024];
!     cptr tail;
  
!     /* Get the environment variable */
!     tail = getenv("ANGBAND_PATH");
  
!     /* Use the angband_path, or a default */
!     strcpy(path, tail ? tail : DEFAULT_PATH);
  
!     /* Hack -- Add a path separator (only if needed) */
!     if (!suffix(path, PATH_SEP)) strcat(path, PATH_SEP);
  
!     /* Initialize */
!     init_file_paths(path);
  }
  
  static void quit_hook(cptr s)
  {
!     /* Shut down the term windows */
!     if (term_choice)
!     {
!         term_nuke(term_choice);
!         emx_nuke(((termWindow*)term_choice)->instance);
!     }
!     if (term_recall)
!     {
!         term_nuke(term_recall);
!         emx_nuke(((termWindow*)term_recall)->instance);
!     }
!     if (term_mirror)
!     {
!         term_nuke(term_mirror);
!         emx_nuke(((termWindow*)term_mirror)->instance);
!     }
! 
!     if (term_screen)
!     {
!         term_nuke(term_screen);
!         emx_nuke(((termWindow*)term_screen)->instance);
!     }
  
!     /* Shut down window system - doesn't return */
!     emx_endPM(s);
  }
  
  void angbandThread(void *arg)
  {
!     bool new_game = FALSE;
  
!     int show_score = 0;
  
!     /* Save the "program name" */
!     argv0 = (char*)arg;
  
!     /* Use the "main-emx.c" support */
!     init_emx();
!     ANGBAND_SYS = "ibm";
  
!     /* Get the file paths */
!     init_stuff();
  
!     /* Assume "Wizard" permission */
!     can_be_wizard = TRUE;
  
!     if (!emx_options((char**)&ANGBAND_DIR_USER,
!                      (char**)&ANGBAND_DIR_SAVE,
!                      (char**)&ANGBAND_DIR_INFO,
!                      &arg_force_roguelike,
!                      &arg_force_original,
!                      &arg_fiddle,
!                      &arg_wizard,
!                      player_name)) quit(NULL);
  
!     /* Process the player name */
!     process_player_name(TRUE);
  
!     /* Tell "quit()" to call "Term_nuke()" */
!     quit_aux = quit_hook;
  
!     /* If requested, display scores and quit */
!     if (show_score > 0) display_scores(0, show_score);
  
!     /* Catch nasty signals */
!     signals_init();
  
!     /* Display the 'news' file */
!     show_news();
  
!     /* Initialize the arrays */
!     init_some_arrays();
  
!     /* Wait for response */
!     pause_line(23);
  
!     /* Play the game */
!     play_game(new_game);
  
!     /* Quit */
!     quit(NULL);
  }
  
  #endif /* EMXPM */
*** ../old/src/Makefile.emx	Sun Oct 13 23:19:48 1996
--- Makefile.emx	Wed Oct 30 23:00:40 1996
***************
*** 2,13 ****
  
  # Purpose: Makefile support for "main-emx.c"
  
! # Note: Use 'dmake -B -r -f makefile.emx' to compile (see "main-emx.c" for details).
! #       Since "dmake" does not demand "hard" tab stops as delimiters,
  #       don't bother to add them.
  #
  #       Use 'dmake -B -r -f makefile.emx install' to install the executables
! #       and the batch file used for multiple VIO windows in the parent directory.
  #
  #       Use 'dmake -B -r -f makefile.emx clean' to remove temporary files.
  #
--- 2,14 ----
  
  # Purpose: Makefile support for "main-emx.c"
  
! # Note: Use 'dmake -B -r -f makefile.emx' to compile (see "main-emx.c" for
! #       details). Since "dmake" does not demand "hard" tab stops as delimiters,
  #       don't bother to add them.
  #
  #       Use 'dmake -B -r -f makefile.emx install' to install the executables
! #       and the batch file used for multiple VIO windows in the parent 
! #       directory.
  #
  #       Use 'dmake -B -r -f makefile.emx clean' to remove temporary files.
  #
***************
*** 16,42 ****
  #       'patches': If the original sources are located in "..\old\src",
  #                  then a file "..\patches.txt" will be created which contains
  #                  all changed files (diff -c). "..\exp\patches.uue" will 
! #                  contain the same file gziped and uuencodes. "..\exp\files.uue"
! #		   will contain the three emx-specific files tared, gziped and
! #  		   uuencoded. Needs 4OS2.
  #
  #       'export': The file "..\exp\$(EXPORT)" is created so that it 
  #                 can directly be uploaded as an official distribution archive.
! #		  Needs 4OS2.
  #
  
! VERSION         = 279v5
  EXPORT          = angband-$(VERSION).os2.zip
  
! CC 		= gcc
! AR		= ar
! CFLAGS 		= -MMD -O3 -DUSE_EMX -Zmt 
! LFLAGS 		= -lvideo 
  
  # Uncomment this if you have nice installed
! NICE 		= nice -i -n -30
  
! ###################################################################################
  
  .KEEP_STATE:
  
--- 17,43 ----
  #       'patches': If the original sources are located in "..\old\src",
  #                  then a file "..\patches.txt" will be created which contains
  #                  all changed files (diff -c). "..\exp\patches.uue" will 
! #                  contain the same file gziped and uuencodes. 
! #                  "..\exp\files.uue" will contain the three emx-specific files 
! #                  tared, gziped and uuencoded. Needs 4OS2.
  #
  #       'export': The file "..\exp\$(EXPORT)" is created so that it 
  #                 can directly be uploaded as an official distribution archive.
! #                 Needs 4OS2.
  #
  
! VERSION         = 280
  EXPORT          = angband-$(VERSION).os2.zip
  
! CC              = gcc
! AR              = ar
! CFLAGS          = -MMD -O3 -DUSE_EMX -Zmt 
! LFLAGS          = -lvideo 
  
  # Uncomment this if you have nice installed
! NICE            = nice -i -n -30
  
! ##############################################################################
  
  .KEEP_STATE:
  
***************
*** 57,65 ****
  
  export: ..\exp\$(EXPORT) 
  
! ####################################################################################
! ###   You don't have to change anything below.   ###################################
! ####################################################################################
  
  OBJS = \
    z-util.o z-virt.o z-form.o z-rand.o z-term.o \
--- 58,66 ----
  
  export: ..\exp\$(EXPORT) 
  
! ##############################################################################
! ###   You don't have to change anything below.   #############################
! ##############################################################################
  
  OBJS = \
    z-util.o z-virt.o z-form.o z-rand.o z-term.o \
***************
*** 100,106 ****
             copy ...\$(EXPFILES) > nul           ^ \
             md lib                               ^ \
             copy ...\lib\ lib\ /s >& nul         ^ \
!            del lib\save\player >& nul         	^ \
             zip -m -r $(EXPORT) * > nul          ^ \
             move $(EXPORT) ..                    ^ \
             cd ..                                ^ \
--- 101,107 ----
             copy ...\$(EXPFILES) > nul           ^ \
             md lib                               ^ \
             copy ...\lib\ lib\ /s >& nul         ^ \
!            del lib\save\player >& nul           ^ \
             zip -m -r $(EXPORT) * > nul          ^ \
             move $(EXPORT) ..                    ^ \
             cd ..                                ^ \
***************
*** 110,121 ****
  
  # Needs 4OS2! 
  ..\patches.txt .PHONY .IGNORE:
!     +@ echo These are the changes to the original source  > ..\patches.txt       	^ \
!        echo archive ($(VERSION)). You don't need to apply them >> ..\patches.txt 	^ \
!        echo if you can get the latest archive, which will >> ..\patches.txt 		^ \
!        echo have them applied already. >> ..\patches.txt 				^ \
!        echo. >> ..\patches.txt 								^ \
!        except (*~) for %a in ($(PATCHFILES)) 						  \
         do (diff -c ..\old\src\%a %a >> ..\patches.txt)
  
  # Needs 4OS2!
--- 111,122 ----
  
  # Needs 4OS2! 
  ..\patches.txt .PHONY .IGNORE:
!     +@ echo These are the changes to the original source  > ..\patches.txt              ^ \
!        echo archive ($(VERSION)). You don't need to apply them >> ..\patches.txt        ^ \
!        echo if you can get the latest archive, which will >> ..\patches.txt             ^ \
!        echo have them applied already. >> ..\patches.txt                                ^ \
!        echo. >> ..\patches.txt                                                          ^ \
!        except (*~) for %a in ($(PATCHFILES))                                              \
         do (diff -c ..\old\src\%a %a >> ..\patches.txt)
  
  # Needs 4OS2!
***************
*** 133,147 ****
  
  # Needs 4OS2!
  ..\exp\files.uue: $(FILES)
!     +@ 	md ..\exp >& nul                                        ^ \
! 	cd ..\exp                                               ^ \
! 	for %a in ($(FILES)) copy ..\src\%a > nul               ^ \
! 	tar -cvf files.tar $(FILESP)                            ^ \
! 	del $(FILESP)						^ \
! 	gzip files.tar                                          ^ \
! 	uuencode files.tar.gz                                   ^ \
! 	del files.tar.gz >& nul                                 ^ \
! 	move files.tar.gz.uue files.uue                          
  
  depends .IGNORE: $(OBJS)
      + echo. > depends
--- 134,148 ----
  
  # Needs 4OS2!
  ..\exp\files.uue: $(FILES)
!     +@  md ..\exp >& nul                                        ^ \
!         cd ..\exp                                               ^ \
!         for %a in ($(FILES)) copy ..\src\%a > nul               ^ \
!         tar -cvf files.tar $(FILESP)                            ^ \
!         del $(FILESP)                                           ^ \
!         gzip files.tar                                          ^ \
!         uuencode files.tar.gz                                   ^ \
!         del files.tar.gz >& nul                                 ^ \
!         move files.tar.gz.uue files.uue                          
  
  depends .IGNORE: $(OBJS)
      + echo. > depends
***************
*** 164,170 ****
   $(EC) REM optional number behind the name sets the number of lines for $(ECF)
   $(EC) REM that screen.                                                 $(ECF)
   $(EC) REM                                                              $(ECF)
!  $(EC) REM The function of the three views:                             $(ECF)
   $(EC) REM                                                              $(ECF)
   $(EC) REM   recall window - display monster recall info                $(ECF)
   $(EC) REM   choice window - display equipment and inventory            $(ECF)
--- 165,171 ----
   $(EC) REM optional number behind the name sets the number of lines for $(ECF)
   $(EC) REM that screen.                                                 $(ECF)
   $(EC) REM                                                              $(ECF)
!  $(EC) REM The original function of the three views:                    $(ECF)
   $(EC) REM                                                              $(ECF)
   $(EC) REM   recall window - display monster recall info                $(ECF)
   $(EC) REM   choice window - display equipment and inventory            $(ECF)
***************
*** 172,181 ****
   $(EC) REM                   pops up - use this if you've got a small   $(ECF)
   $(EC) REM                   screen that doesn't comfortably allow for  $(ECF)
   $(EC) REM                   three windows.                             $(ECF)
   $(EC).                                                                 $(ECF)
!  $(EC) start /win /n aclient recall 10                                  $(ECF)
!  $(EC) start /win /n aclient choice                                     $(ECF)
!  $(EC) rem start /win /n aclient mirror                                 $(ECF)
   $(EC) delay                                                            $(ECF)
   $(EC) angband %1 %2 %3 %4 %5 %6 %7 %8 %9                               $(ECF)
  
--- 173,187 ----
   $(EC) REM                   pops up - use this if you've got a small   $(ECF)
   $(EC) REM                   screen that doesn't comfortably allow for  $(ECF)
   $(EC) REM                   three windows.                             $(ECF)
+  $(EC) REM                                                              $(ECF)
+  $(EC) REM You MUST use the '=' command in Angband to specifiy which    $(ECF)
+  $(EC) REM things you want to have displayed in which window. You may   $(ECF)
+  $(EC) REM freely combine any contents with any window - the window     $(ECF)
+  $(EC) REM titles are there for historic reasons only.                  $(ECF)
   $(EC).                                                                 $(ECF)
!  $(EC) start "Angband Recall" /win /n aclient recall 10                 $(ECF)
!  $(EC) start "Angband Choice" /win /n aclient choice                    $(ECF)
!  $(EC) start "Angband Mirror" /win /n aclient mirror                    $(ECF)
   $(EC) delay                                                            $(ECF)
   $(EC) angband %1 %2 %3 %4 %5 %6 %7 %8 %9                               $(ECF)
  
