home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sources / games / 171 < prev    next >
Encoding:
Internet Message Format  |  1992-08-20  |  56.2 KB

  1. Path: sparky!uunet!zephyr.ens.tek.com!master!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v14i041:  umoria4 - single player dungeon simulation (ver. 5.5), Part09/39
  5. Message-ID: <3399@master.CNA.TEK.COM>
  6. Date: 20 Aug 92 18:03:24 GMT
  7. Sender: news@master.CNA.TEK.COM
  8. Lines: 1974
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: grabiner@math.harvard.edu (David Grabiner)
  12. Posting-number: Volume 14, Issue 41
  13. Archive-name: umoria4/Part09
  14. Supersedes: umoria3: Volume 9, Issue 55-97; Volume 10, Issue 15-17
  15. Environment: Curses, Unix, Mac, MS-DOS, Atari-ST, Amiga, VMS
  16.  
  17.  
  18.  
  19. #! /bin/sh
  20. # This is a shell archive.  Remove anything before this line, then unpack
  21. # it by saving it into a file and typing "sh file".  To overwrite existing
  22. # files, type "sh file -c".  You can also feed this as standard input via
  23. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  24. # will see the following message at the end:
  25. #        "End of archive 9 (of 39)."
  26. # Contents:  amiga/ERRORS atari_st/curscomp/curses.c shortnam.sed
  27. # Wrapped by billr@saab on Thu Aug 20 09:11:28 1992
  28. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  29. if test -f 'amiga/ERRORS' -a "${1}" != "-c" ; then 
  30.   echo shar: Will not clobber existing file \"'amiga/ERRORS'\"
  31. else
  32. echo shar: Extracting \"'amiga/ERRORS'\" \(140 characters\)
  33. sed "s/^X//" >'amiga/ERRORS' <<'END_OF_FILE'
  34. X
  35. XThe game tends to crash with an out of memory error if run for a very
  36. Xlong time.  This has been reported as happening after about 2 hours.
  37. END_OF_FILE
  38. if test 140 -ne `wc -c <'amiga/ERRORS'`; then
  39.     echo shar: \"'amiga/ERRORS'\" unpacked with wrong size!
  40. fi
  41. # end of 'amiga/ERRORS'
  42. fi
  43. if test -f 'atari_st/curscomp/curses.c' -a "${1}" != "-c" ; then 
  44.   echo shar: Will not clobber existing file \"'atari_st/curscomp/curses.c'\"
  45. else
  46. echo shar: Extracting \"'atari_st/curscomp/curses.c'\" \(41529 characters\)
  47. sed "s/^X//" >'atari_st/curscomp/curses.c' <<'END_OF_FILE'
  48. X/* This is essentially a shareware program, its usage is subject to
  49. Xthe following conditions :
  50. X
  51. XPUBLIC-DOMAIN       : don't take the credit for it.
  52. XCommercial purposes : Send 5 US-dollars or equivalent currency and return
  53. X                      postage to me to get a written consent to use it.
  54. X
  55. XCURSES may be distributed to anyone, provided that the various
  56. Xcopyright notices remain intact.
  57. X
  58. XBug reports and suggestions are welcome, send me e-mail.
  59. X
  60. XRene van't Veen                  (...!mcvax!nikhefh!u13)
  61. XDebussystraat 27
  62. X1817 GL Alkmaar
  63. XThe Netherlands
  64. X
  65. XExtensive modifications for clarity and speed by :
  66. XHildo Biersma
  67. XTollensstraat 138
  68. X2513 GE Den Haag
  69. XHolland
  70. XThe copyright remains with the original author */
  71. X
  72. X/*************************************************************************/
  73. X/* curses: simple-minded implementation of the curses package            */
  74. X/* Introduction                                                          */
  75. X/*                                                                       */
  76. X/* This source and resulting object may be modified,used or distributed  */
  77. X/* by anyone who so desires under the following conditions :             */
  78. X/*                                                                       */
  79. X/*  1) This notice and the copyright notice shall not be removed or      */
  80. X/*     changed.                                                          */
  81. X/*  2) No credit shall be taken for this source and resulting objects    */
  82. X/*  3) This source or resulting objects is not to be traded, sold or     */
  83. X/*     used for personal gain or profit.                                 */
  84. X/*  4) Inclusion of this source or resulting objects in commercially     */
  85. X/*     available packages is forbidden without written consent of the    */
  86. X/*     author of this source.                                            */
  87. X/*                                                                       */
  88. X/*************************************************************************/
  89. X
  90. X/**************************************************************************/
  91. X/*                                                                        */
  92. X/*  Some notes on the WINDOW data structure and the meaning of the flags. */
  93. X/*                                                                        */
  94. X/*  struct _win_st                                                        */
  95. X/*  {                                                                     */
  96. X/*    int16 _cury, _curx; : current cursor positions for this screen      */
  97. X/*    int16 _maxy, _maxx; : maximum x and y positions for this screen     */
  98. X/*    int16 _begy, _begx; : first x and y positions for this screen       */
  99. X/*    int16 _flags;       : a collection of flags for this screen         */
  100. X/*    bool  _clear;       : boolean - clear screen first at next update   */
  101. X/*    bool  _leave;       : boolean - leave cursor after printing a char  */
  102. X/*    bool  _scroll;      : boolean - scrolling allowed in this screen    */
  103. X/*    int16 **_y;         : pointer to the screen data (see below)        */
  104. X/*    int16 *_firstch;    : pointer to the first non-updated char         */
  105. X/*    int16 *_lastch;     : pointer to the last non-updated char          */
  106. X/*    int16 *_yend;       : pointer to the last char of _y                */
  107. X/*  };                                                                    */
  108. X/*                                                                        */
  109. X/*  The screen data is an array of 16-bit words. The lower 8 bits is the  */
  110. X/*  character; the next two bits, TOUCHED : 0x0200 and STANDOUT : 0x0100  */
  111. X/*  indicate whether this character is changed since the last screen and  */
  112. X/*  whether it should be printed in reverse. Note that, since curscr is   */
  113. X/*  a copy of the current screen, the TOUCHED flags have no meaning; they */
  114. X/*  may be set in a routine to keep it general. For the same reason, the  */
  115. X/*  _firstch and _lastch pointers may be set but have no real meaning.    */
  116. X/*  The _y pointer points to an array of pointers to words. Thus, _y[1]   */
  117. X/*  is a pointer to line number 1. This would indicate a practical way of */
  118. X/*  scrolling or erasing lines : just swap some pointers and don't copy   */
  119. X/*  the contents when unnecessary. However, this wreaks havoc with the    */
  120. X/*  _firstch and _lastch pointers; therefore this method is not used.     */
  121. X/*                                                                        */
  122. X/*  A subwindow is a screen that is a part of another screen and shares   */
  123. X/*  the character data with it. Any change to the window data is a change */
  124. X/*  to the subwindow and vice versa. The existence of subwindows is the   */
  125. X/*  reason for the data structure of _y described above; a subwindow only */
  126. X/*  has an array of pointers that point into the character data of the    */
  127. X/*  screen it is a subwindow of.                                          */
  128. X/*                                                                        */
  129. X/*  The _flags bit of the window may contain the following flags :        */
  130. X/*   _SUBWIN    : 01 - is this a suwindow                                 */
  131. X/*   _ENDLINE   : 02 - end of line of window is also end of screen        */
  132. X/*   _FULLWIN   : 04 - is this screen the full screen size                */
  133. X/*   _SCROLLWIN : 010 - may this window be scrolled                       */
  134. X/*   _STANDOUT  : 0200 - is reverse printing currently on for this window */
  135. X/*                                                                        */
  136. X/*  The _yend pointer in w is my own addition to this data structure. As  */
  137. X/*  a much-used operation was ptr = &(w->_y[w->_maxy][w->_maxx]), it was  */
  138. X/*  faster to do this at the creation of the window, and use it after.    */
  139. X/*  It is also useful as a sentinel, to see when a pointer goes beyond    */
  140. X/*  the character data.                                                   */
  141. X/*                                                                        */
  142. X/* I hope this makes all of the code somewhat more clear, especially the  */
  143. X/* setting or not setting of TOUCHED on curscr and the use of pointers.   */
  144. X/* Hildo Biersma (adress above) - please write if you have any problems.  */
  145. X/**************************************************************************/
  146. X
  147. X
  148. X/* include files */
  149. X#ifdef ATARIST_MWC
  150. X#include <osbind.h>    /* MWC */
  151. X#else
  152. X#include <tos.h>    /* TC */
  153. X#endif
  154. X#include <ext.h>
  155. X#include <stdlib.h>
  156. X#include <stddef.h>
  157. X#include <string.h>
  158. X#include "cursinc.h"
  159. X/* end of include files */
  160. X
  161. X/* terminal states : cooked, cbreak and raw */
  162. X/* Note that CBREAK mode has been disabled - Hildo Biersma */
  163. X#define COOKED 0
  164. X#define CBREAK 1
  165. X#define RAW    2
  166. X
  167. X/* globals : definition of global variables */
  168. X/* the following global variables are defined as external in curses.h */
  169. XWINDOW      *curscr;
  170. XWINDOW      *stdscr;
  171. Xchar        *Def_term = "AtariST";
  172. Xbool        My_term   = FALSE;
  173. Xconst char  *ttytype  = "Atari ST-series computer, VT52/CURSES mode";
  174. Xint         LINES     = 25;
  175. Xint         COLS      = 80;
  176. X/* end of global and externally available variables */
  177. X
  178. Xbool _doecho  = FALSE;
  179. Xbool _nlmap   = FALSE;
  180. Xbool _curini  = FALSE;
  181. Xbool _modinp  = 0; /* set input to Un*x compatability, i.e only char's */
  182. Xbool _csry    = 0;
  183. Xbool _csrx    = 0;
  184. X/* end of global variable definitions */
  185. X
  186. X/* initscr : initialize the curses package */
  187. XWINDOW *initscr()
  188. X{
  189. X  if (_curini)
  190. X  /* Initialized before */
  191. X  {
  192. X    wrefresh(curscr);
  193. X    return(NULL);
  194. X  };
  195. X  _curini = TRUE;
  196. X  curscr = newwin(0,0,0,0);
  197. X  if (curscr == NULL)
  198. X    return(NULL);
  199. X  stdscr = newwin(0,0,0,0);
  200. X  if (stdscr == NULL)
  201. X    return(NULL);
  202. X  /* Clear screen and home cursor */
  203. X  Bconout(2,'\033');
  204. X  Bconout(2,'E');
  205. X  /* Set 'discard EOL mode' : CR + LF needed for new line */
  206. X  Bconout(2,'\033');
  207. X  Bconout(2,'w');
  208. X  /* Hide cursor */
  209. X  Bconout(2,'\033');
  210. X  Bconout(2,'f');
  211. X  _csry = 0;
  212. X  _csrx = 0;
  213. X  return(stdscr);
  214. X}
  215. X/* end of initscr */
  216. X
  217. X
  218. X/* endwin : end of curses package */
  219. X/* Does not seem to be used by Moria */
  220. Xvoid endwin()
  221. X{
  222. X  if (!_curini)
  223. X    return;
  224. X  _curini = 0;
  225. X  delwin(stdscr);
  226. X  delwin(curscr);
  227. X  _movcur(LINES,0);
  228. X  /* Show cursor */
  229. X  Bconout(2,'\033');
  230. X  Bconout(2,'e');
  231. X}
  232. X/* end of endwin */
  233. X
  234. X
  235. X/* newwin : create a new window for the user */
  236. X/* l : lines; c : columns; by : begin-y; bx : begin-x */
  237. XWINDOW *newwin(l,c,by,bx)
  238. Xint l,c,bx,by;
  239. X{
  240. X  register WINDOW *tmp;
  241. X  int16 i, nl, nc;
  242. X  register int16 *tmpptr1,*tmpptr2; /* temp pointers for loops */
  243. X  
  244. X  tmp = (WINDOW *) malloc(sizeof(WINDOW));
  245. X  if (tmp == NULL)
  246. X    return(NULL);
  247. X  tmp->_curx = 0;
  248. X  tmp->_cury = 0;
  249. X  tmp->_clear = FALSE;
  250. X  tmp->_leave = FALSE;
  251. X  tmp->_scroll = FALSE;
  252. X  if (l == 0)
  253. X    nl = LINES - by;
  254. X  else
  255. X    nl = l;
  256. X  if (c == 0)
  257. X    nc = COLS - bx;
  258. X  else
  259. X    nc = c;
  260. X  if (nl < 1 || nl > LINES || nc < 1 || nc > COLS)
  261. X  {
  262. X    free(tmp);
  263. X    return(NULL);
  264. X  };
  265. X  tmp->_maxy = nl - 1;
  266. X  tmp->_maxx = nc - 1;
  267. X  if (nl == LINES && nc == COLS)
  268. X    tmp->_flags = _FULLWIN;
  269. X  else
  270. X    tmp->_flags = 0;
  271. X  if (by < 0 || by >= LINES || bx < 0 || bx >= COLS)
  272. X  {
  273. X    free(tmp);
  274. X    return(NULL);
  275. X  };
  276. X  tmp->_begy = by;
  277. X  tmp->_begx = bx;
  278. X  /* Allocate an array of pointers to the line-arrays */
  279. X  tmp->_y = (int16 **) malloc(sizeof(int16 *) * (tmp->_maxy+1));
  280. X  if (tmp->_y == NULL)
  281. X  {
  282. X    free(tmp);
  283. X    return(NULL);
  284. X  };
  285. X  /* Allocate a block of memory to fit the whole screen */
  286. X  tmp->_y[0] = (int16 *)malloc(sizeof(int16) * (tmp->_maxy+1)
  287. X                   * (tmp->_maxx+1));
  288. X  if (tmp->_y[0] == NULL)
  289. X  {
  290. X    free(tmp->_y);
  291. X    free(tmp);
  292. X    return(NULL);
  293. X  };
  294. X  for (i = 1; i <= tmp->_maxy; i++)
  295. X    tmp->_y[i] = tmp->_y[0] + i * (tmp->_maxx + 1);
  296. X  tmpptr1 = tmp->_y[0];
  297. X  tmp->_firstch = tmpptr1;
  298. X  tmpptr2 = &(tmp->_y[tmp->_maxy][tmp->_maxx]);
  299. X  tmp->_yend = tmpptr2;
  300. X  tmp->_lastch = tmpptr2;
  301. X  for (; tmpptr1 <= tmpptr2; tmpptr1++)
  302. X      *tmpptr1 = (' ' | TOUCHED);
  303. X  return(tmp);
  304. X} /* end of newwin */
  305. X
  306. X
  307. X/* delwin : delete a window */
  308. X/* Does not seem to be used by Moria */
  309. Xvoid delwin(w)
  310. XWINDOW *w;
  311. X{
  312. X  if (w == NULL)
  313. X    return;
  314. X  if (w->_flags & _SUBWIN)
  315. X    free(w->_y);
  316. X  else
  317. X  {
  318. X    free(w->_y[0]);
  319. X    free(w->_y);
  320. X  };
  321. X  free(w);
  322. X} /* end of delwin */
  323. X
  324. X
  325. X/* mvwin : move window */
  326. X/* Does not seem to be used by Moria */
  327. Xint mvwin(w,y,x)
  328. Xregister WINDOW *w;
  329. Xint y,x;
  330. X{
  331. X  if (y < 0 || x < 0 || (y + w->_maxy + 1) > LINES || (x + w->_maxx + 1) > COLS)
  332. X    return(ERR);
  333. X  w->_begy = y;
  334. X  w->_begx = x;
  335. X  touchwin(w);
  336. X  return(OK);
  337. X} /* end of mvwin */
  338. X
  339. X
  340. X/* touchwin : touch a window */
  341. Xvoid touchwin(w)
  342. XWINDOW *w;
  343. X{
  344. X  register int16 j, **tmpptr1,*tmpptr2; /* temporary pointers for loops */
  345. X
  346. X  w->_firstch = w->_y[0];
  347. X  w->_lastch = w->_yend;
  348. X  for (tmpptr1 = w->_y; *tmpptr1 <= w->_yend; tmpptr1++)
  349. X    for (j = 0,tmpptr2 = *tmpptr1; j <= w->_maxx; j++,tmpptr2++)
  350. X      *tmpptr2 |= TOUCHED;
  351. X} /* end of touchwin */
  352. X
  353. X
  354. X/* subwin : create a sub-window */
  355. X/* Does not seem to be used by Moria */
  356. XWINDOW *subwin(w,l,c,by,bx)
  357. XWINDOW *w;
  358. Xint l,c,by,bx;
  359. X{
  360. X  WINDOW *tmp;
  361. X  int16  i, nl, nc;
  362. X
  363. X  /* cannot take subwindows of curscr */
  364. X  if (w == curscr)
  365. X    return(NULL);
  366. X  tmp = (WINDOW *) malloc(sizeof(WINDOW));
  367. X  if (tmp == NULL)
  368. X    return(NULL);
  369. X  tmp->_curx = 0;
  370. X  tmp->_cury = 0;
  371. X  tmp->_clear = FALSE;
  372. X  tmp->_leave = FALSE;
  373. X  tmp->_scroll = FALSE;
  374. X  if (l == 0)
  375. X    nl = LINES - by;
  376. X  else
  377. X    nl = l;
  378. X  if (c == 0)
  379. X    nc = COLS - bx;
  380. X  else
  381. X    nc = c;
  382. X  if (l < 1 || l > (w->_maxy+1) || c < 1 || c > (w->_maxx+1))
  383. X  {
  384. X    free(tmp);
  385. X    return(NULL);
  386. X  };
  387. X  tmp->_maxy = nl - 1;
  388. X  tmp->_maxx = nc - 1;
  389. X  if (nl == LINES && nc == COLS)
  390. X    tmp->_flags = _FULLWIN | _SUBWIN;
  391. X  else
  392. X    tmp->_flags = _SUBWIN;
  393. X  if (by < w->_begy || by >= (w->_maxy+w->_begy) ||
  394. X      bx < w->_begx || bx >= (w->_maxx+w->_begx))
  395. X  {
  396. X    free(tmp);
  397. X    return(NULL);
  398. X  };
  399. X  tmp->_begy = by;
  400. X  tmp->_begx = bx;
  401. X  tmp->_y = (int16**) malloc(sizeof(int16*) * (tmp->_maxy+1));
  402. X  if (tmp->_y == NULL)
  403. X  {
  404. X    free(tmp);
  405. X    return(NULL);
  406. X  };
  407. X  tmp->_y[0] = w->_y[0] + (tmp->_begy-w->_begy) * (w->_maxx+2) + 
  408. X               (tmp->_maxx - w->_maxx);
  409. X  for (i = 1; i <= tmp->_maxy; i++)
  410. X    tmp->_y[i] = tmp->_y[0] + i * (w->_maxx + 2);
  411. X  tmp->_yend = &(tmp->_y[w->_maxy][w->_maxx]);
  412. X  /* make everything changed on first update of tmp       */
  413. X  touchwin(tmp);
  414. X  return(tmp);
  415. X} /* end of subwin */
  416. X
  417. X
  418. X/* leaveok : tell curses where to leave the cursor after updating */
  419. X/* Does not seem to be used by Moria */
  420. Xvoid leaveok(w,f)
  421. XWINDOW *w;
  422. Xbool f;
  423. X{
  424. X  w->_leave = f;
  425. X} /* end of leaveok */
  426. X
  427. X
  428. X/* scrollok : tell curses it is ok to scroll the window */
  429. X/* Does not seem to be used by Moria */
  430. Xvoid scrollok(w,f)
  431. XWINDOW *w;
  432. Xbool f;
  433. X{
  434. X  w->_scroll = f;
  435. X} /* end of scrollok */
  436. X
  437. X
  438. X/* nl : tell curses to map CR to CR,LF */
  439. X/* Does not seem to be used by Moria */
  440. Xvoid nl()
  441. X{
  442. X  /* Set 'Wrap at EOL' mode */
  443. X  Bconout(2,'\033');
  444. X  Bconout(2,'v');
  445. X  _nlmap = 1;
  446. X} /* end of nl */
  447. X
  448. X
  449. X/* nonl : tell curses not to map CR to CR,LF */
  450. X/* Does not seem to be used by Moria */
  451. Xvoid nonl()
  452. X{
  453. X  /* Set 'Discard EOL' mode */
  454. X  Bconout(2,'\033');
  455. X  Bconout(2,'w');
  456. X  _nlmap = 0;
  457. X} /* end of nonl */
  458. X
  459. X
  460. X/* longname : return the full name of the terminal */
  461. X/* always returns the contents of ttytype in name */
  462. X/* Does not seem to be used by Moria */
  463. Xvoid longname(termbuf,name)
  464. Xchar *termbuf, *name;
  465. X{
  466. X  strcpy(name,ttytype);
  467. X} /* end of longname */
  468. X
  469. X
  470. X/* curaddch : add a character to the current screen */
  471. Xint curaddch(c)
  472. Xchar c;
  473. X{
  474. X  int16 i, tpos, *tmpptr;
  475. X
  476. X  switch(c)
  477. X  {
  478. X    case '\n' :
  479. X      wclrtoeol(curscr);
  480. X      if (_nlmap)
  481. X        wmove(curscr,curscr->_cury+1,0);
  482. X      else
  483. X        wmove(curscr,curscr->_cury + 1,curscr->_curx);
  484. X      break;
  485. X    case '\r' :
  486. X      wmove(curscr,curscr->_cury,0);
  487. X      break;
  488. X    case '\t' :
  489. X      tpos = (curscr->_curx + curscr->_begx) % 8;
  490. X      if ((curscr->_flags & _STANDOUT))
  491. X      {
  492. X        /* reverse on */
  493. X        Bconout(2,'\033');
  494. X        Bconout(2,'p');
  495. X      }
  496. X      for (i = 0; i < (8 - tpos); i++)
  497. X        Bconout(5,' ');
  498. X      if ((curscr->_flags & _STANDOUT))
  499. X      {
  500. X        /* reverse off */
  501. X        Bconout(2,'\033');
  502. X        Bconout(2,'q');
  503. X      }
  504. X      break;
  505. X    default :
  506. X      tmpptr = &(curscr->_y[curscr->_cury][curscr->_curx]);
  507. X      if ((curscr->_flags & _STANDOUT))
  508. X      {
  509. X        *tmpptr = c | STANDOUT;
  510. X        /* reverse on */
  511. X        Bconout(2,'\033');
  512. X        Bconout(2,'p');
  513. X        Bconout(5,c);
  514. X        /* reverse off */
  515. X        Bconout(2,'\033');
  516. X        Bconout(2,'q');
  517. X      }
  518. X      else
  519. X      {
  520. X        *tmpptr = c;
  521. X        Bconout(5,c);
  522. X      };
  523. X      _csrx++;
  524. X  } /* end of switch */
  525. X  return(OK);
  526. X} /* end of curaddch */
  527. X
  528. X
  529. X/* waddch : add a character to a window */
  530. Xint waddch(w,c)
  531. Xregister WINDOW *w;
  532. Xchar   c;
  533. X{
  534. X  int16 i, tpos, *tmpptr;
  535. X
  536. X  if (w == curscr)
  537. X    curaddch(c);
  538. X  else
  539. X  {
  540. X    switch(c)
  541. X    {
  542. X      case '\n' :
  543. X        wclrtoeol(w);
  544. X        if (_nlmap)
  545. X          wmove(w,w->_cury+1,0);
  546. X        else
  547. X          wmove(w,w->_cury+1,w->_curx);
  548. X        break;
  549. X      case '\r' :
  550. X        wmove(w,w->_cury,0);
  551. X        break;
  552. X      case '\t' :
  553. X        tpos = (w->_curx + w->_begx) % 8;
  554. X        for (i = 0; i < (8 - tpos); i++)
  555. X          waddch(w,' ');
  556. X        break;
  557. X      default :
  558. X        tmpptr = &(w->_y[w->_cury][w->_curx]);
  559. X        if ((w->_flags & _STANDOUT))
  560. X          *tmpptr = c | (STANDOUT | TOUCHED);
  561. X        else
  562. X          *tmpptr = c | TOUCHED;
  563. X        if (w->_firstch == NULL)
  564. X        {
  565. X          w->_firstch = tmpptr;
  566. X          w->_lastch = tmpptr;
  567. X        }
  568. X        else
  569. X        {
  570. X          if (w->_firstch > tmpptr)
  571. X            w->_firstch = tmpptr;
  572. X          else
  573. X          {
  574. X            if (w->_lastch < tmpptr)
  575. X              w->_lastch = tmpptr;
  576. X          };
  577. X        };
  578. X        wmove(w,w->_cury,w->_curx+1);
  579. X    } /* end of switch */
  580. X  } /* end of if (w == curscr) */
  581. X  return(OK);
  582. X} /* end of waddch */
  583. X
  584. X
  585. X/* waddstr : add a string of characters to a window */
  586. Xint waddstr(w,s)
  587. Xregister WINDOW *w;
  588. Xregister char   *s;
  589. X{
  590. X  if (w == curscr)
  591. X    while (*s != '\0')
  592. X      curaddch(*s++);
  593. X  else
  594. X    while (*s != '\0')
  595. X      waddch(w,*s++);
  596. X  return(OK);
  597. X} /* end of waddstr */
  598. X
  599. X
  600. X/* box : draw a box around a window */
  601. X/* w : window nr; v : vertical char; h : horizontal char */
  602. X/* Does not seem to be used by Moria */
  603. Xvoid box(w,v,h)
  604. XWINDOW *w;
  605. Xchar v,h;
  606. X{
  607. X  int16 i;
  608. X
  609. X  for (i = 0; i <= w->_maxy; i++)
  610. X  {
  611. X    mvwaddch(w,i,0,v);
  612. X    mvwaddch(w,i,w->_maxx,v);
  613. X  };
  614. X  for (i = 1; i < w->_maxx; i++)
  615. X  {
  616. X    mvwaddch(w,0,i,h);
  617. X    mvwaddch(w,w->_maxy,i,h);
  618. X  };
  619. X} /* end of box */
  620. X
  621. X
  622. X/* wclear : clear a window */
  623. Xvoid wclear(w)
  624. XWINDOW *w;
  625. X{
  626. X  werase(w);
  627. X  clearok(w,TRUE);
  628. X  w->_curx = 0;
  629. X  w->_cury = 0;
  630. X} /* end of wclear */
  631. X
  632. X
  633. X/* wclrtobot : clear a window to the bottom */
  634. Xvoid wclrtobot(w)
  635. XWINDOW *w;
  636. X{
  637. X  register int16 j, **tmpptr1, *tmpptr2; /* temporary pointers for loops */
  638. X
  639. X  tmpptr1 = &(w->_y[w->_cury]);
  640. X  for (j = w->_curx, tmpptr2 = tmpptr1[w->_curx];
  641. X       j <= w->_maxx; j++, tmpptr2++)
  642. X    *tmpptr2 = ' ' | TOUCHED;
  643. X  tmpptr1++;
  644. X  for (; *tmpptr1 <= w->_yend; tmpptr1++)
  645. X    for (j = 0,tmpptr2 = *tmpptr1; j <= w->_maxx; j++, tmpptr2++)
  646. X      *tmpptr2 = ' ' | TOUCHED;
  647. X  if (w == curscr)
  648. X  {
  649. X    /* Erase to end of page */
  650. X    Bconout(2,'\033');
  651. X    Bconout(2,'J');
  652. X  }
  653. X  else
  654. X  {
  655. X    tmpptr2 = &(w->_y[w->_cury][w->_curx]);
  656. X    if (w->_firstch == NULL)
  657. X    {
  658. X      w->_firstch = tmpptr2;
  659. X      w->_lastch = w->_yend;
  660. X    }
  661. X    else
  662. X    {
  663. X      if (w->_firstch > tmpptr2)
  664. X        w->_firstch = tmpptr2;
  665. X      w->_lastch = w->_yend;
  666. X    };
  667. X  };
  668. X} /* end of wclrtobot */
  669. X
  670. X
  671. X/* wclrtoeol : clear a window to the end of the line */
  672. Xvoid wclrtoeol(w)
  673. XWINDOW *w;
  674. X{
  675. X  int16 i, *tmpptr2;
  676. X  register int16 *tmpptr1; /* Temporary pointer for loops */
  677. X
  678. X  for (i = w->_curx, tmpptr1 = &(w->_y[w->_cury][w->_curx]);
  679. X       i <= w->_maxx; i++, tmpptr1++)
  680. X    *tmpptr1 = ' ' | TOUCHED;
  681. X  if (w == curscr)
  682. X  {
  683. X    /* Clear to end of line */
  684. X    Bconout(2,'\033');
  685. X    Bconout(2,'K');
  686. X  }
  687. X  else
  688. X  {
  689. X    tmpptr1 = &(w->_y[w->_cury][w->_curx]);
  690. X    tmpptr2 = &(w->_y[w->_cury][w->_maxx]);
  691. X    if (w->_firstch == NULL)
  692. X    {
  693. X      w->_firstch = tmpptr1;
  694. X      w->_lastch = tmpptr2;
  695. X    }
  696. X    else
  697. X    {
  698. X      if (w->_firstch > tmpptr1)
  699. X        w->_firstch = tmpptr1;
  700. X      if (w->_lastch < tmpptr2)
  701. X        w->_lastch = tmpptr2;
  702. X    };
  703. X  };
  704. X} /* end of wclrtoeo */
  705. X
  706. X
  707. X/* wdelch : delete a character on a window */
  708. X/* Does not seem to be used by Moria */
  709. Xint wdelch(w)
  710. XWINDOW *w;
  711. X{
  712. X  int16 *tmpptr3;
  713. X  register int16 *tmpptr1, *tmpptr2; /* temporary pointers for loops */
  714. X
  715. X  tmpptr3 = &(w->_y[w->_cury][w->_maxx]);
  716. X  for (tmpptr1 = &(w->_y[w->_cury][w->_curx]), tmpptr2 = tmpptr1 + 1;
  717. X       tmpptr1 < tmpptr3;
  718. X       tmpptr1++, tmpptr2++)
  719. X    *tmpptr1 = *tmpptr2 | TOUCHED;
  720. X  *tmpptr3 = ' ' | TOUCHED;
  721. X  tmpptr1 = &(w->_y[w->_cury][w->_curx]);
  722. X  if (w == curscr)
  723. X  {
  724. X    /* Clear to end of line */
  725. X    Bconout(2,'\033');
  726. X    Bconout(2,'K');
  727. X    for (; tmpptr1 <= tmpptr3; tmpptr1++)
  728. X    {
  729. X      Bconout(5,(*tmpptr1 & 0xff));
  730. X      _csrx++;
  731. X    };
  732. X    _movcur(w->_cury,w->_curx);
  733. X  }
  734. X  else
  735. X  {
  736. X    if (w->_firstch == NULL)
  737. X    {
  738. X      w->_firstch = tmpptr1;
  739. X      w->_lastch = tmpptr3;
  740. X    }
  741. X    else
  742. X    {
  743. X      if (w->_firstch > tmpptr1)
  744. X        w->_firstch = tmpptr1;
  745. X      if (w->_lastch < tmpptr3)
  746. X        w->_lastch = tmpptr3;
  747. X    };
  748. X  };
  749. X  return(OK);
  750. X} /* end of wdelch */
  751. X
  752. X
  753. X/* wdeleteln : delete a line from a window */
  754. X/* Does not seem to be used by Moria */
  755. Xint wdeleteln(w)
  756. XWINDOW *w;
  757. X{
  758. X  int16 i,j;
  759. X  register int16 **tmpptr1, *tmpptr2, *tmpptr3; 
  760. X  /* temporary pointers for loops */
  761. X
  762. X  for (i = w->_cury + 1, tmpptr1 = &(w->_y[w->_cury]);
  763. X       i <= w->_maxy;
  764. X       i++, tmpptr1++)
  765. X    for (j = 0, tmpptr2 = *tmpptr1, tmpptr3 = *(tmpptr1 + 1);
  766. X         j <= w->_maxx;
  767. X         j++, tmpptr2++, tmpptr3++)
  768. X      *tmpptr2 = *tmpptr3 | TOUCHED;
  769. X  for (tmpptr2 = w->_y[w->_maxy]; tmpptr2 <= w->_yend; tmpptr2++)
  770. X    *tmpptr2 = ' ' | TOUCHED;
  771. X  if (w == curscr)
  772. X  {
  773. X    /* Delete line */
  774. X    Bconout(2,'\033');
  775. X    Bconout(2,'M');
  776. X    _csrx = 0;
  777. X    _movcur(w->_cury,w->_curx);
  778. X  }
  779. X  else
  780. X  {
  781. X    tmpptr2 = w->_y[w->_cury];
  782. X    if (w->_firstch == NULL)
  783. X    {
  784. X      w->_firstch = tmpptr2;
  785. X      w->_lastch = w->_yend;
  786. X    }
  787. X    else
  788. X    {
  789. X      if (w->_firstch > tmpptr2)
  790. X        w->_firstch = tmpptr2;
  791. X      w->_lastch = w->_yend;
  792. X    };
  793. X  };
  794. X  return(OK);
  795. X} /* end of wdeleteln */
  796. X
  797. X
  798. X/* werase : erase a window */
  799. Xvoid werase(w)
  800. Xregister WINDOW *w;
  801. X{
  802. X  register int16 j, **tmpptr1, *tmpptr2;
  803. X
  804. X  for (tmpptr1 = w->_y; *tmpptr1 <= w->_yend; tmpptr1++)
  805. X    for (j = 0, tmpptr2 = *tmpptr1; j <= w->_maxx; j++, tmpptr2++)
  806. X      *tmpptr2 = (' ' | TOUCHED);
  807. X  if (w == curscr)
  808. X  {
  809. X    /* Clear screen and home cursor */
  810. X    Bconout(2,'\033');
  811. X    Bconout(2,'E');
  812. X    _csry = 0;
  813. X    _csrx = 0;
  814. X    _movcur(curscr->_cury,curscr->_curx);
  815. X  }
  816. X  else
  817. X  {
  818. X    w->_firstch = w->_y[0];
  819. X    w->_lastch = w->_yend;
  820. X  };
  821. X} /* end of werase */
  822. X
  823. X
  824. X/* winsch : insert a character */
  825. X/* Does not seem to be used by Moria */
  826. Xint winsch(w,c)
  827. XWINDOW *w;
  828. Xchar c;
  829. X{
  830. X  int16 *tmpptr2, *tmpptr3;
  831. X  register int16 *tmpptr1; /* temporary pointer for loops */
  832. X
  833. X  tmpptr2 = &(w->_y[w->_cury][w->_curx]);
  834. X  tmpptr3 = &(w->_y[w->_cury][w->_maxx]);
  835. X  for (tmpptr1 = tmpptr3; tmpptr1 > tmpptr2; tmpptr1--)
  836. X    *tmpptr1 = *(tmpptr1 - 1) | TOUCHED;
  837. X  if (w == curscr)
  838. X  {
  839. X    /* Clear to end of line */
  840. X    Bconout(2,'\033');
  841. X    Bconout(2,'K');
  842. X    for (tmpptr1 = tmpptr2; tmpptr1 <= tmpptr3; tmpptr1++)
  843. X    {
  844. X      Bconout(5,(*tmpptr1 & 0xff));
  845. X      _csrx++;
  846. X    };
  847. X    _movcur(w->_cury,w->_curx);
  848. X  }
  849. X  else
  850. X  {
  851. X    if (w->_firstch == NULL)
  852. X    {
  853. X      w->_firstch = tmpptr2;
  854. X      w->_lastch = tmpptr3;
  855. X    }
  856. X    else
  857. X    {
  858. X      if (w->_firstch > tmpptr2)
  859. X        w->_firstch = tmpptr2;
  860. X      if (w->_lastch < tmpptr3)
  861. X        w->_lastch = tmpptr3;
  862. X    };
  863. X  };
  864. X  mvwaddch(w,w->_cury,w->_curx,c);
  865. X  return(OK);
  866. X} /* end of winsch */
  867. X
  868. X
  869. X/* winsertln : insert a line in a window */
  870. X/* Does not seem to be used by Moria */
  871. Xvoid winsertln(w)
  872. XWINDOW *w;
  873. X{
  874. X  int16 i, **tmpptr1, **tmpptr2;
  875. X  register int16 j, *tmpptr3, *tmpptr4;
  876. X
  877. X  for (i = w->_maxy - 1, tmpptr1 = &(w->_y[w->_maxy]), 
  878. X       tmpptr2 = &(w->_y[w->_maxy - 1]); i >= w->_cury; 
  879. X       --i, --tmpptr1, --tmpptr2)
  880. X  {
  881. X    for (j = 0, tmpptr3 = *tmpptr1, tmpptr4 = *tmpptr2;
  882. X         j <= w->_maxx; j++, tmpptr3++, tmpptr4++)
  883. X      *tmpptr3 = *tmpptr4 | TOUCHED;
  884. X  };
  885. X  for (j = 0, tmpptr3 = w->_y[w->_cury]; j <= w->_maxx; j++, tmpptr3++)
  886. X    *tmpptr3 = ' ' | TOUCHED;
  887. X  if (w == curscr)
  888. X  {
  889. X    /* Insert line */
  890. X    Bconout(2,'\033');
  891. X    Bconout(2,'L');
  892. X    _csrx = 0;
  893. X    _movcur(w->_cury,w->_curx);
  894. X  }
  895. X  else
  896. X  {
  897. X    if (w->_firstch == NULL)
  898. X      w->_firstch = w->_y[w->_cury];
  899. X    else
  900. X    {
  901. X      if (w->_firstch > w->_y[w->_cury])
  902. X        w->_firstch = w->_y[w->_cury];
  903. X    };
  904. X    w->_lastch = w->_yend;
  905. X  };
  906. X} /* end of winsertln */
  907. X
  908. X
  909. X/* wmove : move the cursor of the window to a location */
  910. Xint wmove(w,y,x)
  911. XWINDOW *w;
  912. Xint y,x;
  913. X{
  914. X  int16 i;
  915. X
  916. X  if (x < 0)
  917. X  {
  918. X    w->_curx = 0;
  919. X    return(ERR);
  920. X  }
  921. X  else
  922. X    if (x > w->_maxx)
  923. X    {
  924. X      w->_curx = w->_maxx;
  925. X      return(ERR);
  926. X    }
  927. X    else
  928. X      w->_curx = x;
  929. X  if (y < 0)
  930. X    {
  931. X      w->_cury = 0;
  932. X      return(ERR);
  933. X    }
  934. X  else
  935. X    if (y > w->_maxy)
  936. X    {
  937. X      if (w->_scroll)
  938. X      {
  939. X        for (i = w->_maxy; i < y; i++)
  940. X          scroll(w);
  941. X      };
  942. X      w->_cury = w->_maxy;
  943. X      return(ERR);
  944. X    }
  945. X    else
  946. X      w->_cury = y;
  947. X  if (w == curscr)
  948. X    _movcur(y,x);
  949. X  return(OK);
  950. X} /* end of wmove */
  951. X
  952. X
  953. X/* overlay: overlay two windows, ie : copy all non-space chars of v     */
  954. X/* onto the corresponding char of w.                                    */
  955. X/* Does not seem to be used by Moria */
  956. Xvoid overlay(v,w)
  957. XWINDOW *v, *w;
  958. X{
  959. X  int16 i, j;
  960. X  /* temporary pointers for loops */
  961. X  register int16 **tmpptr1, **tmpptr2, *tmpptr3, *tmpptr4;
  962. X
  963. X  for (i = 0, tmpptr1 = v->_y, tmpptr2 = w->_y;
  964. X       i <= v->_maxy && i <= w->_maxy;
  965. X       i++, tmpptr1++, tmpptr2++)
  966. X    for (j = 0, tmpptr3 = *tmpptr1, tmpptr4 = *tmpptr2;
  967. X         j <= v->_maxx && j <= w->_maxx;
  968. X         j++, tmpptr3++, tmpptr4++)
  969. X      if ((*tmpptr3 & 0xff) != 0x20)
  970. X        *tmpptr4 = *tmpptr3 | TOUCHED;
  971. X  if (w == curscr)
  972. X    wrefresh(curscr);
  973. X  else
  974. X  {
  975. X    w->_firstch = w->_y[0];
  976. X    w->_lastch = w->_yend;
  977. X  };
  978. X} /* end of overlay */
  979. X
  980. X
  981. X/* overwrite : overwrite two windows. */
  982. Xvoid overwrite(v,w)
  983. XWINDOW *v, *w;
  984. X{
  985. X  int16 j;
  986. X  /* temporary pointers for loops */
  987. X  register int16 **tmpptr1, **tmpptr2, *tmpptr3, *tmpptr4;
  988. X
  989. X  for (tmpptr1 = w->_y, tmpptr2 = v->_y;
  990. X       *tmpptr1 <= w->_yend && *tmpptr2 <= v->_yend;
  991. X       tmpptr1++, tmpptr2++)
  992. X    for (j = 0, tmpptr3 = *tmpptr1, tmpptr4 = *tmpptr2;
  993. X         j <= w->_maxx && j <= v->_maxx;
  994. X         j++, tmpptr3++, tmpptr4++)
  995. X      *tmpptr3 = *tmpptr4 | TOUCHED;
  996. X  if (w == curscr)
  997. X    wrefresh(curscr);
  998. X  else
  999. X  {
  1000. X    w->_firstch = w->_y[0];
  1001. X    w->_lastch = w->_yend;
  1002. X  };
  1003. X} /* end of overwrite */
  1004. X
  1005. X
  1006. X/* wstandout : set the standout flag for a window */
  1007. X/* In the real curses, this returns FALSE or a pointer to a capability flag.
  1008. X   Right here, it is a void function. */
  1009. Xvoid wstandout(w)
  1010. XWINDOW *w;
  1011. X{
  1012. X  w->_flags |= _STANDOUT;
  1013. X} /* end of wstandout */
  1014. X
  1015. X
  1016. X/* wstandend : end standout mode */
  1017. X/* In the real curses, this returns FALSE or a pointer to a capability flag.
  1018. X   Right here, it is a void function. */
  1019. Xvoid wstandend(w)
  1020. XWINDOW *w;
  1021. X{
  1022. X  w->_flags &= ~_STANDOUT;
  1023. X} /* end of wstandend */
  1024. X
  1025. X
  1026. X/* raw : set terminal in raw mode */
  1027. X/* Does not seem to be used by Moria */
  1028. Xvoid raw()
  1029. X{
  1030. X  /*
  1031. X  * raw mode means :
  1032. X  * when getting a character from the keyboard, return everything
  1033. X  * including keyboard shift state.
  1034. X  */
  1035. X  /* Note on RAW / COOKED / CBREAK : CBREAK mode has been cut out. */
  1036. X  /* RAW means    : full return of getch() values.                 */
  1037. X  /* COOKED means : return lower byte of getch() values only.      */
  1038. X  
  1039. X  _modinp = RAW;
  1040. X} /* end of raw */
  1041. X
  1042. X
  1043. X/* noraw : reset terminal from raw mode into cooked mode */
  1044. Xvoid noraw()
  1045. X{
  1046. X  /* See note above for RAW / COOKED / CBREAK */
  1047. X  _modinp = COOKED;
  1048. X} /* end of noraw */
  1049. X
  1050. X
  1051. X/* crmode: set terminal in cbreak mode */
  1052. X/* Note that CBREAK mode has been cut out - CBREAK now is the same as RAW */
  1053. X/* This had been done to avoid having programs quit when pressing CTRL-C. */
  1054. Xvoid crmode()
  1055. X{
  1056. X  _modinp = CBREAK;
  1057. X} /* end of crmode */
  1058. X
  1059. X
  1060. X/* nocrmode : reset terminal from cbreak into cooked mode */
  1061. Xvoid nocrmode()
  1062. X{
  1063. X  _modinp = COOKED;
  1064. X} /* end of nocrmode */
  1065. X
  1066. X
  1067. X/* echo : set curses to echo characters on input */
  1068. Xvoid echo()
  1069. X{
  1070. X  _doecho = TRUE;
  1071. X} /* end of echo */
  1072. X
  1073. X
  1074. X/* noecho : set curses not to echo characters on input */
  1075. Xvoid noecho()
  1076. X{
  1077. X  _doecho = FALSE;
  1078. X} /* end of noecho */
  1079. X
  1080. X
  1081. X/* wgetch : get a character from the terminal */
  1082. X/* WARNING : wgetch returns a 32-bit value, not a char although only */
  1083. X/* the lowest 8 bits may actually be transmitted. */
  1084. X/* Watch out for this bit of skulduggery : while getch is defined as */
  1085. X/* wgetch in the main program, in this routine wgetch makes use of   */
  1086. X/* getch. The difference between getch and wgetch is that wgetch     */
  1087. X/* displays a cursor and echoes (if wished) the input character.     */
  1088. X/* The cbreak mode has been cut out as I dislike being thrown out of */
  1089. X/* a program if I accidentally press CTRL-C.                         */
  1090. Xlong wgetch(w)
  1091. XWINDOW *w;
  1092. X{
  1093. X  int32 retval;
  1094. X
  1095. X  /* Show cursor */
  1096. X  Bconout(2,'\033');
  1097. X  Bconout(2,'e');
  1098. X  retval = getch();
  1099. X  if (_modinp == COOKED)
  1100. X    retval &= 0x00ff;
  1101. X  /* Hide cursor */
  1102. X  Bconout(2,'\033');
  1103. X  Bconout(2,'f');
  1104. X  if (_doecho)
  1105. X    waddch(w,(char)(0x00ff & retval));
  1106. X  return(retval);
  1107. X} /* end of wgetch */
  1108. X
  1109. X
  1110. X/* wgetstr : get a string from the terminal */
  1111. X/* I do not know whether this really works. The if's seem wrong to me - HB */
  1112. X/* Does not seem to be used by Moria */
  1113. Xint wgetstr(w,s)
  1114. XWINDOW *w;
  1115. Xchar   *s;
  1116. X{
  1117. X  int16 ox, oy;
  1118. X  bool reset, end;
  1119. X  char c;
  1120. X  int i;
  1121. X
  1122. X  reset = FALSE;
  1123. X  getyx(w,oy,ox);
  1124. X  if (_modinp == COOKED && _doecho == TRUE)
  1125. X  {
  1126. X    reset = TRUE;
  1127. X    _doecho = FALSE;
  1128. X  };
  1129. X  i = 0;
  1130. X  for (end = FALSE; !end; i++)
  1131. X  {
  1132. X    switch (_modinp)
  1133. X    {
  1134. X      case COOKED:
  1135. X        c = (char) wgetch(w);
  1136. X        if (c != 0x0d && c != 0x0a && c != 0x04 && c != 0)
  1137. X        {
  1138. X          s[i] = '\0';
  1139. X          end = TRUE;
  1140. X          break;
  1141. X        };
  1142. X        /* receive a backspace */
  1143. X        if (c == 0x08)
  1144. X        {
  1145. X          if (i != 0)
  1146. X          {
  1147. X            --i;
  1148. X            s[i] = 0;
  1149. X            if (reset)
  1150. X            mvwaddstr(w,oy,ox,s);
  1151. X          };
  1152. X          break;
  1153. X        };
  1154. X        /* receive control U or line kill */
  1155. X        if (c == 0x13)
  1156. X        {
  1157. X          i = 0;
  1158. X          if (reset)
  1159. X          wmove(w,oy,ox);
  1160. X          break;
  1161. X        };
  1162. X        s[i] = c;
  1163. X        if (reset)
  1164. X          waddch(w,c);
  1165. X        break;
  1166. X      case CBREAK:
  1167. X        c = (char) wgetch(w);
  1168. X        if (c != 0x0d && c != 0x0a && c != 0x04 && c != 0)
  1169. X        {
  1170. X          s[i] = '\0';
  1171. X          end = TRUE;
  1172. X          break;
  1173. X        };
  1174. X        s[i] = c;
  1175. X        break;
  1176. X      case RAW:
  1177. X        c = (char) wgetch(w);
  1178. X        if (c != 0x0d && c != 0x0a && c != 0x04 && c != 0)
  1179. X        {
  1180. X          s[i] = '\0';
  1181. X          end = TRUE;
  1182. X          break;
  1183. X        };
  1184. X        s[i] = c;
  1185. X        break;
  1186. X    };
  1187. X  };
  1188. X  if (reset)
  1189. X  _doecho = TRUE;
  1190. X  return(OK);
  1191. X} /* end of wgetstr */
  1192. X
  1193. X
  1194. X/* cur_refresh : refresh the current screen only. This is a simple and */
  1195. X/* relatively dumb routine that is called from wrefresh() only.        */
  1196. Xvoid cur_refresh()
  1197. X{
  1198. X  register int16 i, j, **tmpptr1, *tmpptr2;
  1199. X  
  1200. X  for (i = 0, tmpptr1 = curscr->_y; i < LINES; i++, tmpptr1++)
  1201. X  {
  1202. X    _movcur(i,0);
  1203. X    for (j = 0, tmpptr2 = *tmpptr1; j < COLS; j++ ,tmpptr2++)
  1204. X    {
  1205. X      if ((*tmpptr2 & STANDOUT))
  1206. X      {
  1207. X        /* reverse on */
  1208. X        Bconout(2,'\033');
  1209. X        Bconout(2,'p');
  1210. X        Bconout(5,(*tmpptr2 & 0xff));
  1211. X        /* reverse off */
  1212. X        Bconout(2,'\033');
  1213. X        Bconout(2,'q');
  1214. X      }
  1215. X      else
  1216. X        Bconout(5,(*tmpptr2 & 0xff));
  1217. X      _csrx++;
  1218. X    };
  1219. X  };
  1220. X  _movcur(curscr->_cury, curscr->_curx);
  1221. X} /* end of cur_refresh */
  1222. X
  1223. X/* wrefresh (new version) : refresh a window on the screen            */
  1224. X/* This should be an int function and return ERR or OK; but as Moria  */
  1225. X/* expects to see the void version, that's what it is.                */
  1226. X/* Sorry if you find this routine a bit hard to understand, what with */
  1227. X/* the pointer stuff and all that. If you have any problems, please   */
  1228. X/* read the comments on the data structure above. wrefresh() prints   */
  1229. X/* all chars marked as TOUCHED and different from the current curscr. */
  1230. X/* It also removes all TOUCHED marks from the window. If you like a   */
  1231. X/* good bit of horror, then look below this routine : the original    */
  1232. X/* source appears below (commented out). Enjoy the original code !    */
  1233. Xvoid wrefresh(w)
  1234. Xregister WINDOW *w;
  1235. X{
  1236. X           int16 **winptr1, **curptr1, curline, c;
  1237. X  register int16 *winptr2, *curptr2, curpos, linelength;
  1238. X
  1239. X  if (w == curscr)
  1240. X  {
  1241. X    if (w->_clear)
  1242. X    {
  1243. X      werase(w);
  1244. X      w->_clear = FALSE;
  1245. X      /* next statement is return at end of routine */
  1246. X    }
  1247. X    else
  1248. X    {
  1249. X      cur_refresh(); /* dumb routine : refresh the current screen */
  1250. X      /* next statement is return at end of routine */
  1251. X    }
  1252. X  }
  1253. X  else /* ie : w != curscr */
  1254. X  {
  1255. X    if (curscr->_clear)
  1256. X    {
  1257. X      werase(curscr);
  1258. X      curscr->_clear = FALSE;
  1259. X      /* Note that both curscr and w might have _clear set; so reset */
  1260. X      /* w->_clear too, or it might affect the next wrefresh() call. */
  1261. X      w->_clear = FALSE;
  1262. X    }
  1263. X    else /* ie : w != curscr and !curscr->_clear */
  1264. X    {
  1265. X      if (w->_clear)
  1266. X      {
  1267. X        /* no need to actually clear the curscr; just touch window w. This */
  1268. X        /* will set w->_firstch to the beginning of w, w->_lastch to the   */
  1269. X        /* end of w, and make all characters touched. This will ensure all */
  1270. X        /* characters of w that differ from curscr will be printed,        */
  1271. X        /* whether window w is the size of curscr or not.                  */
  1272. X        touchwin(w);
  1273. X        w->_clear = FALSE;
  1274. X      }
  1275. X    }
  1276. X    /* Copy all chars from _firstch to _lastch and print them.           */
  1277. X    /* curline : current line in curscr - initial value is first line    */
  1278. X    /* curpos : current char in curscr - initial value is first char     */
  1279. X    /* winptr1, curptr1 : pointer to current line in window, curscr      */
  1280. X    /* winptr2, curptr2 : pointer to current char in window, curscr      */
  1281. X    if (w->_firstch == NULL) /* ie : no changes */
  1282. X    {
  1283. X      curscr->_cury = w->_cury + w->_begy;
  1284. X      curscr->_curx = w->_curx + w->_begx;
  1285. X      _movcur(curscr->_cury, curscr->_curx);
  1286. X      /* next statement is return */
  1287. X    }
  1288. X    else /* w->_firstch != NULL : changes have appeared */
  1289. X    {
  1290. X      curline = (int16) ((w->_firstch - w->_y[0]) / (w->_maxx + 1));
  1291. X      winptr1 = &(w->_y[curline]);
  1292. X      winptr2 = w->_firstch;
  1293. X      curline += w->_begy;
  1294. X      curptr1 = &(curscr->_y[curline]);
  1295. X      curpos = (winptr2 - *winptr1) + w->_begx;
  1296. X      /* Sorry about the parentheses below - they are necessary. */
  1297. X      /* curptr2 is the address of word nr curpos in the line that */
  1298. X      /* curptr1 points to - ie curptr2 = curscr->_y[curline][curpos] */
  1299. X      curptr2 = &((*curptr1)[curpos]);
  1300. X      linelength = w->_maxx + w->_begx;
  1301. X      if (linelength > COLS)
  1302. X        linelength = COLS;
  1303. X      while (winptr2 <= w->_lastch)
  1304. X      {
  1305. X        if (*winptr2 & TOUCHED)
  1306. X        {
  1307. X          /* logical AND *winptr2 with 0x01ff, which is ~TOUCHED plus the */
  1308. X          /* the unused bits above TOUCHED that might accidentally be set */
  1309. X          /* by the processor. Would AND with ~TOUCHED were it not that I */
  1310. X          /* need to AND c with 0x01ff anyway - this way saves some time. */
  1311. X          c = (*winptr2 &= 0x01ff);
  1312. X          if ((*curptr2 & 0x01ff) != c)
  1313. X          {
  1314. X            *curptr2 = c;
  1315. X            _movcur(curline,curpos);
  1316. X            /* Note that _movcur sets _csrx to curpos and _csry to curline */
  1317. X            if ((c & STANDOUT))
  1318. X            {
  1319. X              /* reverse on */
  1320. X              Bconout(2,'\033');
  1321. X              Bconout(2,'p');
  1322. X              Bconout(5,(c & 0xff));
  1323. X              /* reverse off */
  1324. X              Bconout(2,'\033');
  1325. X              Bconout(2,'q');
  1326. X            }
  1327. X            else
  1328. X              Bconout(5,(c & 0xff));
  1329. X            /* We just printed a char, so cursor pos. has changed - also */
  1330. X            /* change _csrx. (_csry still is correct.)                   */
  1331. X            _csrx++;
  1332. X          }; /* end of if chars are different on window and curscr */
  1333. X        }; /* end of if TOUCHED char */
  1334. X        /* Now update all counters for next loop of while */
  1335. X        if ((++curpos) <= linelength)
  1336. X        {
  1337. X          /* line not yet finished */
  1338. X          winptr2++;
  1339. X          curptr2++;
  1340. X        }
  1341. X        else
  1342. X        {
  1343. X          /* line finished - goto next line --> update all counters */
  1344. X          curpos = w->_begx;
  1345. X          winptr2 = *(++winptr1);
  1346. X          curptr1++;
  1347. X          /* curptr2 is the address of word nr curpos in the line that */
  1348. X          /* the just increased curptr1 points to. */
  1349. X          /* Sorry about the parentheses - they are necessary here. */
  1350. X          curptr2 = &((*curptr1)[curpos]);
  1351. X          curline++;
  1352. X        }
  1353. X      }; /* end of while */
  1354. X      w->_firstch = NULL;
  1355. X      w->_lastch = NULL;
  1356. X      if (w->_leave)
  1357. X      {
  1358. X        w->_curx = _csrx - w->_begx;
  1359. X        w->_cury = _csry - w->_begy;
  1360. X        curscr->_cury = _csry;
  1361. X        curscr->_curx = _csrx;
  1362. X      }
  1363. X      else
  1364. X      {
  1365. X        curscr->_cury = w->_cury + w->_begy;
  1366. X        curscr->_curx = w->_curx + w->_begx;
  1367. X        _movcur(curscr->_cury, curscr->_curx);
  1368. X      };
  1369. X    }
  1370. X  } /* End of else : w != curscr */
  1371. X  return;
  1372. X} /* end of wrefresh : new version */
  1373. X
  1374. X
  1375. X/* HORROR CODE STARTS HERE - NOT FOR SENSITIVE PROGRAMMERS OR YOUNGSTERS  */
  1376. X/* As promised above, the original wrefresh() code. The only changes that */
  1377. X/* have been made are in the tabs and { } placement. This code does OK on */
  1378. X/* just one or two changed chars, but is far too slow on a whole screen.  */
  1379. X/* #[wrefresh: refresh a window on the screen */
  1380. X/* commenting out starts here
  1381. Xvoid wrefresh(w)
  1382. XWINDOW *w ;
  1383. X{
  1384. X  WORD i,j,k,l ;
  1385. X  WORD c, *ptr ;
  1386. X
  1387. X  ERR = 0 ;
  1388. X  OK = 1 ;
  1389. X  if ( w != curscr && curscr->_clear )
  1390. X  {
  1391. X    Bconout(2,'\033') ;
  1392. X    Bconout(2,'E') ;
  1393. X    _csry = 0 ;
  1394. X    _csrx = 0 ;
  1395. X    for ( i = 0 ; i < LINES ; i++ )
  1396. X    {
  1397. X      for ( j = 0 ; j < COLS ; j++ )
  1398. X        curscr->_y[i][j] = ' ' ;
  1399. X    } ;
  1400. X    curscr->_clear = 0 ;
  1401. X  } ;
  1402. X  if ( w->_clear )
  1403. X  {
  1404. X    if ( ( w->_flags & _FULLWIN ) )
  1405. X    {
  1406. X      Bconout(2,'\033') ;
  1407. X      Bconout(2,'E') ;
  1408. X      _csry = 0 ;
  1409. X      _csrx = 0 ;
  1410. X      for ( i = 0 ; i < LINES ; i++ )
  1411. X      {
  1412. X        for ( j = 0 ; j < COLS ; j++ )
  1413. X          curscr->_y[i][j] = ' ' ;
  1414. X      } ;
  1415. X    } ;
  1416. X    w->_firstch = w->_y[0] ;
  1417. X    w->_lastch = &(w->_y[w->_maxy][w->_maxx]) ;
  1418. X    w->_clear = 0 ;
  1419. X  } ;
  1420. X  if ( w != curscr )
  1421. X  {
  1422. X    if ( w->_firstch != 0 )
  1423. X    {
  1424. X      if ( w->_flags & _SUBWIN )
  1425. X      {
  1426. X        for ( i = 0 ; i <= w->_maxy ; i++ )
  1427. X        {
  1428. X          ptr = w->_y[i] ;
  1429. X          if ( ptr >= w->_firstch && ptr <= w->_lastch )
  1430. X          {
  1431. X            for ( j = 0 ; j <= w->_maxx ; j++ )
  1432. X            {
  1433. X              c = ptr[j] ;
  1434. X              k = i + w->_begy ;
  1435. X              l = j + w->_begx ;
  1436. X              if ( ( c & TOUCHED ) && ( k >= 0 && k < LINES && l >= 0 
  1437. X                    && l < COLS ) )
  1438. X              {
  1439. X                ptr[j] = c & ~TOUCHED ;
  1440. X                if ( ( curscr->_y[k][l] & 0x01ff ) != ( c & 0x01ff ) )
  1441. X                {
  1442. X                  curscr->_y[k][l] = c ;
  1443. X                  _movcur(k,l) ;
  1444. X                  if ( ( c & STANDOUT ) )
  1445. X                  {
  1446. X                    Bconout(2,'\033') ;
  1447. X                    Bconout(2,'p') ;
  1448. X                    Bconout(5,(c & 0xff)) ;
  1449. X                    Bconout(2,'\033') ;
  1450. X                    Bconout(2,'q') ;
  1451. X                  }
  1452. X                  else
  1453. X                  {
  1454. X                    Bconout(5,( c & 0xff )) ;
  1455. X                  } ;
  1456. X                  _csry = k ;
  1457. X                  _csrx = l + 1 ;
  1458. X                } ;
  1459. X              } ;
  1460. X            } ;
  1461. X          } ;
  1462. X        } ;
  1463. X      }
  1464. X      else
  1465. X      {
  1466. X        for ( ptr = w->_firstch ; ptr <= w->_lastch ; ptr++ )
  1467. X        {
  1468. X          c = *ptr ;
  1469. X          if ( c & TOUCHED )
  1470. X          {
  1471. X            k = ( WORD ) ( ptr - w->_y[0] ) ;
  1472. X            k = k / (  w->_maxx + 1 ) ;
  1473. X            l = ( WORD ) ( ptr - w->_y[k] ) + w->_begx ;
  1474. X            k = k + w->_begy ;
  1475. X            if ( k >= 0 && k < LINES && l >= 0 && l < COLS )
  1476. X            {
  1477. X              *ptr = c & ~TOUCHED ;
  1478. X              if ( ( curscr->_y[k][l] & 0x01ff ) != ( c & 0x01ff ) )
  1479. X              {
  1480. X                curscr->_y[k][l] = c ;
  1481. X                _movcur(k,l) ;
  1482. X                if ( ( c & STANDOUT ) )
  1483. X                {
  1484. X                  Bconout(2,'\033') ;
  1485. X                  Bconout(2,'p') ;
  1486. X                  Bconout(5,(c & 0xff)) ;
  1487. X                  Bconout(2,'\033') ;
  1488. X                  Bconout(2,'q') ;
  1489. X                }
  1490. X                else
  1491. X                {
  1492. X                  Bconout(5,( c & 0xff )) ;
  1493. X                } ;
  1494. X                _csry = k ;
  1495. X                _csrx = l + 1 ;
  1496. X              } ;
  1497. X            } ;
  1498. X          } ;
  1499. X        } ;
  1500. X      } ;
  1501. X      w->_firstch = 0 ;
  1502. X      w->_lastch = 0 ;
  1503. X      if ( w->_leave )
  1504. X      {
  1505. X        w->_curx = _csrx - w->_begx ;
  1506. X        w->_cury = _csry - w->_begy ;
  1507. X        curscr->_cury = _csry ;
  1508. X        curscr->_curx = _csrx ;
  1509. X      }
  1510. X      else
  1511. X      {
  1512. X        curscr->_cury = w->_cury + w->_begy ;
  1513. X        curscr->_curx = w->_curx + w->_begx ;
  1514. X        _movcur(curscr->_cury, curscr->_curx) ;
  1515. X      } ;
  1516. X    }
  1517. X    else
  1518. X    {
  1519. X      curscr->_cury = w->_cury + w->_begy ;
  1520. X      curscr->_curx = w->_curx + w->_begx ;
  1521. X      _movcur(curscr->_cury, curscr->_curx) ;
  1522. X    } ;
  1523. X  }
  1524. X  else
  1525. X  {
  1526. X    Bconout(2,'\033') ;
  1527. X    Bconout(2,'H') ;
  1528. X    _csry = 0 ;
  1529. X    _csrx = 0 ;
  1530. X    for ( i = 0 ; i < LINES ; i++ )
  1531. X    {
  1532. X      for ( j = 0 ; j < COLS ; j++ )
  1533. X      {
  1534. X        c = w->_y[i][j] ;
  1535. X        if ( ( c & STANDOUT ) )
  1536. X        {
  1537. X          Bconout(2,'\033') ;
  1538. X          Bconout(2,'p') ;
  1539. X          Bconout(5,(c & 0xff)) ;
  1540. X          Bconout(2,'\033') ;
  1541. X          Bconout(2,'q') ;
  1542. X        }
  1543. X        else
  1544. X        {
  1545. X          Bconout(5,(c & 0xff)) ;
  1546. X        } ;
  1547. X        _csrx++ ;
  1548. X      } ;
  1549. X      _movcur(i+1,0) ;
  1550. X    } ;
  1551. X    _movcur( curscr->_cury, curscr->_curx) ;
  1552. X  } ;
  1553. X}
  1554. XEnd of commenting out */
  1555. X/* #]wrefresh: */
  1556. X/* END OF HORROR CODE - CHILDREN CAN OPEN THEIR EYES NOW */
  1557. X
  1558. X
  1559. X/* mvcur : move cursor in standard curses manner */
  1560. X/* Does not seem to be used by Moria */
  1561. Xvoid mvcur(ly,lx,ny,nx)
  1562. Xint ly,lx,ny,nx;
  1563. X{
  1564. X  _movcur((int16) ny,(int16) nx);
  1565. X} /* end of mvcur */
  1566. X
  1567. X
  1568. X/* _movcur : move cursor */
  1569. Xvoid _movcur(y,x)
  1570. Xregister int16 y,x;
  1571. X{
  1572. X  if (_csry == y && _csrx == x)
  1573. X    return;
  1574. X  /* Set cursor position */
  1575. X  Bconout(2,'\033');
  1576. X  Bconout(2,'Y');
  1577. X  Bconout(2,y + ' ');
  1578. X  Bconout(2,x + ' ');
  1579. X  _csry = y;
  1580. X  _csrx = x;
  1581. X} /* end of _movcur */
  1582. X
  1583. X
  1584. X/* scroll : scroll a window upward one line */
  1585. Xint scroll(w)
  1586. XWINDOW *w;
  1587. X{
  1588. X           int16 **tmpptr1, **tmpptr2;
  1589. X  register int16 j, *tmpptr3, *tmpptr4; /* temp pointers for loops */
  1590. X
  1591. X  for (tmpptr1 = w->_y, tmpptr2 = &(w->_y[1]);
  1592. X       *tmpptr2 < w->_yend; 
  1593. X       tmpptr1++, tmpptr2++)
  1594. X  {
  1595. X    for (j = 0, tmpptr3 = *tmpptr1, tmpptr4 = *tmpptr2;
  1596. X         j <= w->_maxx;
  1597. X         j++, tmpptr3++, tmpptr4++)
  1598. X    {
  1599. X      *tmpptr3 = *tmpptr4;
  1600. X    }
  1601. X  }
  1602. X  for (tmpptr3 = w->_y[w->_maxy]; tmpptr3 <= w->_yend; tmpptr3++)
  1603. X    *tmpptr3 = ' ';
  1604. X  if (w == curscr)
  1605. X    wrefresh(curscr);
  1606. X  else
  1607. X  {
  1608. X    w->_firstch = w->_y[0];
  1609. X    w->_lastch = w->_yend;
  1610. X  };
  1611. X  return(OK);
  1612. X} /* end of scroll */
  1613. X/* end of the curses source */
  1614. END_OF_FILE
  1615. if test 41529 -ne `wc -c <'atari_st/curscomp/curses.c'`; then
  1616.     echo shar: \"'atari_st/curscomp/curses.c'\" unpacked with wrong size!
  1617. fi
  1618. # end of 'atari_st/curscomp/curses.c'
  1619. fi
  1620. if test -f 'shortnam.sed' -a "${1}" != "-c" ; then 
  1621.   echo shar: Will not clobber existing file \"'shortnam.sed'\"
  1622. else
  1623. echo shar: Extracting \"'shortnam.sed'\" \(11015 characters\)
  1624. sed "s/^X//" >'shortnam.sed' <<'END_OF_FILE'
  1625. Xs/CM_CARRY_GOLD/ACM_CARRY_GOLD/g
  1626. Xs/CM_CARRY_OBJ/BCM_CARRY_OBJ/g
  1627. Xs/CS_BR_FIRE/ACS_BR_FIRE/g
  1628. Xs/CS_BR_FROST/BCS_BR_FROST/g
  1629. Xs/CS_SUMMON_MON/ACS_SUMMON_MON/g
  1630. Xs/CS_SUMMON_UND/BCS_SUMMON_UND/g
  1631. Xs/CS_TEL_LONG/ACS_TEL_LONG/g
  1632. Xs/CS_TEL_SHORT/BCS_TEL_SHORT/g
  1633. Xs/CS_TEL_TO/CCS_TEL_TO/g
  1634. Xs/CUR_VERSION_MAJ/ACUR_VERSION_MAJ/g
  1635. Xs/CUR_VERSION_MIN/BCUR_VERSION_MIN/g
  1636. Xs/DUN_STR_DEN/ADUN_STR_DEN/g
  1637. Xs/DUN_STR_MAG/BDUN_STR_MAG/g
  1638. Xs/DUN_STR_MC/CDUN_STR_MC/g
  1639. Xs/DUN_STR_QC/DDUN_STR_QC/g
  1640. Xs/DUN_STR_QUA/EDUN_STR_QUA/g
  1641. Xs/DUN_STR_RNG/FDUN_STR_RNG/g
  1642. Xs/DUN_TUN_CHG/ADUN_TUN_CHG/g
  1643. Xs/DUN_TUN_CON/BDUN_TUN_CON/g
  1644. Xs/DUN_TUN_JCT/CDUN_TUN_JCT/g
  1645. Xs/DUN_TUN_PEN/DDUN_TUN_PEN/g
  1646. Xs/DUN_TUN_RND/EDUN_TUN_RND/g
  1647. Xs/ID_SHOW_HITDAM/AID_SHOW_HITDAM/g
  1648. Xs/ID_SHOW_P1/BID_SHOW_P1/g
  1649. Xs/INVEN_ARM/AINVEN_ARM/g
  1650. Xs/INVEN_ARRAY_SIZE/BINVEN_ARRAY_SIZE/g
  1651. Xs/INVEN_AUX/CINVEN_AUX/g
  1652. Xs/INVEN_HANDS/AINVEN_HANDS/g
  1653. Xs/INVEN_HEAD/BINVEN_HEAD/g
  1654. Xs/INVEN_LEFT/AINVEN_LEFT/g
  1655. Xs/INVEN_LIGHT/BINVEN_LIGHT/g
  1656. Xs/ITEM_GROUP_MAX/AITEM_GROUP_MAX/g
  1657. Xs/ITEM_GROUP_MIN/BITEM_GROUP_MIN/g
  1658. Xs/ITEM_NEVER_STACK_MAX/AITEM_NEVER_STACK_MAX/g
  1659. Xs/ITEM_NEVER_STACK_MIN/BITEM_NEVER_STACK_MIN/g
  1660. Xs/ITEM_SINGLE_STACK_MAX/AITEM_SINGLE_STACK_MAX/g
  1661. Xs/ITEM_SINGLE_STACK_MIN/BITEM_SINGLE_STACK_MIN/g
  1662. Xs/MAX_CAVE_FLOOR/AMAX_CAVE_FLOOR/g
  1663. Xs/MAX_CAVE_ROOM/BMAX_CAVE_ROOM/g
  1664. Xs/MAX_MALLOC/AMAX_MALLOC/g
  1665. Xs/AMAX_MALLOC_CHANCE/BMAX_MALLOC_CHANCE/g
  1666. Xs/MAX_MONS_LEVEL/AMAX_MONS_LEVEL/g
  1667. Xs/MAX_MON_MULT/BMAX_MON_MULT/g
  1668. Xs/MAX_MON_NATTACK/CMAX_MON_NATTACK/g
  1669. Xs/MAX_OBJECTS/AMAX_OBJECTS/g
  1670. Xs/MAX_OBJ_LEVEL/BMAX_OBJ_LEVEL/g
  1671. Xs/MIN_MALLOC_LEVEL/AMIN_MALLOC_LEVEL/g
  1672. Xs/MIN_MALLOC_TD/BMIN_MALLOC_TD/g
  1673. Xs/MIN_MALLOC_TN/CMIN_MALLOC_TN/g
  1674. Xs/MORIA_HELP/AMORIA_HELP/g
  1675. Xs/MORIA_HOU/BMORIA_HOU/g
  1676. Xs/MORIA_ORIG_HELP/AMORIA_ORIG_HELP/g
  1677. Xs/MORIA_OWIZ_HELP/BMORIA_OWIZ_HELP/g
  1678. Xs/MORIA_SAV/AMORIA_SAV/g
  1679. Xs/AMORIA_SAVE/BMORIA_SAVE/g
  1680. Xs/AMORIA_SAV_NAME/CMORIA_SAV_NAME/g
  1681. Xs/MORIA_TOP/AMORIA_TOP/g
  1682. Xs/AMORIA_TOP_NAME/BMORIA_TOP_NAME/g
  1683. Xs/MORIA_WELCOME/AMORIA_WELCOME/g
  1684. Xs/MORIA_WIZ_HELP/BMORIA_WIZ_HELP/g
  1685. Xs/NORMAL_TABLE_SD/ANORMAL_TABLE_SD/g
  1686. Xs/NORMAL_TABLE_SIZE/BNORMAL_TABLE_SIZE/g
  1687. Xs/OBJ_BASE_MAGIC/AOBJ_BASE_MAGIC/g
  1688. Xs/OBJ_BASE_MAX/BOBJ_BASE_MAX/g
  1689. Xs/OBJ_DIV_CURSED/AOBJ_DIV_CURSED/g
  1690. Xs/OBJ_DIV_SPECIAL/BOBJ_DIV_SPECIAL/g
  1691. Xs/OBJ_STD_ADJ/AOBJ_STD_ADJ/g
  1692. Xs/OBJ_STD_MIN/BOBJ_STD_MIN/g
  1693. Xs/PLAYER_EXIT_PAUSE/APLAYER_EXIT_PAUSE/g
  1694. Xs/PLAYER_FOOD_ALERT/BPLAYER_FOOD_ALERT/g
  1695. Xs/PLAYER_FOOD_FAINT/CPLAYER_FOOD_FAINT/g
  1696. Xs/PLAYER_FOOD_FULL/DPLAYER_FOOD_FULL/g
  1697. Xs/PLAYER_FOOD_MAX/EPLAYER_FOOD_MAX/g
  1698. Xs/PLAYER_FOOD_WEAK/FPLAYER_FOOD_WEAK/g
  1699. Xs/PLAYER_REGEN_FAINT/GPLAYER_REGEN_FAINT/g
  1700. Xs/PLAYER_REGEN_HPBASE/HPLAYER_REGEN_HPBASE/g
  1701. Xs/PLAYER_REGEN_MNBASE/IPLAYER_REGEN_MNBASE/g
  1702. Xs/PLAYER_REGEN_NORMAL/JPLAYER_REGEN_NORMAL/g
  1703. Xs/PLAYER_REGEN_WEAK/KPLAYER_REGEN_WEAK/g
  1704. Xs/PLAYER_WEIGHT_CAP/LPLAYER_WEIGHT_CAP/g
  1705. Xs/SCREEN_HEIGHT/ASCREEN_HEIGHT/g
  1706. Xs/SCREEN_WIDTH/BSCREEN_WIDTH/g
  1707. Xs/SN_SLAYING/ASN_SLAYING/g
  1708. Xs/SN_SLAY_ANIMAL/BSN_SLAY_ANIMAL/g
  1709. Xs/SN_SLAY_EVIL/CSN_SLAY_EVIL/g
  1710. Xs/SN_SLOWNESS/ASN_SLOWNESS/g
  1711. Xs/SN_SLOW_DESCENT/BSN_SLOW_DESCENT/g
  1712. Xs/STORE_MAX_INVEN/ASTORE_MAX_INVEN/g
  1713. Xs/STORE_MIN_INVEN/BSTORE_MIN_INVEN/g
  1714. Xs/TR_RES_ACID/ATR_RES_ACID/g
  1715. Xs/TR_RES_COLD/BTR_RES_COLD/g
  1716. Xs/TR_RES_FIRE/CTR_RES_FIRE/g
  1717. Xs/TR_RES_LIGHT/DTR_RES_LIGHT/g
  1718. Xs/TR_SLAY_ANIMAL/ATR_SLAY_ANIMAL/g
  1719. Xs/TR_SLAY_DRAGON/BTR_SLAY_DRAGON/g
  1720. Xs/TR_SLAY_EVIL/CTR_SLAY_EVIL/g
  1721. Xs/TR_SLAY_UNDEAD/DTR_SLAY_UNDEAD/g
  1722. Xs/TV_MAX_ENCHANT/ATV_MAX_ENCHANT/g
  1723. Xs/TV_MAX_OBJECT/BTV_MAX_OBJECT/g
  1724. Xs/TV_MAX_PICK_UP/CTV_MAX_PICK_UP/g
  1725. Xs/TV_MAX_VISIBLE/DTV_MAX_VISIBLE/g
  1726. Xs/TV_MAX_WEAR/ETV_MAX_WEAR/g
  1727. Xs/TV_MIN_DOORS/ATV_MIN_DOORS/g
  1728. Xs/TV_MIN_ENCHANT/BTV_MIN_ENCHANT/g
  1729. Xs/TV_MIN_VISIBLE/CTV_MIN_VISIBLE/g
  1730. Xs/TV_MIN_WEAR/DTV_MIN_WEAR/g
  1731. Xs/TV_POTION1/ATV_POTION1/g
  1732. Xs/TV_POTION2/BTV_POTION2/g
  1733. Xs/TV_SCROLL1/ATV_SCROLL1/g
  1734. Xs/TV_SCROLL2/BTV_SCROLL2/g
  1735. Xs/WIN_MON_APPEAR/AWIN_MON_APPEAR/g
  1736. Xs/WIN_MON_TOT/BWIN_MON_TOT/g
  1737. Xs/aggravate/Aaggravate/g
  1738. Xs/Aaggravate_monster/Baggravate_monster/g
  1739. Xs/attack_blows/Aattack_blows/g
  1740. Xs/attack_desc/Battack_desc/g
  1741. Xs/attack_dice/Cattack_dice/g
  1742. Xs/attack_sides/Dattack_sides/g
  1743. Xs/attack_type/Eattack_type/g
  1744. Xs/background/Abackground/g
  1745. Xs/Abackground_type/Bbackground_type/g
  1746. Xs/change_character/Achange_character/g
  1747. Xs/change_name/Bchange_name/g
  1748. Xs/change_speed/Cchange_speed/g
  1749. Xs/change_trap/Dchange_trap/g
  1750. Xs/character_generated/Acharacter_generated/g
  1751. Xs/character_saved/Bcharacter_saved/g
  1752. Xs/confuse_monster/Aconfuse_monster/g
  1753. Xs/confused/Bconfused/g
  1754. Xs/create_character/Acreate_character/g
  1755. Xs/create_food/Bcreate_food/g
  1756. Xs/creature_type/Acreature_type/g
  1757. Xs/creatures/Bcreatures/g
  1758. Xs/default_dir/Adefault_dir/g
  1759. Xs/default_signals/Bdefault_signals/g
  1760. Xs/delete_monster/Adelete_monster/g
  1761. Xs/delete_object/Bdelete_object/g
  1762. Xs/detect_evil/Adetect_evil/g
  1763. Xs/detect_inv/Bdetect_inv/g
  1764. Xs/detect_inv2/Cdetect_inv2/g
  1765. Xs/detect_invisible/Ddetect_invisible/g
  1766. Xs/detect_monsters/Edetect_monsters/g
  1767. Xs/detect_object/Fdetect_object/g
  1768. Xs/detect_sdoor/Gdetect_sdoor/g
  1769. Xs/detect_trap/Hdetect_trap/g
  1770. Xs/detect_treasure/Idetect_treasure/g
  1771. Xs/disarm_all/Adisarm_all/g
  1772. Xs/disarm_trap/Bdisarm_trap/g
  1773. Xs/insert_lnum/Ainsert_lnum/g
  1774. Xs/insert_num/Binsert_num/g
  1775. Xs/insert_str/Cinsert_str/g
  1776. Xs/insult_cur/Ainsult_cur/g
  1777. Xs/insult_max/Binsult_max/g
  1778. Xs/inven_carry/Ainven_carry/g
  1779. Xs/inven_check_num/Binven_check_num/g
  1780. Xs/inven_check_weight/Cinven_check_weight/g
  1781. Xs/inven_command/Dinven_command/g
  1782. Xs/inven_ctr/Einven_ctr/g
  1783. Xs/inven_damage/Ainven_damage/g
  1784. Xs/inven_destroy/Binven_destroy/g
  1785. Xs/inven_drop/Cinven_drop/g
  1786. Xs/inven_throw/Ainven_throw/g
  1787. Xs/inven_type/Binven_type/g
  1788. Xs/log_max_dlv/Alog_max_dlv/g
  1789. Xs/log_max_exp/Blog_max_exp/g
  1790. Xs/magic_shop/Amagic_shop/g
  1791. Xs/magic_spell/Bmagic_spell/g
  1792. Xs/max_panel_cols/Amax_panel_cols/g
  1793. Xs/max_panel_rows/Bmax_panel_rows/g
  1794. Xs/monster_attacks/Amonster_attacks/g
  1795. Xs/monster_death/Bmonster_death/g
  1796. Xs/monster_name/Cmonster_name/g
  1797. Xs/monster_type/Dmonster_type/g
  1798. Xs/move_cursor/Amove_cursor/g
  1799. Xs/Amove_cursor_relative/Bmove_cursor_relative/g
  1800. Xs/msdos_init/Amsdos_init/g
  1801. Xs/msdos_intro/Bmsdos_intro/g
  1802. Xs/next_to_corr/Anext_to_corr/g
  1803. Xs/next_to_wall/Bnext_to_wall/g
  1804. Xs/next_to_walls/Cnext_to_walls/g
  1805. Xs/object_ident/Aobject_ident/g
  1806. Xs/object_list/Bobject_list/g
  1807. Xs/panel_col/Apanel_col/g
  1808. Xs/Apanel_col_max/Bpanel_col_max/g
  1809. Xs/Apanel_col_min/Cpanel_col_min/g
  1810. Xs/Apanel_col_prt/Dpanel_col_prt/g
  1811. Xs/panel_contains/Epanel_contains/g
  1812. Xs/panel_row/Apanel_row/g
  1813. Xs/Apanel_row_max/Bpanel_row_max/g
  1814. Xs/Apanel_row_min/Cpanel_row_min/g
  1815. Xs/Apanel_row_prt/Dpanel_row_prt/g
  1816. Xs/player_exp/Aplayer_exp/g
  1817. Xs/player_hp/Bplayer_hp/g
  1818. Xs/player_init/Cplayer_init/g
  1819. Xs/player_light/Dplayer_light/g
  1820. Xs/player_saves/Eplayer_saves/g
  1821. Xs/player_type/Fplayer_type/g
  1822. Xs/protect_evil/Aprotect_evil/g
  1823. Xs/protection/Bprotection/g
  1824. Xs/prt_stat/Aprt_stat/g
  1825. Xs/Aprt_stat_block/Bprt_stat_block/g
  1826. Xs/Aprt_state/Cprt_state/g
  1827. Xs/put_misc1/Aput_misc1/g
  1828. Xs/put_misc2/Bput_misc2/g
  1829. Xs/put_misc3/Cput_misc3/g
  1830. Xs/remove_curse/Aremove_curse/g
  1831. Xs/remove_fear/Bremove_fear/g
  1832. Xs/resist_cold/Aresist_cold/g
  1833. Xs/resist_heat/Bresist_heat/g
  1834. Xs/restore_level/Arestore_level/g
  1835. Xs/restore_screen/Brestore_screen/g
  1836. Xs/restore_signals/Crestore_signals/g
  1837. Xs/restore_term/Drestore_term/g
  1838. Xs/screen_change/Ascreen_change/g
  1839. Xs/screen_map/Bscreen_map/g
  1840. Xs/search_flag/Asearch_flag/g
  1841. Xs/search_off/Bsearch_off/g
  1842. Xs/search_on/Csearch_on/g
  1843. Xs/set_acid_affect/Aset_acid_affect/g
  1844. Xs/set_acid_destroy/Bset_acid_destroy/g
  1845. Xs/set_corr/Aset_corr/g
  1846. Xs/Aset_corrodes/Bset_corrodes/g
  1847. Xs/sleep_monster/Asleep_monster/g
  1848. Xs/Asleep_monsters1/Bsleep_monsters1/g
  1849. Xs/Asleep_monsters2/Csleep_monsters2/g
  1850. Xs/speed_monster/Aspeed_monster/g
  1851. Xs/Aspeed_monsters/Bspeed_monsters/g
  1852. Xs/store_bought/Astore_bought/g
  1853. Xs/Astore_bought_p/Bstore_bought_p/g
  1854. Xs/store_buy/Cstore_buy/g
  1855. Xs/store_carry/Astore_carry/g
  1856. Xs/store_check_num/Bstore_check_num/g
  1857. Xs/store_choice/Cstore_choice/g
  1858. Xs/store_ctr/Dstore_ctr/g
  1859. Xs/store_init/Astore_init/g
  1860. Xs/store_inven/Bstore_inven/g
  1861. Xs/summon_monster/Asummon_monster/g
  1862. Xs/summon_object/Bsummon_object/g
  1863. Xs/summon_undead/Csummon_undead/g
  1864. Xs/sustain_chr/Asustain_chr/g
  1865. Xs/sustain_con/Bsustain_con/g
  1866. Xs/sustain_dex/Csustain_dex/g
  1867. Xs/sustain_int/Dsustain_int/g
  1868. Xs/sustain_str/Esustain_str/g
  1869. Xs/sustain_wis/Fsustain_wis/g
  1870. Xs/td_destroy/Atd_destroy/g
  1871. Xs/Atd_destroy2/Btd_destroy2/g
  1872. Xs/teleport/Ateleport/g
  1873. Xs/Ateleport_away/Bteleport_away/g
  1874. Xs/Ateleport_flag/Cteleport_flag/g
  1875. Xs/Ateleport_monster/Dteleport_monster/g
  1876. Xs/Ateleport_to/Eteleport_to/g
  1877. Xs/wizard_create/Awizard_create/g
  1878. Xs/wizard_light/Bwizard_light/g
  1879. Xs/generate_cave/Bgenerate_cave/g
  1880. Xs/compact_monsters/Acompact_monsters/g
  1881. Xs/compact_objects/Bcompact_objects/g
  1882. Xs/spell_choice/Aspell_choice/g
  1883. Xs/spell_type/Bspell_type/g
  1884. Xs/spell_names/Cspell_names/g
  1885. Xs/spell_worked/Dspell_worked/g
  1886. Xs/spell_order/Espell_order/g
  1887. Xs/spell_chance/Fspell_chance/g
  1888. Xs/spell_char/Gspell_char/g
  1889. Xs/spell_forgotten/Hspell_forgotten/g
  1890. Xs/spell_learned/Ispell_learned/g
  1891. Xs/spell_worked/Jspell_worked/g
  1892. Xs/place_monster/Aplace_monster/g
  1893. Xs/place_boundary/Bplace_boundary/g
  1894. Xs/place_streamer/Cplace_streamer/g
  1895. Xs/place_open_door/Dplace_open_door/g
  1896. Xs/place_broken_door/Eplace_broken_door/g
  1897. Xs/place_closed_door/Fplace_closed_door/g
  1898. Xs/place_locked_door/Gplace_locked_door/g
  1899. Xs/place_stuck_door/Hplace_stuck_door/g
  1900. Xs/place_secret_door/Iplace_secret_door/g
  1901. Xs/place_door/Jplace_door/g
  1902. Xs/place_up_stairs/Kplace_up_stairs/g
  1903. Xs/place_down_stairs/Lplace_down_stairs/g
  1904. Xs/place_stairs/Mplace_stairs/g
  1905. Xs/place_gold/Nplace_gold/g
  1906. Xs/place_trap/Oplace_trap/g
  1907. Xs/place_object/Pplace_object/g
  1908. Xs/place_win_monster/Qplace_win_monster/g
  1909. Xs/place_rubble/Rplace_rubble/g
  1910. Xs/build_type1/Abuild_type1/g
  1911. Xs/build_type2/Bbuild_type2/g
  1912. Xs/build_type3/Cbuild_type3/g
  1913. Xs/version_maj/Aversion_maj/g
  1914. Xs/version_min/Bversion_min/g
  1915. Xs/rd_shorts/Ard_shorts/g
  1916. Xs/wr_shorts/Awr_shorts/g
  1917. Xs/purchase_haggle/Bpurchase_haggle/g
  1918. Xs/prt_comment1/Aprt_comment1/g
  1919. Xs/prt_comment2/Bprt_comment2/g
  1920. Xs/prt_comment3/Cprt_comment3/g
  1921. Xs/prt_comment4/Dprt_comment4/g
  1922. Xs/prt_comment5/Eprt_comment5/g
  1923. Xs/prt_comment6/Fprt_comment6/g
  1924. Xs/comment1/Acomment1/g
  1925. Xs/comment2a/Bcomment2a/g
  1926. Xs/comment2b/Ccomment2b/g
  1927. Xs/comment3a/Dcomment3a/g
  1928. Xs/comment3b/Ecomment3b/g
  1929. Xs/comment4a/Fcomment4a/g
  1930. Xs/comment4b/Gcomment4b/g
  1931. Xs/comment5/Hcomment5/g
  1932. Xs/display_char/Adisplay_char/g
  1933. Xs/display_scores/Bdisplay_scores/g
  1934. Xs/display_commands/Cdisplay_commands/g
  1935. Xs/display_inventory/Ddisplay_inventory/g
  1936. Xs/display_cost/Edisplay_cost/g
  1937. Xs/display_store/Fdisplay_cost/g
  1938. Xs/signal_handler/Asignal_handler/g
  1939. Xs/new_mana/Anew_mana/g
  1940. Xs/Anew_mana_frac/Bnew_mana_frac/g
  1941. Xs/find_breakleft/Afind_breakleft/g
  1942. Xs/find_breakright/Bfind_breakright/g
  1943. Xs/map_diag1/Amap_diag1/g
  1944. Xs/map_diag2/Bmap_diag2/g
  1945. Xs/You feel Bconfused/You feel confused/g
  1946. Xs/appears Bconfused/appears confused/g
  1947. Xs/rune of Bprotection/rune of protection/g
  1948. Xs/You feel less Bconfused now/You feel less confused now/g
  1949. Xs/error in Bmove_cursor_relative/error in move_cursor_relative/g
  1950. Xs/You are too Bconfused/You are too confused/g
  1951. Xs/You hit a Ateleport trap!/You hit a teleport trap!/g
  1952. Xs/You are Bconfused/You are confused/g
  1953. Xs/kill weaker Bcreatures/kill weaker creatures/g
  1954. Xs/Ateleport short distances/teleport short distances/g
  1955. Xs/Ateleport long distances/teleport long distances/g
  1956. Xs/Ateleport its prey/teleport its prey/g
  1957. Xs/of these Bcreatures/of these creatures/g
  1958. Xs/invisible Bcreatures!/invisible creatures!/g
  1959. Xs/envelops several Bcreatures!/envelops several creatures!/g
  1960. Xs/You are Bconfused/You are confused/g
  1961. END_OF_FILE
  1962. if test 11015 -ne `wc -c <'shortnam.sed'`; then
  1963.     echo shar: \"'shortnam.sed'\" unpacked with wrong size!
  1964. fi
  1965. # end of 'shortnam.sed'
  1966. fi
  1967. echo shar: End of archive 9 \(of 39\).
  1968. cp /dev/null ark9isdone
  1969. MISSING=""
  1970. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 ; do
  1971.     if test ! -f ark${I}isdone ; then
  1972.     MISSING="${MISSING} ${I}"
  1973.     fi
  1974. done
  1975. if test "${MISSING}" = "" ; then
  1976.     echo You have unpacked all 39 archives.
  1977.     echo "Now run "bldfiles.sh" to build split files"
  1978.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1979. else
  1980.     echo You still need to unpack the following archives:
  1981.     echo "        " ${MISSING}
  1982. fi
  1983. ##  End of shell archive.
  1984. exit 0
  1985.