home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / games / volume16 / nethck31 / patch1dd < prev    next >
Encoding:
Text File  |  1993-03-04  |  53.8 KB  |  1,827 lines

  1. Subject:  v17i071:  nethack31 - display oriented dungeons & dragons (Ver. 3.1), Patch1dd/31
  2. Newsgroups: comp.sources.games
  3. Approved: billr@saab.CNA.TEK.COM
  4.  
  5. Submitted-by: izchak@linc.cis.upenn.edu (Izchak Miller)
  6. Posting-number: Volume 17, Issue 71
  7. Archive-name: nethack31/Patch1dd
  8. Patch-To: nethack31: Volume 16, Issue 1-116
  9. Environment: Amiga, Atari, Mac, MS-DOS, Windows-NT, OS2, Unix, VMS, X11
  10.  
  11.  
  12.  
  13. #! /bin/sh
  14. # This is a shell archive.  Remove anything before this line, then unpack
  15. # it by saving it into a file and typing "sh file".  To overwrite existing
  16. # files, type "sh file -c".  You can also feed this as standard input via
  17. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  18. # will see the following message at the end:
  19. #        "End of archive 30 (of 31)."
  20. # Contents:  patches01m sys/amiga/amisnd.c sys/winnt/Install.nt
  21. #   sys/winnt/Makefile.src sys/winnt/nttty.c
  22. # Wrapped by billr@saab on Fri Mar  5 10:50:49 1993
  23. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  24. if test -f 'patches01m' -a "${1}" != "-c" ; then 
  25.   echo shar: Renaming existing file \"'patches01m'\" to \"'patches01m.orig'\"
  26.   mv -f 'patches01m' 'patches01m.orig'
  27. fi
  28. echo shar: Extracting \"'patches01m'\" \(6957 characters\)
  29. sed "s/^X//" >'patches01m' <<'END_OF_FILE'
  30. X*** /tmp/da07389    Thu Feb 25 10:19:33 1993
  31. X--- doc/Guidebook.mn    Fri Feb 12 14:58:38 1993
  32. X***************
  33. X*** 4,12 ****
  34. X  .ds vr "NetHack 3.1
  35. X  .ds f0 "\*(vr
  36. X  .ds f1
  37. X! .ds f2 "May 28, 1990
  38. X  .mt
  39. X  A Guide to the Mazes of Menace
  40. X  .au
  41. X  Eric S. Raymond
  42. X  (Extensively edited and expanded for 3.0 by Mike Threepoint)
  43. X--- 4,13 ----
  44. X  .ds vr "NetHack 3.1
  45. X  .ds f0 "\*(vr
  46. X  .ds f1
  47. X! .ds f2 "January 25, 1993
  48. X  .mt
  49. X  A Guide to the Mazes of Menace
  50. X+ (Guidebook for NetHack 3.1)
  51. X  .au
  52. X  Eric S. Raymond
  53. X  (Extensively edited and expanded for 3.0 by Mike Threepoint)
  54. X***************
  55. X*** 20,26 ****
  56. X  guild.  After much practice and sweat you have finally completed your
  57. X  training and are ready to embark upon a perilous adventure.  To prove
  58. X  your worthiness, the local guildmasters have sent you into the Mazes of
  59. X! Menace.  Your quest is to return with the Amulet of Yendor.  According
  60. X  to legend, the gods will grant immortality to the one who recovers this
  61. X  artifact; true or not, its recovery will bring honor and full guild
  62. X  membership (not to mention the attentions of certain wealthy wizards).
  63. X--- 21,27 ----
  64. X  guild.  After much practice and sweat you have finally completed your
  65. X  training and are ready to embark upon a perilous adventure.  To prove
  66. X  your worthiness, the local guildmasters have sent you into the Mazes of
  67. X! Menace.  Your quest is to retrieve the Amulet of Yendor.  According
  68. X  to legend, the gods will grant immortality to the one who recovers this
  69. X  artifact; true or not, its recovery will bring honor and full guild
  70. X  membership (not to mention the attentions of certain wealthy wizards).
  71. X***************
  72. X*** 436,442 ****
  73. X  .lp p
  74. X  Pay your shopping bill.
  75. X  .lp P
  76. X! Put on a ring.
  77. X  .lp ^P
  78. X  Repeat previous message (subsequent ^P's repeat earlier messages).
  79. X  .lp q
  80. X--- 437,443 ----
  81. X  .lp p
  82. X  Pay your shopping bill.
  83. X  .lp P
  84. X! Put on a ring or other accessory (amulet, blindfold).
  85. X  .lp ^P
  86. X  Repeat previous message (subsequent ^P's repeat earlier messages).
  87. X  .lp q
  88. X***************
  89. X*** 446,452 ****
  90. X  .lp r
  91. X  Read a scroll or spell book.
  92. X  .lp R
  93. X! Remove a ring.
  94. X  .lp ^R
  95. X  Redraw the screen.
  96. X  .lp s
  97. X--- 447,453 ----
  98. X  .lp r
  99. X  Read a scroll or spell book.
  100. X  .lp R
  101. X! Remove an accessory (ring, amulet, etc).
  102. X  .lp ^R
  103. X  Redraw the screen.
  104. X  .lp s
  105. X***************
  106. X*** 482,487 ****
  107. X--- 483,490 ----
  108. X  .ux " versions with job control only)." (
  109. X  .lp :
  110. X  Look at what is here.
  111. X+ .lp ;
  112. X+ Show what type of thing a visible symbol corresponds to.
  113. X  .lp ,
  114. X  Pick up some things.
  115. X  .lp @
  116. X***************
  117. X*** 1164,1169 ****
  118. X--- 1167,1175 ----
  119. X  set your character class by appending a dash and the first letter of
  120. X  the character class (that is, by suffixing one of
  121. X  .op "-A -B -C -E -H -K -P -R -S -T -V -W" ).
  122. X+ If
  123. X+ .op "-@"
  124. X+ is used for the class, then a random one will be automatically chosen.
  125. X  Cannot be set with the `O' command.
  126. X  .lp news\ \ \ \ 
  127. X  Read the NetHack news file, if present (default on).
  128. X*** /tmp/da07397    Thu Feb 25 10:19:36 1993
  129. X--- doc/Guidebook.tex    Fri Feb 12 14:58:42 1993
  130. X***************
  131. X*** 55,61 ****
  132. X  guild.  After much practice and sweat you have finally completed your
  133. X  training and are ready to embark upon a perilous adventure.  To prove
  134. X  your worthiness, the local guildmasters have sent you into the Mazes of
  135. X! Menace.  Your quest is to return with the Amulet of Yendor.  According
  136. X  to legend, the gods will grant immortality to the one who recovers this
  137. X  artifact; true or not, its recovery will bring honor and full guild
  138. X  membership (not to mention the attentions of certain wealthy wizards).
  139. X--- 55,61 ----
  140. X  guild.  After much practice and sweat you have finally completed your
  141. X  training and are ready to embark upon a perilous adventure.  To prove
  142. X  your worthiness, the local guildmasters have sent you into the Mazes of
  143. X! Menace.  Your quest is to retrieve the Amulet of Yendor.  According
  144. X  to legend, the gods will grant immortality to the one who recovers this
  145. X  artifact; true or not, its recovery will bring honor and full guild
  146. X  membership (not to mention the attentions of certain wealthy wizards).
  147. X***************
  148. X*** 595,601 ****
  149. X  Pay your shopping bill.
  150. X  %.lp
  151. X  \item[\tb{P}]
  152. X! Put on a ring.
  153. X  %.lp
  154. X  \item[\tb{\^{}P}]
  155. X  Repeat previous message (subsequent {\tt \^{}P}'s repeat earlier messages).
  156. X--- 595,601 ----
  157. X  Pay your shopping bill.
  158. X  %.lp
  159. X  \item[\tb{P}]
  160. X! Put on a ring or other accessory (amulet, blindfold).
  161. X  %.lp
  162. X  \item[\tb{\^{}P}]
  163. X  Repeat previous message (subsequent {\tt \^{}P}'s repeat earlier messages).
  164. X***************
  165. X*** 610,616 ****
  166. X  Read a scroll or spell book.
  167. X  %.lp
  168. X  \item[\tb{R}]
  169. X! Remove a ring.
  170. X  %.lp
  171. X  \item[\tb{\^{}R}]
  172. X  Redraw the screen.
  173. X--- 610,616 ----
  174. X  Read a scroll or spell book.
  175. X  %.lp
  176. X  \item[\tb{R}]
  177. X! Remove an accessory (ring, amulet, etc).
  178. X  %.lp
  179. X  \item[\tb{\^{}R}]
  180. X  Redraw the screen.
  181. X***************
  182. X*** 663,668 ****
  183. X--- 663,671 ----
  184. X  \item[\tb{:}]
  185. X  Look at what is here.
  186. X  %.lp
  187. X+ \item[\tb{;}]
  188. X+ Show what type of thing a visible symbol corresponds to.
  189. X+ %.lp
  190. X  \item[\tb{,}]
  191. X  Pick up some things.
  192. X  %.lp
  193. X***************
  194. X*** 1481,1486 ****
  195. X--- 1484,1491 ----
  196. X  set your character class by appending a dash and the first letter of
  197. X  the character class (that is, by suffixing one of
  198. X  ``{\tt -A -B -C -E -H -K -P -R -S -T -V -W}'').
  199. X+ If ``{\tt -@}'' is used for the class, then a random one will be
  200. X+ automatically chosen.
  201. X  Cannot be set with the `{\tt O}' command.
  202. X  %.lp
  203. X  \item[\ib{news}]
  204. X*** /tmp/da07421    Thu Feb 25 10:19:49 1993
  205. X--- doc/lev_comp.6    Wed Feb 24 15:34:38 1993
  206. X***************
  207. X*** 223,228 ****
  208. X--- 223,229 ----
  209. X          | gold_detail
  210. X          | engraving_detail
  211. X          | diggable_detail
  212. X+         | passwall_detail
  213. X  
  214. X  monster_detail    : "MONSTER" ':' monster_c ',' m_name ',' coordinate
  215. X            monster_infos
  216. X***************
  217. X*** 296,301 ****
  218. X--- 297,304 ----
  219. X  
  220. X  diggable_detail    : "NON_DIGGABLE" ':' region
  221. X  
  222. X+ passwall_detail    : "NON_PASSWALL" ':' region
  223. X+ 
  224. X  region_detail    : "REGION" ':' region ',' light_state ','
  225. X            room_type prefilled
  226. X  
  227. X***************
  228. X*** 403,408 ****
  229. X--- 406,412 ----
  230. X  \&'C'    cloudy air
  231. X  \&'I'    ice
  232. X  \&'S'    a secret door
  233. X+ \&'H'    a secret corridor
  234. X  \&'{'    a fountain
  235. X  \&'\\'    a throne
  236. X  \&'K'    a sink (if SINKS is defined, else a room location)
  237. X*** /tmp/da07429    Thu Feb 25 10:19:51 1993
  238. X--- doc/nethack.6    Mon Feb 22 12:24:26 1993
  239. X***************
  240. X*** 12,18 ****
  241. X  .B \-n
  242. X  ]
  243. X  [
  244. X! .B \-[ABCEHKPRSTVW]
  245. X  ]
  246. X  [
  247. X  .B \-[DX]
  248. X--- 12,18 ----
  249. X  .B \-n
  250. X  ]
  251. X  [
  252. X! .B \-[ABCEHKPRSTVW@]
  253. X  ]
  254. X  [
  255. X  .B \-[DX]
  256. X***************
  257. X*** 100,105 ****
  258. X--- 100,111 ----
  259. X  suffix or a separate option consisting of one of
  260. X  .B "\-A \-B \-C \-E \-H \-K \-P \-R \-S \-T \-V \-W"
  261. X  can be used to determine the character role.
  262. X+ Likewise,
  263. X+ .B "\-@"
  264. X+ can be used to explicitly request that a random role be chosen.
  265. X+ It may need to be quoted with a backslash (-\\@) if @
  266. X+ is the "kill" character (see "stty") for the terminal, in order
  267. X+ to prevent the current input line from being cleared.
  268. X  .PP
  269. X  The
  270. X  .B \-s
  271. X
  272. END_OF_FILE
  273. if test 6957 -ne `wc -c <'patches01m'`; then
  274.     echo shar: \"'patches01m'\" unpacked with wrong size!
  275. fi
  276. # end of 'patches01m'
  277. if test -f 'sys/amiga/amisnd.c' -a "${1}" != "-c" ; then 
  278.   echo shar: Renaming existing file \"'sys/amiga/amisnd.c'\" to \"'sys/amiga/amisnd.c.orig'\"
  279.   mv -f 'sys/amiga/amisnd.c' 'sys/amiga/amisnd.c.orig'
  280. fi
  281. echo shar: Extracting \"'sys/amiga/amisnd.c'\" \(7303 characters\)
  282. sed "s/^X//" >'sys/amiga/amisnd.c' <<'END_OF_FILE'
  283. X/*    SCCS Id: @(#)amisnd.c    3.1    92/11/28    */
  284. X/*     Copyright (c) 1992, 1993 by Gregg Wonderly */
  285. X/* NetHack may be freely redistributed.  See license for details. */
  286. X
  287. X/*
  288. X * This file contains music playing code.
  289. X *
  290. X * If we were REALLY determined, we would make the sound play
  291. X * asynchronously, but I'll save that one for a rainy day...
  292. X */
  293. X
  294. X#include "hack.h"
  295. X
  296. X#undef red
  297. X#undef blue
  298. X#undef green
  299. X#include <exec/types.h>
  300. X#include <exec/memory.h>
  301. X#include <exec/io.h>
  302. X#include <devices/audio.h>
  303. X#include <dos/dos.h>
  304. X#include <dos/dosextens.h>
  305. X#include <graphics/gfxbase.h>
  306. X
  307. X#include <clib/exec_protos.h>
  308. X#include <clib/alib_protos.h>
  309. X#include <clib/dos_protos.h>
  310. X#include <clib/graphics_protos.h>
  311. X
  312. X#include <stdio.h>
  313. X#include <stdlib.h>
  314. X
  315. X#define    AMII_AVERAGE_VOLUME    60
  316. X
  317. Xint amii_volume = AMII_AVERAGE_VOLUME;
  318. X
  319. Xtypedef struct VHDR
  320. X{
  321. X    char name[4];
  322. X    long len;
  323. X    unsigned long oneshot, repeat, samples;
  324. X    UWORD freq;
  325. X    UBYTE n_octaves, compress;
  326. X    LONG volume;
  327. X} VHDR;
  328. X
  329. Xtypedef struct IFFHEAD
  330. X{
  331. X    char FORM[4];
  332. X    long flen;
  333. X    char _8SVX[4];
  334. X    VHDR vhdr;
  335. X    char NAME[4];
  336. X    long namelen;
  337. X} IFFHEAD;
  338. X
  339. Xextern struct GfxBase *GfxBase;
  340. X
  341. XUBYTE whichannel[] = { 1, 2, 4, 8 };
  342. Xvoid makesound( char *, char *, int vol);
  343. Xvoid amii_speaker( struct obj *instr, char *melody, int vol );
  344. X
  345. X/* A major scale in indexs to freqtab... */
  346. Xint notetab[] = { 0, 2, 4, 5, 7, 9, 11, 12 };
  347. X
  348. X/* Frequencies for a scale starting at one octave below 'middle C' */
  349. Xlong freqtab[] = {
  350. X    220,    /*A */
  351. X    233,    /*Bb*/
  352. X    246,    /*B */
  353. X    261,    /*C */
  354. X    277,    /*Db*/
  355. X    293,    /*D */
  356. X    311,    /*Eb*/
  357. X    329,    /*E */
  358. X    349,    /*F */
  359. X    370,    /*Gb*/
  360. X    392,    /*G */
  361. X    415,    /*Ab*/
  362. X    440,    /*A */
  363. X};
  364. X
  365. X#ifdef    TESTING
  366. Xmain( argc, argv )
  367. X    int argc;
  368. X    char **argv;
  369. X{
  370. X    makesound( "wooden_flute", "AwBwCwDwEwFwGwawbwcwdwewfwgw", 60 );
  371. X    makesound( "wooden_flute", "AhBhChDhEhFhGhahbhchdhehfhgh", 60 );
  372. X    makesound( "wooden_flute", "AqBqCqDqEqFqGqaqbqcqdqeqfqgq", 60 );
  373. X    makesound( "wooden_flute", "AeBeCeDeEeFeGeaebecedeeefege", 60 );
  374. X    makesound( "wooden_flute", "AxBxCxDxExFxGxaxbxcxdxexfxgx", 60 );
  375. X    makesound( "wooden_flute", "AtBtCtDtEtFtGtatbtctdtetftgt", 60 );
  376. X    makesound( "wooden_flute", "AtBtCtDtEtFtGtatbtctdtetftgt", 60 );
  377. X    makesound( "wooden_flute", "AtBtCtDtEtFtGtatbtctdtetftgt", 60 );
  378. X    makesound( "wooden_flute", "AtBtCtDtEtFtGtatbtctdtetftgt", 60 );
  379. X    makesound( "wooden_flute", "AtBtCtDtEtFtGtatbtctdtetftgt", 60 );
  380. X    makesound( "wooden_flute", "AtBtCtDtEtFtGtatbtctdtetftgt", 60 );
  381. X    makesound( "wooden_flute", "AtBtCtDtEtFtGtatbtctdtetftgt", 60 );
  382. X    makesound( "wooden_flute", "AtBtCtDtEtFtGtatbtctdtetftgt", 60 );
  383. X    makesound( "wooden_flute", "AtBtCtDtEtFtGtatbtctdtetftgt", 60 );
  384. X}
  385. X#else
  386. Xvoid
  387. Xamii_speaker( struct obj *instr, char *melody, int vol )
  388. X{
  389. X    int typ = instr->otyp;
  390. X    const char * actualn = OBJ_NAME( objects[typ] ) ;
  391. X
  392. X    /* Make volume be relative to users volume level, with 60 being the
  393. X     * average level that will be passed to us.
  394. X     */
  395. X    vol = vol * amii_volume / AMII_AVERAGE_VOLUME;
  396. X
  397. X    makesound( actualn, melody, vol );
  398. X}
  399. X#endif
  400. X
  401. Xvoid
  402. Xmakesound ( char *actualn , char * melody, int vol )
  403. X{
  404. X    char *t;
  405. X    int c, cycles, dot, dlay;
  406. X    FILE *fp = 0;
  407. X    IFFHEAD iffhead;
  408. X    struct IOAudio *AudioIO = 0;
  409. X    struct MsgPort *AudioMP = 0;
  410. X    struct Message *AudioMSG = 0;
  411. X    ULONG device = -1;
  412. X    BYTE *waveptr = 0;
  413. X    LONG frequency=440, duration=1, clock, samp, samples, samcyc=1;
  414. X    unsigned char name [ 100 ] ;
  415. X
  416. X    if ( flags.silent )
  417. X        return;
  418. X
  419. X    if( GfxBase->DisplayFlags & PAL )
  420. X        clock = 3546895;
  421. X    else
  422. X        clock = 3579545;
  423. X
  424. X    /*
  425. X     * Is this a known instrument ?
  426. X     *
  427. X     */
  428. X    sprintf ( name, "NetHack:sounds/%s", actualn ) ;
  429. X    for( t = strchr( name, ' ' ); t; t = strchr( name, ' ' ) )
  430. X        *t = '_';
  431. X    if( (fp = fopen( name, "r" )) == NULL )
  432. X    {
  433. X        perror( name );
  434. X        return;
  435. X    }
  436. X
  437. X    AudioIO = (struct IOAudio *)
  438. X        AllocMem( sizeof( struct IOAudio ), MEMF_PUBLIC|MEMF_CLEAR );
  439. X    if( AudioIO == 0 )
  440. X        goto killaudio;
  441. X
  442. X    AudioMP = CreatePort( NULL, 0 );
  443. X    if( AudioMP == 0 )
  444. X        goto killaudio;
  445. X
  446. X    AudioIO->ioa_Request.io_Message.mn_ReplyPort = AudioMP;
  447. X    AudioIO->ioa_Request.io_Message.mn_Node.ln_Pri = 0;
  448. X    AudioIO->ioa_Request.io_Command = ADCMD_ALLOCATE;
  449. X    AudioIO->ioa_Request.io_Flags = ADIOF_NOWAIT;
  450. X    AudioIO->ioa_AllocKey = 0;
  451. X    AudioIO->ioa_Data = whichannel;
  452. X    AudioIO->ioa_Length = sizeof( whichannel );
  453. X
  454. X    device = OpenDevice( AUDIONAME, 0L, (struct IORequest *)AudioIO, 0L );
  455. X    if( device != 0 )
  456. X        goto killaudio;
  457. X
  458. X    if( fread( &iffhead, sizeof( iffhead ), 1, fp ) != 1 )
  459. X        goto killaudio;
  460. X
  461. X    /* This is an even number of bytes long */
  462. X    if( fread( name, (iffhead.namelen+1) & ~1, 1, fp ) != 1 )
  463. X        goto killaudio;
  464. X
  465. X    if( fread( &samples, 4, 1, fp ) != 1 )
  466. X        goto killaudio;
  467. X
  468. X    if( fread( &samples, 4, 1, fp ) != 1 )
  469. X        goto killaudio;
  470. X
  471. X    waveptr = AllocMem( samples, MEMF_CHIP|MEMF_PUBLIC );
  472. X    if( !waveptr )
  473. X        goto killaudio;
  474. X
  475. X    if( fread( waveptr, samples, 1, fp ) != 1 )
  476. X        goto killaudio;
  477. X
  478. X    while( melody[0] && melody[1] )
  479. X    {
  480. X        c = *melody++;
  481. X        duration = *melody++;
  482. X        dot = 0;
  483. X        if( *melody == '.' )
  484. X        {
  485. X            dot = 1;
  486. X            ++melody;
  487. X        }
  488. X        switch( duration )
  489. X        {
  490. X            case 'w': dlay = 3; duration = 1; cycles = 1; break;
  491. X            case 'h': dlay = 3; duration = 2; cycles = 1; break;
  492. X            case 'q': dlay = 2; duration = 4; cycles = 1; break;
  493. X            case 'e': dlay = 1; duration = 8; cycles = 1; break;
  494. X            case 'x': dlay = 0; duration = 16; cycles = 1; break;
  495. X            case 't': dlay = 0; duration = 32; cycles = 1; break;
  496. X            default: goto killaudio;  /* unrecognized duration */
  497. X        }
  498. X
  499. X        /* Lower case characters are one octave above upper case */
  500. X        switch( c )
  501. X        {
  502. X            case 'a': case 'b': case 'c':
  503. X            case 'd': case 'e': case 'f': case 'g':
  504. X                c -= 'a' - 7;
  505. X                break;
  506. X
  507. X            case 'A': case 'B': case 'C':
  508. X            case 'D': case 'E': case 'F': case 'G':
  509. X                c -= 'A';
  510. X                break;
  511. X
  512. X            default:
  513. X                continue;
  514. X        }
  515. X
  516. X        samcyc = samples;
  517. X
  518. X        /* lowercase start at middle 'C', upper case are one octave below */
  519. X        frequency = c > 7 ? freqtab[notetab[c%7]]*2 : freqtab[notetab[c]];
  520. X
  521. X        /* We can't actually do a dotted whole note unless we add code for a real
  522. X         * 8SVX sample which includes sustain sample information to tell us how
  523. X         * to hold the note steady...  So when duration == 1, ignore 'dot'...
  524. X         */
  525. X        if( dot && duration > 1 )
  526. X            samp = ((samples / duration) * 3) / 2;
  527. X        else
  528. X            samp = samples / duration;
  529. X
  530. X        /* Only use some of the samples based on frequency */
  531. X        samp = frequency * samp / 880;
  532. X
  533. X        /* The 22khz samples are middle C samples, so adjust the play
  534. X         * back frequency accordingly
  535. X         */
  536. X        frequency = (frequency * (iffhead.vhdr.freq*2)/3) / 440L;
  537. X
  538. X        AudioIO->ioa_Request.io_Message.mn_ReplyPort = AudioMP;
  539. X        AudioIO->ioa_Request.io_Command = CMD_WRITE;
  540. X        AudioIO->ioa_Request.io_Flags = ADIOF_PERVOL;
  541. X        AudioIO->ioa_Data = (BYTE *)waveptr;
  542. X        AudioIO->ioa_Length = samp;
  543. X
  544. X        /* The clock rate represents the unity rate, so dividing by
  545. X         * the frequency gives us a period ratio...
  546. X         */
  547. X/*printf( "clock: %ld, freq: %ld, div: %ld\n", clock, frequency, clock/frequency );*/
  548. X        AudioIO->ioa_Period = clock/frequency;
  549. X        AudioIO->ioa_Volume = vol;
  550. X        AudioIO->ioa_Cycles = cycles;
  551. X
  552. X        BeginIO( (struct IORequest *)AudioIO );
  553. X        WaitPort( AudioMP );
  554. X        AudioMSG = GetMsg( AudioMP );
  555. X        if( dlay )
  556. X            Delay( dlay );
  557. X    }
  558. X
  559. X    killaudio:
  560. X    if( fp ) fclose( fp );
  561. X    if( waveptr ) FreeMem( waveptr, samples );
  562. X    if( device == 0 ) CloseDevice( (struct IORequest *)AudioIO );
  563. X    if( AudioMP ) DeletePort( AudioMP );
  564. X    if( AudioIO ) FreeMem( AudioIO, sizeof( *AudioIO ) );
  565. X}
  566. END_OF_FILE
  567. if test 7303 -ne `wc -c <'sys/amiga/amisnd.c'`; then
  568.     echo shar: \"'sys/amiga/amisnd.c'\" unpacked with wrong size!
  569. fi
  570. # end of 'sys/amiga/amisnd.c'
  571. if test -f 'sys/winnt/Install.nt' -a "${1}" != "-c" ; then 
  572.   echo shar: Renaming existing file \"'sys/winnt/Install.nt'\" to \"'sys/winnt/Install.nt.orig'\"
  573.   mv -f 'sys/winnt/Install.nt' 'sys/winnt/Install.nt.orig'
  574. fi
  575. echo shar: Extracting \"'sys/winnt/Install.nt'\" \(10400 characters\)
  576. sed "s/^X//" >'sys/winnt/Install.nt' <<'END_OF_FILE'
  577. X    Copyright (c) NetHack PC Development Team 1990 - 1993.
  578. X    NetHack may be freely redistributed.  See license for details.
  579. X        ======================================================
  580. X        Instructions for compiling and installing
  581. X         NetHack 3.1 on a Windows NT system
  582. X        ======================================================
  583. X         (or, How to make NT NetHack 3.1.1)
  584. X            Last revision: Feb 24, 1993
  585. X
  586. XCredit for the PC versions of NetHack goes to the PC Development team 
  587. Xconsisting of Norm Meluch, Kevin Smolkowski, Paul Winner and Steve 
  588. XVanDevender who built on the work of Pierre Martineau, Stephen Spackman, 
  589. XSteve Creps, Mike Threepoint and Don Kneller.  
  590. X
  591. XCredit for the porting of NetHack to Windows NT goes to the NT Porting 
  592. XTeam started by Michael Allison.
  593. X
  594. XThe NT porting team also wishes to thank the following people for
  595. Xtheir help, testing effort, and suggestions which contributed to the 
  596. Xcompletion of the first Windows NT port of NetHack: Doug Thompson, 
  597. XPhil Mills, Scott Murray. 
  598. X
  599. XThis first version of NetHack for Windows NT is a tty port utilizing 
  600. Xthe NT WIN32 Console I/O subsystem.
  601. X
  602. X
  603. XI.  Dispelling the Myths:
  604. X
  605. X    Compiling NetHack is not as easy as it sounds, nor as hard as it looks,
  606. X    however it will behoove you to read this entire file through before
  607. X    beginning the task.
  608. X
  609. X    We have provided the proper makefiles for building NetHack using the
  610. X    following compilers:
  611. X
  612. X    Microsoft Windows NT October 1992 SDK C Compiler with December '92 fixes.
  613. X
  614. X    All the makefiles were created for use with MS NMAKE which
  615. X    is provided with the Windows NT SDK (Software Development Kit).
  616. X
  617. X    You may find it useful to obtain copies of lex (flex) and yacc (bison).
  618. X    While not strictly necessary to compile nethack, they are required should
  619. X    you desire to make any changes to the level and dungeon compilers.
  620. X    Flex and Yacc for NT are available in the "Porting from UNIX to
  621. X    NT" library on the MSWIN32 Forum on compuserve and other places.
  622. X
  623. X    To use the distributed NetHack icon, a version of uudecode is required,
  624. X    but this is not a necessary step for compiling NT NetHack.
  625. X
  626. XII. To compile your copy of NetHack on a Windows NT machine:
  627. X    (or "just follow these few 'simple' steps outlined below.")
  628. X
  629. XSetting Up
  630. X
  631. X1.  It almost goes without saying that you should make sure that your tools
  632. X    are set up and running correctly.
  633. X
  634. X2.  Make sure all the NetHack files are in the appropriate directory
  635. X    structure.  You should have a main directory with subdirectories
  636. X    dat, doc, include, src, sys\share, sys\winnt, util and win\tty.
  637. X    Other subdirectories may also be included in your distribution, but
  638. X    they are not necessary for use with NT.  You can delete them
  639. X    to save space.
  640. X
  641. X    Check the file "Files" in your top level directory for an exact
  642. X    listing of what file is in which directory.  In order for the
  643. X    Makefiles to work, all the source files must be in the proper
  644. X    locations.
  645. X
  646. X    If you downloaded or ftp'd the sources from a UNIX system, the lines
  647. X    will probably end in UNIX-style newlines, instead of the carriage
  648. X    return and line feed pairs used by DOS.  Some programs have trouble
  649. X    with them, so you may need to convert them (with a utility like
  650. X    Rahul Dhesi's "flip").  Also, every file should end with an empty
  651. X    line, because Microsoft C has a habit of ignoring the
  652. X    last line of each file. 
  653. X
  654. X3.  Go to the sys\winnt directory and run the setup.bat batch file.
  655. X    The necessary Makefile movements will be accomplished for you.
  656. X
  657. X4.  Now go to the include subdirectory to check a couple of the header
  658. X    files there.  Things *should* work as they are, but since you have
  659. X    probably set up your system in some sort of custom configuration
  660. X    it doesn't hurt to check out the following:
  661. X
  662. X    First check config.h according to the comments to match your system and
  663. X    desired set of features.  Mostly you need to check the WIZARD option,
  664. X    make sure the HACKDIR is set properly. The directory specified here must
  665. X    conform to any file-system limitations for directory names.  If you will 
  666. X    be installing NetHack on a FAT (MSDOS compatible) volume (disk), then 
  667. X    there is a limit of 8 characters for each intermediate subdirectory.
  668. X    If the volume is formatted with the NTFS file system, however, then there
  669. X    is no such limitation.
  670. X    Also check COMPRESS.
  671. X
  672. X    You may include all or as few of the special game features as you wish.
  673. X
  674. X    Also check ntconf.h, which should not need much editing. It is there that
  675. X    you may choose to enable color text character support by leaving
  676. X    TERMCOLOR uncommented, or disable color support by commenting out 
  677. X    TERMCOLOR.
  678. X
  679. X5.  If you want to change the high score list behavior, examine the top of
  680. X    topten.c, in the src directory.  You may want to change the definitions of
  681. X    PERSMAX, POINTSMIN, and ENTRYMAX.  I set POINTSMIN to 51 and ENTRYMAX to
  682. X    50 to keep the size of the score list down.
  683. X
  684. X6.  Go to the src directory and edit the top of your Makefile.
  685. X    Change the setting of (GAMEDIR) reflect the directory where
  686. X    you want NetHack to be installed.  
  687. X
  688. X    ie.  GAMEDIR = \games\nethack
  689. X
  690. X    The directory you specify *MUST* exist for all remaining steps to be 
  691. X    successful. Be sure the directory you want the game installed 
  692. X    actually exists.  If it doesn't, create it now.
  693. X
  694. X    If you elected not to use the high-quality BSD random number routines by
  695. X    commenting out RANDOM in ntconf.h, comment out (or set equal
  696. X    to nothing) the RANDOM macro in your Makefile.
  697. X
  698. X    If you are recompiling after patching your sources, or if you got your
  699. X    files from somewhere other than the official distribution, "touch
  700. X    makedefs.c" to ensure that certain files (onames.h and pm.h) are remade,
  701. X    lest potentially troublesome timestamps fool "make".
  702. X
  703. XCompiling
  704. X
  705. X7.  Now that everything is set up, go to the util directory and
  706. X    run nmake.  If you get any errors along the way then something
  707. X    has not been set up correctly.
  708. X
  709. X8.  Next, go to the dat directory and run nmake (just as you did for util).
  710. X    Once again, if you get any errors then something has not been 
  711. X    set up correctly.
  712. X
  713. X9.  Finally, go to the src directory and "nmake install".  The time it takes
  714. X    to compile depends on your particular machine of course, but you should 
  715. X    be able to go for lunch and return to find everything finished.  The 
  716. X    less memory, and slower your machine, the longer the lunch you may take.
  717. X    
  718. X    In any case, it is likely that the command prompt window where you are 
  719. X    doing the compiling will be occupied for a quite a while.  If all 
  720. X    goes well, you will get an NetHack executable.
  721. X
  722. XRunning NetHack
  723. X
  724. X10. Make sure the support files -- data, rumors, cmdhelp, opthelp, help, hh,
  725. X    history, and license -- were copied to the game directory.  If not,
  726. X    move them there from the dat directory yourself.  
  727. X    Assuming you are still in the src,dat, or util directory,
  728. X    "rumors." can be created manually by entering "..\util\makedefs -r"
  729. X    "data." can be created by entering "..\util\makedefs -d".
  730. X
  731. X    Make sure the files NetHack.cnf and termcap also made it to your game
  732. X    directory.  If not, go to sys\share and copy NetHack.cnf and
  733. X    termcap to your game directory.  Edit NetHack.cnf to reflect your
  734. X    particular setup and personal preferences, by following the comments.
  735. X    If you are using the NetHack.cnf off the distribution, be sure to
  736. X    comment out the following line which is MSDOS specific, and will
  737. X    result in a syntax error under the Windows NT port at run time;
  738. X
  739. X    Change:
  740. X    OPTIONS=rawio,BIOS,IBMgraphics
  741. X    to:
  742. X    #OPTIONS=rawio,BIOS,IBMgraphics
  743. X
  744. X    Also, be sure that the value of HACKDIR is correctly referring to
  745. X    the location of your executable.
  746. X  
  747. X    I also recommend uncommenting the second GRAPHICS= section
  748. X    located later in the file for the best choice of character sets.
  749. X
  750. X
  751. XRunning from Command Prompt
  752. X
  753. X11. If you are running it from the command prompt, you must first set the
  754. X    HACKDIR environment variable to the location where the nethack 
  755. X    executable resides:
  756. X
  757. X    set HACKDIR=c:\games\nethack)
  758. X    (or whatever drive and directory you want to use)
  759. X
  760. X    You should also add the directory containing the NetHack executable
  761. X    to your PATH, so that you can just type "nethack" or "nethack -umike"
  762. X    to start it up.  Alternatively, you can explicitly invoke it with 
  763. X    "c:\games\nethack\nethack" (specifying whatever drive and directory your
  764. X    executable resides in) each time.
  765. X
  766. X
  767. XRunning from Program Manager
  768. X
  769. X12. If you will be running it by launching it from the Program Manager,
  770. X    be sure to specify the location of your NetHack executable in the 
  771. X    "Working Directory:" dialogue box field when creating your 
  772. X    Program Manager Icon:
  773. X
  774. X    ie.  Description      :  NetHack 3.1.1 
  775. X         Command Line     :  C:\GAMES\NETHACK\NETHACK.EXE
  776. X         Working Directory:  C:\GAMES\NETHACK
  777. X         Shortcut key     :
  778. X
  779. X13. A NetHack icon has been provided int the file SYS\WINNT\NHICO.UU.
  780. X    This is a uuencoded copy of the icon file, and you must use uudecode
  781. X    to turn it into a Windows NT icon file, in order to use the icon.
  782. X
  783. X14. Play NetHack.  If it works, you're done!
  784. X
  785. XNotes:
  786. X
  787. X1)  To install an update of NetHack after changing something, enter "nmake"
  788. X    from the src directory.  If you add, delete, or reorder monsters or
  789. X    objects, or you change the format of saved level files, delete any save
  790. X    and bones files.  (Trying to use such files sometimes produces amusing
  791. X    confusions on the game's part, but usually crashes.)
  792. X
  793. X    If you made changes to any of the level compiler software, you may have
  794. X    to delete dgn_flex.c, dgn_yacc.c, lev_flex.c, and lev_yacc.c from the
  795. X    util directory to ensure that they are remade.
  796. X
  797. X2)  The executable produced by this port is a 32-bit, flat-address space, 
  798. X    non-overlayed .exe file, which should run on any Windows NT system. It
  799. X    is also a rather large file:
  800. X
  801. X    More than 1,900,000 bytes, nethack.exe when debugging information 
  802. X        is included in the .exe.
  803. X
  804. X3)  A true Windows (WIN32s) version of NetHack is currently under development
  805. X    by the PC Windows Porting team.
  806. X
  807. X
  808. X4)  If you have comments or suggestions, feel free to drop any one of
  809. X    us a line c/o nethack-bugs@linc.cis.upenn.edu.  From compuserve,
  810. X    try  >INTERNET:nethack-bugs@linc.cis.upenn.edu.
  811. END_OF_FILE
  812. if test 10400 -ne `wc -c <'sys/winnt/Install.nt'`; then
  813.     echo shar: \"'sys/winnt/Install.nt'\" unpacked with wrong size!
  814. fi
  815. # end of 'sys/winnt/Install.nt'
  816. if test -f 'sys/winnt/Makefile.src' -a "${1}" != "-c" ; then 
  817.   echo shar: Renaming existing file \"'sys/winnt/Makefile.src'\" to \"'sys/winnt/Makefile.src.orig'\"
  818.   mv -f 'sys/winnt/Makefile.src' 'sys/winnt/Makefile.src.orig'
  819. fi
  820. echo shar: Extracting \"'sys/winnt/Makefile.src'\" \(12159 characters\)
  821. sed "s/^X//" >'sys/winnt/Makefile.src' <<'END_OF_FILE'
  822. X#       SCCS Id: @(#)Makefile.src       3.1     93/02/21
  823. X#       Copyright (c) NetHack PC Development Team 1993
  824. X#
  825. X#       NT NetHack 3.1 Src Makefile 
  826. X#    for MS NMAKE for Windows NT
  827. X#  
  828. X#    NT Version Tested:  October 1992 SDK pre-release
  829. X#                + December '92 compiler fix
  830. X#
  831. X#       For questions read the Install.nt file included with
  832. X#       the distribution.
  833. X#
  834. X#    Michael Allison
  835. X#
  836. X#----------------------------------------------------------------------
  837. X# The following nmake include sets up the environment
  838. X# correctly for the Windows NT Console I/O subsystem
  839. X#
  840. X# Do not delete the following include.
  841. X#
  842. X!include <..\sys\winnt\nhincl.mak>
  843. X
  844. X#
  845. X#  Set the gamedir according to your preference.  It must be present prior
  846. X#  to compilation.
  847. X
  848. XGAME    = nethack            # Game Name
  849. XGAMEDIR = c:\games\hackdir      # Game directory
  850. X
  851. X#
  852. X#  Source directories.    Makedefs hardcodes these, don't change them.
  853. X#
  854. X
  855. XINCL = ..\include   # NetHack include files
  856. XDAT  = ..\dat       # NetHack data files
  857. XDOC  = ..\doc       # NetHack documentation files
  858. XUTIL = ..\util      # Utility source
  859. XSRC  = ..\src       # Main source
  860. XSYS  = ..\sys\share # Shared system files
  861. XMSYS = ..\sys\winnt # NT Win32 specific files
  862. XWIN  = ..\win\tty   # windows files (wintty)
  863. XGAMEFILE = $(GAMEDIR)\$(GAME).exe # whole thing
  864. X
  865. XRANDOM = ..\sys\share\random.o
  866. X#RANDOM = 
  867. X
  868. X#
  869. X#  Uncomment the next two lines _ONLY_ if you do not want any
  870. X#  debug capability in the object files, or in the NetHack executable.
  871. X#cdebug =
  872. X#linkdebug =
  873. X
  874. X#
  875. X#  The default make target (so just typing 'nmake' is useful).
  876. X#
  877. X
  878. Xdefault : $(GAMEFILE)
  879. X
  880. X######################################################################
  881. X#
  882. X#  Nothing below this line should have to be changed.
  883. X#
  884. X#  Other things that have to be reconfigured are in
  885. X#       config.h, pccconf.h and possibly system.h.
  886. X#
  887. X
  888. X#       This line should not be deleted.
  889. X
  890. XNTSUB = -DWIN32CON
  891. X#
  892. X#  Make Rules.
  893. X#
  894. X
  895. X.SUFFIXES:  .exe .o .c .y .l
  896. X
  897. X.c.o:
  898. X    $(cc) $(cflags) $(NTSUB) -I$(INCL)  $(cvars) $(cdebug) -Fo$*.o $*.c
  899. X
  900. X
  901. X#
  902. X#  Object files for the game itself.
  903. X#
  904. X
  905. XVOBJ01 = allmain.o  alloc.o    $(RANDOM)  apply.o    artifact.o  attrib.o
  906. XVOBJ02 = ball.o     bones.o    botl.o     cmd.o      dbridge.o
  907. XVOBJ03 = decl.o     detect.o   display.o  do.o       do_name.o
  908. XVOBJ04 = do_wear.o  dog.o      dogmove.o  dokick.o   dothrow.o
  909. XVOBJ05 = drawing.o  dungeon.o  eat.o      end.o      engrave.o
  910. XVOBJ06 = exper.o    explode.o  extralev.o files.o    fountain.o
  911. XVOBJ07 = hack.o     hacklib.o  invent.o   lock.o
  912. XVOBJ08 = mail.o     main.o     makemon.o  mcastu.o   mhitm.o
  913. XVOBJ09 = mhitu.o    minion.o   mkmap.o    mklev.o    mkmaze.o
  914. XVOBJ10 = mkobj.o    mkroom.o   mon.o      mondata.o  monmove.o
  915. XVOBJ11 = monst.o    monstr.o   mplayer.o  mthrowu.o  muse.o
  916. XVOBJ12 = music.o    o_init.o   objects.o  objnam.o   options.o
  917. XVOBJ13 = pickup.o   pline.o    polyself.o potion.o   quest.o
  918. XVOBJ14 = questpgr.o pager.o    pray.o     priest.o   read.o
  919. XVOBJ15 = rect.o     restore.o  rip.o      rnd.o      rumors.o
  920. XVOBJ16 = save.o     shk.o      shknam.o   sit.o      sounds.o
  921. XVOBJ17 = sp_lev.o   spell.o    steal.o    timeout.o
  922. XVOBJ18 = topten.o   track.o    trap.o     u_init.o
  923. XVOBJ19 = uhitm.o    vault.o    vision.o   vis_tab.o  weapon.o
  924. XVOBJ20 = were.o     wield.o    windows.o  wizard.o
  925. XVOBJ21 = worm.o     worn.o     write.o    zap.o
  926. XWOBJ   = topl.o     getline.o  wintty.o
  927. XSOBJ   = winnt.o    sys.o      tty.o      unix.o
  928. XVVOBJ  = version.o
  929. X
  930. X
  931. XVOBJ   = $(VOBJ01) $(VOBJ02) $(VOBJ03) $(VOBJ04) $(VOBJ05) \
  932. X         $(VOBJ06) $(VOBJ07) $(VOBJ08) $(VOBJ09) $(VOBJ10) \
  933. X         $(VOBJ11) $(VOBJ12) $(VOBJ13) $(VOBJ14) $(VOBJ15) \
  934. X         $(VOBJ16) $(VOBJ17) $(VOBJ18) $(VOBJ19) $(VOBJ20) \
  935. X         $(VOBJ21)
  936. X
  937. XALLOBJ = $(VOBJ) $(SOBJ) $(WOBJ) $(VVOBJ)
  938. X
  939. XDGN_FILE_H = $(INCL)\align.h    $(INCL)\dgn_file.h
  940. XDUNGEON_H  = $(INCL)\align.h    $(INCL)\dungeon.h
  941. XEMIN_H     = $(DUNGEON_H)       $(INCL)\emin.h
  942. XEPRI_H     = $(DUNGEON_H)       $(INCL)\align.h     $(INCL)\epri.h
  943. XESHK_H     = $(DUNGEON_H)       $(INCL)\eshk.h
  944. XMONDATA_H  = $(INCL)\align.h    $(INCL)\mondata.h
  945. XMONST_H    = $(INCL)\align.h    $(INCL)\monst.h
  946. XPERMONST_H = $(INCL)\monattk.h  $(INCL)\monflag.h   $(INCL)\align.h   \
  947. X             $(INCL)\permonst.h
  948. XRM_H       = $(INCL)\align.h    $(INCL)\rm.h
  949. XSP_LEV_H   = $(INCL)\align.h    $(INCL)\sp_lev.h
  950. XVAULT_H    = $(DUNGEON_H)       $(INCL)\vault.h
  951. XYOUPROP_H  = $(PERMONST_H)      $(MONDATA_H)        $(INCL)\prop.h    \
  952. X             $(INCL)\pm.h       $(INCL)\youprop.h
  953. XYOU_H      = $(MONST_H)         $(YOUPROP_H)        $(INCL)\align.h   \
  954. X             $(INCL)\attrib.h   $(INCL)\you.h
  955. XDISPLAY_H  = $(MONDATA_H)       $(INCL)\vision.h    $(INCL)\display.h
  956. XNTCONF_H   = $(INCL)\micro.h    $(INCL)\system.h    $(INCL)\ntconf.h
  957. XCONFIG_H   = $(GLOBAL_H)        $(INCL)\tradstdc.h  $(INCL)\config.h
  958. XDECL_H     = $(YOU_H)           $(INCL)\spell.h     $(INCL)\color.h   \
  959. X             $(INCL)\obj.h      $(INCL)\onames.h    $(INCL)\pm.h      \
  960. X             $(INCL)\decl.h
  961. XGLOBAL_H   = $(NTCONF_H)        $(INCL)\coord.h     $(INCL)\global.h
  962. XHACK_H     = $(CONFIG_H)        $(DUNGEON_H)        $(DECL_H)         \
  963. X             $(DISPLAY_H)       $(INCL)\monsym.h    $(INCL)\mkroom.h  \
  964. X             $(INCL)\objclass.h $(INCL)\trap.h      $(INCL)\flag.h    \
  965. X             $(RM_H)            $(INCL)\vision.h    $(INCL)\wintype.h \
  966. X             $(INCL)\engrave.h  $(INCL)\rect.h      $(INCL)\extern.h \
  967. X             $(INCL)\trampoli.h $(INCL)\hack.h
  968. X
  969. X
  970. X
  971. X#
  972. X#  The default target.
  973. X#
  974. X
  975. Xall :     $(GAMEFILE) install.tag
  976. X    @echo Done.
  977. X
  978. Xinstall: install.tag
  979. X
  980. Xinstall.tag:    $(GAMEFILE) $(DAT)\sp_lev.tag
  981. X    copy $(SYS)\termcap       $(GAMEDIR)
  982. X    copy $(DAT)\*.?           $(GAMEDIR)
  983. X    copy $(DAT)\*.dat         $(GAMEDIR)
  984. X    copy $(DAT)\*.lev         $(GAMEDIR)
  985. X    copy $(SYS)\NetHack.cnf   $(GAMEDIR)
  986. X    copy $(UTIL)\recover.exe  $(GAMEDIR)
  987. X    del   $(GAMEDIR)\makefile
  988. X    echo install done > install.tag
  989. X
  990. X#
  991. X#  The main target.
  992. X#
  993. X$(GAMEFILE) : $(GAME).res  $(UTIL)\utility.tag
  994. X    $(link) $(linkdebug) $(conflags) -out:$*.exe @$(GAME).res $(conlibs)
  995. X
  996. X$(GAME).res : $(ALLOBJ)
  997. X    @echo $(VOBJ01) > $@
  998. X    @echo $(VOBJ02) >> $@
  999. X    @echo $(VOBJ03) >> $@
  1000. X    @echo $(VOBJ04) >> $@
  1001. X    @echo $(VOBJ05) >> $@
  1002. X    @echo $(VOBJ06) >> $@
  1003. X    @echo $(VOBJ07) >> $@
  1004. X    @echo $(VOBJ08) >> $@
  1005. X    @echo $(VOBJ09) >> $@
  1006. X    @echo $(VOBJ10) >> $@
  1007. X    @echo $(VOBJ11) >> $@
  1008. X    @echo $(VOBJ12) >> $@
  1009. X    @echo $(VOBJ13) >> $@
  1010. X    @echo $(VOBJ14) >> $@
  1011. X    @echo $(VOBJ15) >> $@
  1012. X    @echo $(VOBJ16) >> $@
  1013. X    @echo $(VOBJ17) >> $@
  1014. X    @echo $(VOBJ18) >> $@
  1015. X    @echo $(VOBJ19) >> $@
  1016. X    @echo $(VOBJ20) >> $@
  1017. X    @echo $(VOBJ21) >> $@
  1018. X    @echo $(WOBJ) >> $@
  1019. X    @echo $(SOBJ) >> $@
  1020. X    @echo $(VVOBJ) >> $@
  1021. X
  1022. X
  1023. X#
  1024. X#  The following include files depend on makedefs to be created.
  1025. X#
  1026. X#  date.h should be remade every time any of the source or include
  1027. X#  files is modified.
  1028. X#
  1029. X
  1030. X$(INCL)\date.h : $(VOBJ)
  1031. X    $(UTIL)\makedefs -v
  1032. X
  1033. X$(INCL)\onames.h :
  1034. X    $(UTIL)\makedefs -o
  1035. X
  1036. X$(INCL)\pm.h :
  1037. X    $(UTIL)\makedefs -p
  1038. X
  1039. Xmain.o:  $(HACK_H) $(SYS)\pcmain.c
  1040. X    $(cc) $(cflags) $(NTSUB) -I$(INCL)  $(cvars) $(cdebug) -Fo$*.o $(SYS)\pcmain.c
  1041. X
  1042. Xtty.o:   $(HACK_H) $(INCL)\wintty.h $(MSYS)\nttty.c
  1043. X    $(cc) $(cflags) $(NTSUB) -I$(INCL)  $(cvars) $(cdebug) -Fo$*.o $(MSYS)\nttty.c
  1044. X
  1045. Xunix.o:  $(SYS)\pcunix.c $(HACK_H)
  1046. X    $(cc) $(cflags) $(NTSUB) -I$(INCL)  $(cvars) $(cdebug) -Fo$*.o $(SYS)\pcunix.c
  1047. X
  1048. Xsys.o : $(SYS)\pcsys.c $(HACK_H)
  1049. X    $(cc) $(cflags) $(NTSUB) -I$(INCL)  $(cvars) $(cdebug) -Fo$*.o $(SYS)\pcsys.c
  1050. X
  1051. Xwinnt.o : $(HACK_H) $(MSYS)\winnt.c
  1052. X    $(cc) $(cflags) $(NTSUB) -I$(INCL)  $(cvars) $(cdebug) -Fo$*.o $(MSYS)\winnt.c
  1053. X
  1054. X
  1055. X# some other files in other directories
  1056. X
  1057. Xgetline.o : $(WIN)\getline.c
  1058. X    $(cc) $(cflags) $(NTSUB) -I$(INCL)  $(cvars) $(cdebug) -Fo$*.o $(WIN)\$*.c
  1059. X
  1060. Xtermcap.o : $(CONFIG_H) $(WIN)\termcap.c
  1061. X    $(cc) $(cflags) $(NTSUB) -I$(INCL)  $(cvars) $(cdebug) -Fo$*.o $(WIN)\$*.c
  1062. X
  1063. Xtopl.o : $(CONFIG_H) $(WIN)\topl.c
  1064. X    $(cc) $(cflags) $(NTSUB) -I$(INCL)  $(cvars) $(cdebug) -Fo$*.o $(WIN)\$*.c
  1065. X
  1066. Xwintty.o : $(CONFIG_H) $(WIN)\wintty.c
  1067. X    $(cc) $(cflags) $(NTSUB) -I$(INCL)  $(cvars) $(cdebug) -Fo$*.o $(WIN)\$*.c
  1068. X
  1069. X#
  1070. X#  Housekeeping.
  1071. X#
  1072. X
  1073. Xclean :
  1074. X    -del *.o
  1075. X
  1076. Xspotless : clean
  1077. X    -del $(INCL)\date.h
  1078. X    -del $(INCL)\onames.h
  1079. X    -del $(INCL)\pm.h
  1080. X    -del $(INCL)\vis_tab.h
  1081. X    -del vis_tab.c
  1082. X    -del $(UTIL)\makedefs.exe
  1083. X    -del $(UTIL)\lev_comp.exe
  1084. X    -del $(UTIL)\dgn_comp.exe
  1085. X    -del $(UTIL)\*.res
  1086. X    -del $(UTIL)\*.def
  1087. X    -del $(UTIL)\*.map
  1088. X    -del $(DAT)\data
  1089. X    -del $(DAT)\rumors
  1090. X    -del $(UTIL)\guideboo.dvi
  1091. X
  1092. X# dependencies
  1093. Xallmain.o     : $(HACK_H)
  1094. Xalloc.o       : $(CONFIG_H)
  1095. Xapply.o       : $(HACK_H)
  1096. Xartifact.o    : $(HACK_H)       $(INCL)\artifact.h
  1097. Xattrib.o      : $(HACK_H)
  1098. Xbones.o       : $(HACK_H)
  1099. Xbotl.o        : $(HACK_H)
  1100. Xcmd.o         : $(HACK_H)       $(INCL)\func_tab.h
  1101. Xdbridge.o     : $(HACK_H)
  1102. Xdecl.o        : $(HACK_H)       $(INCL)\quest.h
  1103. Xdetect.o      : $(HACK_H)
  1104. Xdisplay.o     : $(HACK_H)
  1105. Xdo.o          : $(HACK_H)       $(INCL)\lev.h
  1106. Xdo_name.o     : $(HACK_H)
  1107. Xdo_wear.o     : $(HACK_H)
  1108. Xdog.o         : $(HACK_H)       $(INCL)\edog.h
  1109. Xdogmove.o     : $(HACK_H)       $(INCL)\mfndpos.h   $(INCL)\edog.h
  1110. Xdokick.o      : $(HACK_H)       $(ESHK_H)
  1111. Xdothrow.o     : $(HACK_H)
  1112. Xdrawing.o     : $(HACK_H)       $(INCL)\termcap.h
  1113. Xdungeon.o     : $(HACK_H)       $(DGN_FILE_H)
  1114. Xeat.o         : $(HACK_H)
  1115. Xend.o         : $(HACK_H)       $(ESHK_H)
  1116. Xengrave.o     : $(HACK_H)       $(INCL)\lev.h
  1117. Xexper.o       : $(HACK_H)
  1118. Xexplode.o     : $(HACK_H)
  1119. Xextralev.o    : $(HACK_H)
  1120. Xfiles.o       : $(HACK_H)
  1121. Xfountain.o    : $(HACK_H)
  1122. Xhack.o        : $(HACK_H)
  1123. Xinvent.o      : $(HACK_H)
  1124. Xlock.o        : $(HACK_H)
  1125. Xmail.o        : $(HACK_H)
  1126. Xhacklib.o     : $(HACK_H)
  1127. Xmakemon.o     : $(HACK_H)
  1128. Xmcastu.o      : $(HACK_H)
  1129. Xmhitm.o       : $(HACK_H)
  1130. Xmhitu.o       : $(HACK_H)
  1131. Xminion.o      : $(HACK_H)
  1132. Xmklev.o       : $(HACK_H)
  1133. Xmkmap.o       : $(HACK_H)
  1134. Xmkmaze.o      : $(HACK_H)
  1135. Xmkobj.o       : $(HACK_H)
  1136. Xmkroom.o      : $(HACK_H)
  1137. Xmon.o         : $(HACK_H)
  1138. Xmondata.o     : $(HACK_H)
  1139. Xmonmove.o     : $(HACK_H)       $(INCL)\mfndpos.h   $(INCL)\artifact.h
  1140. Xmonst.o       : $(CONFIG_H)     $(PERMONST_H)       $(INCL)\monsym.h     \
  1141. X                $(ESHK_H)       $(VAULT_H)          $(INCL)\color.h      \
  1142. X                $(EPRI_H)
  1143. Xmonstr.o      : $(CONFIG_H)
  1144. Xmplayer.o     : $(HACK_H)
  1145. Xmthrowu.o     : $(HACK_H)
  1146. Xmuse.o        : $(HACK_H)
  1147. Xmusic.o       : $(HACK_H)
  1148. Xo_init.o      : $(HACK_H)
  1149. Xobjects.o     : $(CONFIG_H)     $(INCL)\obj.h       $(INCL)\objclass.h   \
  1150. X                $(INCL)\prop.h  $(INCL)\color.h
  1151. Xobjnam.o      : $(HACK_H)
  1152. Xoptions.o     : $(HACK_H)       $(INCL)\termcap.h
  1153. Xpager.o       : $(HACK_H)
  1154. Xpickup.o      : $(HACK_H)
  1155. Xpline.o       : $(HACK_H)     $(EPRI_H)
  1156. Xpolyself.o    : $(HACK_H)
  1157. Xpotion.o      : $(HACK_H)
  1158. Xpriest.o      : $(HACK_H)     $(INCL)\mfndpos.h   $(ESHK_H) \
  1159. X                $(EPRI_H)     $(EMIN_H)
  1160. Xquest.o       : $(HACK_H)     $(INCL)\quest.h     $(INCL)\qtext.h
  1161. Xquestpgr.o    : $(HACK_H)     $(INCL)\quest.h     $(INCL)\qtext.h
  1162. Xpray.o        : $(HACK_H)
  1163. Xread.o        : $(HACK_H)
  1164. Xrect.o        : $(HACK_H)
  1165. Xrestore.o     : $(HACK_H)     $(INCL)\lev.h       $(INCL)\quest.h
  1166. Xrip.o         : $(HACK_H)
  1167. Xrnd.o         : $(HACK_H)
  1168. Xrumors.o      : $(HACK_H)
  1169. Xsave.o        : $(HACK_H)     $(INCL)\lev.h       $(INCL)\quest.h
  1170. Xsearch.o      : $(HACK_H)     $(INCL)\artifact.h
  1171. Xshk.o         : $(HACK_H)
  1172. Xshknam.o      : $(HACK_H)     $(ESHK_H)
  1173. Xsit.o         : $(HACK_H)
  1174. Xsounds.o      : $(HACK_H)     $(INCL)\edog.h      $(ESHK_H)
  1175. Xsp_lev.o      : $(HACK_H)
  1176. Xspell.o       : $(HACK_H)
  1177. Xsteal.o       : $(HACK_H)
  1178. Xtimeout.o     : $(HACK_H)
  1179. Xtopten.o      : $(HACK_H)
  1180. Xtrack.o       : $(HACK_H)
  1181. Xtrap.o        : $(HACK_H)     $(INCL)\edog.h
  1182. Xu_init.o      : $(HACK_H)
  1183. Xuhitm.o       : $(HACK_H)
  1184. Xvault.o       : $(HACK_H)     $(INCL)\vault.h
  1185. Xversion.o     : $(HACK_H)     $(INCL)\date.h      $(INCL)\patchlev.h
  1186. Xvision.o      : $(HACK_H)     $(INCL)\vis_tab.h
  1187. Xvis_tab.o     : $(HACK_H)
  1188. Xweapon.o      : $(HACK_H)
  1189. Xwere.o        : $(HACK_H)
  1190. Xwield.o       : $(HACK_H)
  1191. Xwindows.o     : $(HACK_H)
  1192. Xwintty.o      : $(HACK_H)
  1193. Xwizard.o      : $(HACK_H)
  1194. Xworm.o        : $(HACK_H)     $(INCL)\lev.h
  1195. Xworn.o        : $(HACK_H)
  1196. Xwrite.o       : $(HACK_H)
  1197. Xzap.o         : $(HACK_H)
  1198. END_OF_FILE
  1199. if test 12159 -ne `wc -c <'sys/winnt/Makefile.src'`; then
  1200.     echo shar: \"'sys/winnt/Makefile.src'\" unpacked with wrong size!
  1201. fi
  1202. # end of 'sys/winnt/Makefile.src'
  1203. if test -f 'sys/winnt/nttty.c' -a "${1}" != "-c" ; then 
  1204.   echo shar: Renaming existing file \"'sys/winnt/nttty.c'\" to \"'sys/winnt/nttty.c.orig'\"
  1205.   mv -f 'sys/winnt/nttty.c' 'sys/winnt/nttty.c.orig'
  1206. fi
  1207. echo shar: Extracting \"'sys/winnt/nttty.c'\" \(12579 characters\)
  1208. sed "s/^X//" >'sys/winnt/nttty.c' <<'END_OF_FILE'
  1209. X/*    SCCS Id: @(#)nttty.c    3.1    90/22/02
  1210. X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1211. X/* NetHack may be freely redistributed.  See license for details. */
  1212. X
  1213. X/* tty.c - (Windows NT) version */
  1214. X/*                                                  
  1215. X * Initial Creation - Michael Allison January 31/93 
  1216. X *
  1217. X */
  1218. X
  1219. X#ifdef WIN32CON
  1220. X
  1221. X#define NEED_VARARGS /* Uses ... */    /* comment line for pre-compiled headers */
  1222. X#include "hack.h"
  1223. X#include "wintty.h"
  1224. X#include "termcap.h"
  1225. X#include <windows.h>
  1226. X#include <wincon.h>
  1227. X#include <sys\types.h>
  1228. X#include <sys\stat.h>
  1229. X/* #include <conio.h> */
  1230. X
  1231. Xvoid FDECL(cmov, (int, int));
  1232. Xvoid FDECL(nocmov, (int, int));
  1233. Xvoid FDECL(xputspecl, (char *));
  1234. Xvoid FDECL(xputcolor, (char));
  1235. X
  1236. X/*
  1237. X * The following WIN32 Console API routines are used in this file.
  1238. X *
  1239. X * CreateFile
  1240. X * GetConsoleScreenBufferInfo
  1241. X * GetStdHandle
  1242. X * SetConsoleCursorPosition
  1243. X * SetConsoleTextAttribute
  1244. X * PeekConsoleInput
  1245. X * ReadConsoleInput
  1246. X * WriteConsoleOutputCharacter
  1247. X */
  1248. X
  1249. X/* Win32 Console handles for input and output */
  1250. XHANDLE hConIn;
  1251. XHANDLE hConOut;
  1252. X
  1253. X/* Win32 Screen buffer,coordinate,console I/O information */
  1254. XCONSOLE_SCREEN_BUFFER_INFO csbi;
  1255. XCOORD ntcoord;
  1256. XINPUT_RECORD ir;
  1257. X
  1258. X/* Flag for whether NetHack was launched via progman, not command line.
  1259. X * The reason we care at all, is so that we can get
  1260. X * a final RETURN at the end of the game when launched from progman
  1261. X * to prevent the scoreboard (or panic message :-| from vanishing
  1262. X * immediately after it is displayed, yet not bother when started
  1263. X * from the command line. 
  1264. X */
  1265. Xint ProgmanLaunched;
  1266. X
  1267. X    /* (see termcap.h) -- CM, ND, CD, HI,HE, US,UE, ul_hack */
  1268. Xstruct tc_lcl_data tc_lcl_data = { 0, 0, 0, 0,0, 0,0, FALSE };
  1269. XSTATIC_VAR char *HO, *CL, *CE, *UP, *XD, *BC, *SO, *SE, *TI, *TE;
  1270. XSTATIC_VAR char *VS, *VE;
  1271. X
  1272. X#ifdef TEXTCOLOR
  1273. Xchar *hilites[MAXCOLORS]; /* terminal escapes for the various colors */
  1274. Xstatic void NDECL(init_hilite);
  1275. XSTATIC_VAR char *MD;
  1276. X#endif
  1277. X
  1278. Xstatic char *KS = NULL, *KE = NULL;    /* keypad sequences */
  1279. Xstatic char nullstr[] = "";
  1280. Xchar erase_char,kill_char;
  1281. X
  1282. X/* STATIC_VAR char tgotobuf[20]; */
  1283. X/* #define tgoto(fmt, x, y)    (Sprintf(tgotobuf, fmt, y+1, x+1), tgotobuf) */
  1284. X#define tgoto(fmt, x, y) gotoxy(x,y)
  1285. X/*
  1286. X * Get initial state of terminal, set ospeed (for termcap routines)
  1287. X * and switch off tab expansion if necessary.
  1288. X * Called by startup() in termcap.c and after returning from ! or ^Z
  1289. X */
  1290. Xvoid
  1291. Xgettty(){
  1292. X    register int i;
  1293. X
  1294. X    erase_char = '\b';
  1295. X    kill_char = 21;        /* cntl-U */
  1296. X    flags.cbreak = TRUE;
  1297. X    TI = VS = VE = TE = nullstr;
  1298. X    HO = "\033\001";
  1299. X    CL = "\033\002";        /* the VT52 termcap */
  1300. X    CE = "\033\003";
  1301. X    UP = "\033\004";
  1302. X    CM = "\033\005";    /* used with function tgoto() */
  1303. X    ND = "\033\006";
  1304. X    XD = "\033\007";
  1305. X    BC = "\033\010";
  1306. X    SO = "\033\011";
  1307. X    SE = "\033\012";
  1308. X    /* HI and HE will be updated in init_hilite if we're using color */
  1309. X    HI = "\033\013";
  1310. X    HE = "\033\014";
  1311. X# ifdef TEXTCOLOR
  1312. X    for (i = 0; i < MAXCOLORS / 2; i++)
  1313. X    {
  1314. X         hilites[i|BRIGHT] = (char *) alloc(sizeof("\033\015\001"));
  1315. X         hilites[i] = (char *) alloc(sizeof("\033\015\001"));
  1316. X    }
  1317. X    init_hilite();
  1318. X# endif
  1319. X}
  1320. X
  1321. X/* reset terminal to original state */
  1322. Xvoid
  1323. Xsettty(s)
  1324. Xconst char *s;
  1325. X{
  1326. X    end_screen();
  1327. X    if(s) raw_print(s);
  1328. X}
  1329. X
  1330. X/* called by init_nhwindows() and resume_nhwindows() */
  1331. Xvoid
  1332. Xsetftty()
  1333. X{
  1334. X    start_screen();
  1335. X}
  1336. X
  1337. Xint
  1338. Xtgetch()
  1339. X{
  1340. X    int ch;
  1341. X    int valid = 0;
  1342. X    int metaflags = 0;
  1343. X    int count;
  1344. X
  1345. X    valid = 0;
  1346. X    while (!valid)
  1347. X    {
  1348. X        ReadConsoleInput(hConIn,&ir,1,&count);
  1349. X        /* We only care about ascii press-down KEY_EVENTs */
  1350. X        if ((ir.EventType == KEY_EVENT) &&
  1351. X           (ir.Event.KeyEvent.bKeyDown) &&    
  1352. X           (ir.Event.KeyEvent.uChar.AsciiChar)) valid = 1;
  1353. X    }
  1354. X    metaflags = ir.Event.KeyEvent.dwControlKeyState;
  1355. X    /*
  1356. X     * metaflags can be checked to see if various special
  1357. X         * keys were pressed at the same time as the key.
  1358. X         * Currently we are using the ALT keys only.
  1359. X     *
  1360. X     *           RIGHT_ALT_PRESSED, LEFT_ALT_PRESSED,
  1361. X         *           RIGHT_CTRL_PRESSED, LEFT_CTRL_PRESSED,
  1362. X         *           SHIFT_PRESSED,NUMLOCK_ON, SCROLLLOCK_ON,
  1363. X         *           CAPSLOCK_ON, ENHANCED_KEY
  1364. X         *
  1365. X     * are all valid bit masks to use on metaflags
  1366. X         * eg. (metaflags & LEFT_CTRL_PRESSED) is true if the
  1367. X         *      left control key was pressed with the keystroke.
  1368. X         */
  1369. X    ch = (ir.Event.KeyEvent.uChar.AsciiChar == '\r') ?
  1370. X             '\n' :ir.Event.KeyEvent.uChar.AsciiChar;
  1371. X    if (metaflags & (LEFT_ALT_PRESSED|RIGHT_ALT_PRESSED))
  1372. X       ch = tolower(ch) | 0x080;
  1373. X    return ch;
  1374. X}
  1375. X
  1376. Xint
  1377. Xkbhit()
  1378. X{
  1379. X    int done = 0;    /* true =  "stop searching"        */
  1380. X    int retval;    /* true =  "we had a match"        */
  1381. X    int count;    /* scratch-pad area for API call   */
  1382. X
  1383. X    done = 0;
  1384. X    retval = 0;
  1385. X    while (!done)
  1386. X    {
  1387. X        count = 0;
  1388. X        PeekConsoleInput(hConIn,&ir,1,&count);
  1389. X        if (count > 0)
  1390. X            {
  1391. X        /* Make sure its an ascii press-down KEY_EVENT */
  1392. X            if ((ir.EventType == KEY_EVENT) &&
  1393. X            (ir.Event.KeyEvent.bKeyDown) &&    
  1394. X            (ir.Event.KeyEvent.uChar.AsciiChar))
  1395. X            { 
  1396. X             /* This is what we were looking for        */
  1397. X             done = 1;            /* Stop looking         */
  1398. X             retval = 1;        /* Found what we sought */
  1399. X            }
  1400. X        /* Discard it, its an insignificant event */
  1401. X            else ReadConsoleInput(hConIn,&ir,1,&count);
  1402. X        }
  1403. X        else  /* There are no events in console event queue*/
  1404. X        {
  1405. X        done = 1;      /* Stop looking               */
  1406. X        retval = 0;      /* No ascii press-down key    */
  1407. X        }
  1408. X    }
  1409. X    return retval;
  1410. X}
  1411. X
  1412. X/* called by init_tty in wintty.c for WIN32CON port only */
  1413. Xvoid
  1414. Xnttty_open()
  1415. X{
  1416. X        HANDLE hStdOut;
  1417. X
  1418. X        /* The following 6 lines of code were suggested by 
  1419. X         * Bob Landau of Microsoft WIN32 Developer support,
  1420. X         * as the only current means of determining whether
  1421. X         * we were launched from the command prompt, or from
  1422. X         * the NT program manager. M. Allison
  1423. X         */
  1424. X        hStdOut = GetStdHandle( STD_OUTPUT_HANDLE );
  1425. X        GetConsoleScreenBufferInfo( hStdOut, &csbi);
  1426. X        ProgmanLaunched = ((csbi.dwCursorPosition.X == 0) &&
  1427. X                           (csbi.dwCursorPosition.Y == 0));
  1428. X        if ((csbi.dwSize.X <= 0) || (csbi.dwSize.Y <= 0))
  1429. X            ProgmanLaunched = 0;
  1430. X
  1431. X
  1432. X        /* Obtain handles for the standard Console I/O devices */
  1433. X    hConIn = CreateFile("CONIN$",
  1434. X            GENERIC_READ |GENERIC_WRITE,
  1435. X            FILE_SHARE_READ |FILE_SHARE_WRITE,
  1436. X            NULL, OPEN_EXISTING, 0, NULL);                    
  1437. X
  1438. X    hConOut = CreateFile("CONOUT$",
  1439. X            GENERIC_READ |GENERIC_WRITE,
  1440. X            FILE_SHARE_READ |FILE_SHARE_WRITE,
  1441. X            NULL, OPEN_EXISTING, 0, NULL);                    
  1442. X    get_scr_size();
  1443. X}
  1444. X
  1445. Xvoid
  1446. Xgotoxy(x,y)
  1447. Xint x,y;
  1448. X{
  1449. X    COORD gtcoord;
  1450. X
  1451. X    x--; y--;            /* (0,0) is upper right corner */
  1452. X    gtcoord.X = x;
  1453. X    gtcoord.Y = y;
  1454. X    SetConsoleCursorPosition(hConOut, gtcoord);
  1455. X}
  1456. X
  1457. Xvoid
  1458. Xget_scr_size()
  1459. X{
  1460. X    if (GetConsoleScreenBufferInfo(hConOut,&csbi))
  1461. X    {
  1462. X        LI = csbi.dwSize.Y;
  1463. X        CO = csbi.dwSize.X;
  1464. X    }
  1465. X    else
  1466. X    {    
  1467. X        LI = 25;
  1468. X        CO = 80;
  1469. X    }
  1470. X}
  1471. X
  1472. Xvoid
  1473. Xnttty_rubout()
  1474. X{
  1475. X    DWORD count;
  1476. X
  1477. X    GetConsoleScreenBufferInfo(hConOut,&csbi);
  1478. X    if (csbi.dwCursorPosition.X > 0)
  1479. X        ntcoord.X = csbi.dwCursorPosition.X-1;
  1480. X    ntcoord.Y = csbi.dwCursorPosition.Y;
  1481. X    WriteConsoleOutputCharacter(hConOut,' ',1,ntcoord,&count);
  1482. X    SetConsoleCursorPosition(hConOut,ntcoord);    
  1483. X}
  1484. X
  1485. X/* fatal error */
  1486. X/*VARARGS1*/
  1487. X
  1488. Xvoid
  1489. Xerror VA_DECL(const char *,s)
  1490. X    VA_START(s);
  1491. X    VA_INIT(s, const char *);
  1492. X    /* error() may get called before tty is initialized */
  1493. X    if (flags.window_inited) end_screen();
  1494. X    putchar('\n');
  1495. X    Vprintf(s,VA_ARGS);
  1496. X    putchar('\n');
  1497. X    VA_END();
  1498. X    exit(1);
  1499. X}
  1500. X
  1501. X
  1502. Xvoid
  1503. Xtty_startup(wid, hgt)
  1504. X    int *wid, *hgt;
  1505. X{
  1506. X    register int i;
  1507. X
  1508. X    *wid = CO;
  1509. X    *hgt = LI;
  1510. X}
  1511. X
  1512. Xvoid
  1513. Xtty_number_pad(state)
  1514. Xint state;
  1515. X{
  1516. X}
  1517. X
  1518. Xvoid
  1519. Xtty_start_screen()
  1520. X{
  1521. X/*    xputs(TI);
  1522. X *    xputs(VS);
  1523. X */
  1524. X    if (flags.num_pad) tty_number_pad(1);    /* make keypad send digits */
  1525. X}
  1526. X
  1527. Xvoid
  1528. Xtty_end_screen()
  1529. X{
  1530. X    clear_screen();
  1531. X}
  1532. X
  1533. X/* Cursor movements */
  1534. X
  1535. Xvoid
  1536. Xnocmov(x, y)
  1537. Xint x,y;
  1538. X{
  1539. X    ntcoord.X = x;
  1540. X    ntcoord.Y = y;
  1541. X    SetConsoleCursorPosition(hConOut,ntcoord);
  1542. X}
  1543. X
  1544. Xvoid
  1545. Xcmov(x, y)
  1546. Xregister int x, y;
  1547. X{
  1548. X    ntcoord.X = x;
  1549. X    ntcoord.Y = y;
  1550. X    SetConsoleCursorPosition(hConOut,ntcoord);
  1551. X    ttyDisplay->cury = y;
  1552. X    ttyDisplay->curx = x;
  1553. X}
  1554. X
  1555. Xvoid
  1556. Xxputc(c)
  1557. Xchar c;
  1558. X{
  1559. X    int count;
  1560. X
  1561. X    ntcoord.X = ttyDisplay->curx;
  1562. X    ntcoord.Y = ttyDisplay->cury;
  1563. X    WriteConsoleOutputCharacter(hConOut,&c,1,ntcoord,&count);
  1564. X}
  1565. X
  1566. Xvoid
  1567. Xxputs(s)
  1568. Xconst char *s;
  1569. X{
  1570. X    int count;
  1571. X    if (s[0]=='\033')xputspecl(s);
  1572. X    else
  1573. X    {
  1574. X        ntcoord.X = ttyDisplay->curx;
  1575. X        ntcoord.Y = ttyDisplay->cury;
  1576. X        WriteConsoleOutputCharacter(hConOut,s,
  1577. X            strlen(s),ntcoord,&count);
  1578. X    }
  1579. X}
  1580. Xvoid
  1581. Xcl_end()
  1582. X{
  1583. X        int count;
  1584. X
  1585. X        ntcoord.X = ttyDisplay->curx;
  1586. X        ntcoord.Y = ttyDisplay->cury;
  1587. X        FillConsoleOutputCharacter(hConOut,' ',
  1588. X            CO - ntcoord.X,ntcoord,&count);
  1589. X        tty_curs(BASE_WINDOW, (int)ttyDisplay->curx+1,
  1590. X                        (int)ttyDisplay->cury);
  1591. X}
  1592. X
  1593. X
  1594. Xvoid
  1595. Xclear_screen()
  1596. X{
  1597. X    int count;
  1598. X
  1599. X    ntcoord.X = 0;
  1600. X    ntcoord.Y = 0;
  1601. X    FillConsoleOutputCharacter(hConOut,' ',CO * LI,
  1602. X        ntcoord, &count);
  1603. X    home();
  1604. X}
  1605. X
  1606. X
  1607. Xvoid
  1608. Xhome()
  1609. X{
  1610. X    tty_curs(BASE_WINDOW, 1, 0);    /* using UP ... */
  1611. X    ttyDisplay->curx = ttyDisplay->cury = 0;
  1612. X}
  1613. X
  1614. Xvoid
  1615. Xstandoutbeg()
  1616. X{
  1617. X    /* Mix all three colors for white */
  1618. X    SetConsoleTextAttribute(hConOut,
  1619. X        FOREGROUND_RED|FOREGROUND_BLUE|
  1620. X        FOREGROUND_GREEN|FOREGROUND_INTENSITY );
  1621. X}
  1622. X
  1623. Xvoid
  1624. Xstandoutend()
  1625. X{
  1626. X    /* Mix all three colors for white */
  1627. X    SetConsoleTextAttribute(hConOut,
  1628. X        FOREGROUND_RED|FOREGROUND_BLUE|
  1629. X        FOREGROUND_GREEN);
  1630. X}
  1631. X
  1632. X#if 0    /* if you need one of these, uncomment it (here and in extern.h) */
  1633. Xvoid
  1634. Xrevbeg()
  1635. X{
  1636. X    if(MR) xputs(MR);
  1637. X}
  1638. X
  1639. Xvoid
  1640. Xboldbeg()
  1641. X{
  1642. X    if(MD) xputs(MD);
  1643. X}
  1644. X
  1645. Xvoid
  1646. Xblinkbeg()
  1647. X{
  1648. X    if(MB) xputs(MB);
  1649. X}
  1650. X
  1651. Xvoid
  1652. Xdimbeg()
  1653. X/* not in most termcap entries */
  1654. X{
  1655. X    if(MH) xputs(MH);
  1656. X}
  1657. X
  1658. Xvoid
  1659. Xm_end()
  1660. X{
  1661. X    if(ME) xputs(ME);
  1662. X}
  1663. X#endif /* 0              */
  1664. X
  1665. X
  1666. Xvoid
  1667. Xbacksp()
  1668. X{
  1669. X    nttty_rubout();
  1670. X}
  1671. X
  1672. Xvoid
  1673. Xtty_nhbell()
  1674. X{
  1675. X    if (flags.silent) return;
  1676. X    Beep(8000,500);
  1677. X}
  1678. X
  1679. X
  1680. Xvoid
  1681. Xtty_delay_output()
  1682. X{
  1683. X    /* delay 50 ms - could also use a 'nap'-system call */
  1684. X    /* BUG: if the padding character is visible, as it is on the 5620
  1685. X       then this looks terrible. */
  1686. X}
  1687. X
  1688. Xvoid
  1689. Xcl_eos()            /* free after Robert Viduya */
  1690. X{                /* must only be called with curx = 1 */
  1691. X
  1692. X        register int cy = ttyDisplay->cury+1;
  1693. X        while(cy <= LI-2) {
  1694. X            cl_end();
  1695. X            xputc('\n');
  1696. X            cy++;
  1697. X        }
  1698. X        cl_end();
  1699. X        tty_curs(BASE_WINDOW, (int)ttyDisplay->curx+1,
  1700. X                        (int)ttyDisplay->cury);
  1701. X}
  1702. X
  1703. X/* Because the tty port assumes that hilites etc.
  1704. X   can be done by blasting sequences to the screen
  1705. X   and code to do that is scattered about, this
  1706. X   routine will parse our special versions of those
  1707. X   sequences to ensure compatibility.
  1708. X*/
  1709. Xvoid
  1710. Xxputspecl(char *x)
  1711. X{
  1712. X      switch (x[1])
  1713. X      {
  1714. X    case 1:        /* HO */
  1715. X        home();
  1716. X        break;
  1717. X    case 2:        /* CL */
  1718. X    case 3:        /* CE */
  1719. X    case 4:        /* UP */
  1720. X    case 5:        /* CM */
  1721. X    case 6:        /* ND */
  1722. X    case 7:        /* XD */
  1723. X    case 8:        /* BC */
  1724. X    case 9:        /* SO */
  1725. X    case 10:    /* SE */
  1726. X        impossible("Unexpected termcap usage under NT");
  1727. X        break;
  1728. X    case 11:    /* HI */
  1729. X        standoutbeg();
  1730. X        break;
  1731. X    case 12:    /* HE */
  1732. X        standoutend();
  1733. X        break;
  1734. X#ifdef TEXTCOLOR
  1735. X    case 13:
  1736. X        xputcolor(x[2]);
  1737. X        break;
  1738. X#endif
  1739. X    default:
  1740. X        impossible("bad escape sequence");
  1741. X      }
  1742. X}
  1743. X
  1744. X#ifdef TEXTCOLOR
  1745. X/*
  1746. X * BLACK        0
  1747. X * RED            1
  1748. X * GREEN        2
  1749. X * BROWN        3    low-intensity yellow
  1750. X * BLUE            4
  1751. X * MAGENTA         5
  1752. X * CYAN            6
  1753. X * GRAY            7    low-intensity white
  1754. X * NO_COLOR        8
  1755. X * ORANGE_COLORED    9
  1756. X * BRIGHT_GREEN        10
  1757. X * YELLOW        11
  1758. X * BRIGHT_BLUE        12
  1759. X * BRIGHT_MAGENTA      13
  1760. X * BRIGHT_CYAN        14
  1761. X * WHITE        15
  1762. X * MAXCOLORS        16
  1763. X * BRIGHT        8
  1764. X */
  1765. X
  1766. Xvoid
  1767. Xxputcolor(char x)
  1768. X{
  1769. X    WORD attr;
  1770. X
  1771. X    if ((x >= 0) && (x <= FOREGROUND_GREEN|FOREGROUND_BLUE|
  1772. X             FOREGROUND_RED|FOREGROUND_INTENSITY)) {
  1773. X        attr = x;
  1774. X        SetConsoleTextAttribute(hConOut,attr);
  1775. X    }
  1776. X    else impossible("xputcolor: bad color value");
  1777. X}
  1778. X
  1779. X#define CMAP(a,b) Sprintf(hilites[a],"\033\015%c",b)
  1780. Xstatic void
  1781. Xinit_hilite()
  1782. X{
  1783. X    CMAP(BLACK,FOREGROUND_GREEN|FOREGROUND_BLUE|FOREGROUND_RED);
  1784. X    CMAP(RED,FOREGROUND_RED);
  1785. X    CMAP(GREEN,FOREGROUND_GREEN);
  1786. X    CMAP(BROWN,FOREGROUND_GREEN|FOREGROUND_RED);
  1787. X    CMAP(BLUE,FOREGROUND_BLUE|FOREGROUND_INTENSITY);
  1788. X    CMAP(MAGENTA,FOREGROUND_BLUE|FOREGROUND_RED);
  1789. X    CMAP(CYAN,FOREGROUND_GREEN|FOREGROUND_BLUE);
  1790. X    CMAP(GRAY,FOREGROUND_GREEN|FOREGROUND_RED|FOREGROUND_BLUE);
  1791. X    CMAP(BRIGHT,FOREGROUND_GREEN|FOREGROUND_BLUE|FOREGROUND_RED|FOREGROUND_INTENSITY);
  1792. X    CMAP(ORANGE_COLORED,FOREGROUND_RED|FOREGROUND_INTENSITY);
  1793. X    CMAP(BRIGHT_GREEN,FOREGROUND_GREEN|FOREGROUND_INTENSITY);
  1794. X    CMAP(YELLOW,FOREGROUND_GREEN|FOREGROUND_RED|FOREGROUND_INTENSITY);
  1795. X    CMAP(BRIGHT_BLUE,FOREGROUND_BLUE|FOREGROUND_INTENSITY);
  1796. X    CMAP(BRIGHT_MAGENTA,FOREGROUND_BLUE|FOREGROUND_RED|FOREGROUND_INTENSITY);
  1797. X    CMAP(BRIGHT_CYAN,FOREGROUND_GREEN|FOREGROUND_BLUE);
  1798. X    CMAP(WHITE,FOREGROUND_GREEN|FOREGROUND_BLUE|FOREGROUND_RED|FOREGROUND_INTENSITY);
  1799. X}
  1800. X
  1801. X#endif /* TEXTCOLOR */
  1802. X
  1803. X#endif /* WIN32CON */
  1804. END_OF_FILE
  1805. if test 12579 -ne `wc -c <'sys/winnt/nttty.c'`; then
  1806.     echo shar: \"'sys/winnt/nttty.c'\" unpacked with wrong size!
  1807. fi
  1808. # end of 'sys/winnt/nttty.c'
  1809. echo shar: End of archive 30 \(of 31\).
  1810. cp /dev/null ark30isdone
  1811. MISSING=""
  1812. 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 ; do
  1813.     if test ! -f ark${I}isdone ; then
  1814.     MISSING="${MISSING} ${I}"
  1815.     fi
  1816. done
  1817. if test "${MISSING}" = "" ; then
  1818.     echo You have unpacked all 31 archives.
  1819.     echo "Now execute 'patchit.sh'"
  1820.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1821. else
  1822.     echo You still need to unpack the following archives:
  1823.     echo "        " ${MISSING}
  1824. fi
  1825. ##  End of shell archive.
  1826. exit 0
  1827.