home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / games / volume14 / umoria4 / part34 < prev    next >
Internet Message Format  |  1992-08-31  |  59KB

  1. Path: uunet!zephyr.ens.tek.com!master!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v14i066:  umoria4 - single player dungeon simulation (ver. 5.5), Part34/39
  5. Message-ID: <3430@master.CNA.TEK.COM>
  6. Date: 22 Aug 92 22:15:14 GMT
  7. Sender: news@master.CNA.TEK.COM
  8. Lines: 2321
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: grabiner@math.harvard.edu (David Grabiner)
  12. Posting-number: Volume 14, Issue 66
  13. Archive-name: umoria4/Part34
  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 34 (of 39)."
  26. # Contents:  doc/history files/rwizcmds.hlp ibmpc/ms_ansi.c
  27. #   mac/macrsrc.c mac/moria.ro mac/scrnmgr/ScrnMgr.h
  28. #   mac/scrnmgr/ScrnTest.c source/signals.c
  29. # Wrapped by billr@saab on Thu Aug 20 09:11:35 1992
  30. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  31. if test -f 'doc/history' -a "${1}" != "-c" ; then 
  32.   echo shar: Will not clobber existing file \"'doc/history'\"
  33. else
  34. echo shar: Extracting \"'doc/history'\" \(7027 characters\)
  35. sed "s/^X//" >'doc/history' <<'END_OF_FILE'
  36. X
  37. XA History of Moria: written by Jim Wilson
  38. X    This history is somewhat biased towards the Umoria versions because
  39. X    those are the versions that I am most familiar with; info for the
  40. X    VMS versions, in particular, may be inaccurate.
  41. X
  42. XMoria 4.8:
  43. X    The last version developed by the original authors, R.A. Koeneke,
  44. X    etc., at the Univ Oklahoma.  This is written in VMS Pascal, and
  45. X    is only available for VAX/VMS systems.  All other versions of moria
  46. X    are based on this program.  (Sometimes referred to as VMS Moria    4.8.)
  47. X
  48. XMoria UB 5.0:
  49. X    This version was developed at Univ Buffalo, hence the UB in the name.
  50. X    This is also written in VMS Pascal, and is only available for VAX/VMS
  51. X    systems.  Some of the distinguishing features of this version are:
  52. X    a Black Market where one can purchase highly enchanted magic items at
  53. X    100 times normal value, monsters on the town level worth negative
  54. X    experience (Mother and Baby, Small Child), `shadow' Balrogs start
  55. X    appearing at level 50 with the `real' Balrog at level 1200 (this makes
  56. X    it a bit difficult to win).  There are also some new items, and many
  57. X    more new monsters.  (Sometimes referred to as VMS Moria 5.0 or
  58. X    Moria 5.0.  Should not be confused with Umoria 5.x.)  This is based
  59. X    on the Moria 4.8 sources.
  60. XMoria UB 5.1:
  61. X    The latest version of UB Moria.  This version is not available outside
  62. X    Univ Buffalo as yet, and I do not know what any of the new features
  63. X    are.  Only available for VAX/VMS systems.
  64. X
  65. XVMS Moria 6.0:
  66. X    This version was under development at Villanova by Rick Greene.
  67. X    However, it was never completed and was never released.  I believe
  68. X    that it was abandoned because Rick lost computer and/or network access.
  69. X    This was based on the Moria UB 5.0 sources.
  70. X
  71. XImoria:
  72. X    This version was developed at the Univ. Washington.  It is written
  73. X    in VMS Pascal, and is only available for VAX/VMX systems.  This
  74. X    version has never been officially released outside U. Washington.
  75. X    I know very little about this version, but have been told by people
  76. X    at U Washington that it is far superior to any other Moria version
  77. X    that currently exists.  It has many new monsters, new objects,
  78. X    new races, new classes, new terrain types (like water), etc.
  79. X    Unfortunately, the authors have never shown any serious intent
  80. X    to release the sources, they are simply unavailable.  I believe
  81. X    that it is based on the Moria 4.8 sources.
  82. XImoria 4.9:
  83. X    The latest version of Imoria.  I do not know anything about this
  84. X    version.
  85. X
  86. XPC-Moria 4.00+:
  87. X    This version is a port of the Moria 4.8 Pascal sources to the IBM-PC
  88. X    by John W. DeBoskey.  This is a faithful port of the original game,
  89. X    unfortunately, this version has quite a few bugs and hence is not
  90. X    as good as the unrelated PC-Moria 4.87 version.
  91. X
  92. XUmoria (UNIX Moria) 4.83/4.85/4.87:
  93. X    This version was developed by Jim Wilson at UC Berkeley.
  94. X    It is written in UNIX/C and is much more portable than the original
  95. X    sources.  These sources, at one time or another, were ported to VMS,
  96. X    IBM-PC, Atari ST, Amiga, Macintosh, Apple IIGS, VM/SP, Archimedes,
  97. X    are probably others too.  This version fixes very many bugs, spelling
  98. X    errors, and inconsistencies in the original Moria 4.8 sources.
  99. X    This version has no help facility like the original program.  It has
  100. X    character rerolling (in the later versions), but few other changes
  101. X    from the original game.  (This version has many names, e.g.
  102. X    Umoria 4.87, UNIX Moria 4.87, PC-Moria 4.83, PC-Moria 4.873, Mac Moria
  103. X    4.87, etc.  Just about anything with a .83/.85/.87 in the name is
  104. X    a version of this program.)  This is based on the Moria 4.8 sources.
  105. X
  106. XPC-Moria 4.83/4.873:
  107. X    This version was developed by Don Kneller, based on the Umoria sources.
  108. X    These sources are identical except that they will compile on machines
  109. X    with 16 bit integers, had many changes to reduce program size,
  110. X    and introduced the reduced map display.  (Note: PC-Moria 4.83 is
  111. X    extremely buggy, and is unplayable.  I strongly recommend that you
  112. X    upgrade to a newer version if you are still playing it.)
  113. X
  114. XAmiga Moria v3.0:
  115. X    This version was written by Richard and Bryan Henderson of Kettering,
  116. X    Ohio.  It is based on the Umoria 4.85 sources.  This version
  117. X    has bitmapped graphics, unlike the ascii graphics of all other
  118. X    versions.  It has weapons of Godly Might (which make one practically
  119. X    invicible) and some other changes that make it far far easier than
  120. X    all other Moria versions.  It also has several new monsters, such
  121. X    as Lavender Leprechauns.  Sources for this version were never
  122. X    released.
  123. X
  124. XBRUCE Moria:
  125. X    This version was developed by Christopher J. Stuart at Monash
  126. X    University, Clayton, Victoria Australia.  This version has many
  127. X    great new features: monster memories, look any direction code,
  128. X    settable options, better run/find code, can center character on
  129. X    screen, stat code rewritten to fix bugs, rudimentory help facility
  130. X    added, plus many other enhancements.  This was considered an
  131. X    experimental version, and source never publicly released.  This
  132. X    was based on the Umoria 4.85 sources.
  133. X
  134. XUMoria 5.x:
  135. X    This version is under developement by Jim Wilson at Cygnus Support.
  136. X    It has unified source for the UNIX/IBM-PC/Atari/Mac/VMS/Amiga ports
  137. X    of Umoria 4.87.  It includes many new features borrowed from BRUCE
  138. X    Moria, many more bug fixes, all floating point code eliminated,
  139. X    many changes that affect play balance (hopefully for the better),
  140. X    many type/structure changes to reduce game size and allow fixes for
  141. X    pervasive bugs.  See the doc/FEATURES.NEW file for a list of most
  142. X    user visible changes.  (Sometimes called Umoria 5.0, Moria 5.0,
  143. X    Moria 5.x.  Should not be confused with Moria UB 5.0.)
  144. XUmoria 5.5:
  145. X    The latest version of Umoria 5.x.
  146. X
  147. XVertical position indicates roughly when the versions were made available,
  148. Xalthough the scale is not very accurate.
  149. X
  150. X
  151. X1983                            Moria 1.0
  152. X                                   |
  153. X1985                            Moria 4.8
  154. X                                  /  \
  155. X1987            UMoria 4.83 ------    ----------------------\
  156. X                   /  \                       |              \
  157. X                  /    ------- PC-Moria 4.83  |              |
  158. X            UMoria 4.85            |          |              |
  159. X              /  | \               |          |         Moria UB 5.0
  160. X1988   /------   |  ------         |          |              |
  161. X      /          |    UMoria 4.87  |          |              |
  162. X     |       BRUCE Moria  |   \    |          |              |
  163. X Amiga Moria     |        |   PC-Moria 4.873  |              |---\
  164. X (surviving)     |           |      /            |              |    \
  165. X1989             |   /----------/             |              |  VMS Moria 6.0
  166. X                 |  /                         |              |   (defunct)
  167. X1990         Umoria 5.0                             |              |
  168. X                 |                       Imoria 4.9     Moria UB 5.1
  169. X                 |                            |              |
  170. X1992         Umoria 5.5               (alive and well)  (alive and well)
  171. X                 |
  172. X           (alive and well)
  173. END_OF_FILE
  174. if test 7027 -ne `wc -c <'doc/history'`; then
  175.     echo shar: \"'doc/history'\" unpacked with wrong size!
  176. fi
  177. # end of 'doc/history'
  178. fi
  179. if test -f 'files/rwizcmds.hlp' -a "${1}" != "-c" ; then 
  180.   echo shar: Will not clobber existing file \"'files/rwizcmds.hlp'\"
  181. else
  182. echo shar: Extracting \"'files/rwizcmds.hlp'\" \(376 characters\)
  183. sed "s/^X//" >'files/rwizcmds.hlp' <<'END_OF_FILE'
  184. X*  - Wizard light.
  185. X:  - Map area.
  186. X\  - Wizard Help.
  187. X^A - Remove Curse and Cure all maladies.
  188. X^D - Down/Up n levels.
  189. X^E - Change character.
  190. X^F - Delete monsters.
  191. X^G - Allocate treasures.
  192. X^I - Identify.
  193. X^O - Print random objects sample.
  194. X^T - Teleport player.
  195. X^W - Wizard password on/off.
  196. X@  - Create any object *CAN CAUSE FATAL ERROR*
  197. X+  - Gain experience.
  198. X&  - Summon monster.
  199. END_OF_FILE
  200. if test 376 -ne `wc -c <'files/rwizcmds.hlp'`; then
  201.     echo shar: \"'files/rwizcmds.hlp'\" unpacked with wrong size!
  202. fi
  203. # end of 'files/rwizcmds.hlp'
  204. fi
  205. if test -f 'ibmpc/ms_ansi.c' -a "${1}" != "-c" ; then 
  206.   echo shar: Will not clobber existing file \"'ibmpc/ms_ansi.c'\"
  207. else
  208. echo shar: Extracting \"'ibmpc/ms_ansi.c'\" \(6468 characters\)
  209. sed "s/^X//" >'ibmpc/ms_ansi.c' <<'END_OF_FILE'
  210. X/* ibmpc/ms_ansi.c: a set of routines to provide either PCcurses or ANSI output
  211. X
  212. X   Copyright (c) 1989-92 James E. Wilson, Don Kneller
  213. X
  214. X   This software may be copied and distributed for educational, research, and
  215. X   not for profit purposes provided that this copyright and statement are
  216. X   included in all such copies. */
  217. X
  218. X#include <curses.h>
  219. X#include <stdio.h>
  220. X
  221. X#if defined(MSDOS) && defined(ANSI)
  222. X
  223. X#ifdef LINT_ARGS
  224. Xstatic int curses_move(int, int);
  225. Xstatic char *getent(char *,char * *,int );
  226. Xstatic void initansistr(void);
  227. Xstatic int ansi_initscr(void);
  228. Xstatic int ansi_endwin(void);
  229. Xstatic int ansi_addch(int );
  230. Xstatic int ansi_mvaddstr(int ,int ,char *);
  231. Xstatic int ansi_mvprintw(int ,int ,char *,int ,int ,int ,int );
  232. Xstatic int ansi_move(int ,int );
  233. Xstatic int ansi_move_tgoto(int ,int );
  234. Xstatic int ansi_clrtobot(void);
  235. Xstatic int ansi_clrtoeol(void);
  236. Xstatic int ansi_mvaddch(int ,int ,char );
  237. Xstatic int ansi_clear(void);
  238. Xstatic int ansi_refresh(void);
  239. Xstatic int ansi_noop(void);
  240. Xint ansi_prep(int ,int, int);
  241. X#else
  242. Xstatic int    ansi_addch(), ansi_mvaddstr(), ansi_mvprintw(), ansi_move(),
  243. X        ansi_move_tgoto(),
  244. X        ansi_clrtobot(), ansi_clrtoeol(), ansi_mvaddch(), ansi_endwin(),
  245. X        ansi_refresh(), ansi_clear(), ansi_noop(), ansi_initscr();
  246. Xint ansi_prep();
  247. X#endif
  248. X
  249. Xextern char *tgetstr();
  250. Xextern char *getenv();
  251. Xextern char *tgoto();
  252. X
  253. X/* Must supply a functional form of the PCcurses "move" routine */
  254. Xstatic int
  255. Xcurses_move(y, x)
  256. Xint    y, x;
  257. X{
  258. X    return wmove(stdscr, y, x);
  259. X}
  260. X
  261. X/* Default is for curses to be used */
  262. Xint    (*output_addch)() = addch;
  263. Xint    (*output_mvaddstr)() = mvaddstr;
  264. Xint    (*output_mvprintw)() = mvprintw;
  265. Xint    (*output_move)() = curses_move;
  266. Xint    (*output_endwin)() = endwin;
  267. Xint    (*output_clrtobot)() = clrtobot;
  268. Xint    (*output_clrtoeol)() = clrtoeol;
  269. Xint    (*output_mvaddch)() = mvaddch;
  270. Xint    (*output_initscr)() = initscr;
  271. Xint    (*output_refresh)() = refresh;
  272. Xint    (*output_clear)() = clear;
  273. X
  274. Xint    (*output_nocrmode)() = nocrmode;
  275. Xint    (*output_crmode)() = crmode;
  276. Xint    (*output_nonl)() = nonl;
  277. Xint    (*output_nl)() = nl;
  278. Xint    (*output_noecho)() = noecho;
  279. Xint    (*output_echo)() = echo;
  280. Xint    ansi;
  281. Xint    LI;
  282. X
  283. X#define LEFTFIELD    -10;
  284. X#define    NEED        1
  285. X
  286. Xstatic int    moveopt = 1;
  287. Xstatic char    *CE, *CL, *CM, *DO, *LE, *ND, *TE, *TI, *UP;
  288. Xstatic int    currow = 0;
  289. Xstatic int    curcol = LEFTFIELD;
  290. X
  291. Xstatic char    *
  292. Xgetent(str, tbufp, need)
  293. Xchar    *str, **tbufp;
  294. Xint    need;
  295. X{
  296. X    char    *value;
  297. X
  298. X    if ((value = tgetstr(str, tbufp)) == NULL && need == NEED)
  299. X        error("termcap:  Moria needs %s\n", str);
  300. X    return value;
  301. X}
  302. X
  303. Xstatic void
  304. Xinitansistr()
  305. X{
  306. X    static    char tbuf[512];
  307. X    char    temp[1024], *tbufp, *term;
  308. X
  309. X    if ((term = getenv("TERM")) == NULL)
  310. X        term = "ibmpc-mono";
  311. X    if (tgetent(temp, term) < 1)
  312. X        error("Unknown terminal type: %s.", term);
  313. X    tbufp = tbuf;
  314. X    LE = getent("le", &tbufp, NEED);
  315. X    CE = getent("ce", &tbufp, NEED);
  316. X    CL = getent("cl", &tbufp, NEED);
  317. X    CM = getent("cm", &tbufp, NEED);
  318. X    ND = getent("nd", &tbufp, NEED);
  319. X    TE = getent("te", &tbufp, !NEED);
  320. X    TI = getent("ti", &tbufp, !NEED);
  321. X    UP = getent("up", &tbufp, NEED);
  322. X    DO = getent("do", &tbufp, NEED);
  323. X    LI = tgetnum("li");
  324. X    if (LI <= 0)
  325. X        LI = 24;
  326. X}
  327. X
  328. Xansi_prep(check_ansi, domoveopt, truetgoto)
  329. Xint    check_ansi;
  330. Xint    domoveopt;
  331. Xint    truetgoto;
  332. X{
  333. X    moveopt = domoveopt;
  334. X
  335. X    /* Check for ANSI.SYS */
  336. X    if (check_ansi) {
  337. X        /* Clear the input queue */
  338. X        while (kbhit())
  339. X            (void) getch();
  340. X
  341. X        /* Send out the DSR string */
  342. X        fputs("\033[6n", stdout);
  343. X        fflush(stdout);
  344. X
  345. X        /* Is there anything in the input?  If so ANSI responded. */
  346. X        if (kbhit()) {
  347. X            while (kbhit())
  348. X                (void) getch();
  349. X        }
  350. X        else {
  351. X            putchar('\n');
  352. X            error("ANSI.SYS not installed!  See MORIA.DOC for details!\n");
  353. X        }
  354. X    }
  355. X
  356. X    /* get the ANSI strings */
  357. X    initansistr();
  358. X
  359. X    /* change function pointers to ANSI versions */
  360. X    output_addch = ansi_addch;
  361. X    output_mvaddstr = ansi_mvaddstr;
  362. X    output_mvprintw = ansi_mvprintw;
  363. X    if (truetgoto)
  364. X        output_move = ansi_move_tgoto;
  365. X    else
  366. X        output_move = ansi_move;
  367. X    output_clrtobot = ansi_clrtobot;
  368. X    output_clrtoeol = ansi_clrtoeol;
  369. X    output_mvaddch = ansi_mvaddch;
  370. X    output_refresh = ansi_refresh;
  371. X    output_clear = ansi_clear;
  372. X    output_initscr = ansi_initscr;
  373. X    output_endwin = ansi_endwin;
  374. X
  375. X    output_nocrmode =
  376. X    output_crmode =
  377. X    output_nonl =
  378. X    output_nl =
  379. X    output_noecho =
  380. X    output_echo = ansi_noop;
  381. X
  382. X    ansi = 1;
  383. X}
  384. X
  385. Xstatic int
  386. Xansi_initscr()
  387. X{
  388. X    if (TI != NULL)
  389. X        fputs(TI, stdout);
  390. X    return OK;
  391. X}
  392. X
  393. Xstatic int
  394. Xansi_endwin()
  395. X{
  396. X    if (TI != NULL)
  397. X        fputs(TE, stdout);
  398. X    return OK;
  399. X}
  400. X
  401. Xstatic int
  402. Xansi_addch(ch)
  403. Xint    ch;
  404. X{
  405. X    putc(ch, stdout);
  406. X    curcol++;
  407. X    return OK;
  408. X}
  409. X
  410. Xstatic int
  411. Xansi_mvaddstr(row, col, str)
  412. Xint    row, col;
  413. Xchar    *str;
  414. X{
  415. X    (void) ansi_move(row, col);
  416. X    fputs(str, stdout);
  417. X    curcol = LEFTFIELD;
  418. X    return OK;
  419. X}
  420. X
  421. Xstatic int
  422. Xansi_mvprintw(row, col, fmt, a1, a2, a3, a4)
  423. Xint    row, col;
  424. Xchar    *fmt;
  425. Xint    a1, a2, a3, a4;    /* large enough for %c%s%c of files.c ! */
  426. X{
  427. X    (void) ansi_move(row, col);
  428. X    fprintf(stdout, fmt, a1, a2, a3, a4);
  429. X    curcol = LEFTFIELD;
  430. X    return OK;
  431. X}
  432. X
  433. X#define abs(x)    ((x) < 0 ? -(x) : (x))
  434. X
  435. X/* For a bit more speed, don't use tgoto() from termcap */
  436. Xstatic int
  437. Xansi_move(row, col)
  438. Xint    row, col;
  439. X{
  440. X    if (moveopt && abs(currow - row) < 3 && abs(curcol - col) < 3) {
  441. X        while (row > currow)
  442. X            fputs(DO, stdout), currow++;
  443. X        while (row < currow)
  444. X            fputs(UP, stdout), currow--;
  445. X        while (col > curcol)
  446. X            fputs(ND, stdout), curcol++;
  447. X        while (col < curcol)
  448. X            fputs(LE, stdout), curcol--;
  449. X    }
  450. X    else
  451. X        fprintf(stdout, "\033[%d;%dH\0__cursor motion__", row+1,col+1);
  452. X    currow = row;
  453. X    curcol = col;
  454. X    return OK;
  455. X}
  456. X
  457. X/* Use tgoto (which is rather slow) */
  458. Xstatic int
  459. Xansi_move_tgoto(row, col)
  460. Xint    row, col;
  461. X{
  462. X    if (moveopt && abs(currow - row) < 3 && abs(curcol - col) < 3) {
  463. X        while (row > currow)
  464. X            fputs(DO, stdout), currow++;
  465. X        while (row < currow)
  466. X            fputs(UP, stdout), currow--;
  467. X        while (col > curcol)
  468. X            fputs(ND, stdout), curcol++;
  469. X        while (col < curcol)
  470. X            fputs(LE, stdout), curcol--;
  471. X    }
  472. X    else {
  473. X        fputs(tgoto(CM, col, row), stdout);
  474. X    }
  475. X    currow = row;
  476. X    curcol = col;
  477. X    return OK;
  478. X}
  479. X
  480. Xstatic int
  481. Xansi_clrtobot()
  482. X{
  483. X    ansi_clrtoeol();
  484. X    ansi_move(++currow, 0);
  485. X    ansi_clrtoeol();
  486. X    for (; currow <= LI; currow++) {
  487. X        fputs(DO, stdout);
  488. X        ansi_clrtoeol();
  489. X    }
  490. X    curcol = LEFTFIELD;
  491. X    return OK;
  492. X}
  493. X
  494. Xstatic int
  495. Xansi_clrtoeol()
  496. X{
  497. X    fputs(CE, stdout);
  498. X    return OK;
  499. X}
  500. X
  501. Xstatic int
  502. Xansi_mvaddch(row, col, ch)
  503. Xint    row, col;
  504. Xchar    ch;
  505. X{
  506. X    ansi_move(row, col);
  507. X    putchar(ch);
  508. X    curcol++;
  509. X    return OK;
  510. X}
  511. X
  512. Xstatic int
  513. Xansi_clear()
  514. X{
  515. X    fputs(CL, stdout);
  516. X    return OK;
  517. X}
  518. X
  519. Xstatic int
  520. Xansi_refresh()
  521. X{
  522. X    fflush(stdout);
  523. X    return OK;
  524. X}
  525. X
  526. Xstatic int
  527. Xansi_noop()
  528. X{
  529. X    return OK;
  530. X}
  531. X#endif
  532. END_OF_FILE
  533. if test 6468 -ne `wc -c <'ibmpc/ms_ansi.c'`; then
  534.     echo shar: \"'ibmpc/ms_ansi.c'\" unpacked with wrong size!
  535. fi
  536. # end of 'ibmpc/ms_ansi.c'
  537. fi
  538. if test -f 'mac/macrsrc.c' -a "${1}" != "-c" ; then 
  539.   echo shar: Will not clobber existing file \"'mac/macrsrc.c'\"
  540. else
  541. echo shar: Extracting \"'mac/macrsrc.c'\" \(7982 characters\)
  542. sed "s/^X//" >'mac/macrsrc.c' <<'END_OF_FILE'
  543. X/* mac/macrsrc.c: code for handling C data as resources
  544. X
  545. X   Copyright (c) 1989-92 Curtis McCauley, James E. Wilson
  546. X
  547. X   This software may be copied and distributed for educational, research, and
  548. X   not for profit purposes provided that this copyright and statement are
  549. X   included in all such copies. */
  550. X
  551. X#include <stdio.h>
  552. X
  553. X#include "config.h"
  554. X#include "constant.h"
  555. X#include "types.h"
  556. X#include "externs.h"
  557. X#include "macrsrc.h"
  558. X
  559. Xrestable_type restable[MAX_RESOURCES] = {
  560. X#ifndef RSRC_PART2
  561. X    {
  562. X        #ifdef RSRC
  563. X            (char *) object_list, "Object List",
  564. X        #else
  565. X            (char **) &object_list, NULL,
  566. X        #endif
  567. X        treasureRsrc, object_list_id,
  568. X        MAX_OBJECTS, sizeof(treasure_type),
  569. X        treasure_strproc,
  570. X        TRUE                                    },
  571. X#endif
  572. X#ifndef RSRC_PART1
  573. X    {
  574. X        #ifdef RSRC
  575. X            (char *) background, "Background Table",
  576. X        #else
  577. X            (char **) &background, NULL,
  578. X        #endif
  579. X        backgroundRsrc, background_id,
  580. X        MAX_BACKGROUND, sizeof(background_type),
  581. X        background_strproc,
  582. X        TRUE                                    },
  583. X    {
  584. X        #ifdef RSRC
  585. X            (char *) magic_spell, "Magic Spells",
  586. X        #else
  587. X            (char **) &magic_spell, NULL,
  588. X        #endif
  589. X        spellRsrc, magic_spell_id,
  590. X        (MAX_CLASS-1) * 31, sizeof(spell_type),
  591. X        NULL,
  592. X        TRUE                                    },
  593. X    {
  594. X        #ifdef RSRC
  595. X            (char *) player_title, "Player Titles",
  596. X        #else
  597. X            (char **) &player_title, NULL,
  598. X        #endif
  599. X        charPtrRsrc, player_title_id,
  600. X        MAX_CLASS * MAX_PLAYER_LEVEL, sizeof(char *),
  601. X        char_ptr_strproc,
  602. X        TRUE                                    },
  603. X    {
  604. X        #ifdef RSRC
  605. X            (char *) race, "Race List",
  606. X        #else
  607. X            (char **) &race, NULL,
  608. X        #endif
  609. X        raceRsrc, race_id,
  610. X        MAX_RACES, sizeof(race_type),
  611. X        race_strproc,
  612. X        TRUE                                    },
  613. X    {
  614. X        #ifdef RSRC
  615. X            (char *) c_list, "Creature List",
  616. X        #else
  617. X            (char **) &c_list, NULL,
  618. X        #endif
  619. X        monsterRsrc, c_list_id,
  620. X        MAX_CREATURES, sizeof(creature_type),
  621. X        creature_strproc,
  622. X        TRUE                                    },
  623. X    {
  624. X        #ifdef RSRC
  625. X            (char *) owners, "Owner List",
  626. X        #else
  627. X            (char **) &owners, NULL,
  628. X        #endif
  629. X        ownerRsrc, owners_id,
  630. X        MAX_OWNERS, sizeof(owner_type),
  631. X        owner_strproc,
  632. X        TRUE                                    },
  633. X    {
  634. X        #ifdef RSRC
  635. X            (char *) colors, "Colors",
  636. X        #else
  637. X            (char **) &colors, NULL,
  638. X        #endif
  639. X        charPtrRsrc, colors_id,
  640. X        MAX_COLORS, sizeof(char *),
  641. X        char_ptr_strproc,
  642. X        TRUE                                    },
  643. X    {
  644. X        #ifdef RSRC
  645. X            (char *) mushrooms, "Mushrooms",
  646. X        #else
  647. X            (char **) &mushrooms, NULL,
  648. X        #endif
  649. X        charPtrRsrc, mushrooms_id,
  650. X        MAX_MUSH, sizeof(char *),
  651. X        char_ptr_strproc,
  652. X        TRUE                                    },
  653. X    {
  654. X        #ifdef RSRC
  655. X            (char *) woods, "Woods",
  656. X        #else
  657. X            (char **) &woods, NULL,
  658. X        #endif
  659. X        charPtrRsrc, woods_id,
  660. X        MAX_WOODS, sizeof(char *),
  661. X        char_ptr_strproc,
  662. X        TRUE                                    },
  663. X    {
  664. X        #ifdef RSRC
  665. X            (char *) metals, "Metals",
  666. X        #else
  667. X            (char **) &metals, NULL,
  668. X        #endif
  669. X        charPtrRsrc, metals_id,
  670. X        MAX_METALS, sizeof(char *),
  671. X        char_ptr_strproc,
  672. X        TRUE                                    },
  673. X    {
  674. X        #ifdef RSRC
  675. X            (char *) rocks, "Rocks",
  676. X        #else
  677. X            (char **) &rocks, NULL,
  678. X        #endif
  679. X        charPtrRsrc, rocks_id,
  680. X        MAX_ROCKS, sizeof(char *),
  681. X        char_ptr_strproc,
  682. X        TRUE                                    },
  683. X    {
  684. X        #ifdef RSRC
  685. X            (char *) amulets, "Amulets",
  686. X        #else
  687. X            (char **) &amulets, NULL,
  688. X        #endif
  689. X        charPtrRsrc, amulets_id,
  690. X        MAX_AMULETS, sizeof(char *),
  691. X        char_ptr_strproc,
  692. X        TRUE                                    },
  693. X    {
  694. X        #ifdef RSRC
  695. X            (char *) syllables, "Syllables",
  696. X        #else
  697. X            (char **) &syllables, NULL,
  698. X        #endif
  699. X        charPtrRsrc, syllables_id,
  700. X        MAX_SYLLABLES, sizeof(char *),
  701. X        char_ptr_strproc,
  702. X        TRUE                                }
  703. X#endif
  704. X};
  705. X
  706. X#ifdef MACGAME
  707. Xmemtable_type memtable[MAX_PTRS] = {
  708. X    { (char **) &cave,
  709. X        MAX_HEIGHT * MAX_WIDTH, sizeof(cave_type),
  710. X        TRUE                                        },
  711. X    { (char **) &store,
  712. X        MAX_STORES, sizeof(store_type),
  713. X        TRUE                                        },
  714. X    { (char **) &c_recall,
  715. X        MAX_CREATURES, sizeof(recall_type),
  716. X        TRUE                                        },
  717. X};
  718. X#endif
  719. X
  720. X#ifndef RSRC_PART1
  721. Xrestart_type restart_vars[MAX_RESTART] = {
  722. X
  723. X    /* treasure.c */
  724. X    { (char *) &inven_ctr,                 sizeof(inven_ctr)                },
  725. X    { (char *) &inven_weight,             sizeof(inven_weight)            },
  726. X    { (char *) &equip_ctr,                 sizeof(equip_ctr)                },
  727. X
  728. X    /* variable.c */
  729. X    { (char *) &weapon_heavy,             sizeof(weapon_heavy)            },
  730. X    { (char *) &pack_heavy,             sizeof(pack_heavy)                },
  731. X    { (char *) &total_winner,             sizeof(total_winner)            },
  732. X    { (char *) &character_generated,    sizeof(character_generated)        },
  733. X    { (char *) &character_saved,         sizeof(character_saved)            },
  734. X    { (char *) &dun_level,                 sizeof(dun_level)                },
  735. X    { (char *) &missile_ctr,             sizeof(missile_ctr)                },
  736. X    { (char *) &last_msg,                 sizeof(last_msg)                },
  737. X    { (char *) &death,                     sizeof(death)                    },
  738. X    { (char *) &default_dir,             sizeof(default_dir)                },
  739. X    { (char *) &turn,                     sizeof(turn)                    },
  740. X    { (char *) &wizard,                 sizeof(wizard)                    },
  741. X    { (char *) &panic_save,             sizeof(panic_save)                },
  742. X    { (char *) &noscore,                 sizeof(noscore)                    },
  743. X    { (char *) &find_cut,                 sizeof(find_cut)                },
  744. X    { (char *) &find_examine,             sizeof(find_examine)            },
  745. X    { (char *) &find_bound,             sizeof(find_bound)                },
  746. X    { (char *) &find_prself,             sizeof(find_prself)                },
  747. X    { (char *) &prompt_carry_flag,         sizeof(prompt_carry_flag)        },
  748. X    { (char *) &show_weight_flag,         sizeof(show_weight_flag)        },
  749. X    { (char *) &highlight_seams,         sizeof(highlight_seams)            },
  750. X    { (char *) &find_ignore_doors,         sizeof(find_ignore_doors)        },
  751. X    { (char *) &doing_inven,             sizeof(doing_inven)                },
  752. X    { (char *) &screen_change,             sizeof(screen_change)            },
  753. X    { (char *) &eof_flag,                sizeof (eof_flag)                },
  754. X    { (char *) &wait_for_more,             sizeof(wait_for_more)            },
  755. X    { (char *) &spell_learned,             sizeof(spell_learned)            },
  756. X    { (char *) &spell_worked,             sizeof(spell_worked)            },
  757. X    { (char *) &spell_forgotten,         sizeof(spell_forgotten)            },
  758. X
  759. X    /* moved to variable.c from elsewhere */
  760. X    { (char *) &last_command,            sizeof(last_command)            },
  761. X    { (char *) &light_flag,                sizeof(light_flag)                }
  762. X
  763. X};
  764. X#endif
  765. X
  766. X#ifdef MACGAME
  767. Xclrtable_type clrtable[MAX_CLRS] = {
  768. X
  769. X    /* these are not initialized, but probably ought to be */
  770. X
  771. X    /* treasure.c */
  772. X    { (char *) &object_ident,             sizeof(object_ident)            },
  773. X    { (char *) &t_level,                 sizeof(t_level)                    },
  774. X    { (char *) &t_list,                 sizeof(t_list)                    },
  775. X    { (char *) &inventory,                 sizeof(inventory)                },
  776. X
  777. X    /* monsters.c */
  778. X    { (char *) &m_level,                 sizeof(m_level)                    },
  779. X    { (char *) &m_list,                 sizeof(m_list)                    },
  780. X
  781. X    /* variable.c */
  782. X    { (char *) &panel_row,                 sizeof(panel_row)                },
  783. X    { (char *) &panel_col,                 sizeof(panel_col)                },
  784. X    { (char *) &panel_row_min,             sizeof(panel_row_min)            },
  785. X    { (char *) &panel_row_max,             sizeof(panel_row_max)            },
  786. X    { (char *) &panel_col_min,             sizeof(panel_col_min)            },
  787. X    { (char *) &panel_col_max,             sizeof(panel_col_max)            },
  788. X    { (char *) &panel_row_prt,             sizeof(panel_row_prt)            },
  789. X    { (char *) &panel_col_prt,             sizeof(panel_col_prt)            },
  790. X    { (char *) &py,                        sizeof(py)                        },
  791. X    { (char *) &max_score,                sizeof (max_score)                }
  792. X
  793. X};
  794. X#endif
  795. X
  796. X/* String procs are used by the DumpRes package to make sure that    */
  797. X/* char *'s imbedded in the stucts are dumped or loaded properly.    */
  798. X/* All that is required is to pass a pointer to the pointer to the    */
  799. X/* supplied subroutine for each char * field in the struct.            */
  800. X
  801. Xvoid treasure_strproc(ptr, proc)
  802. Xchar *ptr;
  803. Xvoid (*proc)(char **str);
  804. X
  805. X{
  806. X    (*proc)(&((treasure_type *) ptr)->name);
  807. X    return;
  808. X}
  809. X
  810. Xvoid creature_strproc(ptr, proc)
  811. Xchar *ptr;
  812. Xvoid (*proc)(char **str);
  813. X
  814. X{
  815. X    (*proc)(&((creature_type *) ptr)->name);
  816. X    return;
  817. X}
  818. X
  819. Xvoid race_strproc(ptr, proc)
  820. Xchar *ptr;
  821. Xvoid (*proc)(char **str);
  822. X
  823. X{
  824. X    (*proc)(&((race_type *) ptr)->trace);
  825. X    return;
  826. X}
  827. X
  828. Xvoid background_strproc(ptr, proc)
  829. Xchar *ptr;
  830. Xvoid (*proc)(char **str);
  831. X
  832. X{
  833. X    (*proc)(&((background_type *) ptr)->info);
  834. X    return;
  835. X}
  836. X
  837. Xvoid owner_strproc(ptr, proc)
  838. Xchar *ptr;
  839. Xvoid (*proc)(char **str);
  840. X
  841. X{
  842. X    (*proc)(&((owner_type *) ptr)->owner_name);
  843. X    return;
  844. X}
  845. X
  846. X/* This is for arrays of char *'s, which can be treated essentially    */
  847. X/* as structs with a single field - the char *.  It is inefficient,    */
  848. X/* since the array of char *'s, garbage data, is created as a        */
  849. X/* resource along with the STR# resource, but has the advantage of    */
  850. X/* not requiring special casing.                                    */
  851. X
  852. Xvoid char_ptr_strproc(ptr, proc)
  853. Xchar *ptr;
  854. Xvoid (*proc)(char **str);
  855. X
  856. X{
  857. X    (*proc)((char **) ptr);
  858. X    return;
  859. X}
  860. END_OF_FILE
  861. if test 7982 -ne `wc -c <'mac/macrsrc.c'`; then
  862.     echo shar: \"'mac/macrsrc.c'\" unpacked with wrong size!
  863. fi
  864. # end of 'mac/macrsrc.c'
  865. fi
  866. if test -f 'mac/moria.ro' -a "${1}" != "-c" ; then 
  867.   echo shar: Will not clobber existing file \"'mac/moria.ro'\"
  868. else
  869. echo shar: Extracting \"'mac/moria.ro'\" \(8153 characters\)
  870. sed "s/^X//" >'mac/moria.ro' <<'END_OF_FILE'
  871. X/NOSCROLL
  872. XMacMoria.rsrc
  873. XRSRCMRIA
  874. X
  875. X* #include "Types.r"
  876. X
  877. XINCLUDE ScrnMgr.rsrc
  878. XINCLUDE MacMoria.dump.rsrc
  879. XINCLUDE MacMoria.misc.rsrc
  880. X
  881. X* type 'MRIA' as 'STR ';
  882. X
  883. X* type 'CNFG' (256 : 257) {
  884. X*     longint;
  885. X* };
  886. X
  887. X*type 'TEXT' {
  888. X*    string;
  889. X*};
  890. X
  891. X*resource 'MRIA' (0) {
  892. X*    "Moria 5.4 for the Macintosh"
  893. X*};
  894. X
  895. XTYPE MRIA = GNRL
  896. X , 0
  897. X.P
  898. XMoria 5.4 for the Macintosh
  899. X
  900. X
  901. XTYPE BNDL
  902. XMRIA, 128 (32)
  903. XMRIA 0
  904. XICN#
  905. X0 128 1 129 2 130
  906. XFREF
  907. X0 128 1 129 2 130 3 131 4 132
  908. X            ;;/* [1] Appilication */
  909. X            ;;/* [2] Save file */
  910. X            ;;/* [3] Info files */
  911. X            ;;/* [4] Score file */
  912. X            ;;/* [5] Config file */
  913. X
  914. XTYPE FREF
  915. XApplication, 128 (32)
  916. XAPPL 0
  917. X
  918. XTYPE FREF
  919. XSave Files, 129 (32)
  920. XSAVE 1
  921. X
  922. XTYPE FREF
  923. XInfo Files, 130 (32)
  924. XTEXT 2
  925. X
  926. XTYPE FREF
  927. XScore File, 131 (32)
  928. XSCOR 2
  929. X
  930. XTYPE FREF
  931. XConfig File, 132 (32)
  932. XCNFG 2
  933. X
  934. X
  935. XTYPE ICON = GNRL
  936. XApplication, 128 (32)
  937. X.H
  938. X 0001 0000 0002 8000 0004 4000 0008 2000
  939. X 0010 1000 0022 0800 0045 0400 0088 8200
  940. X 0105 1500 0202 A880 0440 4040 08A8 8020
  941. X 1115 0010 248A 0028 4051 3F44 9120 C08A
  942. X 4000 8051 2441 3022 1001 C814 091E 7F8F
  943. X 0402 3007 0241 0007 0100 8007 0080 6007
  944. X 0040 1FE7 0020 021F 0010 0407 0008 0800
  945. X 0004 1000 0002 2000 0001 4000 0000 8000
  946. X
  947. X
  948. XTYPE ICON = GNRL
  949. XCommand Set, 256 (32)
  950. X.H
  951. X 0000 0000 0000 0000 0000 0000 0000 0000
  952. X 0000 0000 0000 0000 0000 0000 0000 0000
  953. X 0000 0000 7FFF FFFE 8000 0001 9AAA AAA9
  954. X 8000 0001 9555 5559 8000 0001 9AAA AAA9
  955. X 8000 0001 857F FF51 8000 0001 8000 0001
  956. X 7FFF FFFE 0000 0000 0000 0000 0000 0000
  957. X 0000 0000 0000 0000 0000 0000 0000 0000
  958. X 0000 0000 0000 0000 0000 0000 0000 0000
  959. X
  960. X
  961. XTYPE ICON = GNRL
  962. XTEXT Editor, 257 (32)
  963. X.H
  964. X 0FFF FE00 0800 0300 0800 0280 0800 0240
  965. X 0800 0220 0800 0210 0800 03F8 0800 0008
  966. X 0800 0008 0807 C008 080F E008 0818 3008
  967. X 0830 1808 0820 1808 0800 1808 0800 3008
  968. X 0800 6008 0800 C008 0801 8008 0801 8008
  969. X 0801 8008 0801 8008 0800 0008 0801 8008
  970. X 0803 C008 0801 8008 0800 0008 0800 0008
  971. X 0800 0008 0800 0008 0800 0008 0FFF FFF8
  972. X
  973. X
  974. XTYPE ICN# = GNRL
  975. XApplication, 128 (32)
  976. X.H
  977. X*        /* [1] */
  978. X 0001 0000 0002 8000 0004 4000 0008 2000
  979. X 0010 1000 0022 0800 0045 0400 0088 8200
  980. X 0105 1500 0202 A880 0440 4040 08A8 8020
  981. X 1115 0010 248A 0028 4051 3F44 9120 C08A
  982. X 4000 8051 2441 3022 1001 C814 091E 7F8F
  983. X 0402 3007 0241 0007 0100 8007 0080 6007
  984. X 0040 1FE7 0020 021F 0010 0407 0008 0800
  985. X 0004 1000 0002 2000 0001 4000 0000 8000
  986. X*        /* [2] */
  987. X 0001 0000 0003 8000 0007 C000 000F E000
  988. X 001F F000 003F F800 007F FC00 00FF FE00
  989. X 01FF FF00 03FF FF80 07FF FFC0 0FFF FFE0
  990. X 1FFF FFF0 3FFF FFF8 7FFF FFFC FFFF FFFE
  991. X 7FFF FFFF 3FFF FFFE 1FFF FFFC 0FFF FFFF
  992. X 07FF FFFF 03FF FFFF 01FF FFFF 00FF FFFF
  993. X 007F FFFF 003F FE1F 001F FC07 000F F800
  994. X 0007 F000 0003 E000 0001 C000 0000 8000
  995. X
  996. XTYPE ICN# = GNRL
  997. XSave Files, 129 (32)
  998. X.H
  999. X*        /* [1] */
  1000. X 0FFF FE00 0800 0300 0800 0280 0800 0240
  1001. X 0800 0220 0800 0210 0800 03F8 0800 0008
  1002. X 0800 0008 087F FE08 08FF FF08 0980 0188
  1003. X 099F F988 09B0 0988 09B1 2988 0992 A988
  1004. X 0991 2988 09B0 4988 09B0 0988 099F F988
  1005. X 0980 0188 09FF FF88 09FF FF88 0980 0188
  1006. X 0800 0008 0912 6488 09B5 5548 0955 65C8
  1007. X 0915 5548 0912 5548 0800 0008 0FFF FFF8
  1008. X*        /* [2] */
  1009. X 0FFF FE00 0FFF FF00 0FFF FF80 0FFF FFC0
  1010. X 0FFF FFE0 0FFF FFF0 0FFF FFF8 0FFF FFF8
  1011. X 0FFF FFF8 0FFF FFF8 0FFF FFF8 0FFF FFF8
  1012. X 0FFF FFF8 0FFF FFF8 0FFF FFF8 0FFF FFF8
  1013. X 0FFF FFF8 0FFF FFF8 0FFF FFF8 0FFF FFF8
  1014. X 0FFF FFF8 0FFF FFF8 0FFF FFF8 0FFF FFF8
  1015. X 0FFF FFF8 0FFF FFF8 0FFF FFF8 0FFF FFF8
  1016. X 0FFF FFF8 0FFF FFF8 0FFF FFF8 0FFF FFF8
  1017. X
  1018. XTYPE ICN# = GNRL
  1019. XAux Files, 130 (32)
  1020. X.H
  1021. X*        /* [1] */
  1022. X 0FFF FE00 0800 0300 0800 0280 09FB AE40
  1023. X 0800 0220 0800 0210 09F7 7BF8 0800 0008
  1024. X 0800 0008 09BB EDC8 0800 0008 0800 0008
  1025. X 09F7 B7C8 0800 0008 0800 0008 09B5 FDC8
  1026. X 0800 0008 0800 0008 0977 B6C8 0800 0008
  1027. X 0800 0008 09EB B748 0800 0008 0800 0008
  1028. X 0800 0008 0912 6488 09B5 5548 0955 65C8
  1029. X 0915 5548 0912 5548 0800 0008 0FFF FFF8
  1030. X*        /* [2] */
  1031. X 0FFF FE00 0FFF FF00 0FFF FF80 0FFF FFC0
  1032. X 0FFF FFE0 0FFF FFF0 0FFF FFF8 0FFF FFF8
  1033. X 0FFF FFF8 0FFF FFF8 0FFF FFF8 0FFF FFF8
  1034. X 0FFF FFF8 0FFF FFF8 0FFF FFF8 0FFF FFF8
  1035. X 0FFF FFF8 0FFF FFF8 0FFF FFF8 0FFF FFF8
  1036. X 0FFF FFF8 0FFF FFF8 0FFF FFF8 0FFF FFF8
  1037. X 0FFF FFF8 0FFF FFF8 0FFF FFF8 0FFF FFF8
  1038. X 0FFF FFF8 0FFF FFF8 0FFF FFF8 0FFF FFF8
  1039. X
  1040. X
  1041. XTYPE DLOG
  1042. XAbout, 128 (32)
  1043. XAbout UMoria
  1044. X46 26 304 274
  1045. XInvisible NoGoAway
  1046. X0
  1047. X0
  1048. X128
  1049. X
  1050. X
  1051. XTYPE DITL
  1052. XAbout, 128
  1053. X4
  1054. X
  1055. Xbutton
  1056. X224 192 247 235
  1057. XOK
  1058. X
  1059. XuserItem disabled
  1060. X232 224 241 233
  1061. X
  1062. XstaticText disabled
  1063. X16 8 248 184
  1064. X^0\0D\0D++
  1065. XProgrammers:\0D++
  1066. X  Robert Alan Koeneke\0D++
  1067. X  Jimmey Wayne Todd\0D\0D++
  1068. XUNIX Port:\0D++
  1069. X  James E. Wilson\0D\0D++
  1070. XMacintosh Port:\0D++
  1071. X  Curtis W. McCauley\0D++
  1072. X  Benjamin E. Schreiber
  1073. X
  1074. XiconItem disabled
  1075. X16 195 48 227
  1076. X128
  1077. X
  1078. X
  1079. XTYPE STR
  1080. XAbout Title, 128
  1081. XAbout Moria\C9
  1082. X
  1083. X
  1084. XTYPE CNFG = GNRL
  1085. XCommand Set, 256 (32)
  1086. X.S
  1087. X-o\00\00
  1088. X
  1089. X
  1090. XTYPE DLOG
  1091. XCommand Set, 256 (32)
  1092. XCommand Set
  1093. X42 34 218 404
  1094. XInvisible NoGoAway
  1095. X0
  1096. X0
  1097. X256
  1098. X
  1099. X
  1100. XTYPE DITL
  1101. XCommand Set, 256 (32)
  1102. X9
  1103. X
  1104. Xbutton
  1105. X24 296 48 352
  1106. XOK
  1107. X
  1108. Xbutton
  1109. X64 296 88 352
  1110. XCancel
  1111. X
  1112. XradioButton
  1113. X40 24 56 200
  1114. XRogue-Like Commands
  1115. X
  1116. XradioButton
  1117. X64 24 80 200
  1118. XOriginal Commands
  1119. X
  1120. XstaticText disabled
  1121. X112 72 168 352
  1122. XChoose the desired command set.  The change will take effect when you start the next game.
  1123. X
  1124. XuserItem disabled
  1125. X16 16 96 232
  1126. X
  1127. XstaticText
  1128. X8 24 24 104
  1129. XChoose one
  1130. X
  1131. XuserItem disabled
  1132. X32 336 40 344
  1133. X
  1134. XiconItem disabled
  1135. X112 16 144 48
  1136. X256
  1137. X
  1138. X
  1139. XTYPE CNFG = GNRL
  1140. XTEXT Editor, 257 (32)
  1141. X.S
  1142. XMACA
  1143. X
  1144. X
  1145. XTYPE DLOG
  1146. XTEXT Editor, 257 (32)
  1147. XTEXT Editor
  1148. X42 34 226 426
  1149. XInvisible NoGoAway
  1150. X0
  1151. X0
  1152. X257
  1153. X
  1154. X
  1155. XTYPE DITL
  1156. XTEXT Editor, 257 (32)
  1157. X11
  1158. X
  1159. Xbutton
  1160. X24 320 48 376
  1161. XOK
  1162. X
  1163. Xbutton
  1164. X64 320 88 376
  1165. XCancel
  1166. X
  1167. XradioButton
  1168. X40 24 56 200
  1169. XMacWrite
  1170. X
  1171. XradioButton
  1172. X64 24 80 176
  1173. XMicrosoft Word
  1174. X
  1175. XradioButton
  1176. X88 24 104 176
  1177. XOther:  File Creator
  1178. X
  1179. XeditText disabled
  1180. X88 176 104 240
  1181. X
  1182. X
  1183. XstaticText disabled
  1184. X136 72 176 376
  1185. XChoose what kind of documents you want Moria to create ++
  1186. Xwhen it prints to a file
  1187. X
  1188. XuserItem disabled
  1189. X16 8 120 264
  1190. X
  1191. XstaticText
  1192. X8 24 24 104
  1193. XChoose One
  1194. X
  1195. XuserItem disabled
  1196. X32 360 40 368
  1197. X
  1198. XiconItem disabled
  1199. X136 16 168 48
  1200. X257
  1201. X
  1202. X
  1203. XTYPE DLOG
  1204. XSave Quit or Cancel, 258 (32)
  1205. XSave Quit or Cancel
  1206. X40 40 168 318
  1207. XInvisible NoGoAway
  1208. X0
  1209. X0
  1210. X258
  1211. X
  1212. X
  1213. XTYPE DITL
  1214. XSave Quit or Cancel, 258 (32)
  1215. X6
  1216. X
  1217. Xbutton
  1218. X64 16 84 76
  1219. XSave
  1220. X
  1221. Xbutton
  1222. X96 16 116 76
  1223. XQuit
  1224. X
  1225. Xbutton
  1226. X96 200 116 260
  1227. XCancel
  1228. X
  1229. XuserItem disabled
  1230. X64 200 80 216
  1231. X
  1232. XstaticText disabled
  1233. X8 56 48 264
  1234. XWhat do you want to do with the game in progress?
  1235. X
  1236. XiconItem disabled
  1237. X8 16 40 48
  1238. X0
  1239. X
  1240. X
  1241. X
  1242. XTYPE MENU
  1243. XFile, 129
  1244. XFile
  1245. XNew/N
  1246. XOpen\C9/O
  1247. X(-
  1248. XSave/S
  1249. XSave As\C9
  1250. X(-
  1251. XQuit/Q
  1252. X
  1253. X
  1254. XTYPE MENU
  1255. XFile (No Keys), 229
  1256. XFile
  1257. XNew
  1258. XOpen\C9
  1259. X(-
  1260. XSave
  1261. XSave As\C9
  1262. X(-
  1263. XQuit
  1264. X
  1265. X
  1266. XTYPE MENU
  1267. XMoria, 133
  1268. XMoria
  1269. XHelp\C9/H
  1270. XCommand Set\C9
  1271. XTEXT Editor\C9
  1272. X(-
  1273. XHigh Scores\C9
  1274. X
  1275. X
  1276. XTYPE MENU
  1277. XMoria (No keys), 233
  1278. XMoria
  1279. XHelp\C9
  1280. XCommand Set\C9
  1281. XTEXT Editor\C9
  1282. X(-
  1283. XHigh Scores\C9
  1284. X
  1285. X
  1286. XTYPE DLOG
  1287. XMac Help, 512 (32)
  1288. XHelp
  1289. X40 34 310 496
  1290. XInvisible NoGoAway
  1291. X0
  1292. X0
  1293. X512
  1294. X
  1295. X
  1296. XTYPE DITL
  1297. XMac Help, 512 (32)
  1298. X6
  1299. X
  1300. Xbutton
  1301. X16 392 36 452
  1302. XOK
  1303. X
  1304. XuserItem disabled
  1305. X24 432 32 440
  1306. X
  1307. XuserItem disabled
  1308. X48 8 264 440
  1309. X
  1310. XctrlItem
  1311. X48 439 264 455
  1312. X512
  1313. X
  1314. XstaticText Disabled
  1315. X8 52 40 380
  1316. X^0
  1317. X
  1318. XiconItem disabled
  1319. X8 8 40 40
  1320. X128
  1321. X
  1322. X
  1323. XTYPE CNTL
  1324. XMac Help Scroll Bar, 512 (32)
  1325. XScroll
  1326. X0 0 216 16
  1327. XVisible
  1328. X16
  1329. X0
  1330. X0 0 0
  1331. X
  1332. X
  1333. X*type 'DFPR' {
  1334. X*    unsigned hex integer = $600A;                    /* branch around header */
  1335. X*    unsigned hex integer;                            /* flags */
  1336. X*    unsigned literal longint;                        /* resource type */
  1337. X*    integer;                                        /* resource id */
  1338. X*    integer;                                        /* version */
  1339. X*    unsigned hex integer = $4EF9;                    /* jump instruction */
  1340. X*    unsigned hex longint = $0;                        /* target address for jump */
  1341. X*};
  1342. X
  1343. X*type 'LDEF' as 'DFPR';
  1344. X
  1345. XTYPE LDEF = GNRL
  1346. XHigh Scores, 514 (32)
  1347. X.H
  1348. X600A
  1349. X0000
  1350. X.S
  1351. XLDEF
  1352. X.I
  1353. X514
  1354. X0
  1355. X.H
  1356. X4EF9
  1357. X0000
  1358. X
  1359. X
  1360. XTYPE DLOG
  1361. XHigh Scores, 514 (32)
  1362. XHigh Scores
  1363. X40 34 327 526
  1364. XInvisible NoGoAway
  1365. X0
  1366. X0
  1367. X514
  1368. X
  1369. XTYPE DITL
  1370. XHigh Scores, 514 (32)
  1371. X5
  1372. X
  1373. Xbutton
  1374. X15 422 35 482
  1375. XOK
  1376. X
  1377. XuserItem Disabled
  1378. X24 464 32 472
  1379. X
  1380. XuserItem Disabled
  1381. X48 2 281 490
  1382. X
  1383. XstaticText Disabled
  1384. X8 56 40 336
  1385. XMoria High Scores\0D Positions ^0 to ^1
  1386. X
  1387. XiconItem Disabled
  1388. X8 8 40 40
  1389. X128
  1390. X
  1391. X
  1392. XTYPE ALRT
  1393. XGeneral Error, 1024 (32)
  1394. X42 42 148 416
  1395. X1024
  1396. X7777
  1397. X
  1398. XTYPE DITL
  1399. XGeneral Error, 1024 (32)
  1400. X2
  1401. X
  1402. Xbutton
  1403. X80 304 100 364
  1404. XOK
  1405. X
  1406. XstaticText Disabled
  1407. X7 68 71 364
  1408. X^0
  1409. X
  1410. X
  1411. X*resource 'SIZE' (-1) {
  1412. X*    dontSaveScreen,
  1413. X*    acceptSuspendResumeEvents,
  1414. X*    enableOptionSwitch,
  1415. X*    canBackground,
  1416. X*    multiFinderAware,
  1417. X*    backgroundAndForeground,
  1418. X*    dontGetFrontClicks,
  1419. X*    ignoreChildDiedEvents,
  1420. X*    not32BitCompatible,
  1421. X*    reserved,
  1422. X*    reserved,
  1423. X*    reserved,
  1424. X*    reserved,
  1425. X*    reserved,
  1426. X*    reserved,
  1427. X*    reserved,
  1428. X*    375 * 1024,
  1429. X*    375 * 1024
  1430. X*};
  1431. END_OF_FILE
  1432. if test 8153 -ne `wc -c <'mac/moria.ro'`; then
  1433.     echo shar: \"'mac/moria.ro'\" unpacked with wrong size!
  1434. fi
  1435. # end of 'mac/moria.ro'
  1436. fi
  1437. if test -f 'mac/scrnmgr/ScrnMgr.h' -a "${1}" != "-c" ; then 
  1438.   echo shar: Will not clobber existing file \"'mac/scrnmgr/ScrnMgr.h'\"
  1439. else
  1440. echo shar: Extracting \"'mac/scrnmgr/ScrnMgr.h'\" \(7454 characters\)
  1441. sed "s/^X//" >'mac/scrnmgr/ScrnMgr.h' <<'END_OF_FILE'
  1442. X/* mac/scrnmgr/ScrnMgr.h: definitions for scrnmgr code
  1443. X
  1444. X   Copyright (c) 1989-1991 Curtis McCauley, James E. Wilson
  1445. X
  1446. X   You may copy this subroutine package freely, modify it as you desire,
  1447. X   and distribute it at will, as long as the copyright notice in the source
  1448. X   material is not disturbed, excepting that no one may use this package or
  1449. X   any part of it for commercial purposes of any kind without the express
  1450. X   written consent of its author. */
  1451. X
  1452. X#ifndef __SCRNMGR__
  1453. X
  1454. X#define __SCRNMGR__
  1455. X
  1456. X#ifdef THINK_C
  1457. X#include <MacTypes.h>
  1458. X#else
  1459. X#include <Types.h>
  1460. X#endif
  1461. X
  1462. X#ifdef THINK_C
  1463. X#define nil 0                /* Think C doesn't have nil. -- BS  */
  1464. X#endif
  1465. X
  1466. X#define MakeAttr(f, b)        (char) ((f<<3) | b)
  1467. X
  1468. X#define AttrFore(a)            (char) ((a>>3) & 0x7)
  1469. X#define AttrBack(a)            (char) (a & 0x7)
  1470. X
  1471. X#define attrColorWhite        0
  1472. X#define attrColorBlack        1
  1473. X#define attrColorRed        2
  1474. X#define attrColorGreen        3
  1475. X#define attrColorBlue        4
  1476. X#define attrColorCyan        5
  1477. X#define attrColorMagenta    6
  1478. X#define attrColorYellow        7
  1479. X
  1480. X#define attrColorBack        0
  1481. X#define attrColorFore        1
  1482. X
  1483. X#define attrNormal            MakeAttr(attrColorFore, attrColorBack)
  1484. X#define attrReversed        MakeAttr(attrColorBack, attrColorFore)
  1485. X
  1486. X#define attrUnderlined        0x80
  1487. X#define attrItalicized        0x40
  1488. X
  1489. X#define twoColor            0
  1490. X#define multiColor            1
  1491. X
  1492. X#define maskAttrFlags        0xC0
  1493. X#define maskAttrColors        0x3F
  1494. X
  1495. X#define maskModCommand        0x01
  1496. X#define maskModShift        0x02
  1497. X#define maskModCapsLock        0x04
  1498. X#define maskModOption        0x08
  1499. X#define maskModControl        0x10
  1500. X#define maskModMouse        0x80
  1501. X
  1502. X#define fixHalf                0x8000
  1503. X#define fixThird            0x5555
  1504. X#define fixQuarter            0x4000
  1505. X#define fixFifth            0x3333
  1506. X#define fixSixth            0x2AAA
  1507. X#define fixSeventh            0x2492
  1508. X#define fixEighth            0x2000
  1509. X#define fixNinth            0x1C71
  1510. X#define fixTenth            0x1999
  1511. X
  1512. X#define akNormal            0
  1513. X#define akStop                1
  1514. X#define akNote                2
  1515. X#define akCaution            3
  1516. X
  1517. X#define closeBoxItem        0
  1518. X
  1519. X#define scrnErrOk            0
  1520. X#define scrnErrNoMem        -1
  1521. X
  1522. Xlong InitScreenMgr(long h, long v, char *title,
  1523. X    char *resFile, OSType rfCreator, OSType rfType,
  1524. X    void (*fileMenuProc)(long item),
  1525. X    void (*appMenuProc)(long item),
  1526. X    long multiColorFlag);
  1527. X
  1528. Xvoid IdleScreenMgr(void);
  1529. X
  1530. Xvoid ShowScreen(long visible);
  1531. X
  1532. Xvoid CloseScreenMgr(void);
  1533. X
  1534. Xvoid SetScreenQuitProc(void (*quitProc)(void), long willReturnFlag);
  1535. X
  1536. Xvoid SetScreenAboutProc(void (*aboutProc)(void));
  1537. X
  1538. Xvoid XSetScreenChar(int d, char c, long h, long v);
  1539. Xvoid XSetScreenBuffer(int d, char *buffer, long rowBytes, Rect *area,
  1540. X              long h, long v);
  1541. Xvoid XSetScreenString(int d, char *str, long h, long v);
  1542. X
  1543. Xvoid XSetScreenCharAttr(int d, char c, char a, long h, long v);
  1544. Xvoid XSetScreenBufferAttr(int d, char *buffer, char a, long rowBytes,
  1545. X              Rect *area, long h, long v);
  1546. Xvoid XSetScreenStringAttr(int d, char *str, char a, long h, long v);
  1547. X
  1548. Xvoid XSetScreenImage(int d, char *c, char *a, long rowBytes, Rect *area,
  1549. X             long h, long v);
  1550. X
  1551. Xvoid XWriteScreenChar(int d, char c);
  1552. Xvoid XWriteScreenBuffer(int d, char *buffer, long rowBytes, Rect *area);
  1553. Xvoid XWriteScreenString(int d, char *str);
  1554. X
  1555. Xvoid XWriteScreenCharAttr(int d, char c, char a);
  1556. Xvoid XWriteScreenBufferAttr(int d, char *buffer, char a, long rowBytes,
  1557. X                Rect *area);
  1558. Xvoid XWriteScreenStringAttr(int d, char *str, char a);
  1559. X
  1560. Xvoid XWriteScreenImage(int d, char *c, char *a, long rowBytes, Rect *area);
  1561. X
  1562. Xvoid XFillScreen(int d, char c, char a, Rect *area);
  1563. Xvoid XEraseScreen(int d, Rect *area);
  1564. X
  1565. Xvoid XScrollScreen(int d, long dh, long dv, Rect *area, char a);
  1566. X
  1567. Xvoid XMoveScreenCursor(int d, long h, long v);
  1568. Xvoid XSetScreenCursor(int d, long h, long v);
  1569. X
  1570. X#define SetScreenChar(c, h, v)                        XSetScreenChar(0, c, h, v)
  1571. X#define SetScreenBuffer(b, rb, area, h, v)    \
  1572. X        XSetScreenBuffer(0, b, rb, area, h, v)
  1573. X#define SetScreenString(str, h, v)                    XSetScreenString(0, str, h, v)
  1574. X
  1575. X#define SetScreenCharAttr(c, a, h, v)                XSetScreenCharAttr(0, c, a, h, v)
  1576. X#define SetScreenBufferAttr(b, a, rb, area, h, v)    \
  1577. X        XSetScreenBufferAttr(0, b, a, rb, area, h, v)
  1578. X#define SetScreenStringAttr(str, a, h, v)        \
  1579. X        XSetScreenStringAttr(0, str, a, h, v)
  1580. X
  1581. X#define SetScreenImage(c, a, rb, area, h, v)        \
  1582. X        XSetScreenImage(0, c, a, rb, area, h, v)
  1583. X
  1584. X#define WriteScreenChar(c)                            XWriteScreenChar(0, c)
  1585. X#define WriteScreenBuffer(b, rb, area)                XWriteScreenBuffer(0, b, rb, area)
  1586. X#define WriteScreenString(str)                        XWriteScreenString(0, str)
  1587. X
  1588. X#define WriteScreenCharAttr(c, a)                    XWriteScreenCharAttr(0, c, a)
  1589. X#define WriteScreenBufferAttr(b, a, rb, area)        \
  1590. X        XWriteScreenBufferAttr(0, b, a, rb, area)
  1591. X#define WriteScreenStringAttr(str, a)                XWriteScreenStringAttr(0, str, a)
  1592. X
  1593. X#define WriteScreenImage(c, a, rb, area)        \
  1594. X        XWriteScreenImage(0, c, a, rb, area)
  1595. X
  1596. X#define FillScreen(c, a, area)                        XFillScreen(0, c, a, area)
  1597. X#define EraseScreen(area)                            XEraseScreen(0, area)
  1598. X
  1599. X#define ScrollScreen(dh, dv, area, a)                XScrollScreen(0, dh, dv, area, a)
  1600. X
  1601. X#define MoveScreenCursor(h, v)                        XMoveScreenCursor(0, h, v)
  1602. X#define SetScreenCursor(h, v)                        XSetScreenCursor(0, h, v)
  1603. X
  1604. X#define DSetScreenChar(c, h, v)                        XSetScreenChar(1, c, h, v)
  1605. X#define DSetScreenBuffer(b, rb, area, h, v)        \
  1606. X        XSetScreenBuffer(1, b, rb, area, h, v)
  1607. X#define DSetScreenString(str, h, v)                    XSetScreenString(1, str, h, v)
  1608. X
  1609. X#define DSetScreenCharAttr(c, a, h, v)                XSetScreenCharAttr(1, c, a, h, v)
  1610. X#define DSetScreenBufferAttr(b, a, rb, area, h, v)    \
  1611. X        XSetScreenBufferAttr(1, b, a, rb, area, h, v)
  1612. X#define DSetScreenStringAttr(str, a, h, v)        \
  1613. X        XSetScreenStringAttr(1, str, a, h, v)
  1614. X
  1615. X#define DSetScreenImage(c, a, rb, area, h, v)        \
  1616. X        XSetScreenImage(1, c, a, rb, area, h, v)
  1617. X
  1618. X#define DWriteScreenChar(c)                            XWriteScreenChar(1, c)
  1619. X#define DWriteScreenBuffer(b, rb, area)                XWriteScreenBuffer(1, b, rb, area)
  1620. X#define DWriteScreenString(str)                        XWriteScreenString(1, str)
  1621. X
  1622. X#define DWriteScreenCharAttr(c, a)                    XWriteScreenCharAttr(1, c, a)
  1623. X#define DWriteScreenBufferAttr(b, a, rb, area)        \
  1624. X        XWriteScreenBufferAttr(1, b, a, rb, area)
  1625. X#define DWriteScreenStringAttr(str, a)                XWriteScreenStringAttr(1, str, a)
  1626. X
  1627. X#define DWriteScreenImage(c, a, rb, area)        \
  1628. X        XWriteScreenImage(1, c, a, rb, area)
  1629. X
  1630. X#define DFillScreen(c, a, area)                        XFillScreen(1, c, a, area)
  1631. X#define DEraseScreen(area)                            XEraseScreen(1, area)
  1632. X
  1633. X#define DScrollScreen(dh, dv, area, a)                XScrollScreen(1, dh, dv, area, a)
  1634. X
  1635. X#define DMoveScreenCursor(h, v)                        XMoveScreenCursor(1, h, v)
  1636. X#define DSetScreenCursor(h, v)                        XSetScreenCursor(1, h, v)
  1637. X
  1638. Xvoid DefineScreenCursor(long color, long lines, long blinkRate);
  1639. Xvoid HideScreenCursor(void);
  1640. Xvoid ShowScreenCursor(void);
  1641. X
  1642. Xvoid UpdateScreen(void);
  1643. X
  1644. Xvoid FlushScreenKeys(void);
  1645. Xlong CountScreenKeys(void);
  1646. Xint GetScreenKeys(char *keyCode, char *modifiers, char *ascii, short *h,
  1647. X          short *v);
  1648. X
  1649. Xvoid EnableScreenMouse(long flag);
  1650. Xvoid ClipScreenMouse(Rect *clip);
  1651. X
  1652. Xvoid GetScreenCharAttr(char *c, char *a, long h, long v);
  1653. Xvoid GetScreenImage(char *c, char *a, long rowBytes, Rect *area, long h,
  1654. X            long v);
  1655. X
  1656. Xvoid GetScreenCursor(long *h, long *v);
  1657. X
  1658. Xlong YesOrNo(char *question);
  1659. Xlong DoScreenALRT(long id, long kind, Fixed hRatio, Fixed vRatio);
  1660. X
  1661. Xvoid GetScreenBounds(Rect *bounds);
  1662. X
  1663. Xvoid CenterScreenDLOG(long id, Fixed hRatio, Fixed vRatio, long *h, long *v);
  1664. X
  1665. Xpascal void DrawDefaultBorder();
  1666. Xpascal void DrawGroupRect();
  1667. X
  1668. Xvoid ConfigScreenMgr(long force, ResType theType, long theID,
  1669. X             long (*ConfigProc)(Handle theData));
  1670. X
  1671. Xvoid BeginScreenWait(long rate);
  1672. Xvoid EndScreenWait(void);
  1673. X
  1674. XHandle GetFileMHandle(void);
  1675. XHandle GetAppMHandle(void);
  1676. X
  1677. Xlong PushScreen(void);
  1678. Xvoid PopScreen(void);
  1679. X
  1680. X#endif
  1681. END_OF_FILE
  1682. if test 7454 -ne `wc -c <'mac/scrnmgr/ScrnMgr.h'`; then
  1683.     echo shar: \"'mac/scrnmgr/ScrnMgr.h'\" unpacked with wrong size!
  1684. fi
  1685. # end of 'mac/scrnmgr/ScrnMgr.h'
  1686. fi
  1687. if test -f 'mac/scrnmgr/ScrnTest.c' -a "${1}" != "-c" ; then 
  1688.   echo shar: Will not clobber existing file \"'mac/scrnmgr/ScrnTest.c'\"
  1689. else
  1690. echo shar: Extracting \"'mac/scrnmgr/ScrnTest.c'\" \(6460 characters\)
  1691. sed "s/^X//" >'mac/scrnmgr/ScrnTest.c' <<'END_OF_FILE'
  1692. X/* mac/scrnmgr/ScrnTest.c: test driver for scrnmgr code
  1693. X
  1694. X   Copyright (c) 1989-1991 Curtis McCauley, James E. Wilson
  1695. X
  1696. X   You may copy this subroutine package freely, modify it as you desire,
  1697. X   and distribute it at will, as long as the copyright notice in the source
  1698. X   material is not disturbed, excepting that no one may use this package or
  1699. X   any part of it for commercial purposes of any kind without the express
  1700. X   written consent of its author. */
  1701. X
  1702. X/* Mac interface files required only for the call to TickCount() */
  1703. X
  1704. X#ifndef THINK_C
  1705. X#include <Types.h>
  1706. X#include <Quickdraw.h>
  1707. X#include <Events.h>
  1708. X#else
  1709. X#define NULL 0
  1710. X#endif
  1711. X
  1712. X#include "ScrnMgr.h"
  1713. X
  1714. Xstatic long done;
  1715. X
  1716. X/*    This routine handles the items in the application menu.  It gets called
  1717. X    by the screen manager whenever the user selects from that menu with the
  1718. X    appropriate item number. */
  1719. X
  1720. X/*     Spins the watch cursor for n seconds, rotating the hands 4 times a
  1721. X    second. */
  1722. X
  1723. Xstatic void Wait(n)
  1724. Xint n;
  1725. X
  1726. X{
  1727. X    long tick;
  1728. X
  1729. X    tick = TickCount() + n * 60L;
  1730. X
  1731. X    BeginScreenWait(15);
  1732. X    while (TickCount() < tick)
  1733. X      SystemTask ();
  1734. X    EndScreenWait();
  1735. X
  1736. X    return;
  1737. X}
  1738. X
  1739. Xstatic void DoAppMenu(theItem)
  1740. Xlong theItem;
  1741. X
  1742. X{
  1743. X    long i;
  1744. X#ifndef USE_PUSH
  1745. X    char save_chars[80*25], save_attrs[80*25];
  1746. X    long save_cursor_h, save_cursor_v;
  1747. X    Rect screen;
  1748. X#endif
  1749. X
  1750. X    switch (theItem) {
  1751. X
  1752. X        case 1:
  1753. X            /* X out every character cell on the screen, with immediate updates. */
  1754. X#ifdef USE_PUSH
  1755. X            if (PushScreen() == scrnErrOk) {
  1756. X                for (i = 0; i < 25*79; i++) {
  1757. X                    SetScreenChar('x', i % 79, i % 25);
  1758. X                    UpdateScreen();
  1759. X                }
  1760. X                Wait(10);
  1761. X                PopScreen();
  1762. X            }
  1763. X            break;
  1764. X#else
  1765. X            screen.left = screen.top = 0;
  1766. X            screen.right = 80;
  1767. X            screen.bottom = 25;
  1768. X            GetScreenImage(save_chars, save_attrs, 80, &screen, 0, 0);
  1769. X            GetScreenCursor(&save_cursor_h, &save_cursor_v);
  1770. X            for (i = 0; i < 25*79; i++) {
  1771. X                SetScreenChar('x', i % 79, i % 25);
  1772. X                UpdateScreen();
  1773. X            }
  1774. X            Wait(10);
  1775. X            SetScreenImage(save_chars, save_attrs, 80, &screen, 0, 0);
  1776. X            SetScreenCursor(save_cursor_h, save_cursor_v);
  1777. X            break;
  1778. X#endif
  1779. X
  1780. X        case 2:
  1781. X            /* Test the alert package. */
  1782. X            DoScreenALRT(1024, akNote, fixHalf, fixHalf);
  1783. X            break;
  1784. X
  1785. X    }
  1786. X
  1787. X    return;
  1788. X}
  1789. X
  1790. X/*    This routine gets called when the user selects quit from the file
  1791. X    menu.  It was installed with a call to SetScreenQuitProc(). */
  1792. X
  1793. Xstatic void Quit()
  1794. X
  1795. X{
  1796. X    if (YesOrNo("Are you certain that you want to quit the test?")) {
  1797. X        done = true;
  1798. X    }
  1799. X
  1800. X    return;
  1801. X}
  1802. X
  1803. X/*    All this routine does is to put some characters in the screen buffer. */
  1804. X
  1805. Xstatic void RunSomeTests()
  1806. X
  1807. X{
  1808. X    long i;
  1809. X    Rect area;
  1810. X    char msg[80];
  1811. X
  1812. X    /* Fill the whole screen with blanks. */
  1813. X    area.left = 0;
  1814. X    area.top = 0;
  1815. X    area.right = 80;
  1816. X    area.bottom = 25;
  1817. X    FillScreen(' ', MakeAttr(attrColorBlack, attrColorWhite), &area);
  1818. X
  1819. X    /* Put up a humorous message. */
  1820. X    SetScreenCursor(0, 0);
  1821. X    WriteScreenString("Hello, world --");
  1822. X    SetScreenCursor(10, 2);
  1823. X    WriteScreenStringAttr("This is a test",
  1824. X                  MakeAttr(attrColorRed,
  1825. X                       attrColorWhite) | attrUnderlined);
  1826. X    WriteScreenString(" of the Screen Manager.");
  1827. X    SetScreenCursor(10, 3);
  1828. X    WriteScreenString("This is only a ");
  1829. X    WriteScreenStringAttr("test",
  1830. X                  MakeAttr(attrColorWhite,
  1831. X                       attrColorBlack) | attrItalicized);
  1832. X    WriteScreenString(".  If this had been");
  1833. X    SetScreenCursor(10, 4);
  1834. X    WriteScreenString("an actual run, the program would bomb.");
  1835. X
  1836. X    /* Show all the screen colors on a black background. */
  1837. X    SetScreenCursor(0, 10);
  1838. X    for (i = 0; i < 8; i++)
  1839. X        WriteScreenCharAttr('a'+i, MakeAttr(i, attrColorBlack));
  1840. X
  1841. X    /* Fill a subsection of the screen with white asterisks on a red
  1842. X       background. */
  1843. X    area.left = 11;
  1844. X    area.top = 11;
  1845. X    area.right = 16;
  1846. X    area.bottom = 16;
  1847. X    FillScreen('*', MakeAttr(attrColorWhite, attrColorRed), &area);
  1848. X
  1849. X    /* Show the pixel bounds of the entire display screen, minus the
  1850. X       menu bar. */
  1851. X    GetScreenBounds(&area);
  1852. X    sprintf(msg, "Bounds: %d %d %d %d", area.top, area.left,
  1853. X        area.bottom, area.right);
  1854. X    SetScreenString(msg, 0, 18);
  1855. X
  1856. X    return;
  1857. X}
  1858. X
  1859. X/*    The big picture. */
  1860. X
  1861. Xint main()
  1862. X
  1863. X{
  1864. X    char keycode, modifiers, ascii;
  1865. X    int h, v;
  1866. X    long i;
  1867. X    Rect scrollRect1, scrollRect2;
  1868. X    char coords[6], hex[6];
  1869. X
  1870. X    /* This flag gets set in the quit proc. */
  1871. X    done = false;
  1872. X
  1873. X    /* Put the screen up on the monitor. */
  1874. X    InitScreenMgr(80, 25, "This is a Test",
  1875. X        "ScrnMgrConfig", '????', '????',
  1876. X        NULL, DoAppMenu,
  1877. X        multiColor);
  1878. X
  1879. X    /* Point to the quit proc.  Indicate that the quit proc always returns. */
  1880. X    SetScreenQuitProc(Quit, true);
  1881. X
  1882. X    /* Configure the screen cursor.  It does not flash. */
  1883. X    DefineScreenCursor(attrColorBlack, 2, 0);
  1884. X    ShowScreenCursor();
  1885. X
  1886. X    /* Put some characters in the buffer. */
  1887. X    RunSomeTests();
  1888. X
  1889. X    /* Layout some rects for keyboard input. */
  1890. X    scrollRect1.left = 60;
  1891. X    scrollRect1.top = 0;
  1892. X    scrollRect1.right = 70;
  1893. X    scrollRect1.bottom = 1;
  1894. X
  1895. X    scrollRect2.left = 60;
  1896. X    scrollRect2.top = 0;
  1897. X    scrollRect2.right = 70;
  1898. X    scrollRect2.bottom = 10;
  1899. X
  1900. X    /* Detect mouse clicks in the specified area. */
  1901. X    ClipScreenMouse(&scrollRect2);
  1902. X    EnableScreenMouse(true);
  1903. X
  1904. X    i = 0;
  1905. X
  1906. X    while (!done) {
  1907. X
  1908. X        /* Very important.  Allows screen manager to update the
  1909. X           screen if any characters have been stuffed in the buffer,
  1910. X           to pull any keystrokes off the event queue, etc. */
  1911. X        IdleScreenMgr();
  1912. X
  1913. X        /* Look for keyboard or mouse input. */
  1914. X        if (GetScreenKeys(&keycode, &modifiers, &ascii, &h, &v)) {
  1915. X
  1916. X            /* Is is not a mouse click?  Then it is a keystroke. */
  1917. X            if (!(modifiers & maskModMouse)) {
  1918. X                /* Scroll top line one char to the left.
  1919. X                   Filling in with white on green. */
  1920. X                ScrollScreen(-1, 0, &scrollRect1,
  1921. X                         MakeAttr(attrColorWhite,
  1922. X                              attrColorGreen));
  1923. X                /* Put the character on the screen to the top right. */
  1924. X                SetScreenChar(ascii, 69, 0);
  1925. X                /* If top line has been filled, scroll lines down. */
  1926. X                if (!(++i % 10)) {
  1927. X                    ScrollScreen(0, 1, &scrollRect2,
  1928. X                             MakeAttr(attrColorWhite,
  1929. X                                  attrColorGreen));
  1930. X                    UpdateScreen();
  1931. X                }
  1932. X                /* Show the keycodes entered. */
  1933. X                sprintf(hex, "%2.2X %2.2X",
  1934. X                    (int)(unsigned char) ascii,
  1935. X                    (int)(unsigned char) keycode);
  1936. X                SetScreenString(hex, 40, 24);
  1937. X                /* If the char 'D' has been typed, go into a wait.  Notice that the D does
  1938. X                not appear on the screen until the wait has ended, at the IdleScreenMgr
  1939. X                call. */
  1940. X                if (ascii == 'D') Wait(30);
  1941. X            }
  1942. X
  1943. X            /* Otherwise, it is a mouse click.  Show the coordinates. */
  1944. X            else {
  1945. X                sprintf(coords, "%2.2d %2.2d", h, v);
  1946. X                SetScreenString(coords, 0, 24);
  1947. X            }
  1948. X
  1949. X        }
  1950. X    }
  1951. X
  1952. X    /* Clean up. */
  1953. X    CloseScreenMgr();
  1954. X
  1955. X    return(0);
  1956. X}
  1957. END_OF_FILE
  1958. if test 6460 -ne `wc -c <'mac/scrnmgr/ScrnTest.c'`; then
  1959.     echo shar: \"'mac/scrnmgr/ScrnTest.c'\" unpacked with wrong size!
  1960. fi
  1961. # end of 'mac/scrnmgr/ScrnTest.c'
  1962. fi
  1963. if test -f 'source/signals.c' -a "${1}" != "-c" ; then 
  1964.   echo shar: Will not clobber existing file \"'source/signals.c'\"
  1965. else
  1966. echo shar: Extracting \"'source/signals.c'\" \(7840 characters\)
  1967. sed "s/^X//" >'source/signals.c' <<'END_OF_FILE'
  1968. X/* source/signals.c: signal handlers
  1969. X
  1970. X   Copyright (c) 1989-92 James E. Wilson, Christopher J. Stuart
  1971. X
  1972. X   This software may be copied and distributed for educational, research, and
  1973. X   not for profit purposes provided that this copyright and statement are
  1974. X   included in all such copies. */
  1975. X
  1976. X/* This signal package was brought to you by        -JEW-  */
  1977. X/* Completely rewritten by                -CJS- */
  1978. X
  1979. X/* To find out what system we're on.  */
  1980. X
  1981. X#include <stdio.h>
  1982. X
  1983. X#include "config.h"
  1984. X#include "constant.h"
  1985. X
  1986. X/* Signals have no significance on the Mac */
  1987. X
  1988. X#ifdef MAC
  1989. X
  1990. Xvoid nosignals()
  1991. X{
  1992. X}
  1993. X
  1994. Xvoid signals()
  1995. X{
  1996. X}
  1997. X
  1998. Xvoid init_signals()
  1999. X{
  2000. X}
  2001. X
  2002. X#else /* a non-Mac system */
  2003. X
  2004. X#ifdef ATARIST_MWC
  2005. X/* need these for atari st, but for unix, must include signals.h first,
  2006. X   or else suspend won't be properly declared */
  2007. X#include "types.h"
  2008. X#include "externs.h"
  2009. X#endif
  2010. X
  2011. X/* skip most of the file on an ATARI ST */
  2012. X/* commented away most single handling for Atari ST TC too, as this
  2013. X   doesn't work as it should.  */
  2014. X#if !defined(ATARIST_MWC) && !defined(ATARIST_TC)
  2015. X
  2016. X#if defined(SYS_V) && defined(lint)
  2017. X/* for AIX, prevent hundreds of unnecessary lint errors, define before
  2018. X   signal.h is included */
  2019. X#define _h_IEEETRAP
  2020. Xtypedef struct { int stuff; } fpvmach;
  2021. X#endif
  2022. X
  2023. X/* must include before externs.h, because that uses SIGTSTP */
  2024. X#include <signal.h>
  2025. X
  2026. X#include "types.h"
  2027. X#include "externs.h"
  2028. X
  2029. X#ifndef USG
  2030. X/* only needed for Berkeley UNIX */
  2031. X#include <sys/types.h>
  2032. X#include <sys/param.h>
  2033. X#endif
  2034. X
  2035. X#ifdef USG
  2036. X#ifndef ATARIST_MWC
  2037. X#include <string.h>
  2038. X#endif
  2039. X#else
  2040. X#include <strings.h>
  2041. X#endif
  2042. X
  2043. X#ifndef VMS
  2044. X#ifdef USG
  2045. Xvoid exit();
  2046. X#ifdef __TURBOC__
  2047. Xvoid sleep();
  2048. X#else
  2049. Xunsigned sleep();
  2050. X#endif
  2051. X#endif
  2052. X#endif
  2053. X
  2054. Xstatic int error_sig = -1;
  2055. Xstatic int signal_count = 0;
  2056. X
  2057. X/*ARGSUSED*/
  2058. X#ifndef USG
  2059. Xstatic int signal_handler(sig, code, scp)
  2060. Xint sig, code;
  2061. Xstruct sigcontext *scp;
  2062. X{
  2063. X  int smask;
  2064. X
  2065. X  smask = sigsetmask(0) | (1 << sig);
  2066. X#else
  2067. X#if defined(__TURBOC__) || defined(AMIGA)
  2068. Xstatic void signal_handler(sig)
  2069. X#else
  2070. Xstatic int signal_handler(sig)
  2071. X#endif
  2072. Xint sig;
  2073. X{
  2074. X#endif
  2075. X
  2076. X  if(error_sig >= 0)    /* Ignore all second signals. */
  2077. X    {
  2078. X      if(++signal_count > 10)    /* Be safe. We will die if persistent enough. */
  2079. X    (void) signal(sig, SIG_DFL);
  2080. X      return;
  2081. X    }
  2082. X  error_sig = sig;
  2083. X
  2084. X  /* Allow player to think twice. Wizard may force a core dump. */
  2085. X  if (sig == SIGINT
  2086. X#if !defined(MSDOS) && !defined(AMIGA) && !defined(ATARIST_TC)
  2087. X      || sig == SIGQUIT
  2088. X#endif
  2089. X      )
  2090. X    {
  2091. X      if (death)
  2092. X    (void) signal(sig, SIG_IGN);        /* Can't quit after death. */
  2093. X      else if (!character_saved && character_generated)
  2094. X    {
  2095. X      if (!get_check("Really commit *Suicide*?"))
  2096. X        {
  2097. X          if (turn > 0)
  2098. X        disturb(1, 0);
  2099. X          erase_line(0, 0);
  2100. X          put_qio();
  2101. X          error_sig = -1;
  2102. X#ifdef USG
  2103. X          (void) signal(sig, signal_handler);/* Have to restore handler. */
  2104. X#else
  2105. X          (void) sigsetmask(smask);
  2106. X#endif
  2107. X          /* in case control-c typed during msg_print */
  2108. X          if (wait_for_more)
  2109. X        put_buffer(" -more-", MSG_LINE, 0);
  2110. X          put_qio();
  2111. X          return;        /* OK. We don't quit. */
  2112. X        }
  2113. X      (void) strcpy(died_from, "Interrupting");
  2114. X    }
  2115. X      else
  2116. X    (void) strcpy(died_from, "Abortion");
  2117. X      prt("Interrupt!", 0, 0);
  2118. X      death = TRUE;
  2119. X      exit_game();
  2120. X    }
  2121. X  /* Die. */
  2122. X  prt(
  2123. X"OH NO!!!!!!  A gruesome software bug LEAPS out at you. There is NO defense!",
  2124. X      23, 0);
  2125. X  if (!death && !character_saved && character_generated)
  2126. X    {
  2127. X      panic_save = 1;
  2128. X      prt("Your guardian angel is trying to save you.", 0, 0);
  2129. X      (void) sprintf(died_from,"(panic save %d)",sig);
  2130. X      if (!save_char())
  2131. X    {
  2132. X      (void) strcpy(died_from, "software bug");
  2133. X      death = TRUE;
  2134. X      turn = -1;
  2135. X    }
  2136. X    }
  2137. X  else
  2138. X    {
  2139. X      death = TRUE;
  2140. X      (void) _save_char(savefile);    /* Quietly save the memory anyway. */
  2141. X    }
  2142. X  restore_term();
  2143. X#if !defined(MSDOS) && !defined(AMIGA) && !defined(ATARIST_TC)
  2144. X  /* always generate a core dump */
  2145. X  (void) signal(sig, SIG_DFL);
  2146. X  (void) kill(getpid(), sig);
  2147. X  (void) sleep(5);
  2148. X#endif
  2149. X  exit(1);
  2150. X}
  2151. X
  2152. X#endif /* ATARIST_MWC, ATARIST_TC */
  2153. X
  2154. X#ifndef USG
  2155. Xstatic int mask;
  2156. X#endif
  2157. X
  2158. Xvoid nosignals()
  2159. X{
  2160. X#if !defined(ATARIST_MWC) && !defined(ATARIST_TC)
  2161. X#ifdef SIGTSTP
  2162. X#if defined(atarist) && defined(__GNUC__)
  2163. X  (void) signal(SIGTSTP, (__Sigfunc)SIG_IGN);
  2164. X#else
  2165. X  (void) signal(SIGTSTP, SIG_IGN);
  2166. X#endif
  2167. X#ifndef USG
  2168. X  mask = sigsetmask(0);
  2169. X#endif
  2170. X#endif
  2171. X  if (error_sig < 0)
  2172. X    error_sig = 0;
  2173. X#endif
  2174. X}
  2175. X
  2176. Xvoid signals()
  2177. X{
  2178. X#if !defined(ATARIST_MWC) && !defined(ATARIST_TC)
  2179. X#ifdef SIGTSTP
  2180. X#if defined(atarist) && defined(__GNUC__)
  2181. X  (void) signal(SIGTSTP, (__Sigfunc)suspend);
  2182. X#else
  2183. X  (void) signal(SIGTSTP, suspend);
  2184. X#endif
  2185. X#ifndef USG
  2186. X  (void) sigsetmask(mask);
  2187. X#endif
  2188. X#endif
  2189. X  if (error_sig == 0)
  2190. X    error_sig = -1;
  2191. X#endif
  2192. X}
  2193. X
  2194. X
  2195. Xvoid init_signals()
  2196. X{
  2197. X#if !defined(ATARIST_MWC) && !defined(ATARIST_TC)
  2198. X  /* No signals for Atari ST compiled with MWC or TC.  */
  2199. X  (void) signal(SIGINT, signal_handler);
  2200. X
  2201. X#if defined(atarist) && defined(__GNUC__)
  2202. X  /* Atari ST compiled with GNUC has most signals, but we need a cast
  2203. X     in every call to signal.  */
  2204. X  (void) signal(SIGINT, (__Sigfunc)signal_handler);
  2205. X  (void) signal(SIGQUIT, (__Sigfunc)signal_handler);
  2206. X  (void) signal(SIGTSTP,(__Sigfunc)SIG_IGN);
  2207. X  (void) signal(SIGILL, (__Sigfunc)signal_handler);
  2208. X  (void) signal(SIGHUP, (__Sigfunc)SIG_IGN);
  2209. X  (void) signal(SIGTRAP,(__Sigfunc)signal_handler);
  2210. X  (void) signal(SIGIOT, (__Sigfunc)signal_handler);
  2211. X  (void) signal(SIGEMT, (__Sigfunc)signal_handler);
  2212. X  (void) signal(SIGKILL, (__Sigfunc)signal_handler);
  2213. X  (void) signal(SIGBUS, (__Sigfunc)signal_handler);
  2214. X  (void) signal(SIGSEGV, (__Sigfunc)signal_handler);
  2215. X  (void) signal(SIGSYS, (__Sigfunc)signal_handler);
  2216. X  (void) signal(SIGTERM,(__Sigfunc)signal_handler);
  2217. X  (void) signal(SIGPIPE, (__Sigfunc)signal_handler);
  2218. X
  2219. X#else
  2220. X  /* Everybody except the atari st.  */
  2221. X  (void) signal(SIGINT, signal_handler);
  2222. X  (void) signal(SIGFPE, signal_handler);
  2223. X
  2224. X#if defined(MSDOS)
  2225. X  /* many fewer signals under MSDOS */
  2226. X#else
  2227. X
  2228. X#ifdef AMIGA
  2229. X/*  (void) signal(SIGINT, signal_handler); */
  2230. X  (void) signal(SIGTERM, signal_handler);
  2231. X  (void) signal(SIGABRT, signal_handler);
  2232. X/*  (void) signal(SIGFPE, signal_handler); */
  2233. X  (void) signal(SIGILL, signal_handler);
  2234. X  (void) signal(SIGSEGV, signal_handler);
  2235. X
  2236. X#else
  2237. X
  2238. X  /* Everybody except Atari, MSDOS, and Amiga.  */
  2239. X  /* Ignore HANGUP, and let the EOF code take care of this case. */
  2240. X  (void) signal(SIGHUP, SIG_IGN);
  2241. X  (void) signal(SIGQUIT, signal_handler);
  2242. X  (void) signal(SIGILL, signal_handler);
  2243. X  (void) signal(SIGTRAP, signal_handler);
  2244. X  (void) signal(SIGIOT, signal_handler);
  2245. X#ifdef SIGEMT  /* in BSD systems */
  2246. X  (void) signal(SIGEMT, signal_handler);
  2247. X#endif
  2248. X#ifdef SIGDANGER /* in SYSV systems */
  2249. X  (void) signal(SIGDANGER, signal_handler);
  2250. X#endif
  2251. X  (void) signal(SIGKILL, signal_handler);
  2252. X  (void) signal(SIGBUS, signal_handler);
  2253. X  (void) signal(SIGSEGV, signal_handler);
  2254. X  (void) signal(SIGSYS, signal_handler);
  2255. X  (void) signal(SIGTERM, signal_handler);
  2256. X  (void) signal(SIGPIPE, signal_handler);
  2257. X#ifdef SIGXCPU    /* BSD */
  2258. X  (void) signal(SIGXCPU, signal_handler);
  2259. X#endif
  2260. X#ifdef SIGPWR /* SYSV */
  2261. X  (void) signal(SIGPWR, signal_handler);
  2262. X#endif
  2263. X#endif
  2264. X#endif
  2265. X#endif
  2266. X#endif
  2267. X}
  2268. X
  2269. Xvoid ignore_signals()
  2270. X{
  2271. X#if !defined(ATARIST_MWC)
  2272. X  (void) signal(SIGINT, SIG_IGN);
  2273. X#ifdef SIGQUIT
  2274. X  (void) signal(SIGQUIT, SIG_IGN);
  2275. X#endif
  2276. X#endif
  2277. X}
  2278. X
  2279. Xvoid default_signals()
  2280. X{
  2281. X#if !defined(ATARIST_MWC)
  2282. X  (void) signal(SIGINT, SIG_DFL);
  2283. X#ifdef SIGQUIT
  2284. X  (void) signal(SIGQUIT, SIG_DFL);
  2285. X#endif
  2286. X#endif
  2287. X}
  2288. X
  2289. Xvoid restore_signals()
  2290. X{
  2291. X#if !defined(ATARIST_MWC)
  2292. X#if defined(atarist) && defined(__GNUC__)
  2293. X  (void) signal(SIGINT, (__Sigfunc)signal_handler);
  2294. X#else
  2295. X  (void) signal(SIGINT, signal_handler);
  2296. X#endif
  2297. X#ifdef SIGQUIT
  2298. X#if defined(atarist) && defined(__GNUC__)
  2299. X  (void) signal(SIGQUIT, (__Sigfunc)signal_handler);
  2300. X#else
  2301. X  (void) signal(SIGQUIT, signal_handler);
  2302. X#endif
  2303. X#endif
  2304. X#endif
  2305. X}
  2306. X
  2307. X#endif /* big Mac conditional */
  2308. END_OF_FILE
  2309. if test 7840 -ne `wc -c <'source/signals.c'`; then
  2310.     echo shar: \"'source/signals.c'\" unpacked with wrong size!
  2311. fi
  2312. # end of 'source/signals.c'
  2313. fi
  2314. echo shar: End of archive 34 \(of 39\).
  2315. cp /dev/null ark34isdone
  2316. MISSING=""
  2317. 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
  2318.     if test ! -f ark${I}isdone ; then
  2319.     MISSING="${MISSING} ${I}"
  2320.     fi
  2321. done
  2322. if test "${MISSING}" = "" ; then
  2323.     echo You have unpacked all 39 archives.
  2324.     echo "Now run "bldfiles.sh" to build split files"
  2325.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2326. else
  2327.     echo You still need to unpack the following archives:
  2328.     echo "        " ${MISSING}
  2329. fi
  2330. ##  End of shell archive.
  2331. exit 0
  2332.