home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / games / volume16 / nethck31 / patch2a < prev    next >
Encoding:
Internet Message Format  |  1993-06-15  |  58.4 KB

  1. Path: uunet!news.tek.com!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v17i076:  nethack31 - display oriented dungeons & dragons (Ver. 3.1), Patch2a/33
  5. Date: 11 Jun 1993 00:04:10 GMT
  6. Organization: Tektronix, Inc, Redmond, OR, USA
  7. Lines: 2274
  8. Approved: billr@saab.CNA.TEK.COM
  9. Message-ID: <1v8i5q$inn@ying.cna.tek.com>
  10. NNTP-Posting-Host: saab.cna.tek.com
  11. Xref: uunet comp.sources.games:1755
  12.  
  13. Submitted-by: izchak@linc.cis.upenn.edu (Izchak Miller)
  14. Posting-number: Volume 17, Issue 76
  15. Archive-name: nethack31/Patch2a
  16. Patch-To: nethack31: Volume 16, Issue 1-116
  17. Environment: Amiga, Atari, Mac, MS-DOS, Windows-NT, OS2, Unix, VMS, X11
  18.  
  19.     [Here's patch 2 to nethack3.1 in a series of 33 shar files. There
  20.      are both new files, replacement files and patch files. Run the
  21.      'patchit.sh' script after unpacking everything to apply the patches.
  22.      You may then want to go in and cleanup things by removing the .orig
  23.      files.  -br]
  24.  
  25. [From the development team:]
  26. [[In port-specific news, the Amiga and Mac ports have again changed the
  27. most, both in user interface for the previously existing windowing
  28. systems and in adding support for "tty" windowing.  The MS-DOS versions
  29. may now use direct screen I/O instead of going through termcap routines,
  30. and be compiled for NEC PC-9801 machines thanks to Yamamoto Keizo.
  31. The SYSV 386 music driver was ported to 386BSD by Andrew Chernov and
  32. SCO by Andreas Arens.
  33.  
  34. In general news, the pickup and disclosure options were enhanced;
  35. information on the new usage is available from the Guidebook and
  36. intra-game options help.
  37.  
  38. A number of bugs were fixed, of which the most commonly encountered
  39. fatal ones were associated with cursed bags of holding, renaming
  40. shopkeepers, objects falling through trapdoors on deep levels, and
  41. kicking embedded objects loose.
  42.  
  43. As usual, bones and save files from previous versions should be discarded
  44. when upgrading to 3.1.2.]]
  45.  
  46.  
  47. #! /bin/sh
  48. # This is a shell archive.  Remove anything before this line, then unpack
  49. # it by saving it into a file and typing "sh file".  To overwrite existing
  50. # files, type "sh file -c".  You can also feed this as standard input via
  51. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  52. # will see the following message at the end:
  53. #        "End of archive 1 (of 33)."
  54. # Contents:  MANIFEST_P2 include src sys sys/amiga sys/amiga/amilib.c
  55. #   sys/amiga/splitter sys/amiga/winfuncs.c sys/mac sys/mac/dprintf.c
  56. #   sys/msdos sys/os2 sys/share sys/unix sys/winnt
  57. # Wrapped by billr@saab on Thu Jun 10 16:54:59 1993
  58. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  59. if test -f 'MANIFEST_P2' -a "${1}" != "-c" ; then 
  60.   echo shar: Renaming existing file \"'MANIFEST_P2'\" to \"'MANIFEST_P2.orig'\"
  61.   mv -f 'MANIFEST_P2' 'MANIFEST_P2.orig'
  62. fi
  63. echo shar: Extracting \"'MANIFEST_P2'\" \(2660 characters\)
  64. sed "s/^X//" >'MANIFEST_P2' <<'END_OF_FILE'
  65. X   File Name        Archive #    Description
  66. X-----------------------------------------------------------
  67. X MANIFEST_P2                1    This shipping list
  68. X UPDATE2                    9    
  69. X include                    1    
  70. X include/mactty.h          33    
  71. X include/mttypriv.h         3    
  72. X include/ntconf.h           9    
  73. X patches02a                 8    
  74. X patches02b                 7    
  75. X patches02c                18    
  76. X patches02d                 4    
  77. X patches02e                15    
  78. X patches02f                10    
  79. X patches02g                20    
  80. X patches02h                11    
  81. X patches02i                 3    
  82. X patches02j                19    
  83. X patches02k                17    
  84. X patches02l                13    
  85. X patches02m                 2    
  86. X patches02n                 5    
  87. X patches02o                14    
  88. X patches02p.1              22    
  89. X patches02p.2              25    
  90. X patches02q                 9    
  91. X patches02r                32    
  92. X patches02s                12    
  93. X patches02t.uu1             6    
  94. X patches02t.uu2            32    
  95. X patches02u                32    
  96. X patchit.sh                 7    
  97. X src                        1    
  98. X src/ball.c                23    
  99. X src/sounds.c              22    
  100. X sys                        1    
  101. X sys/amiga                  1    
  102. X sys/amiga/amifont8.uu     16    
  103. X sys/amiga/amilib.c         1    
  104. X sys/amiga/amitty.c         8    
  105. X sys/amiga/charwin.uu      14    
  106. X sys/amiga/colors.uu        7    
  107. X sys/amiga/randwin.uu       8    
  108. X sys/amiga/splitter         1    
  109. X sys/amiga/splitter/splitter.c 28    
  110. X sys/amiga/wbwin.c         16    
  111. X sys/amiga/wbwin.uu        31    
  112. X sys/amiga/winami.c        28    
  113. X sys/amiga/windefs.h       13    
  114. X sys/amiga/winext.h         6    
  115. X sys/amiga/winfuncs.c       1    
  116. X sys/amiga/winkey.c         5    
  117. X sys/amiga/winmenu.c       24    
  118. X sys/amiga/winproto.h      18    
  119. X sys/amiga/winreq.c        27    
  120. X sys/amiga/winstr.c        33    
  121. X sys/mac                    1    
  122. X sys/mac/NHDeflts           4    
  123. X sys/mac/NHmake.hqx        24    
  124. X sys/mac/NHrez.hqx         15    
  125. X sys/mac/NHrsrc.hqx        26    
  126. X sys/mac/dprintf.c          1    
  127. X sys/mac/macmenu.c.uu      27    
  128. X sys/mac/mactty.c          23    
  129. X sys/mac/mrecover.c        30    
  130. X sys/mac/mrecover.hqx      17    
  131. X sys/mac/mttymain.c        31    
  132. X sys/msdos                  1    
  133. X sys/msdos/trampoli.c      29    
  134. X sys/msdos/video.c         31    
  135. X sys/os2                    1    
  136. X sys/os2/Install.os2       30    
  137. X sys/share                  1    
  138. X sys/share/dgn_lex.c       25    
  139. X sys/share/lev_lex.c       21    
  140. X sys/share/pcsys.c         28    
  141. X sys/share/termcap.uu      29    
  142. X sys/unix                   1    
  143. X sys/unix/snd86unx.shr     26    
  144. X sys/winnt                  1    
  145. X sys/winnt/Install.nt      30    
  146. X sys/winnt/nhincl.mak      33    
  147. X sys/winnt/nttty.c         29    
  148. X sys/winnt/winnt.cnf       10    
  149. END_OF_FILE
  150. if test 2660 -ne `wc -c <'MANIFEST_P2'`; then
  151.     echo shar: \"'MANIFEST_P2'\" unpacked with wrong size!
  152. fi
  153. # end of 'MANIFEST_P2'
  154. if test ! -d 'include' ; then
  155.     echo shar: Creating directory \"'include'\"
  156.     mkdir 'include'
  157. fi
  158. if test ! -d 'src' ; then
  159.     echo shar: Creating directory \"'src'\"
  160.     mkdir 'src'
  161. fi
  162. if test ! -d 'sys' ; then
  163.     echo shar: Creating directory \"'sys'\"
  164.     mkdir 'sys'
  165. fi
  166. if test ! -d 'sys/amiga' ; then
  167.     echo shar: Creating directory \"'sys/amiga'\"
  168.     mkdir 'sys/amiga'
  169. fi
  170. if test -f 'sys/amiga/amilib.c' -a "${1}" != "-c" ; then 
  171.   echo shar: Renaming existing file \"'sys/amiga/amilib.c'\" to \"'sys/amiga/amilib.c.orig'\"
  172.   mv -f 'sys/amiga/amilib.c' 'sys/amiga/amilib.c.orig'
  173. fi
  174. echo shar: Extracting \"'sys/amiga/amilib.c'\" \(7470 characters\)
  175. sed "s/^X//" >'sys/amiga/amilib.c' <<'END_OF_FILE'
  176. X/*    SCCS Id: @(#)amilib.c    3.1    93/04/26    */
  177. X/* Copyright (c) Gregg Wonderly, Naperville, Illinois,  1991,1992,1993. */
  178. X/* NetHack may be freely redistributed.  See license for details. */
  179. X
  180. X#include "hack.h"
  181. X#include "wintype.h"
  182. X#include "winami.h"
  183. X#include "func_tab.h"
  184. X
  185. X#ifdef AMIGA_INTUITION
  186. X
  187. X#include <exec/types.h>
  188. X#include <graphics/gfxbase.h>
  189. X#include <intuition/intuition.h>
  190. X#include <intuition/intuitionbase.h>
  191. X#include <libraries/dosextens.h>
  192. X#include <ctype.h>
  193. X#undef  strcmpi
  194. X#include <string.h>
  195. X#include <errno.h>
  196. X
  197. X#ifdef  IDCMP_CLOSEWINDOW
  198. X# define    INTUI_NEW_LOOK
  199. X#endif
  200. X
  201. X#ifdef AZTEC_C
  202. X#include <functions.h>
  203. X#else
  204. X#include <dos.h>
  205. X#include <proto/exec.h>
  206. X#endif
  207. X
  208. X#include "Amiga:lib/amilib.h"
  209. X
  210. X#include "Amiga:winami.p"
  211. X#include "Amiga:amiwind.p"
  212. X
  213. XWinamiBASE *WinamiBase = 0;
  214. X
  215. Xextern char *roles[];
  216. Xextern char orgdir[];
  217. X
  218. Xstruct Library *ConsoleDevice = 0;
  219. Xint bigscreen = 0;
  220. Xchar Initialized = 0;
  221. Xstruct amii_DisplayDesc *amiIDisplay = 0;
  222. Xstruct Screen *HackScreen = 0;
  223. Xwinid WIN_BASE = WIN_ERR;
  224. Xwinid amii_rawprwin = WIN_ERR;
  225. X
  226. X/*void genl_botl_flush( void );*/
  227. Xvoid amii_outrip( winid, int );
  228. Xvoid setup_librefs( WinamiBASE * );
  229. X
  230. X/* The current color map */
  231. Xunsigned short amii_initmap[] = {
  232. X#define C_BLACK        0
  233. X#define C_WHITE        1
  234. X#define C_BROWN        2
  235. X#define C_CYAN        3
  236. X#define C_GREEN        4
  237. X#define C_MAGENTA    5
  238. X#define C_BLUE        6
  239. X#define C_RED        7
  240. X
  241. X    0x0000, /* color #0 */
  242. X    0x0FFF, /* color #1 */
  243. X    0x0830, /* color #2 */
  244. X    0x07ac, /* color #3 */
  245. X    0x0181, /* color #4 */
  246. X    0x0C06, /* color #5 */
  247. X    0x023E, /* color #6 */
  248. X    0x0c00  /* color #7 */
  249. X};
  250. X
  251. X
  252. X
  253. X/* Interface definition, for use by windows.c and winprocs.h to provide
  254. X * the simple intuition interface for the amiga...
  255. X */
  256. Xstruct window_procs amii_procs =
  257. X{
  258. X    "amii",
  259. X    amii_init_nhwindows,
  260. X    amii_player_selection,
  261. X    amii_askname,
  262. X    amii_get_nh_event,
  263. X    amii_exit_nhwindows,
  264. X    amii_suspend_nhwindows,
  265. X    amii_resume_nhwindows,
  266. X    amii_create_nhwindow,
  267. X    amii_clear_nhwindow,
  268. X    amii_display_nhwindow,
  269. X    amii_destroy_nhwindow,
  270. X    amii_curs,
  271. X    amii_putstr,
  272. X    amii_display_file,
  273. X    amii_start_menu,
  274. X    amii_add_menu,
  275. X    amii_end_menu,
  276. X    amii_select_menu,
  277. X    amii_update_inventory,
  278. X    amii_mark_synch,
  279. X    amii_wait_synch,
  280. X#ifdef CLIPPING
  281. X    amii_cliparound,
  282. X#endif
  283. X    amii_print_glyph,
  284. X    amii_raw_print,
  285. X    amii_raw_print_bold,
  286. X    amii_nhgetch,
  287. X    amii_nh_poskey,
  288. X    amii_bell,
  289. X    amii_doprev_message,
  290. X    amii_yn_function,
  291. X    amii_getlin,
  292. X#ifdef COM_COMPL
  293. X    amii_get_ext_cmd,
  294. X#endif /* COM_COMPL */
  295. X    amii_number_pad,
  296. X    amii_delay_output,
  297. X    /* other defs that really should go away (they're tty specific) */
  298. X#ifdef CHANGE_COLOR
  299. X    amii_delay_output,
  300. X    amii_delay_output,
  301. X#endif
  302. X    amii_delay_output,
  303. X    amii_delay_output,
  304. X
  305. X    amii_outrip,
  306. X};
  307. X
  308. X
  309. X/* Interface definition, for use by windows.c and winprocs.h to provide
  310. X * the view window interface to nethack...
  311. X */
  312. Xstruct window_procs amiv_procs =
  313. X{
  314. X    "amiv",
  315. X    amii_init_nhwindows,
  316. X    amii_player_selection,
  317. X    amii_askname,
  318. X    amii_get_nh_event,
  319. X    amii_exit_nhwindows,
  320. X    amii_suspend_nhwindows,
  321. X    amii_resume_nhwindows,
  322. X    amii_create_nhwindow,
  323. X    amii_clear_nhwindow,
  324. X    amii_display_nhwindow,
  325. X    amii_destroy_nhwindow,
  326. X    amii_curs,
  327. X    amii_putstr,
  328. X    amii_display_file,
  329. X    amii_start_menu,
  330. X    amii_add_menu,
  331. X    amii_end_menu,
  332. X    amii_select_menu,
  333. X    amii_update_inventory,
  334. X    amii_mark_synch,
  335. X    amii_wait_synch,
  336. X#ifdef CLIPPING
  337. X    amii_cliparound,
  338. X#endif
  339. X    amii_print_glyph,
  340. X    amii_raw_print,
  341. X    amii_raw_print_bold,
  342. X    amii_nhgetch,
  343. X    amii_nh_poskey,
  344. X    amii_bell,
  345. X    amii_doprev_message,
  346. X    amii_yn_function,
  347. X    amii_getlin,
  348. X#ifdef COM_COMPL
  349. X    amii_get_ext_cmd,
  350. X#endif /* COM_COMPL */
  351. X    amii_number_pad,
  352. X    amii_delay_output,
  353. X    /* other defs that really should go away (they're tty specific) */
  354. X#ifdef CHANGE_COLOR
  355. X    amii_delay_output,
  356. X    amii_delay_output,
  357. X#endif
  358. X    amii_delay_output,
  359. X    amii_delay_output,
  360. X
  361. X    amii_outrip,
  362. X};
  363. X
  364. Xvoid
  365. Xamii_loadlib( void )
  366. X{
  367. X    /* Close the library if opened it already (switching display types) */
  368. X    if( WinamiBase )
  369. X    CloseLibrary( (struct Library *)WinamiBase );
  370. X
  371. X    if( ( WinamiBase = ( WinamiBASE *)OpenLibrary( "winami.library", 0 ) ) == NULL )
  372. X    {
  373. X    panic( "can't find winami.library" );
  374. X    }
  375. X    setup_librefs( WinamiBase );
  376. X}
  377. X
  378. Xvoid
  379. Xamiv_loadlib( void )
  380. X{
  381. X    /* Close the library if opened it already (switching display types) */
  382. X    if( WinamiBase )
  383. X    CloseLibrary( (struct Library *)WinamiBase );
  384. X
  385. X    if( ( WinamiBase = ( WinamiBASE *)OpenLibrary( "winamiv.library", 0 ) ) == NULL )
  386. X    {
  387. X    panic( "can't find winami.library" );
  388. X    }
  389. X    setup_librefs( WinamiBase );
  390. X}
  391. X
  392. Xvoid
  393. XCleanUp()
  394. X{
  395. X    if( WinamiBase )
  396. X    {
  397. X    CloseLibrary( (struct Library *)WinamiBase );
  398. X    WinamiBase = NULL;
  399. X    }
  400. X}
  401. X
  402. X/* The library has references to the following code and data items in the main
  403. X * game, so fill in the access pointers for it to user...uggghhh...
  404. X */
  405. Xvoid
  406. Xsetup_librefs( base )
  407. X    WinamiBASE *base;
  408. X{
  409. X    base->G_pline = pline;
  410. X    base->G_display_inventory = display_inventory;
  411. X    base->G_terminate = terminate;
  412. X    base->G_rnd = rnd;
  413. X    base->G_panic = panic;
  414. X    base->G_clearlocks = clearlocks;
  415. X    base->G_on_level = on_level;
  416. X    base->G_exit = exit;
  417. X    base->G_lowc = lowc;
  418. X    base->G_alloc = alloc;
  419. X    base->G_Abort = Abort;
  420. X    base->G_error = error;
  421. X    base->G_fopenp = fopenp;
  422. X/*    base->G_genl_botl_flush = genl_botl_flush; */
  423. X
  424. X    base->G_yn_number = &yn_number;
  425. X    base->G_zapcolors = zapcolors;
  426. X    base->G_plname = plname;
  427. X    base->G_objects = objects;
  428. X    base->G_monsyms = monsyms;
  429. X    base->G_extcmdlist = extcmdlist;
  430. X    base->G_flags = &flags;
  431. X    base->G_oc_syms = oc_syms;
  432. X    base->G_showsyms = showsyms;
  433. X    base->G_quitchars = quitchars;
  434. X    base->G_pl_character = pl_character;
  435. X    base->G_WIN_MESSAGE = &WIN_MESSAGE;
  436. X    base->G_WIN_MAP = &WIN_MAP;
  437. X    base->G_tc_gbl_data = &tc_gbl_data;
  438. X    base->G_defsyms = defsyms;
  439. X    base->G_WIN_STATUS = &WIN_STATUS;
  440. X    base->G_u = &u;
  441. X    base->G_roles = roles;
  442. X    base->G_dungeon_topology = &dungeon_topology;
  443. X    base->G_toplines = toplines;
  444. X    base->G_WIN_INVEN = &WIN_INVEN;
  445. X    base->G_windowprocs = &windowprocs;
  446. X    base->G_orgdir = orgdir;
  447. X    base->G_mons = mons;
  448. X    base->G_amiIDisplay = &amiIDisplay;
  449. X    base->G_HackScreen = &HackScreen;
  450. X    base->G_pl_classes = pl_classes;
  451. X    base->G_bigscreen = &bigscreen;
  452. X    base->G_WINBASE = &WIN_BASE;
  453. X    base->G_amii_rawprwin = &amii_rawprwin;
  454. X    base->G_amii_initmap = amii_initmap;
  455. X    base->G_Initialized = &Initialized;
  456. X    base->G_ConsoleDevice = &ConsoleDevice;
  457. X    base->G_amii_procs = &amii_procs;
  458. X}
  459. X#endif
  460. X
  461. Xvoid Abort(rc)
  462. Xlong rc;
  463. X{
  464. X#ifdef CHDIR
  465. X    chdir(orgdir);
  466. X#endif
  467. X    if (Initialized && ConsoleDevice) {
  468. X    printf("\n\nAbort with alert code %08lx...\n", rc);
  469. X    amii_getret();
  470. X    } else
  471. X    Alert(rc);
  472. X#ifdef __SASC
  473. X    {
  474. X/*  __emit(0x4afc);     /* illegal instruction */
  475. X    __emit(0x40fc);     /* divide by */
  476. X    __emit(0x0000);     /*  #0  */
  477. X    /* NOTE: don't move CleanUp() above here - */
  478. X    /* it is too likely to kill the system     */
  479. X    /* before it can get the SnapShot out, if  */
  480. X    /* there is something really wrong.    */
  481. X    }
  482. X#endif
  483. X    CleanUp();
  484. X#undef exit
  485. X#ifdef AZTEC_C
  486. X    _abort();
  487. X#endif
  488. X    exit((int) rc);
  489. X}
  490. X
  491. X/* fatal error */
  492. X/*VARARGS1*/
  493. Xvoid error VA_DECL(const char *, s)
  494. X    VA_START(s);
  495. X    VA_INIT(s, char *);
  496. X
  497. X    putchar('\n');
  498. X    vprintf(s, VA_ARGS);
  499. X    putchar('\n');
  500. X
  501. X    VA_END();
  502. X    Abort(0L);
  503. X}
  504. X
  505. END_OF_FILE
  506. if test 7470 -ne `wc -c <'sys/amiga/amilib.c'`; then
  507.     echo shar: \"'sys/amiga/amilib.c'\" unpacked with wrong size!
  508. fi
  509. # end of 'sys/amiga/amilib.c'
  510. if test ! -d 'sys/amiga/splitter' ; then
  511.     echo shar: Creating directory \"'sys/amiga/splitter'\"
  512.     mkdir 'sys/amiga/splitter'
  513. fi
  514. if test -f 'sys/amiga/winfuncs.c' -a "${1}" != "-c" ; then 
  515.   echo shar: Renaming existing file \"'sys/amiga/winfuncs.c'\" to \"'sys/amiga/winfuncs.c.orig'\"
  516.   mv -f 'sys/amiga/winfuncs.c' 'sys/amiga/winfuncs.c.orig'
  517. fi
  518. echo shar: Extracting \"'sys/amiga/winfuncs.c'\" \(40043 characters\)
  519. sed "s/^X//" >'sys/amiga/winfuncs.c' <<'END_OF_FILE'
  520. X/*    SCCS Id: @(#)winfuncs.c    3.1    93/04/02 */
  521. X/* Copyright (c) Gregg Wonderly, Naperville, Illinois,  1991,1992,1993. */
  522. X/* NetHack may be freely redistributed.  See license for details. */
  523. X
  524. X#include "amiga:windefs.h"
  525. X#include "amiga:winext.h"
  526. X#include "amiga:winproto.h"
  527. X#include "incl:patchlevel.h"
  528. X
  529. Xint topl_addspace=1;
  530. X
  531. X
  532. Xvoid
  533. Xamii_destroy_nhwindow(win)      /* just hide */
  534. X    register winid win;
  535. X{
  536. X    register struct amii_WinDesc *cw;
  537. X
  538. X    if( win == WIN_ERR || ( cw = amii_wins[win] ) == NULL )
  539. X    {
  540. X    panic(winpanicstr,win,"destroy_nhwindow");
  541. X    }
  542. X
  543. X#ifdef    VIEWWINDOW
  544. X    if( cw->type == NHW_MAP )
  545. X    {
  546. X    amii_destroy_nhwindow( WIN_VIEW );
  547. X    amii_destroy_nhwindow( WIN_VIEWBOX );
  548. X
  549. X    /* If inventory is up, close it now, it will be freed later */
  550. X    if( alwaysinvent && WIN_INVEN != WIN_ERR &&
  551. X                amii_wins[ WIN_INVEN ] &&
  552. X                amii_wins[ WIN_INVEN ]->win )
  553. X    {
  554. X        dismiss_nhwindow( WIN_INVEN );
  555. X    }
  556. X    }
  557. X#endif
  558. X
  559. X    /* Tear down the Intuition stuff */
  560. X    dismiss_nhwindow(win);
  561. X
  562. X    if( cw->resp )
  563. X    free( cw->resp );
  564. X    cw->resp = NULL;
  565. X
  566. X    if( cw->canresp )
  567. X    free( cw->canresp );
  568. X    cw->canresp = NULL;
  569. X
  570. X    if( cw->morestr )
  571. X    free( cw->morestr );
  572. X    cw->morestr = NULL;
  573. X
  574. X    free( cw );
  575. X    amii_wins[win] = NULL;
  576. X}
  577. X
  578. Xamii_create_nhwindow(type)
  579. X    register int type;
  580. X{
  581. X    register struct Window *w = NULL;
  582. X    register struct NewWindow *nw = NULL;
  583. X    register struct amii_WinDesc *wd = NULL;
  584. X    struct Window *mapwin = NULL, *stwin = NULL, *msgwin = NULL;
  585. X    register int newid;
  586. X    int maph;
  587. X
  588. X    maph = ( 22 * MAPFTHEIGHT ) + HackScreen->WBorTop +
  589. X            HackScreen->WBorBottom + MAPFTHEIGHT + 1 + 1;
  590. X    if( WIN_STATUS != WIN_ERR && amii_wins[ WIN_STATUS ] )
  591. X    stwin = amii_wins[ WIN_STATUS ]->win;
  592. X
  593. X    if( WIN_MESSAGE != WIN_ERR && amii_wins[ WIN_MESSAGE ] )
  594. X    msgwin = amii_wins[ WIN_MESSAGE ]->win;
  595. X
  596. X    if( WIN_MAP != WIN_ERR && amii_wins[ WIN_MAP ] )
  597. X    mapwin = amii_wins[ WIN_MAP ]->win;
  598. X
  599. X    /* Create Port anytime that we need it */
  600. X
  601. X    if( HackPort == NULL )
  602. X    {
  603. X    HackPort = CreatePort( NULL, 0 );
  604. X    if( !HackPort )
  605. X        panic( "no memory for msg port" );
  606. X    }
  607. X
  608. X    nw = &new_wins[ type ].newwin;
  609. X    nw->Width = amiIDisplay->xpix;
  610. X    nw->Screen = HackScreen;
  611. X
  612. X    nw->DetailPen = C_BLACK;
  613. X    nw->BlockPen = C_WHITE;
  614. X
  615. X    if( type == NHW_MAP || type == NHW_BASE )
  616. X    {
  617. X    nw->LeftEdge = 0;
  618. X
  619. X    if(
  620. X#ifndef    VIEWWINDOW
  621. X        bigscreen &&
  622. X#endif
  623. X        type == NHW_MAP )
  624. X    {
  625. X        nw->Height = maph;
  626. X        if( msgwin && stwin )
  627. X        {
  628. X        nw->TopEdge = msgwin->TopEdge + msgwin->Height +
  629. X                ((stwin->TopEdge-
  630. X                (msgwin->TopEdge + msgwin->Height)-maph))/2;
  631. X        }
  632. X        else
  633. X        {
  634. X        panic( "msgwin and stwin must open before map" );
  635. X        }
  636. X#ifdef    VIEWWINDOW
  637. X        if( !bigscreen )
  638. X        nw->Flags &= ~(BORDERLESS);
  639. X        nw->Width = (MAPFTWIDTH * 80) + HackScreen->WBorLeft +
  640. X                        HackScreen->WBorRight;
  641. X#else
  642. X        nw->Width = HackScreen->Width;
  643. X#endif
  644. X    }
  645. X    else
  646. X    {
  647. X        nw->TopEdge = 1;
  648. X        nw->Height = amiIDisplay->ypix - nw->TopEdge;
  649. X    }
  650. X    }
  651. X#ifdef    VIEWWINDOW
  652. X    else if( type == NHW_VIEWBOX )
  653. X    {
  654. X    struct Window *w = amii_wins[ NHW_MAP ]->win;
  655. X
  656. X    nw->LeftEdge = w->Width;
  657. X    nw->TopEdge = w->TopEdge;
  658. X    nw->Width = amiIDisplay->xpix - nw->LeftEdge;
  659. X    if( msgwin && stwin )
  660. X    {
  661. X        nw->Height = stwin->TopEdge - nw->TopEdge;
  662. X    }
  663. X    else
  664. X    {
  665. X        nw->Height = 10 * VIEWCHARHEIGHT +
  666. X            w->BorderTop + w->BorderBottom;
  667. X    }
  668. X    nw->MaxHeight = VIEWCHARHEIGHT*24;
  669. X    nw->MaxWidth = VIEWCHARWIDTH*80;
  670. X    if( nw->TopEdge + nw->Height > amiIDisplay->ypix - 1 )
  671. X        nw->Height = amiIDisplay->ypix - nw->TopEdge - 1;
  672. X    if( !bigscreen )
  673. X        nw->Flags &= ~(WINDOWSIZING|WINDOWDRAG|WINDOWDEPTH|WINDOWCLOSE);
  674. X    }
  675. X    else if( type == NHW_VIEW )
  676. X    {
  677. X    struct Window *vw = amii_wins[ WIN_VIEWBOX ]->win;
  678. X    int i;
  679. X
  680. X    nw->LeftEdge = vw->LeftEdge + vw->BorderLeft;
  681. X    nw->TopEdge = vw->TopEdge + vw->BorderTop;
  682. X    nw->Width = amiIDisplay->xpix - nw->LeftEdge - 1 - vw->BorderRight;
  683. X    nw->Height = vw->Height - vw->BorderTop - vw->BorderBottom;
  684. X    nw->MaxHeight = VIEWCHARHEIGHT*24;
  685. X    nw->MaxWidth = VIEWCHARWIDTH*80;
  686. X    if( nw->TopEdge + nw->Height > amiIDisplay->ypix - 1 )
  687. X        nw->Height = amiIDisplay->ypix - nw->TopEdge - 1;
  688. X    InitBitMap( &amii_vbm, DEPTH, VIEWCHARWIDTH * 88, VIEWCHARHEIGHT * 30 );
  689. X    for( i = 0; i < DEPTH; ++i )
  690. X    {
  691. X        if( ( amii_vbm.Planes[i] = AllocRaster( VIEWCHARWIDTH * 88,
  692. X                            VIEWCHARHEIGHT * 30 ) ) == 0 )
  693. X        {
  694. X        panic( "can't allocate bitmap for view window" );
  695. X        }
  696. X        memset( amii_vbm.Planes[i], 0,
  697. X                    RASSIZE( VIEWCHARWIDTH * 88, VIEWCHARHEIGHT * 30 ) );
  698. X    }
  699. X    nw->Flags |= SUPER_BITMAP;
  700. X    nw->BitMap = &amii_vbm;
  701. X    }
  702. X#endif
  703. X    else if( type == NHW_STATUS )
  704. X    {
  705. X#ifndef    VIEWWINDOW
  706. X    if( WIN_MAP != WIN_ERR && amii_wins[ WIN_MAP ] )
  707. X        w = amii_wins[ WIN_MAP ]->win;
  708. X    else
  709. X#endif
  710. X    if( WIN_BASE != WIN_ERR && amii_wins[ WIN_BASE ] )
  711. X        w = amii_wins[ WIN_BASE ]->win;
  712. X    else
  713. X        panic( "No window to base STATUS location from" );
  714. X
  715. X    /* Status window is relative to bottom of WIN_BASE/WIN_MAP */
  716. X
  717. X    /* Expand the height of window by borders */
  718. X    nw->Height = (txheight * 2) + 4;
  719. X    if( bigscreen )
  720. X    {
  721. X        nw->Height += txheight + w->WScreen->WBorTop + 1 + w->WScreen->WBorBottom;
  722. X    }
  723. X
  724. X    nw->TopEdge = amiIDisplay->ypix - nw->Height - 1;
  725. X    nw->LeftEdge = w->LeftEdge;
  726. X    if( nw->LeftEdge + nw->Width >= amiIDisplay->xpix )
  727. X        nw->LeftEdge = 0;
  728. X    if( nw->Width >= amiIDisplay->xpix - nw->LeftEdge )
  729. X        nw->Width = amiIDisplay->xpix - nw->LeftEdge;
  730. X    }
  731. X    else if( type == NHW_MESSAGE )
  732. X    {
  733. X#ifndef    VIEWWINDOW
  734. X    if( WIN_MAP != WIN_ERR && amii_wins[ WIN_MAP ] )
  735. X        w = amii_wins[ WIN_MAP ]->win;
  736. X    else
  737. X#endif
  738. X    if( WIN_BASE != WIN_ERR && amii_wins[ WIN_BASE ] )
  739. X        w = amii_wins[ WIN_BASE ]->win;
  740. X    else
  741. X        panic( "No window to base STATUS location from" );
  742. X
  743. X    nw->TopEdge = 1;
  744. X    nw->Height = HackScreen->WBorTop + 1 +
  745. X        ((txheight+1)*(1+(scrollmsg != 0))) + 1 + HackScreen->WBorBottom;
  746. X    if( scrollmsg )
  747. X    {
  748. X        nw->FirstGadget = &MsgScroll;
  749. X        nw->Height = HackScreen->Height - 1 -
  750. X        /* Size of all borders for bigscreen */
  751. X        ( ( TextsFont->tf_YSize + HackScreen->WBorTop + 1 +
  752. X                    HackScreen->WBorBottom ) * 2 ) -
  753. X        /* Text space in status window */
  754. X        ( ( TextsFont->tf_YSize + 1 ) * 2 ) - 2 -
  755. X        maph;
  756. X        nw->Flags |= WINDOWSIZING;
  757. X#ifdef    VIEWWINDOW
  758. X        nw->Flags |= WINDOWDRAG;
  759. X#endif
  760. X    }
  761. X#ifdef  INTUI_NEW_LOOK
  762. X    if( IntuitionBase->LibNode.lib_Version >= 37 )
  763. X    {
  764. X        MsgPropScroll.Flags |= PROPNEWLOOK;
  765. X    }
  766. X#endif
  767. X    /* Just allow height adjustments */
  768. X    nw->MinWidth = w->Width;
  769. X    nw->MinHeight = HackScreen->WBorTop +
  770. X        HackScreen->WBorBottom + ((w->RPort->TxHeight+1)*2) + 3;
  771. X    }
  772. X
  773. X    nw->IDCMPFlags |= MENUPICK;
  774. X
  775. X    /* Check if there is "Room" for all this stuff... */
  776. X    if( bigscreen && type != NHW_BASE && type != NHW_VIEW )
  777. X    {
  778. X    nw->Flags &= ~( BORDERLESS | BACKDROP );
  779. X#ifdef    VIEWWINDOW
  780. X    nw->Flags |= ( WINDOWDRAG | WINDOWDEPTH | SIZEBRIGHT );
  781. X#else
  782. X    if( HackScreen->Width < 657 )
  783. X    {
  784. X        nw->Flags |= ( WINDOWDRAG | WINDOWDEPTH );
  785. X    }
  786. X    else
  787. X    {
  788. X        nw->Flags |= ( WINDOWDRAG | WINDOWDEPTH | SIZEBRIGHT );
  789. X        if( type == NHW_MAP )
  790. X        nw->Flags |= WINDOWSIZING;
  791. X    }
  792. X#endif
  793. X
  794. X/*#endif*/
  795. X#ifdef    VIEWWINDOW
  796. X    if( type == NHW_VIEWBOX )
  797. X        nw->Flags |= WINDOWSIZING;
  798. X#endif
  799. X    }
  800. X
  801. X    /* No titles on a hires only screen */
  802. X    if( !bigscreen )
  803. X    nw->Title = 0;
  804. X
  805. X    /* Don't open MENU or TEXT windows yet */
  806. X
  807. X    if( type == NHW_MENU || type == NHW_TEXT )
  808. X    w = NULL;
  809. X    else
  810. X    w=OpenShWindow( (void *)nw );
  811. X
  812. X    if( w == NULL && type != NHW_MENU && type != NHW_TEXT )
  813. X    {
  814. X    char buf[ 100 ];
  815. X
  816. X    sprintf( buf, "nw is l: %d, t: %d, w: %d, h: %d",
  817. X        nw->LeftEdge, nw->TopEdge,
  818. X        nw->Width, nw->Height );
  819. X    raw_print( buf );
  820. X    panic("bad openwin %d",type);
  821. X    }
  822. X
  823. X    /* Check for an empty slot */
  824. X
  825. X    for(newid = 0; newid<MAXWIN + 1; newid++)
  826. X    {
  827. X    if(amii_wins[newid] == 0)
  828. X        break;
  829. X    }
  830. X
  831. X    if(newid==MAXWIN+1)
  832. X    panic("time to write re-alloc code\n");
  833. X
  834. X    /* Set wincnt accordingly */
  835. X
  836. X    if( newid > wincnt )
  837. X    wincnt = newid;
  838. X
  839. X    /* Do common initialization */
  840. X
  841. X    wd = (struct amii_WinDesc *)alloc(sizeof(struct amii_WinDesc));
  842. X    memset( wd, 0, sizeof( struct amii_WinDesc ) );
  843. X    amii_wins[newid] = wd;
  844. X
  845. X    wd->newwin = NULL;
  846. X    wd->win = w;
  847. X    wd->type = type;
  848. X    wd->wflags = 0;
  849. X    wd->active = FALSE;
  850. X    wd->curx=wd->cury = 0;
  851. X    wd->resp = wd->canresp = wd->morestr = 0;   /* CHECK THESE */
  852. X    wd->maxrow = new_wins[type].maxrow;
  853. X    wd->maxcol = new_wins[type].maxcol;
  854. X
  855. X    if( type != NHW_TEXT && type != NHW_MENU )
  856. X    {
  857. X    if( TextsFont && ( type == NHW_MESSAGE || type == NHW_STATUS ) )
  858. X    {
  859. X        SetFont(w->RPort, TextsFont);
  860. X        txheight = w->RPort->TxHeight;
  861. X        txwidth = w->RPort->TxWidth;
  862. X        txbaseline = w->RPort->TxBaseline;
  863. X        if( type == NHW_MESSAGE )
  864. X        {
  865. X        if( scrollmsg )
  866. X        {
  867. X            WindowLimits( w, w->Width, w->BorderTop +
  868. X                w->BorderBottom +
  869. X                ((txheight+1)*3) + 1, 0, 0 );
  870. X        }
  871. X        else
  872. X        {
  873. X            WindowLimits( w, w->Width, w->BorderTop +
  874. X                w->BorderBottom +
  875. X                txheight + 2, 0, 0 );
  876. X        }
  877. X        }
  878. X    }
  879. X#ifdef HACKFONT
  880. X    else if( HackFont )
  881. X        SetFont(w->RPort, HackFont);
  882. X#endif
  883. X    wd->rows = ( w->Height - w->BorderTop -
  884. X        w->BorderBottom - 2 ) / w->RPort->TxHeight;
  885. X    wd->cols = ( w->Width - w->BorderLeft -
  886. X        w->BorderRight - 2 ) / w->RPort->TxWidth;
  887. X    }
  888. X
  889. X    /* Okay, now do the individual type initialization */
  890. X
  891. X    switch(type)
  892. X    {
  893. X    /* History lines for MESSAGE windows are stored in cw->data[?].
  894. X     * maxcol and maxrow are used as cursors.  maxrow is the count
  895. X     * of the number of history lines stored.  maxcol is the cursor
  896. X     * to the last line that was displayed by ^P.
  897. X     */
  898. X    case NHW_MESSAGE:
  899. X        SetMenuStrip(w, HackMenu);
  900. X#ifdef    VIEWWINDOW
  901. X        if(flags.msg_history<20)flags.msg_history=20;
  902. X#else
  903. X        if(flags.msg_history<40)flags.msg_history=40;
  904. X#endif
  905. X        if(flags.msg_history>400)flags.msg_history=400;
  906. X        flags.window_inited=TRUE;
  907. X        wd->data = (char **)alloc( flags.msg_history*sizeof( char * ) );
  908. X        memset( wd->data, 0, flags.msg_history * sizeof( char * ) );
  909. X        wd->maxrow = wd->maxcol = 0;
  910. X        /* Indicate that we have not positioned the cursor yet */
  911. X        wd->curx = -1;
  912. X        break;
  913. X
  914. X        /* A MENU contains a list of lines in wd->data[?].  These
  915. X         * lines are created in amii_putstr() by reallocating the size
  916. X         * of wd->data to hold enough (char *)'s.  wd->rows is the
  917. X         * number of (char *)'s allocated.  wd->maxrow is the number
  918. X         * used.  wd->maxcol is used to track how wide the menu needs
  919. X         * to be.  wd->resp[x] contains the characters that correspond
  920. X         * to selecting wd->data[x].  wd->resp[x] corresponds to
  921. X         * wd->data[x] for any x. Elements of wd->data[?] that are not
  922. X         * valid selections have the corresponding element of
  923. X         * wd->resp[] set to a value of '\01';  i.e. a ^A which is
  924. X         * not currently a valid keystroke for responding to any
  925. X         * MENU or TEXT window.
  926. X         */
  927. X    case NHW_MENU:
  928. X        wd->resp=(char*)alloc(256);
  929. X        wd->resp[0]=0;
  930. X        wd->rows = wd->maxrow = 0;
  931. X        wd->cols = wd->maxcol = 0;
  932. X        wd->data = NULL;
  933. X        break;
  934. X
  935. X        /* See the explanation of MENU above.  Except, wd->resp[] is not
  936. X         * used for TEXT windows since there is no selection of a
  937. X         * a line performed/allowed.  The window is always full
  938. X         * screen width.
  939. X         */
  940. X    case NHW_TEXT:
  941. X        wd->rows = wd->maxrow = 0;
  942. X        wd->cols = wd->maxcol = amiIDisplay->cols;
  943. X        wd->data = NULL;
  944. X        wd->morestr = NULL;
  945. X        break;
  946. X
  947. X        /* The status window has only two lines.  These are stored in
  948. X         * wd->data[], and here we allocate the space for them.
  949. X         */
  950. X    case NHW_STATUS:
  951. X        SetMenuStrip(w, HackMenu);
  952. X        /* wd->cols is the number of characters which fit across the
  953. X         * screen.
  954. X         */
  955. X        wd->data=(char **)alloc(3*sizeof(char *));
  956. X        wd->data[0] = (char *)alloc(wd->cols + 10);
  957. X        wd->data[1] = (char *)alloc(wd->cols + 10);
  958. X        wd->data[2] = NULL;
  959. X        break;
  960. X
  961. X        /* NHW_MAP does not use wd->data[] or the other text
  962. X         * manipulating members of the amii_WinDesc structure.
  963. X         */
  964. X    case NHW_MAP:
  965. X        SetMenuStrip(w, HackMenu);
  966. X#ifdef    VIEWWINDOW
  967. X        WIN_VIEWBOX = amii_create_nhwindow( NHW_VIEWBOX );
  968. X        WIN_VIEW = amii_create_nhwindow( NHW_VIEW );
  969. X        if( HackFont4 )
  970. X        SetFont( w->RPort, HackFont4 );
  971. X#else
  972. X        if( HackFont )
  973. X        SetFont( w->RPort, HackFont );
  974. X#endif
  975. X        break;
  976. X
  977. X        /* The base window must exist until CleanUp() deletes it. */
  978. X    case NHW_BASE:
  979. X        SetMenuStrip(w, HackMenu);
  980. X        /* Make our requesters come to our screen */
  981. X        {
  982. X        register struct Process *myProcess =
  983. X                    (struct Process *) FindTask(NULL);
  984. X        pr_WindowPtr = (struct Window *)(myProcess->pr_WindowPtr);
  985. X        myProcess->pr_WindowPtr = (APTR) w;
  986. X        }
  987. X
  988. X        /* Need this for RawKeyConvert() */
  989. X
  990. X        ConsoleIO.io_Data = (APTR) w;
  991. X        ConsoleIO.io_Length = sizeof( struct Window );
  992. X        ConsoleIO.io_Message.mn_ReplyPort = CreatePort(NULL, 0L);
  993. X        if( OpenDevice("console.device", -1L,
  994. X                (struct IORequest *) &ConsoleIO, 0L) != 0)
  995. X        {
  996. X        Abort(AG_OpenDev | AO_ConsoleDev);
  997. X        }
  998. X
  999. X        ConsoleDevice = (struct Library *) ConsoleIO.io_Device;
  1000. X
  1001. X        KbdBuffered = 0;
  1002. X
  1003. X#ifdef HACKFONT
  1004. X        if( TextsFont )
  1005. X        SetFont( w->RPort, TextsFont );
  1006. X        else if( HackFont )
  1007. X        SetFont( w->RPort, HackFont );
  1008. X#endif
  1009. X        txwidth = w->RPort->TxWidth;
  1010. X        txheight = w->RPort->TxHeight;
  1011. X        txbaseline = w->RPort->TxBaseline;
  1012. X        break;
  1013. X
  1014. X#ifdef    VIEWWINDOW
  1015. X    case NHW_VIEWBOX:
  1016. X        /* Position BitMap at zero, zero */
  1017. X        ScrollLayer( 0, w->RPort->Layer,
  1018. X                -w->RPort->Layer->Scroll_X,
  1019. X                  -w->RPort->Layer->Scroll_Y );
  1020. X    case NHW_VIEW:
  1021. X        if( HackFont16 )
  1022. X        SetFont( w->RPort, HackFont16 );
  1023. X        wd->curx = -1;
  1024. X        wd->cury = -1;
  1025. X        SetMenuStrip(w, HackMenu);
  1026. X        break;
  1027. X#endif
  1028. X
  1029. X    default:
  1030. X        panic("bad create_nhwindow( %d )\n",type);
  1031. X        return WIN_ERR;
  1032. X    }
  1033. X
  1034. X    return( newid );
  1035. X}
  1036. X
  1037. X/* Initialize the windowing environment */
  1038. X
  1039. Xvoid
  1040. Xamii_init_nhwindows()
  1041. X{
  1042. X    if (HackScreen)
  1043. X    panic( "init_nhwindow() called twice", 0 );
  1044. X
  1045. X    WIN_MESSAGE = WIN_ERR;
  1046. X    WIN_MAP = WIN_ERR;
  1047. X    WIN_STATUS = WIN_ERR;
  1048. X    WIN_INVEN = WIN_ERR;
  1049. X    WIN_BASE = WIN_ERR;
  1050. X
  1051. X#ifndef    SHAREDLIB
  1052. X    if ( (IntuitionBase = (struct IntuitionBase *)
  1053. X      OpenLibrary("intuition.library", INTUITION_VERSION)) == NULL)
  1054. X    {
  1055. X    Abort(AG_OpenLib | AO_Intuition);
  1056. X    }
  1057. X
  1058. X    if ( (GfxBase = (struct GfxBase *)
  1059. X          OpenLibrary("graphics.library", GRAPHICS_VERSION)) == NULL)
  1060. X    {
  1061. X    Abort(AG_OpenLib | AO_GraphicsLib);
  1062. X    }
  1063. X
  1064. X#ifdef    VIEWWINDOW
  1065. X    if ( (LayersBase = (struct Library *)
  1066. X        OpenLibrary("layers.library", 0)) == NULL)
  1067. X    {
  1068. X    Abort(AG_OpenLib | AO_LayersLib);
  1069. X    }
  1070. X#endif
  1071. X#endif
  1072. X    amiIDisplay=(struct amii_DisplayDesc *)alloc(sizeof(struct amii_DisplayDesc));
  1073. X    memset( amiIDisplay, 0, sizeof( struct amii_DisplayDesc ) );
  1074. X
  1075. X    /* Use Intuition sizes for overscan screens... */
  1076. X
  1077. X    amiIDisplay->ypix = GfxBase->NormalDisplayRows;
  1078. X    amiIDisplay->xpix = GfxBase->NormalDisplayColumns;
  1079. X
  1080. X    amiIDisplay->cols = amiIDisplay->xpix / FONTWIDTH;
  1081. X
  1082. X    amiIDisplay->toplin=0;
  1083. X    amiIDisplay->rawprint=0;
  1084. X    amiIDisplay->lastwin=0;
  1085. X
  1086. X    if( bigscreen == 0 )
  1087. X    {
  1088. X    if( ( GfxBase->ActiView->ViewPort->Modes & LACE ) == LACE )
  1089. X    {
  1090. X        amiIDisplay->ypix *= 2;
  1091. X        NewHackScreen.ViewModes |= LACE;
  1092. X        bigscreen = 1;
  1093. X    }
  1094. X    else if( GfxBase->NormalDisplayRows >= 240 )
  1095. X    {
  1096. X        bigscreen = 1;
  1097. X    }
  1098. X    }
  1099. X    else if( bigscreen == -1 )
  1100. X    bigscreen = 0;
  1101. X    else if( bigscreen )
  1102. X    {
  1103. X    /* If bigscreen requested and we don't have enough rows in
  1104. X     * noninterlaced mode, switch to interlaced...
  1105. X     */
  1106. X    if( GfxBase->NormalDisplayRows < 240 )
  1107. X    {
  1108. X        amiIDisplay->ypix *= 2;
  1109. X        NewHackScreen.ViewModes |= LACE;
  1110. X    }
  1111. X    }
  1112. X
  1113. X    if( !bigscreen )
  1114. X    {
  1115. X        scrollmsg = 0;
  1116. X        alwaysinvent = 0;
  1117. X    }
  1118. X    amiIDisplay->rows = amiIDisplay->ypix / FONTHEIGHT;
  1119. X
  1120. X#ifdef HACKFONT
  1121. X    /*
  1122. X     *  Load the fonts that we need.
  1123. X     */
  1124. X
  1125. X    if( DiskfontBase =
  1126. X        OpenLibrary( "diskfont.library", DISKFONT_VERSION ) )
  1127. X    {
  1128. X    Hack80.ta_Name -= SIZEOF_DISKNAME;
  1129. X    HackFont = OpenDiskFont( &Hack80 );
  1130. X    Hack80.ta_Name += SIZEOF_DISKNAME;
  1131. X
  1132. X#ifdef    VIEWWINDOW
  1133. X    Hack40.ta_Name -= SIZEOF_DISKNAME;
  1134. X    HackFont4 = OpenDiskFont( &Hack40 );
  1135. X    Hack40.ta_Name += SIZEOF_DISKNAME;
  1136. X
  1137. X    Hack160.ta_Name -= SIZEOF_DISKNAME;
  1138. X    HackFont16 = OpenDiskFont( &Hack160 );
  1139. X    Hack160.ta_Name += SIZEOF_DISKNAME;
  1140. X#endif
  1141. X    /* Textsfont13 is filled in with "FONT=" settings. The default is
  1142. X     * courier/13.
  1143. X     */
  1144. X    TextsFont = NULL;
  1145. X    if( bigscreen )
  1146. X        TextsFont = OpenDiskFont( &TextsFont13 );
  1147. X
  1148. X    /* Try hack/8 for texts if no user specified font */
  1149. X    if( TextsFont == NULL )
  1150. X    {
  1151. X        Hack80.ta_Name -= SIZEOF_DISKNAME;
  1152. X        TextsFont = OpenDiskFont( &Hack80 );
  1153. X        Hack80.ta_Name += SIZEOF_DISKNAME;
  1154. X    }
  1155. X
  1156. X    /* If no fonts, make everything topaz 8 for non-view windows.
  1157. X     */
  1158. X    if( !HackFont || !TextsFont )
  1159. X    {
  1160. X        Hack80.ta_Name = "topaz.font";
  1161. X        if( !HackFont )
  1162. X        {
  1163. X        HackFont = OpenFont( &Hack80 );
  1164. X        if( !HackFont )
  1165. X            panic( "Can't get a map font, topaz:8" );
  1166. X        }
  1167. X
  1168. X        if( !TextsFont )
  1169. X        {
  1170. X        TextsFont = OpenFont( &Hack80 );
  1171. X        if( !TextsFont )
  1172. X            panic( "Can't open text font" );
  1173. X        }
  1174. X    }
  1175. X#ifdef    VIEWWINDOW
  1176. X    /*
  1177. X     * These other fonts are required for the view windows, so
  1178. X     * we have to "panic".
  1179. X     */
  1180. X    if( !HackFont4 || !HackFont16 )
  1181. X    {
  1182. X        panic( "Can't open all hack/4 or hack/16 font" );
  1183. X    }
  1184. X#endif
  1185. X    CloseLibrary(DiskfontBase);
  1186. X    DiskfontBase = NULL;
  1187. X    }
  1188. X#endif
  1189. X
  1190. X    /* This is the size screen we want to open, within reason... */
  1191. X
  1192. X    NewHackScreen.Width = max( WIDTH, amiIDisplay->xpix );
  1193. X    NewHackScreen.Height = max( SCREENHEIGHT, amiIDisplay->ypix );
  1194. X    {
  1195. X    static char fname[18];
  1196. X    sprintf(fname,"NetHack %d.%d.%d", VERSION_MAJOR, VERSION_MINOR, PATCHLEVEL);
  1197. X    NewHackScreen.DefaultTitle=fname;
  1198. X    }
  1199. X    NewHackScreen.BlockPen = C_CYAN;
  1200. X#ifdef    INTUI_NEW_LOOK
  1201. X    if( IntuitionBase->LibNode.lib_Version >= 37 && bigscreen )
  1202. X    {
  1203. X    NewHackScreen.Width = STDSCREENWIDTH;
  1204. X    NewHackScreen.Height = STDSCREENHEIGHT;
  1205. X    }
  1206. X#endif
  1207. X
  1208. X    if( ( HackScreen = OpenScreen( (void *)&NewHackScreen ) ) == NULL )
  1209. X    Abort( AN_OpenScreen & ~AT_DeadEnd );
  1210. X#ifdef  INTUI_NEW_LOOK
  1211. X    if( IntuitionBase->LibNode.lib_Version >= 37 )
  1212. X    PubScreenStatus( HackScreen, 0 );
  1213. X#endif
  1214. X
  1215. X    amiIDisplay->ypix = HackScreen->Height;
  1216. X    amiIDisplay->xpix = HackScreen->Width;
  1217. X
  1218. X#ifdef TEXTCOLOR
  1219. X    LoadRGB4(&HackScreen->ViewPort, flags.amii_curmap, 1L << DEPTH );
  1220. X#endif
  1221. X
  1222. X    /* Display the copyright etc... */
  1223. X
  1224. X    if( WIN_BASE == WIN_ERR )
  1225. X    WIN_BASE = amii_create_nhwindow( NHW_BASE );
  1226. X    amii_clear_nhwindow( WIN_BASE );
  1227. X    amii_putstr( WIN_BASE, 0, "" );
  1228. X    amii_putstr( WIN_BASE, 0, "" );
  1229. X    amii_putstr( WIN_BASE, 0, "" );
  1230. X    amii_putstr( WIN_BASE, 0,
  1231. X      "NetHack, Copyright 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993.");
  1232. X    amii_putstr( WIN_BASE, 0,
  1233. X    "         By Stichting Mathematisch Centrum and M. Stephenson.");
  1234. X    amii_putstr( WIN_BASE, 0, "         See license for details.");
  1235. X    amii_putstr( WIN_BASE, 0, "");
  1236. X
  1237. X    Initialized = 1;
  1238. X}
  1239. X
  1240. X/* Clear the indicated window */
  1241. X
  1242. Xvoid
  1243. Xamii_clear_nhwindow(win)
  1244. X    register winid win;
  1245. X{
  1246. X    register struct amii_WinDesc *cw;
  1247. X    register struct Window *w;
  1248. X
  1249. X    if( win == WIN_ERR || ( cw = amii_wins[win] ) == NULL )
  1250. X    panic( winpanicstr, win, "clear_nhwindow" );
  1251. X
  1252. X    if( w = cw->win )
  1253. X    SetDrMd( w->RPort, JAM2);
  1254. X
  1255. X    cursor_off( win );
  1256. X
  1257. X    /* should be: clear the rastport, reset x,y etc */
  1258. X
  1259. X    if( cw->type == NHW_MENU || cw->type == NHW_TEXT )
  1260. X    {
  1261. X    /* Window might not be opened yet */
  1262. X
  1263. X    if( w )
  1264. X    {
  1265. X        SetAPen( w->RPort, 0 );
  1266. X        SetBPen( w->RPort, 0 );
  1267. X        RectFill( w->RPort, w->BorderLeft, w->BorderTop,
  1268. X          w->Width - w->BorderRight-1,
  1269. X          w->Height - w->BorderBottom-1 );
  1270. X        SetAPen( w->RPort, 1 );
  1271. X    }
  1272. X    }
  1273. X    else if( w )
  1274. X    {
  1275. X    if( cw->type == NHW_MESSAGE )
  1276. X    {
  1277. X        amii_curs( win, 1, 0 );
  1278. X        if( !scrollmsg )
  1279. X        TextSpaces( w->RPort, cw->cols );
  1280. X    }
  1281. X    else
  1282. X    {
  1283. X        SetAPen( w->RPort, 0 );
  1284. X        SetBPen( w->RPort, 0 );
  1285. X        RectFill( w->RPort, w->BorderLeft, w->BorderTop,
  1286. X          w->Width - w->BorderRight-1,
  1287. X          w->Height - w->BorderBottom-1 );
  1288. X        SetAPen( w->RPort, 1 );
  1289. X#ifdef    VIEWWINDOW
  1290. X        if( win == WIN_MAP )
  1291. X        amii_clear_nhwindow( WIN_VIEW );
  1292. X#endif
  1293. X    }
  1294. X    }
  1295. X
  1296. X    cw->cury = 0;
  1297. X    cw->curx = 0;
  1298. X    amii_curs( win, 1, 0 );
  1299. X}
  1300. X
  1301. X/* Dismiss the window from the screen */
  1302. X
  1303. Xvoid
  1304. Xdismiss_nhwindow(win)
  1305. X    register winid win;
  1306. X{
  1307. X    int i;
  1308. X    register struct Window *w;
  1309. X    register struct amii_WinDesc *cw;
  1310. X
  1311. X    if( win == WIN_ERR || ( cw = amii_wins[win] ) == NULL )
  1312. X    {
  1313. X    panic(winpanicstr,win, "dismiss_nhwindow");
  1314. X    }
  1315. X
  1316. X    w = cw->win;
  1317. X
  1318. X    if( w )
  1319. X    {
  1320. X    /* All windows have this stuff attached to them. */
  1321. X    if( win == WIN_MAP || win == WIN_BASE ||
  1322. X        win == WIN_MESSAGE || win == WIN_STATUS
  1323. X#ifdef    VIEWWINDOW
  1324. X        || win == WIN_VIEW || win == WIN_VIEWBOX
  1325. X#endif
  1326. X        )
  1327. X    {
  1328. X        ClearMenuStrip( w );
  1329. X    }
  1330. X
  1331. X    /* Save where user like inventory to appear */
  1332. X    if( win == WIN_INVEN )
  1333. X    {
  1334. X        lastinvent.MinX = w->LeftEdge;
  1335. X        lastinvent.MinY = w->TopEdge;
  1336. X        lastinvent.MaxX = w->Width;
  1337. X        lastinvent.MaxY = w->Height;
  1338. X    }
  1339. X
  1340. X    /* Close the window */
  1341. X    CloseShWindow( w );
  1342. X    cw->win = NULL;
  1343. X
  1344. X#ifdef    VIEWWINDOW
  1345. X    if( cw->type == NHW_VIEW )
  1346. X    {
  1347. X        for( i = 0; i < DEPTH; ++i )
  1348. X        {
  1349. X        FreeRaster( amii_vbm.Planes[i],
  1350. X            VIEWCHARWIDTH*88, VIEWCHARHEIGHT*30 );
  1351. X        }
  1352. X    }
  1353. X#endif
  1354. X
  1355. X    /* Free copy of NewWindow structure for TEXT/MENU windows. */
  1356. X    if( cw->newwin )
  1357. X        FreeNewWindow( (void *)cw->newwin );
  1358. X    cw->newwin = NULL;
  1359. X    }
  1360. X
  1361. X    if( cw->canresp )
  1362. X    free( cw->canresp );
  1363. X    cw->canresp = NULL;
  1364. X
  1365. X    if( cw->morestr )
  1366. X    free( cw->morestr );
  1367. X    cw->morestr = NULL;
  1368. X
  1369. X    if( cw->data && ( cw->type == NHW_MESSAGE ||
  1370. X                cw->type == NHW_MENU || cw->type == NHW_TEXT ) )
  1371. X    {
  1372. X    for( i = 0; i < cw->maxrow; ++i )
  1373. X    {
  1374. X        if( cw->data[ i ] )
  1375. X        free( cw->data[ i ] );
  1376. X    }
  1377. X    free( cw->data );
  1378. X    cw->data = NULL;
  1379. X    }
  1380. X    cw->maxrow = cw->maxcol = 0;
  1381. X}
  1382. X
  1383. Xvoid
  1384. Xamii_exit_nhwindows(str)
  1385. X    const char *str;
  1386. X{
  1387. X    /* Seems strange to have to do this... but we need the BASE window
  1388. X     * left behind...
  1389. X     */
  1390. X    kill_nhwindows( 0 );
  1391. X    if( str )
  1392. X    {
  1393. X    raw_print( "\n");    /* be sure we're not under the top margin */
  1394. X    raw_print( str );
  1395. X    }
  1396. X}
  1397. X
  1398. Xvoid
  1399. Xamii_display_nhwindow(win,blocking)
  1400. X    winid win;
  1401. X    boolean blocking;
  1402. X{
  1403. X    int i;
  1404. X    static int lastwin = -1;
  1405. X    struct Window *w;
  1406. X    struct amii_WinDesc *cw;
  1407. X
  1408. X    if( !Initialized )
  1409. X    return;
  1410. X    lastwin = win;
  1411. X
  1412. X    if( win == WIN_ERR || ( cw = amii_wins[win] ) == NULL )
  1413. X    panic(winpanicstr,win,"display_nhwindow");
  1414. X
  1415. X    if( cw->type == NHW_MESSAGE )
  1416. X    cw->wflags &= ~FLMAP_SKIP;
  1417. X
  1418. X    if( w = cw->win )
  1419. X    WindowToFront( w );
  1420. X
  1421. X    if( cw->type == NHW_MESSAGE || cw->type == NHW_STATUS )
  1422. X    return;
  1423. X
  1424. X    if( WIN_MAP != WIN_ERR && amii_wins[ WIN_MAP ] )
  1425. X    {
  1426. X    flush_glyph_buffer( amii_wins[ WIN_MAP ]->win );
  1427. X    }
  1428. X
  1429. X    if( cw->type == NHW_MENU || cw->type == NHW_TEXT )
  1430. X    {
  1431. X    DoMenuScroll( win, blocking );
  1432. X    }
  1433. X    else if( cw->type==NHW_MAP )
  1434. X    {
  1435. X#ifdef    VIEWWINDOW
  1436. X    if( IntuitionBase->LibNode.lib_Version >= 37 )
  1437. X    {
  1438. X        MoveWindowInFrontOf( amii_wins[ WIN_VIEW ]->win,
  1439. X                        amii_wins[ WIN_VIEWBOX ]->win );
  1440. X    }
  1441. X    else
  1442. X    {
  1443. X        WindowToFront( amii_wins[ WIN_VIEW ]->win );
  1444. X    }
  1445. X    amii_end_glyphout( WIN_VIEW );
  1446. X#endif
  1447. X    amii_end_glyphout( win );
  1448. X    for( i = 0; i < MAXWIN; ++i )
  1449. X    {
  1450. X        if( ( cw = amii_wins[i] ) != NULL &&
  1451. X        ( cw->type == NHW_STATUS || cw->type == NHW_MESSAGE ) &&
  1452. X        ( cw->win ) )
  1453. X        {
  1454. X        WindowToFront(cw->win);
  1455. X        }
  1456. X    }
  1457. X
  1458. X    /* Do more if it is time... */
  1459. X    if( blocking == TRUE && amii_wins[ WIN_MESSAGE ]->curx )
  1460. X    {
  1461. X        outmore( amii_wins[ WIN_MESSAGE ] );
  1462. X    }
  1463. X    }
  1464. X
  1465. X#ifdef    VIEWWINDOW
  1466. X    /* Pop the inventory window to the top if it is always displayed. */
  1467. X    if( alwaysinvent && WIN_INVEN != WIN_ERR &&
  1468. X            (cw = amii_wins[ WIN_INVEN ] ) && cw->win )
  1469. X    {
  1470. X    WindowToFront( cw->win );
  1471. X    }
  1472. X#endif
  1473. X}
  1474. X
  1475. Xvoid
  1476. Xamii_curs(window, x, y)
  1477. Xwinid window;
  1478. Xregister int x, y;  /* not xchar: perhaps xchar is unsigned and
  1479. X           curx-x would be unsigned as well */
  1480. X{
  1481. X    register struct amii_WinDesc *cw;
  1482. X    register struct Window *w;
  1483. X    register struct RastPort *rp;
  1484. X
  1485. X    if( window == WIN_ERR || ( cw = amii_wins[window] ) == NULL )
  1486. X    panic(winpanicstr,  window, "curs");
  1487. X    if( (w = cw->win) == NULL )
  1488. X    {
  1489. X    if( cw->type == NHW_MENU || cw->type == NHW_TEXT )
  1490. X        return;
  1491. X    else
  1492. X        panic( "No window open yet in curs() for winid %d\n", window );
  1493. X    }
  1494. X    amiIDisplay->lastwin = window;
  1495. X
  1496. X    /* Make sure x is within bounds */
  1497. X    if( x > 0 )
  1498. X    --x;    /* column 0 is never used */
  1499. X    else
  1500. X    x = 0;
  1501. X
  1502. X    cw->curx = x;
  1503. X    cw->cury = y;
  1504. X#ifdef DEBUG
  1505. X    if( x<0 || y<0 || y >= cw->rows || x >= cw->cols )
  1506. X    {
  1507. X    char *s = "[unknown type]";
  1508. X    switch(cw->type)
  1509. X    {
  1510. X        case NHW_MESSAGE: s = "[topl window]"; break;
  1511. X        case NHW_STATUS: s = "[status window]"; break;
  1512. X        case NHW_MAP: s = "[map window]"; break;
  1513. X        case NHW_MENU: s = "[menu window]"; break;
  1514. X        case NHW_TEXT: s = "[text window]"; break;
  1515. X    }
  1516. X    impossible("bad curs positioning win %d %s (%d,%d)", window, s, x, y);
  1517. X    return;
  1518. X    }
  1519. X#endif
  1520. X
  1521. X#ifdef CLIPPING
  1522. X    if(clipping && window == WIN_MAP)
  1523. X    {
  1524. X    x -= clipx;
  1525. X    y -= clipy;
  1526. X    }
  1527. X#endif
  1528. X
  1529. X    /* Output all saved output before doing cursor movements for MAP */
  1530. X
  1531. X    if( cw->type == NHW_MAP )
  1532. X    {
  1533. X    flush_glyph_buffer( w );
  1534. X#ifdef    VIEWWINDOW
  1535. X    flush_glyph_buffer( amii_wins[ WIN_VIEW ]->win );
  1536. X#endif
  1537. X    }
  1538. X
  1539. X    /* Actually do it */
  1540. X
  1541. X    rp = w->RPort;
  1542. X    if( cw->type == NHW_MENU || cw->type == NHW_TEXT )
  1543. X    {
  1544. X    Move( rp, (x * rp->TxWidth) + w->BorderLeft + 1,
  1545. X        (y*rp->TxHeight ) + rp->TxBaseline + w->BorderTop + 1 );
  1546. X    }
  1547. X    else if( cw->type == NHW_MAP || cw->type == NHW_BASE
  1548. X#ifdef    VIEWWINDOW
  1549. X    || cw->type == NHW_VIEW
  1550. X#endif
  1551. X    )
  1552. X    {
  1553. X    /* These coordinate calculations must be synced with those
  1554. X     * in flush_glyph_buffer() in amiwind.c.  curs_on_u() will
  1555. X     * use this code, all other drawing occurs through the glyph
  1556. X     * code.  In order for the cursor to appear on top of the hero,
  1557. X     * the code must compute X,Y in the same manner relative to
  1558. X     * the RastPort coordinates.
  1559. X     *
  1560. X     * y = w->BorderTop + (g_nodes[i].y-1) * rp->TxHeight +
  1561. X     *   rp->TxBaseline + 1;
  1562. X     * x = g_nodes[i].x * rp->TxWidth + w->BorderLeft;
  1563. X     */
  1564. X
  1565. X    Move( rp, (x * w->RPort->TxWidth) + w->BorderLeft,
  1566. X            w->BorderTop + ( (y + 1) * w->RPort->TxHeight ) +
  1567. X            w->RPort->TxBaseline + 1 );
  1568. X    }
  1569. X    else if( cw->type == NHW_MESSAGE && !scrollmsg )
  1570. X    {
  1571. X    Move( rp, (x * w->RPort->TxWidth) + w->BorderLeft + 2,
  1572. X            w->BorderTop + w->RPort->TxBaseline + 3 );
  1573. X    }
  1574. X    else if( cw->type == NHW_STATUS )
  1575. X    {
  1576. X    Move( rp, (x * w->RPort->TxWidth) + w->BorderLeft + 2,
  1577. X            (y*(w->RPort->TxHeight+1)) + w->BorderTop +
  1578. X            w->RPort->TxBaseline + 1 );
  1579. X    }
  1580. X    else
  1581. X    {
  1582. X    Move( rp, (x * w->RPort->TxWidth) + w->BorderLeft + 2,
  1583. X            (y*w->RPort->TxHeight) + w->BorderTop +
  1584. X            w->RPort->TxBaseline + 1 );
  1585. X    }
  1586. X}
  1587. X
  1588. Xvoid
  1589. Xamii_set_text_font( name, size )
  1590. X    char *name;
  1591. X    int size;
  1592. X{
  1593. X    register int i;
  1594. X    register struct amii_WinDesc *cw;
  1595. X    int osize = TextsFont13.ta_YSize;
  1596. X    static char nname[ 100 ];
  1597. X
  1598. X    strncpy( nname, name, sizeof( nname ) - 1 );
  1599. X    nname[ sizeof( nname ) - 1 ] = 0;
  1600. X
  1601. X    TextsFont13.ta_Name = nname;
  1602. X    TextsFont13.ta_YSize = size;
  1603. X
  1604. X    /* No alternate text font allowed for 640x250 or smaller */
  1605. X    if( !HackScreen || !bigscreen )
  1606. X    return;
  1607. X
  1608. X    /* Look for windows to set, and change them */
  1609. X
  1610. X    if( DiskfontBase =
  1611. X        OpenLibrary( "diskfont.library", DISKFONT_VERSION ) )
  1612. X    {
  1613. X    TextsFont = OpenDiskFont( &TextsFont13 );
  1614. X    for( i = 0; TextsFont && i < MAXWIN; ++i )
  1615. X    {
  1616. X        if( (cw = amii_wins[ i ]) && cw->win != NULL )
  1617. X        {
  1618. X            switch( cw->type )
  1619. X            {
  1620. X            case NHW_STATUS:
  1621. X            MoveWindow( cw->win, 0, -( size - osize ) * 2 );
  1622. X            SizeWindow( cw->win, 0, ( size - osize ) * 2 );
  1623. X            SetFont( cw->win->RPort, TextsFont );
  1624. X            break;
  1625. X            case NHW_MESSAGE:
  1626. X            case NHW_MAP:
  1627. X            case NHW_BASE:
  1628. X            SetFont( cw->win->RPort, TextsFont );
  1629. X            break;
  1630. X            }
  1631. X        }
  1632. X    }
  1633. X    }
  1634. X    CloseLibrary(DiskfontBase);
  1635. X    DiskfontBase = NULL;
  1636. X}
  1637. X
  1638. Xvoid
  1639. Xkill_nhwindows( all )
  1640. X    register int all;
  1641. X{
  1642. X    register int i;
  1643. X    register struct amii_WinDesc *cw;
  1644. X
  1645. X    /* Foreach open window in all of amii_wins[], CloseShWindow, free memory */
  1646. X
  1647. X    for( i = 0; i < MAXWIN; ++i )
  1648. X    {
  1649. X    if( (cw = amii_wins[ i ]) && (cw->type != NHW_BASE || all) )
  1650. X    {
  1651. X        amii_destroy_nhwindow( i );
  1652. X    }
  1653. X    }
  1654. X}
  1655. X
  1656. Xvoid
  1657. Xamii_cl_end( cw, i )
  1658. X    register struct amii_WinDesc *cw;
  1659. X    register int i;
  1660. X{
  1661. X    register struct Window *w = cw->win;
  1662. X    register int oy, ox;
  1663. X
  1664. X    if( !w )
  1665. X    panic("NULL window pointer in amii_cl_end()");
  1666. X
  1667. X    oy = w->RPort->cp_y;
  1668. X    ox = w->RPort->cp_x;
  1669. X
  1670. X    TextSpaces( w->RPort, cw->cols - i );
  1671. X
  1672. X    Move( w->RPort, ox, oy );
  1673. X}
  1674. X
  1675. Xvoid
  1676. Xcursor_off( window )
  1677. X    winid window;
  1678. X{
  1679. X    register struct amii_WinDesc *cw;
  1680. X    register struct Window *w;
  1681. X    register struct RastPort *rp;
  1682. X    int curx, cury;
  1683. X    long dmode;
  1684. X    short apen, bpen;
  1685. X    unsigned char ch;
  1686. X
  1687. X    if( window == WIN_ERR || ( cw = amii_wins[window] ) == NULL )
  1688. X    {
  1689. X    flags.window_inited=0;
  1690. X    panic(winpanicstr,window, "cursor_off");
  1691. X    }
  1692. X
  1693. X    if( !(cw->wflags & FLMAP_CURSUP ) )
  1694. X    return;
  1695. X    w = cw->win;
  1696. X
  1697. X    if( !w )
  1698. X    return;
  1699. X
  1700. X    cw->wflags &= ~FLMAP_CURSUP;
  1701. X    rp = w->RPort;
  1702. X
  1703. X    /* Save the current information */
  1704. X    curx = rp->cp_x;
  1705. X    cury = rp->cp_y;
  1706. X    dmode = rp->DrawMode;
  1707. X    apen = rp->FgPen;
  1708. X    bpen = rp->BgPen;
  1709. X    SetAPen( rp, cw->curs_apen );
  1710. X    SetBPen( rp, cw->curs_bpen );
  1711. X    SetDrMd( rp, COMPLEMENT );
  1712. X
  1713. X    ch = CURSOR_CHAR;
  1714. X    Move( rp, cw->cursx, cw->cursy );
  1715. X    Text( rp, &ch, 1 );
  1716. X
  1717. X#ifdef    VIEWWINDOW
  1718. X    /* Remove view window outline from map */
  1719. X    if( window == WIN_MAP )
  1720. X    {
  1721. X    SetAPen( rp, C_RED );
  1722. X    SetBPen( rp, C_BLACK );
  1723. X    SetDrMd( rp, COMPLEMENT );
  1724. X        Move( rp, cw->vwx, cw->vwy );
  1725. X        Draw( rp, cw->vcx, cw->vwy );
  1726. X        Draw( rp, cw->vcx, cw->vcy );
  1727. X        Draw( rp, cw->vwx, cw->vcy );
  1728. X        Draw( rp, cw->vwx, cw->vwy );
  1729. X    }
  1730. X#endif
  1731. X
  1732. X    /* Put back the other stuff */
  1733. X
  1734. X    Move( rp, curx, cury );
  1735. X    SetDrMd( rp, dmode );
  1736. X    SetAPen( rp, apen );
  1737. X    SetBPen( rp, bpen );
  1738. X
  1739. X#ifdef    VIEWWINDOW
  1740. X    if( window == WIN_MAP )
  1741. X    cursor_off( WIN_VIEW );
  1742. X#endif
  1743. X}
  1744. X
  1745. Xvoid
  1746. Xcursor_on( window )
  1747. X    winid window;
  1748. X{
  1749. X    register struct amii_WinDesc *cw;
  1750. X    register struct Window *w;
  1751. X#ifdef    VIEWWINDOW
  1752. X    int deltax, deltay, modx, mody;
  1753. X    register struct amii_WinDesc *vcw;
  1754. X    register struct Window *vw;
  1755. X#endif
  1756. X    register struct RastPort *rp;
  1757. X    unsigned char ch;
  1758. X    long dmode;
  1759. X    short apen, bpen;
  1760. X
  1761. X    if( window == WIN_ERR || ( cw = amii_wins[window] ) == NULL )
  1762. X    {
  1763. X    /* tty does this differently - is this OK? */
  1764. X    flags.window_inited=0;
  1765. X    panic(winpanicstr,window, "cursor_on");
  1766. X    }
  1767. X
  1768. X    if( (cw->wflags & FLMAP_CURSUP ) )
  1769. X    cursor_off( window );
  1770. X
  1771. X    w = cw->win;
  1772. X
  1773. X    if( !w )
  1774. X    return;
  1775. X
  1776. X    cw->wflags |= FLMAP_CURSUP;
  1777. X    rp = w->RPort;
  1778. X
  1779. X    /* Save the current information */
  1780. X
  1781. X    cw->cursx = rp->cp_x;
  1782. X    cw->cursy = rp->cp_y;
  1783. X    apen = rp->FgPen;
  1784. X    bpen = rp->BgPen;
  1785. X    dmode = rp->DrawMode;
  1786. X    ch = CURSOR_CHAR;
  1787. X
  1788. X    /* Draw in complement mode. The cursor body will be C_WHITE */
  1789. X
  1790. X    cw->curs_apen = C_WHITE;
  1791. X    cw->curs_bpen = C_WHITE;
  1792. X    SetAPen( rp, cw->curs_apen );
  1793. X    SetBPen( rp, cw->curs_bpen );
  1794. X    SetDrMd( rp, COMPLEMENT );
  1795. X    Move( rp, cw->cursx, cw->cursy );
  1796. X    Text( rp, &ch, 1 );
  1797. X    Move( rp, cw->cursx, cw->cursy );
  1798. X
  1799. X#ifdef    VIEWWINDOW
  1800. X    if( window == WIN_MAP )
  1801. X    {
  1802. X        int x, y, cx, cy;
  1803. X
  1804. X    if( WIN_VIEW == WIN_ERR || ( vcw = amii_wins[ WIN_VIEW ] ) == NULL )
  1805. X    {
  1806. X        flags.window_inited=0;
  1807. X        panic(winpanicstr,WIN_VIEW, "cursor_on");
  1808. X    }
  1809. X
  1810. X    if( (vcw->wflags & FLMAP_CURSUP ) )
  1811. X        cursor_off( WIN_VIEW );
  1812. X
  1813. X    vw = vcw->win;
  1814. X
  1815. X        x = cw->cursx - (vw->Width/8);
  1816. X    if( x <= w->BorderLeft )
  1817. X        x = w->BorderLeft + 1;
  1818. X
  1819. X        y = cw->cursy - (vw->Height/8);
  1820. X    if( y <= w->BorderTop )
  1821. X        y = w->BorderTop + 1;
  1822. X
  1823. X    cx = x + (vw->Width/4);
  1824. X    if( cx >= w->Width - w->BorderRight )
  1825. X    {
  1826. X        cx = w->Width - w->BorderRight-1;
  1827. X        x = cx - (vw->Width/4);
  1828. X    }
  1829. X
  1830. X    cy = y + (vw->Height/4);
  1831. X    if( cy >= w->Height - w->BorderBottom )
  1832. X    {
  1833. X        cy = w->Height - w->BorderBottom-1;
  1834. X        y = cy - (vw->Height/4);
  1835. X    }
  1836. X    cw->vwx = x;
  1837. X    cw->vwy = y;
  1838. X    cw->vcx = cx;
  1839. X    cw->vcy = cy;
  1840. X    SetAPen( rp, C_RED );
  1841. X    SetBPen( rp, C_BLACK );
  1842. X    SetDrMd( rp, COMPLEMENT );
  1843. X        Move( rp, cw->vwx, cw->vwy );
  1844. X        Draw( rp, cw->vcx, cw->vwy );
  1845. X        Draw( rp, cw->vcx, cw->vcy );
  1846. X        Draw( rp, cw->vwx, cw->vcy );
  1847. X        Draw( rp, cw->vwx, cw->vwy );
  1848. X
  1849. X    /* Position VIEW at same location as cursor in MAP */
  1850. X    vcw->curx  = ( cw->cursx * 4 ) - (vw->Width/2) - vw->RPort->Layer->Scroll_X;
  1851. X    vcw->cury  = ( cw->cursy * 4 ) - ((2*vw->Height)/3) - vw->RPort->Layer->Scroll_Y;
  1852. X
  1853. X    if( vcw->curx + vw->RPort->Layer->Scroll_X < 0 )
  1854. X        vcw->curx = -vw->RPort->Layer->Scroll_X;
  1855. X    else if( vcw->curx + vw->RPort->Layer->Scroll_X > vw->RPort->Layer->bounds.MaxX )
  1856. X        vcw->curx = vw->RPort->Layer->bounds.MaxX - vw->RPort->Layer->Scroll_X;
  1857. X
  1858. X    if( vcw->cury + vw->RPort->Layer->Scroll_Y < 0 )
  1859. X        vcw->cury = -vw->RPort->Layer->Scroll_Y;
  1860. X    else if( vcw->cury + vw->RPort->Layer->Scroll_Y > vw->RPort->Layer->bounds.MaxY )
  1861. X        vcw->cury = vw->RPort->Layer->bounds.MaxY - vw->RPort->Layer->Scroll_Y;
  1862. X
  1863. X    {
  1864. X        char buf[ 100 ];
  1865. X        sprintf( buf, "bounds: %d,%d,%d,%d",
  1866. X            vw->RPort->Layer->bounds.MinX,
  1867. X            vw->RPort->Layer->bounds.MinY,
  1868. X            vw->RPort->Layer->bounds.MaxX,
  1869. X            vw->RPort->Layer->bounds.MaxY );
  1870. X        putstr( WIN_MESSAGE, 1, buf );
  1871. X        sprintf( buf, "loc - old: %d,%d,  new: %d,%d",
  1872. X            vw->RPort->Layer->Scroll_X,
  1873. X            vw->RPort->Layer->Scroll_Y,
  1874. X            vcw->curx + vw->RPort->Layer->Scroll_X,
  1875. X            vw->RPort->Layer->Scroll_Y + vcw->cury );
  1876. X        putstr( WIN_MESSAGE, 1, buf );
  1877. X    }
  1878. X
  1879. X    /* Figure out the scroll values to move in no more than 3 scrolls */
  1880. X    deltax     = vcw->curx / 3;
  1881. X    deltay     = vcw->cury / 3;
  1882. X    modx       = vcw->curx % 3;
  1883. X    mody       = vcw->cury % 3;
  1884. X    vcw->curx -= modx;
  1885. X    vcw->cury -= mody;
  1886. X
  1887. X    while( vcw->curx != 0 || vcw->cury != 0 )
  1888. X    {
  1889. X        ScrollLayer( 0, vw->RPort->Layer, deltax, deltay );
  1890. X        vcw->curx -= deltax;
  1891. X        vcw->cury -= deltay;
  1892. X    }
  1893. X    if( modx || mody )
  1894. X        ScrollLayer( 0, vw->RPort->Layer, modx, mody );
  1895. X    }
  1896. X#endif
  1897. X
  1898. X    SetDrMd( rp, dmode );
  1899. X    SetAPen( rp, apen );
  1900. X    SetBPen( rp, bpen );
  1901. X}
  1902. X
  1903. Xvoid amii_suspend_nhwindows( str )
  1904. X    char *str;
  1905. X{
  1906. X    if( HackScreen )
  1907. X    ScreenToBack( HackScreen );
  1908. X}
  1909. X
  1910. Xvoid amii_resume_nhwindows()
  1911. X{
  1912. X    if( HackScreen )
  1913. X    ScreenToFront( HackScreen );
  1914. X}
  1915. X
  1916. Xvoid amii_bell()
  1917. X{
  1918. X    DisplayBeep( NULL );
  1919. X}
  1920. X
  1921. Xvoid
  1922. Xremovetopl(cnt)
  1923. X    int cnt;
  1924. X{
  1925. X    struct amii_WinDesc *cw=amii_wins[WIN_MESSAGE];
  1926. X                    /* NB - this is sufficient for
  1927. X                     * yn_function, but that's it
  1928. X                     */
  1929. X    if(cw->curx < cnt)cw->curx=0;
  1930. X    else cw->curx -= cnt;
  1931. X
  1932. X    amii_curs(WIN_MESSAGE, cw->curx+1, 0);
  1933. X    amii_cl_end(cw, cw->curx);
  1934. X}
  1935. X/*#endif /* AMIGA_INTUITION */
  1936. X
  1937. X#ifdef  PORT_HELP
  1938. Xvoid
  1939. Xport_help()
  1940. X{
  1941. X    display_file( PORT_HELP, 1 );
  1942. X}
  1943. X#endif
  1944. X
  1945. X/*
  1946. X *  print_glyph
  1947. X *
  1948. X *  Print the glyph to the output device.  Don't flush the output device.
  1949. X *
  1950. X *  Since this is only called from show_glyph(), it is assumed that the
  1951. X *  position and glyph are always correct (checked there)!
  1952. X */
  1953. X
  1954. Xvoid
  1955. Xamii_print_glyph(win,x,y,glyph)
  1956. X    winid win;
  1957. X    xchar x,y;
  1958. X    int glyph;
  1959. X{
  1960. X    struct amii_WinDesc *cw;
  1961. X    uchar   ch;
  1962. X    register int offset;
  1963. X#ifdef TEXTCOLOR
  1964. X    int     color;
  1965. X#ifndef    SHAREDLIB
  1966. X    extern int zapcolors[];
  1967. X#endif
  1968. X
  1969. X    if( win == WIN_ERR || (cw=amii_wins[win]) == NULL || cw->type != NHW_MAP)
  1970. X    panic(winpanicstr,win,"print_glyph");
  1971. X
  1972. X#define zap_color(n)  color = flags.use_color ? zapcolors[n] : NO_COLOR
  1973. X#define cmap_color(n) color = flags.use_color ? defsyms[n].color : NO_COLOR
  1974. X#define trap_color(n) color = flags.use_color ? \
  1975. X        (((n) == WEB) ? defsyms[S_web ].color  : \
  1976. X                defsyms[S_trap].color) : \
  1977. X            NO_COLOR
  1978. X#define obj_color(n)  color = flags.use_color ? objects[n].oc_color : NO_COLOR
  1979. X#define mon_color(n)  color = flags.use_color ? mons[n].mcolor : NO_COLOR
  1980. X#define pet_color(n)  color = flags.use_color ? mons[n].mcolor :          \
  1981. X        /* If no color, try to hilite pets; black  */ \
  1982. X        /* should be HI                */ \
  1983. X            ((flags.hilite_pet) ? BLACK : NO_COLOR)
  1984. X
  1985. X# else /* no text color */
  1986. X
  1987. X#define zap_color(n)
  1988. X#define cmap_color(n)
  1989. X#define trap_color(n)
  1990. X#define obj_color(n)
  1991. X#define mon_color(n)
  1992. X#define pet_color(n)
  1993. X
  1994. X#endif
  1995. X
  1996. X    /*
  1997. X     *  Map the glyph back to a character.
  1998. X     *
  1999. X     *  Warning:  For speed, this makes an assumption on the order of
  2000. X     *        offsets.  The order is set in display.h.
  2001. X     */
  2002. X    if ((offset = (glyph - GLYPH_SWALLOW_OFF)) >= 0) {  /* swallow */
  2003. X    /* see swallow_to_glyph()in display.c */
  2004. X    ch = (uchar) showsyms[S_sw_tl + (offset & 0x7)];
  2005. X    mon_color(offset >> 3);
  2006. X    } else if ((offset = (glyph - GLYPH_ZAP_OFF)) >= 0) {       /* zap beam */
  2007. X    ch = showsyms[S_vbeam + (offset & 0x3)];
  2008. X    zap_color((offset >> 2));
  2009. X    } else if( ( offset = (glyph - GLYPH_CMAP_OFF) ) >= 0 ) {   /* cmap */
  2010. X    ch = showsyms[offset];
  2011. X    cmap_color(offset);
  2012. X    } else if ( ( offset = (glyph - GLYPH_TRAP_OFF) ) >= 0 ) {  /* trap */
  2013. X    ch = (offset == WEB) ? showsyms[S_web] : showsyms[S_trap];
  2014. X    trap_color(offset);
  2015. X    } else if( ( offset = (glyph - GLYPH_OBJ_OFF) ) >= 0 ) {    /* object */
  2016. X    ch = oc_syms[objects[offset].oc_class];
  2017. X    obj_color(offset);
  2018. X    } else if ((offset = (glyph - GLYPH_BODY_OFF)) >= 0) {  /* a corpse */
  2019. X    ch = oc_syms[objects[CORPSE].oc_class];
  2020. X    mon_color(offset);
  2021. X    } else if ((offset = (glyph - GLYPH_PET_OFF)) >= 0) {   /* a pet */
  2022. X    ch = (uchar) monsyms[mons[offset].mlet];
  2023. X    pet_color(offset);
  2024. X    } else /*if( glyph_is_monster(glyph) )*/ {      /* a monster */
  2025. X    ch = (uchar) monsyms[mons[glyph].mlet];
  2026. X    mon_color(glyph);
  2027. X    }
  2028. X
  2029. X    /* Move the cursor. */
  2030. X#ifdef CLIPPING
  2031. X    if (!win_curs(x, y)) return;
  2032. X#else
  2033. X    amii_curs(win,x,y+2);
  2034. X#endif
  2035. X
  2036. X#ifdef TEXTCOLOR
  2037. X    /* Turn off color if rogue level. */
  2038. X# ifdef REINCARNATION
  2039. X    if (Is_rogue_level(&u.uz))
  2040. X    color = NO_COLOR;
  2041. X#  endif
  2042. X
  2043. X    amiga_print_glyph(win,color,ch);
  2044. X#else
  2045. X    g_putch(ch);    /* print the character */
  2046. X#endif
  2047. X    cw->curx++;     /* one character over */
  2048. X}
  2049. X
  2050. X/* Make sure the user sees a text string when no windowing is available */
  2051. X
  2052. Xvoid
  2053. Xamii_raw_print(s)
  2054. X    register const char *s;
  2055. X{
  2056. X    if( !s )
  2057. X    return;
  2058. X    if(amiIDisplay)
  2059. X    amiIDisplay->rawprint++;
  2060. X
  2061. X    if( Initialized == 0 && WIN_BASE == WIN_ERR )
  2062. X        init_nhwindows();
  2063. X
  2064. X    if( amii_rawprwin != WIN_ERR )
  2065. X    amii_putstr( amii_rawprwin, 0, s );
  2066. X    else if( WIN_MAP != WIN_ERR && amii_wins[ WIN_MAP ] )
  2067. X    amii_putstr( WIN_MAP, 0, s );
  2068. X    else if( WIN_BASE != WIN_ERR && amii_wins[ WIN_BASE ] )
  2069. X    amii_putstr( WIN_BASE, 0, s );
  2070. X    else
  2071. X    {
  2072. X    puts( s);
  2073. X    fflush(stdout);
  2074. X    }
  2075. X}
  2076. X
  2077. X/* Make sure the user sees a bold text string when no windowing
  2078. X * is available
  2079. X */
  2080. X
  2081. Xvoid
  2082. Xamii_raw_print_bold(s)
  2083. X    register const char *s;
  2084. X{
  2085. X    if( !s )
  2086. X    return;
  2087. X
  2088. X    if(amiIDisplay)
  2089. X    amiIDisplay->rawprint++;
  2090. X
  2091. X    if( Initialized == 0 && WIN_BASE == WIN_ERR )
  2092. X        init_nhwindows();
  2093. X
  2094. X    if( amii_rawprwin != WIN_ERR )
  2095. X    amii_putstr( amii_rawprwin, 1, s );
  2096. X    else if( WIN_MAP != WIN_ERR && amii_wins[ WIN_MAP ] )
  2097. X    amii_putstr( WIN_MAP, 1, s );
  2098. X    else if( WIN_BASE != WIN_ERR && amii_wins[ WIN_BASE ] )
  2099. X    amii_putstr( WIN_BASE, 1, s );
  2100. X    else
  2101. X    {
  2102. X    printf("\33[1m%s\33[0m\n",s);
  2103. X    fflush(stdout);
  2104. X    }
  2105. X}
  2106. X
  2107. X/* Rebuild/update the inventory if the window is up.
  2108. X */
  2109. Xvoid
  2110. Xamii_update_inventory()
  2111. X{
  2112. X    register struct amii_WinDesc *cw;
  2113. X
  2114. X    if( WIN_INVEN != WIN_ERR && ( cw = amii_wins[ WIN_INVEN ] ) &&
  2115. X                cw->type == NHW_MENU && cw->win )
  2116. X    {
  2117. X    display_inventory( NULL, FALSE );
  2118. X    }
  2119. X}
  2120. X
  2121. X/* Humm, doesn't really do anything useful */
  2122. X
  2123. Xvoid
  2124. Xamii_mark_synch()
  2125. X{
  2126. X    if(!amiIDisplay)
  2127. X    fflush(stderr);
  2128. X/* anything else?  do we need this much? */
  2129. X}
  2130. X
  2131. X/* Wait for everything to sync.  Nothing is asynchronous, so we just
  2132. X * ask for a key to be pressed.
  2133. X */
  2134. Xvoid
  2135. Xamii_wait_synch()
  2136. X{
  2137. X    if(!amiIDisplay || amiIDisplay->rawprint)
  2138. X    {
  2139. X    if(amiIDisplay) amiIDisplay->rawprint=0;
  2140. X    }
  2141. X    else
  2142. X    {
  2143. X    display_nhwindow(WIN_MAP,TRUE);
  2144. X    flush_glyph_buffer( amii_wins[ WIN_MAP ]->win );
  2145. X    }
  2146. X}
  2147. X
  2148. Xvoid
  2149. Xamii_setclipped()
  2150. X{
  2151. X    clipping = TRUE;
  2152. X    clipx=clipy=0;
  2153. X    clipxmax=CO;        /* WRONG */
  2154. X    clipymax=LI-5;      /* WRONG */
  2155. X}
  2156. X
  2157. Xvoid
  2158. Xamii_cliparound(x,y)
  2159. X    register int x,y;
  2160. X{
  2161. X/* pull this from wintty.c - LATER */
  2162. X}
  2163. X
  2164. Xvoid
  2165. XflushIDCMP( port )
  2166. X    struct MsgPort *port;
  2167. X{
  2168. X    struct Message *msg;
  2169. X    while( msg = GetMsg( port ) )
  2170. X        ReplyMsg( msg );
  2171. X}
  2172. END_OF_FILE
  2173. if test 40043 -ne `wc -c <'sys/amiga/winfuncs.c'`; then
  2174.     echo shar: \"'sys/amiga/winfuncs.c'\" unpacked with wrong size!
  2175. fi
  2176. # end of 'sys/amiga/winfuncs.c'
  2177. if test ! -d 'sys/mac' ; then
  2178.     echo shar: Creating directory \"'sys/mac'\"
  2179.     mkdir 'sys/mac'
  2180. fi
  2181. if test -f 'sys/mac/dprintf.c' -a "${1}" != "-c" ; then 
  2182.   echo shar: Renaming existing file \"'sys/mac/dprintf.c'\" to \"'sys/mac/dprintf.c.orig'\"
  2183.   mv -f 'sys/mac/dprintf.c' 'sys/mac/dprintf.c.orig'
  2184. fi
  2185. echo shar: Extracting \"'sys/mac/dprintf.c'\" \(1302 characters\)
  2186. sed "s/^X//" >'sys/mac/dprintf.c' <<'END_OF_FILE'
  2187. X/*    SCCS Id: @(#)dprintf.c    3.1    93/05/14          */
  2188. X/* Copyright (c) Jon W{tte, 1993.                  */
  2189. X/* NetHack may be freely redistributed.  See license for details. */
  2190. X
  2191. X#include "hack.h"
  2192. X
  2193. X#include <Types.h>
  2194. X#include <stdarg.h>
  2195. X#include <stdio.h>
  2196. X#include <strings.h>
  2197. X#include <GestaltEqu.h>
  2198. X
  2199. X
  2200. XBoolean
  2201. XHasDebugger ( void ) {
  2202. Xlong osAttr ;
  2203. X    if ( Gestalt ( gestaltOSAttr , & osAttr ) ||
  2204. X        ! ( osAttr & ( 1 << gestaltSysDebuggerSupport ) ) ) {
  2205. X        return 0 ;
  2206. X    }
  2207. X    return 1 ;
  2208. X}
  2209. X
  2210. X
  2211. XBoolean
  2212. XKeyDown ( unsigned short code ) {
  2213. Xunsigned char keys [ 16 ] ;
  2214. X
  2215. X    GetKeys ( ( void * ) keys ) ;
  2216. X    return ( ( keys [ code >> 3 ] >> ( code & 7 ) ) & 1 ) != 0 ;
  2217. X}
  2218. X
  2219. X
  2220. Xvoid
  2221. Xdprintf ( char * format , ... ) {
  2222. Xstatic char buffer [ 100 ] ;
  2223. Xva_list list ;
  2224. Xstatic Boolean checkedTrap = 0 ;
  2225. Xstatic Boolean trapAvailable = 0 ;
  2226. X
  2227. X    if ( ! checkedTrap ) {
  2228. X        checkedTrap = 1 ;
  2229. X        trapAvailable = HasDebugger ( ) ;
  2230. X    }
  2231. X    list = va_start ( list , format ) ;
  2232. X    vsprintf ( & buffer [ 1 ] , format , list ) ;
  2233. X    va_end ( list )  ;
  2234. X    buffer [ 0 ] = strlen ( & buffer [ 1 ] ) ;
  2235. X    if ( trapAvailable ) {
  2236. X        if ( KeyDown ( 0x39 ) ) {                                    /* Caps Lock */
  2237. X            DebugStr ( buffer ) ;
  2238. X        } else if ( KeyDown ( 0x3B ) && flags . window_inited &&    /* Control */
  2239. X            ( WIN_MESSAGE != -1 ) && theWindows [ WIN_MESSAGE ] . theWindow ) {
  2240. X            pline ( "%s" , & buffer [ 1 ] ) ;
  2241. X        }
  2242. X    }
  2243. X}
  2244. END_OF_FILE
  2245. if test 1302 -ne `wc -c <'sys/mac/dprintf.c'`; then
  2246.     echo shar: \"'sys/mac/dprintf.c'\" unpacked with wrong size!
  2247. fi
  2248. # end of 'sys/mac/dprintf.c'
  2249. if test ! -d 'sys/msdos' ; then
  2250.     echo shar: Creating directory \"'sys/msdos'\"
  2251.     mkdir 'sys/msdos'
  2252. fi
  2253. if test ! -d 'sys/os2' ; then
  2254.     echo shar: Creating directory \"'sys/os2'\"
  2255.     mkdir 'sys/os2'
  2256. fi
  2257. if test ! -d 'sys/share' ; then
  2258.     echo shar: Creating directory \"'sys/share'\"
  2259.     mkdir 'sys/share'
  2260. fi
  2261. if test ! -d 'sys/unix' ; then
  2262.     echo shar: Creating directory \"'sys/unix'\"
  2263.     mkdir 'sys/unix'
  2264. fi
  2265. if test ! -d 'sys/winnt' ; then
  2266.     echo shar: Creating directory \"'sys/winnt'\"
  2267.     mkdir 'sys/winnt'
  2268. fi
  2269. echo shar: End of archive 1 \(of 33\).
  2270. cp /dev/null ark1isdone
  2271. MISSING=""
  2272. 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 ; do
  2273.     if test ! -f ark${I}isdone ; then
  2274.     MISSING="${MISSING} ${I}"
  2275.     fi
  2276. done
  2277. if test "${MISSING}" = "" ; then
  2278.     echo You have unpacked all 33 archives.
  2279.     echo "Now execute ./patchit.sh"
  2280.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2281. else
  2282.     echo You still need to unpack the following archives:
  2283.     echo "        " ${MISSING}
  2284. fi
  2285. ##  End of shell archive.
  2286. exit 0
  2287.