home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume7 / nethack3 / patch3b < prev    next >
Encoding:
Internet Message Format  |  1989-09-11  |  38.5 KB

  1. Path: uunet!zephyr.ens.tek.com!tekgen!tekred!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v08i017:  NetHack3 -  display oriented dungeons & dragons (Ver. 3.0), Patch3b
  5. Message-ID: <4536@tekred.CNA.TEK.COM>
  6. Date: 7 Sep 89 21:48:39 GMT
  7. Sender: nobody@tekred.CNA.TEK.COM
  8. Lines: 1552
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: Izchak Miller <izchak@linc.cis.upenn.edu>
  12. Posting-number: Volume 8, Issue 17
  13. Archive-name: NetHack3/Patch3b
  14. Patch-To: NetHack3: Volume 7, Issue 56-93
  15.  
  16. #! /bin/sh
  17. # This is a shell archive.  Remove anything before this line, then unpack
  18. # it by saving it into a file and typing "sh file".  To overwrite existing
  19. # files, type "sh file -c".  You can also feed this as standard input via
  20. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  21. # will see the following message at the end:
  22. #        "End of archive 2 (of 6)."
  23. # Contents:  UPDATE3 patch03b
  24. # Wrapped by billr@saab on Thu Sep  7 14:38:20 1989
  25. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  26. if test -f 'UPDATE3' -a "${1}" != "-c" ; then 
  27.   echo shar: Will not clobber existing file \"'UPDATE3'\"
  28. else
  29. echo shar: Extracting \"'UPDATE3'\" \(1310 characters\)
  30. sed "s/^X//" >'UPDATE3' <<'END_OF_FILE'
  31. XDate: Thu, 7 Sep 89 09:38:37 EDT
  32. XFrom: Izchak Miller <izchak@linc.cis.upenn.edu>
  33. X
  34. XThe main changes included in patch kit 3 are as follows:
  35. X
  36. XA few new objects were added to objects.c, so old save/bones files 
  37. Xshould be thrown out.
  38. X
  39. XPrototypes were adapted to satisfy ANSI C.  Hopefully, we will not see
  40. Xanymore postings which helpfully fix prototypes for ANSI, while breaking
  41. Xthem for the MSDOS compilers they were, originally, set up for.
  42. X
  43. XUse of $(MAKE), and a better use of $PAGER, in scripts.
  44. X
  45. XImprovements to OS/2 and TOS code, including their Makefiles.
  46. X
  47. XGraphics setting was centralized.
  48. X
  49. XAlignment was added to artifacts, and their suitability was improved.
  50. X
  51. XDiscover mode games no longer use up bones files.
  52. X
  53. XSome excess 'register's that were giving Xenix trouble were removed.
  54. X
  55. XWe settled an (amusing) argument over "rights" to available bits which
  56. Xwas responsible (unintentionally) for ring-wielding bestowing
  57. Xlong-lasting intrinsic attributes.  
  58. X
  59. XIn addition, many bugs were fixed.  Among those were the problems
  60. Xwith polymorphing creatures that swallowed you, finishing with
  61. Xcontainers, having chains eaten, external pagers, statue weights, wishing
  62. Xloopholes, parsing endgame options, and monsters growing up.
  63. X
  64. XIn other words, this is a nuts and bolts patch, nothing dramatic but
  65. Xlots of cleanup.
  66. X
  67. END_OF_FILE
  68. if test 1310 -ne `wc -c <'UPDATE3'`; then
  69.     echo shar: \"'UPDATE3'\" unpacked with wrong size!
  70. fi
  71. # end of 'UPDATE3'
  72. fi
  73. if test -f 'patch03b' -a "${1}" != "-c" ; then 
  74.   echo shar: Will not clobber existing file \"'patch03b'\"
  75. else
  76. echo shar: Extracting \"'patch03b'\" \(34436 characters\)
  77. sed "s/^X//" >'patch03b' <<'END_OF_FILE'
  78. X*** others/Old/Makefile.os2    Wed Sep  6 15:28:55 1989
  79. X--- others/Makefile.os2    Mon Aug 21 12:24:24 1989
  80. X***************
  81. X*** 1,8 ****
  82. X! #    SCCS Id: @(#)Makefile.os2    3.0    89/08/10
  83. X  #    PC NetHack 3.0 Makefile for Microsoft(tm) C 5.1 and OS/2
  84. X  #
  85. X! #    NDMAKE ver 4.3+ is required, MS-MAKE does *not* work
  86. X  #
  87. X  # Large memory model
  88. X  CC    = cl
  89. X  LINK    = link
  90. X--- 1,16 ----
  91. X! #    SCCS Id: @(#)Makefile.os2    3.0    89/08/19
  92. X  #    PC NetHack 3.0 Makefile for Microsoft(tm) C 5.1 and OS/2
  93. X  #
  94. X! #    NDMAKE ver 4.3+ is required, MS-MAKE does not work
  95. X! #    without (probably large) modifications -- Timo Hakulinen
  96. X  #
  97. X+ #    Copy pctty.c, pcunix.c, pcmain.c, msdos.c and this file
  98. X+ #    (+ termcap sources if used) into $(SRC) directory, then
  99. X+ #    compile and link in real mode inside $(SRC).
  100. X+ #
  101. X+ #    To use CodeView define OS2_CODEVIEW in pcconf.h and set
  102. X+ #    HACKDIR (+ TERM and TERMCAP if used) in OS/2 config.sys.
  103. X+ #
  104. X  # Large memory model
  105. X  CC    = cl
  106. X  LINK    = link
  107. X***************
  108. X*** 50,58 ****
  109. X  # Optional high-quality BSD random number generation routines (see pcconf.h).
  110. X  # Set to nothing if not used.
  111. X  RANDOM = o\random.o
  112. X  
  113. X! # Termcap objs
  114. X! TERMOBJS= o\tgetent.o o\tgetflag.o o\tgetnum.o o\tgetstr.o o\tgoto.o o\tputs.o o\isdigit.o o\fgetlr.o
  115. X  
  116. X  # For NDMAKE, to handle the .o suffix.
  117. X  .SUFFIXES: .exe .o .c .y .l
  118. X--- 58,69 ----
  119. X  # Optional high-quality BSD random number generation routines (see pcconf.h).
  120. X  # Set to nothing if not used.
  121. X  RANDOM = o\random.o
  122. X+ #RANDOM=
  123. X  
  124. X! # Termcap objs. Set to nothing if TERMLIB not defined in pcconf.h. In that
  125. X! # case a dummy termlib.lib is created.
  126. X! #TERMOBJS= o\tgetent.o o\tgetflag.o o\tgetnum.o o\tgetstr.o o\tgoto.o o\tputs.o o\isdigit.o o\fgetlr.o
  127. X! TERMOBJS=
  128. X  
  129. X  # For NDMAKE, to handle the .o suffix.
  130. X  .SUFFIXES: .exe .o .c .y .l
  131. X***************
  132. X*** 111,118 ****
  133. X  $(GAMEDIR)\$(GAME).exe: o $(HOBJ) $(OS2DEFS) $(TERMLIB)
  134. X      $(LINK) $(HOBJ),$(GAMEDIR)\$(GAME),$(GAME),$(PLIBS) $(TERMLIB),$(OS2DEFS) $(LFLAGS) ;
  135. X  
  136. X! # NDMAKE automatically generates LINK response files, so you can
  137. X! # uncomment the second line if you are using NDMAKE.
  138. X  
  139. X  $(GAME): $(GAMEDIR)\$(GAME).exe
  140. X  $(GAME).exe: $(GAMEDIR)\$(GAME).exe
  141. X--- 122,128 ----
  142. X  $(GAMEDIR)\$(GAME).exe: o $(HOBJ) $(OS2DEFS) $(TERMLIB)
  143. X      $(LINK) $(HOBJ),$(GAMEDIR)\$(GAME),$(GAME),$(PLIBS) $(TERMLIB),$(OS2DEFS) $(LFLAGS) ;
  144. X  
  145. X! # NDMAKE automatically generates LINK and LIB response files
  146. X  
  147. X  $(GAME): $(GAMEDIR)\$(GAME).exe
  148. X  $(GAME).exe: $(GAMEDIR)\$(GAME).exe
  149. X***************
  150. X*** 186,192 ****
  151. X  # Secondary targets
  152. X  #
  153. X  
  154. X! auxil:    spec_levs
  155. X      xcopy $(AUX)\*. $(GAMEDIR)
  156. X  
  157. X  spec_levs: $(AUX)\castle.des $(AUX)\endgame.des $(AUX)\tower.des
  158. X--- 196,202 ----
  159. X  # Secondary targets
  160. X  #
  161. X  
  162. X! auxil:    spec_levs data rumors
  163. X      xcopy $(AUX)\*. $(GAMEDIR)
  164. X  
  165. X  spec_levs: $(AUX)\castle.des $(AUX)\endgame.des $(AUX)\tower.des
  166. X***************
  167. X*** 211,217 ****
  168. X      echo foo> $(GAMEDIR)\record
  169. X  
  170. X  clean:
  171. X!     del o\*.obj
  172. X      rmdir o
  173. X  
  174. X  spotless: clean
  175. X--- 221,227 ----
  176. X      echo foo> $(GAMEDIR)\record
  177. X  
  178. X  clean:
  179. X!     del o\*.o
  180. X      rmdir o
  181. X  
  182. X  spotless: clean
  183. X***************
  184. X*** 218,226 ****
  185. X      del $(INCL)\date.h
  186. X      del $(INCL)\onames.h
  187. X      del $(INCL)\pm.h
  188. X-     touch $(INCL)\date.h $(INCL)\onames.h $(INCL)\pm.h
  189. X      del makedefs.exe
  190. X!     if exist lev_comp.exe del lev_comp.exe
  191. X  
  192. X  #
  193. X  # Other dependencies
  194. X--- 228,243 ----
  195. X      del $(INCL)\date.h
  196. X      del $(INCL)\onames.h
  197. X      del $(INCL)\pm.h
  198. X      del makedefs.exe
  199. X!     del lev_comp.exe
  200. X!     del $(TERMLIB)
  201. X!     del *.def
  202. X!     del *.map
  203. X!     del $(AUX)\data
  204. X!     del $(AUX)\rumors
  205. X!     del castle
  206. X!     del endgame
  207. X!     del tower?
  208. X  
  209. X  #
  210. X  # Other dependencies
  211. X*** others/Old/Makefile.st    Wed Sep  6 15:29:25 1989
  212. X--- others/Makefile.st    Wed Sep  6 12:27:21 1989
  213. X***************
  214. X*** 8,20 ****
  215. X  #    the dependencies for monst1.o and monst2.o. If they ever change
  216. X  #    the loader, this kludge might break.
  217. X  #
  218. X- # MODEL = -mshort for 16 bit integers; then use -lcurses16 for TERMCAP
  219. X- # (I haven't tried this yet, and am not confident of its success.)
  220. X- #
  221. X  CC    = d:\gnu\bin\gcc.ttp
  222. X  LD    = d:\gnu\bin\gcc-ld.ttp
  223. X! MODEL    = 
  224. X! TERMCAP = -lcurses
  225. X  
  226. X  # Directories (makedefs hardcodes these, don't change them)
  227. X  INCL    = ..\include
  228. X--- 8,25 ----
  229. X  #    the dependencies for monst1.o and monst2.o. If they ever change
  230. X  #    the loader, this kludge might break.
  231. X  #
  232. X  CC    = d:\gnu\bin\gcc.ttp
  233. X  LD    = d:\gnu\bin\gcc-ld.ttp
  234. X! YACC    = d:\gnu\bin\bison.ttp -y
  235. X! LEX    = d:\gnu\bin\flex.ttp
  236. X! #
  237. X! # for 32 bit integers (slow, but type mismatches are no problem)
  238. X! # MODEL    =
  239. X! # TERMCAP = -lcurses
  240. X! #
  241. X! # for 16 bit integers (faster, but more finicky)
  242. X! MODEL    = -mshort
  243. X! TERMCAP = -lcurses16
  244. X  
  245. X  # Directories (makedefs hardcodes these, don't change them)
  246. X  INCL    = ..\include
  247. X***************
  248. X*** 89,95 ****
  249. X  
  250. X  $(GAME): $(GAMEDIR)\$(GAME).ttp
  251. X  
  252. X! all:    $(GAME) auxil
  253. X      @echo Done.
  254. X  
  255. X  makedefs.ttp:    $(MAKEOBJS)
  256. X--- 94,100 ----
  257. X  
  258. X  $(GAME): $(GAMEDIR)\$(GAME).ttp
  259. X  
  260. X! all:    $(GAME) lev_comp.ttp auxil
  261. X      @echo Done.
  262. X  
  263. X  makedefs.ttp:    $(MAKEOBJS)
  264. X***************
  265. X*** 105,115 ****
  266. X  lev_main.o:  $(HACK_H) $(INCL)\sp_lev.h
  267. X  
  268. X  # If you have yacc or lex programs, and make any changes,
  269. X! # add some .y.c and .l.c rules to your Make.ini.
  270. X! 
  271. X  lev_comp.c:  lev_comp.y
  272. X! lev_lex.c:  lev_comp.l
  273. X  
  274. X  #
  275. X  #    The following include files depend on makedefs to be created.
  276. X  #
  277. X--- 110,131 ----
  278. X  lev_main.o:  $(HACK_H) $(INCL)\sp_lev.h
  279. X  
  280. X  # If you have yacc or lex programs, and make any changes,
  281. X! # you'll need rules like these. The names of the output
  282. X! # files (e.g. lex,yy.c) vary widely among different ST implementations
  283. X! # of YACC and LEX.
  284. X! #
  285. X! # Also: for some reason the supplied lev_lex.c causes the GCC to abort
  286. X! # on my machine (maybe not enough memory?) when compiled with -mshort.
  287. X! # With MODEL=-mshort, I had to delete lev_lex.c and use these rules.
  288. X! #
  289. X  lev_comp.c:  lev_comp.y
  290. X!     $(YACC) -d lev_comp.y
  291. X!     mv y,tab.c lev_comp.c
  292. X!     mv y,tab.h ..\include\lev_comp.h
  293. X  
  294. X+ lev_lex.c:  lev_comp.l
  295. X+     $(LEX) lev_comp.l
  296. X+     mv lex,yy.c lev_lex.c
  297. X  #
  298. X  #    The following include files depend on makedefs to be created.
  299. X  #
  300. X***************
  301. X*** 151,156 ****
  302. X--- 167,178 ----
  303. X  rip.o:   $(HACK_H) 
  304. X      $(CC) -c $(CFLAGS) -fwritable-strings rip.c
  305. X  #
  306. X+ # GCC 1.35 + bones.c + -mshort + -O == incorrect code. Don't ask me why.
  307. X+ # So we just omit the -O on bones.c
  308. X+ #
  309. X+ bones.o: $(HACK_H)
  310. X+     $(CC) -c $(MODEL) -I$(INCL) bones.c
  311. X+ #
  312. X  # Secondary targets
  313. X  #
  314. X  
  315. X***************
  316. X*** 159,168 ****
  317. X      cp *. $(GAMEDIR)
  318. X  
  319. X  spec_levs: $(AUX)\castle.des $(AUX)\endgame.des $(AUX)\tower.des
  320. X-     lev_comp $(AUX)\castle.des
  321. X-     lev_comp $(AUX)\endgame.des
  322. X-     lev_comp $(AUX)\tower.des
  323. X      cd $(AUX)
  324. X      cp castle $(GAMEDIR)
  325. X      rm castle
  326. X      cp endgame $(GAMEDIR)
  327. X--- 181,190 ----
  328. X      cp *. $(GAMEDIR)
  329. X  
  330. X  spec_levs: $(AUX)\castle.des $(AUX)\endgame.des $(AUX)\tower.des
  331. X      cd $(AUX)
  332. X+     ..\src\lev_comp castle.des
  333. X+     ..\src\lev_comp endgame.des
  334. X+     ..\src\lev_comp tower.des
  335. X      cp castle $(GAMEDIR)
  336. X      rm castle
  337. X      cp endgame $(GAMEDIR)
  338. X***************
  339. X*** 193,199 ****
  340. X  apply.o:  $(HACK_H) $(INCL)\edog.h
  341. X  artifact.o:  $(HACK_H) $(INCL)\artifact.h
  342. X  attrib.o:  $(HACK_H)
  343. X! bones.o:  $(HACK_H)
  344. X  cmd.o:  $(HACK_H) $(INCL)\func_tab.h
  345. X  dbridge.o: $(HACK_H)
  346. X  decl.o:  $(HACK_H)
  347. X--- 215,221 ----
  348. X  apply.o:  $(HACK_H) $(INCL)\edog.h
  349. X  artifact.o:  $(HACK_H) $(INCL)\artifact.h
  350. X  attrib.o:  $(HACK_H)
  351. X! #bones.o:  $(HACK_H)
  352. X  cmd.o:  $(HACK_H) $(INCL)\func_tab.h
  353. X  dbridge.o: $(HACK_H)
  354. X  decl.o:  $(HACK_H)
  355. X*** others/Old/msdos.c    Wed Sep  6 15:30:16 1989
  356. X--- others/msdos.c    Mon Sep  4 14:39:46 1989
  357. X***************
  358. X*** 9,20 ****
  359. X  #  include <osbind.h>
  360. X  # else
  361. X  #  ifdef __TURBOC__    /* avoid incompatible redeclaration */
  362. X- #   define getdate quux
  363. X- #  endif
  364. X- #  include <dos.h>
  365. X- #  ifdef __TURBOC__
  366. X  #   undef getdate
  367. X  #  endif
  368. X  # endif
  369. X  #ifdef OS2
  370. X  # include "def_os2.h"    /* OS2 definitions (Timo Hakulinen) */
  371. X--- 9,17 ----
  372. X  #  include <osbind.h>
  373. X  # else
  374. X  #  ifdef __TURBOC__    /* avoid incompatible redeclaration */
  375. X  #   undef getdate
  376. X  #  endif
  377. X+ #  include <dos.h>
  378. X  # endif
  379. X  #ifdef OS2
  380. X  # include "def_os2.h"    /* OS2 definitions (Timo Hakulinen) */
  381. X***************
  382. X*** 101,113 ****
  383. X  
  384. X      if (comspec = getcomspec()) {
  385. X  #ifdef DGK
  386. X!         settty("To return to NetHack, type \"exit\" at the DOS prompt.\n");
  387. X  #else
  388. X          settty((char *)0);
  389. X  #endif /* DGK */
  390. X          chdirx(orgdir, 0);
  391. X          if (spawnl(P_WAIT, comspec, comspec, NULL) < 0) {
  392. X!             Printf("\nCan't spawn %s !\n", comspec);
  393. X              flags.toplin = 0;
  394. X              more();
  395. X          }
  396. X--- 98,110 ----
  397. X  
  398. X      if (comspec = getcomspec()) {
  399. X  #ifdef DGK
  400. X!         settty("To return to NetHack, enter \"exit\" at the DOS prompt.\n");
  401. X  #else
  402. X          settty((char *)0);
  403. X  #endif /* DGK */
  404. X          chdirx(orgdir, 0);
  405. X          if (spawnl(P_WAIT, comspec, comspec, NULL) < 0) {
  406. X!             Printf("\nCan't spawn \"%s\"!\n", comspec);
  407. X              flags.toplin = 0;
  408. X              more();
  409. X          }
  410. X***************
  411. X*** 117,129 ****
  412. X          docrt();
  413. X      } else
  414. X  #ifdef OS2
  415. X!         pline("Cannot exec CMD.EXE");
  416. X! #else
  417. X! #ifdef TOS
  418. X!         pline("Cannot find SHELL");
  419. X  #else
  420. X!         pline("Cannot exec COMMAND.COM");
  421. X! #endif
  422. X  #endif /* OS2 */
  423. X      return 0;
  424. X  }
  425. X--- 114,126 ----
  426. X          docrt();
  427. X      } else
  428. X  #ifdef OS2
  429. X!         pline("Can't execute CMD.EXE");
  430. X  #else
  431. X! # ifdef TOS
  432. X!         pline("Can't find SHELL");
  433. X! # else
  434. X!         pline("Can't execute COMMAND.COM");
  435. X! # endif
  436. X  #endif /* OS2 */
  437. X      return 0;
  438. X  }
  439. X***************
  440. X*** 134,148 ****
  441. X   * Shift characters are output when either shift key is pushed.
  442. X   */
  443. X  #ifdef TOS
  444. X! #define KEYPADHI    113
  445. X! #define KEYPADLOW    103
  446. X  #else
  447. X! #define KEYPADHI    83
  448. X! #define KEYPADLOW    71
  449. X  #endif
  450. X  
  451. X! #define PADKEYS        (KEYPADHI - KEYPADLOW + 1)
  452. X! #define iskeypad(x)    (KEYPADLOW <= (x) && (x) <= KEYPADHI)
  453. X  static const struct pad {
  454. X      char normal, shift;
  455. X      } keypad[PADKEYS] = {
  456. X--- 131,146 ----
  457. X   * Shift characters are output when either shift key is pushed.
  458. X   */
  459. X  #ifdef TOS
  460. X! #define KEYPADLO    0x67
  461. X! #define KEYPADHI    0x71
  462. X  #else
  463. X! #define KEYPADLO    0x47
  464. X! #define KEYPADHI    0x53
  465. X  #endif
  466. X  
  467. X! #define PADKEYS     (KEYPADHI - KEYPADLO + 1)
  468. X! #define iskeypad(x)    (KEYPADLO <= (x) && (x) <= KEYPADHI)
  469. X! 
  470. X  static const struct pad {
  471. X      char normal, shift;
  472. X      } keypad[PADKEYS] = {
  473. X***************
  474. X*** 150,156 ****
  475. X              {'k', 'K'},        /* 8 */
  476. X              {'u', 'U'},        /* 9 */
  477. X  #ifndef TOS
  478. X!             {'m', CTRL('P')},    /* - */
  479. X  #endif
  480. X              {'h', 'H'},        /* 4 */
  481. X  #ifdef TOS
  482. X--- 148,154 ----
  483. X              {'k', 'K'},        /* 8 */
  484. X              {'u', 'U'},        /* 9 */
  485. X  #ifndef TOS
  486. X!             {'m', C('p')},        /* - */
  487. X  #endif
  488. X              {'h', 'H'},        /* 4 */
  489. X  #ifdef TOS
  490. X***************
  491. X*** 168,202 ****
  492. X              {'i', 'I'},        /* Ins */
  493. X              {'.', ':'}        /* Del */
  494. X      }, numpad[PADKEYS] = {
  495. X!             {'7', '7'},        /* 7 */
  496. X!             {'8', '8'},        /* 8 */
  497. X!             {'9', '9'},        /* 9 */
  498. X  #ifndef TOS
  499. X!             {'m', CTRL('P')},    /* - */
  500. X  #endif
  501. X!             {'4', '4'},        /* 4 */
  502. X  #ifdef TOS
  503. X              {'.', '.'},        /* 5 */
  504. X  #else
  505. X              {'g', 'G'},        /* 5 */
  506. X  #endif
  507. X!             {'6', '6'},        /* 6 */
  508. X  #ifndef TOS
  509. X              {'p', 'P'},        /* + */
  510. X  #endif
  511. X!             {'1', '1'},        /* 1 */
  512. X!             {'2', '2'},        /* 2 */
  513. X!             {'3', '3'},        /* 3 */
  514. X              {'i', 'I'},        /* Ins */
  515. X              {'.', ':'}        /* Del */
  516. X  };
  517. X  
  518. X  /* BIOSgetch gets keys directly with a BIOS call.
  519. X   */
  520. X  #define SHIFT        (0x1 | 0x2)
  521. X! /* #define CTRL        0x4 */
  522. X! /* #define ALT        0x8 */
  523. X! #ifndef OS2
  524. X  #define KEYBRD_BIOS    0x16
  525. X  #endif
  526. X  
  527. X--- 166,220 ----
  528. X              {'i', 'I'},        /* Ins */
  529. X              {'.', ':'}        /* Del */
  530. X      }, numpad[PADKEYS] = {
  531. X!             {'7', M('7')},        /* 7 */
  532. X!             {'8', M('8')},        /* 8 */
  533. X!             {'9', M('9')},        /* 9 */
  534. X  #ifndef TOS
  535. X!             {'m', C('p')},        /* - */
  536. X  #endif
  537. X!             {'4', M('4')},        /* 4 */
  538. X  #ifdef TOS
  539. X              {'.', '.'},        /* 5 */
  540. X  #else
  541. X              {'g', 'G'},        /* 5 */
  542. X  #endif
  543. X!             {'6', M('6')},        /* 6 */
  544. X  #ifndef TOS
  545. X              {'p', 'P'},        /* + */
  546. X  #endif
  547. X!             {'1', M('1')},        /* 1 */
  548. X!             {'2', M('2')},        /* 2 */
  549. X!             {'3', M('3')},        /* 3 */
  550. X              {'i', 'I'},        /* Ins */
  551. X              {'.', ':'}        /* Del */
  552. X  };
  553. X  
  554. X+ /*
  555. X+  * INT 16h function 00h does not return a letter if Alt is pressed,
  556. X+  * but it does return the letter's scan code.  So, in order to convent
  557. X+  * Alt-letter to a letter with the meta bit set, we use a scan code
  558. X+  * table to translate the scan codes into letters, then set the
  559. X+  * "meta" bit for them.  -3.
  560. X+  */
  561. X+ #ifdef MSDOS
  562. X+ #define SCANLO        0x10
  563. X+ #define SCANHI        0x32
  564. X+ #define SCANKEYS    (SCANHI - SCANLO + 1)
  565. X+ #define inmap(x)    (SCANLO <= (x) && (x) <= SCANHI)
  566. X+ 
  567. X+ static const char scanmap[SCANKEYS] = {     /* ... */
  568. X+     'q','w','e','r','t','y','u','i','o','p','[',']', '\n',
  569. X+     0, 'a','s','d','f','g','h','j','k','l',';','\'', '`',
  570. X+     0, '\\', 'z','x','c','v','b','N','m'     /* ... */
  571. X+ };
  572. X+ #endif
  573. X+ 
  574. X  /* BIOSgetch gets keys directly with a BIOS call.
  575. X   */
  576. X  #define SHIFT        (0x1 | 0x2)
  577. X! #define CTRL        0x4
  578. X! #define ALT        0x8
  579. X! #if !defined(OS2) && !defined(TOS)
  580. X  #define KEYBRD_BIOS    0x16
  581. X  #endif
  582. X  
  583. X***************
  584. X*** 215,277 ****
  585. X      scan = CharData.chScan;
  586. X      shift = CharData.fsState;
  587. X  #else /* OS2 */
  588. X! #ifdef TOS
  589. X      long  x;
  590. X! #else
  591. X      union REGS regs;
  592. X! #endif
  593. X  
  594. X      /* Get scan code.
  595. X       */
  596. X! #ifdef TOS
  597. X      x = Crawcin();
  598. X      ch = x & 0x0ff;
  599. X      scan = (x & 0x00ff0000L) >> 16;
  600. X! #else
  601. X      regs.h.ah = 0;
  602. X      int86(KEYBRD_BIOS, ®s, ®s);
  603. X      ch = regs.h.al;
  604. X      scan = regs.h.ah;
  605. X! #endif
  606. X      /* Get shift status.
  607. X       */
  608. X! #ifdef TOS
  609. X      shift = Kbshift(-1);
  610. X! #else
  611. X      regs.h.ah = 2;
  612. X      int86(KEYBRD_BIOS, ®s, ®s);
  613. X      shift = regs.h.al;
  614. X! #endif
  615. X  #endif /* OS2 */
  616. X  
  617. X      /* If scan code is for the keypad, translate it.
  618. X       */
  619. X-     kpad = flags.num_pad ? numpad : keypad;
  620. X      if (iskeypad(scan)) {
  621. X          if (shift & SHIFT) {
  622. X              /* if number_pad is on, this makes little difference */
  623. X!             ch = (*kpad)[scan - KEYPADLOW].shift;
  624. X          } else
  625. X!             ch = (*kpad)[scan - KEYPADLOW].normal;
  626. X      }
  627. X      return ch;
  628. X  }
  629. X  
  630. X  #ifndef TOS
  631. X  
  632. X! #ifndef OS2
  633. X  #define FINDFIRST    0x4E00
  634. X  #define FINDNEXT    0x4F00
  635. X  #define GETDTA        0x2F00
  636. X  #define SETFILETIME    0x5701
  637. X  #define GETSWITCHAR    0x3700
  638. X! #define FREESPACE    0x36
  639. X! #endif
  640. X  
  641. X! #ifdef __TURBOC__
  642. X  #define switchar()    (char)getswitchar()
  643. X! #else
  644. X! #ifndef OS2
  645. X  static char
  646. X  switchar()
  647. X  {
  648. X--- 233,301 ----
  649. X      scan = CharData.chScan;
  650. X      shift = CharData.fsState;
  651. X  #else /* OS2 */
  652. X! # ifdef TOS
  653. X      long  x;
  654. X! # else
  655. X      union REGS regs;
  656. X! # endif
  657. X  
  658. X      /* Get scan code.
  659. X       */
  660. X! # ifdef TOS
  661. X      x = Crawcin();
  662. X      ch = x & 0x0ff;
  663. X      scan = (x & 0x00ff0000L) >> 16;
  664. X! # else
  665. X      regs.h.ah = 0;
  666. X      int86(KEYBRD_BIOS, ®s, ®s);
  667. X      ch = regs.h.al;
  668. X      scan = regs.h.ah;
  669. X! # endif
  670. X      /* Get shift status.
  671. X       */
  672. X! # ifdef TOS
  673. X      shift = Kbshift(-1);
  674. X! # else
  675. X      regs.h.ah = 2;
  676. X      int86(KEYBRD_BIOS, ®s, ®s);
  677. X      shift = regs.h.al;
  678. X! # endif
  679. X  #endif /* OS2 */
  680. X  
  681. X      /* If scan code is for the keypad, translate it.
  682. X       */
  683. X      if (iskeypad(scan)) {
  684. X+         kpad = flags.num_pad ? numpad : keypad;
  685. X          if (shift & SHIFT) {
  686. X              /* if number_pad is on, this makes little difference */
  687. X!             ch = (*kpad)[scan - KEYPADLO].shift;
  688. X          } else
  689. X!             ch = (*kpad)[scan - KEYPADLO].normal;
  690. X      }
  691. X+     if (shift & ALT) {
  692. X+         if (!ch && inmap(scan))
  693. X+             ch = scanmap[scan - SCANLO];
  694. X+         return (isprint(ch) ? M(ch) : ch);
  695. X+     }
  696. X      return ch;
  697. X  }
  698. X  
  699. X  #ifndef TOS
  700. X  
  701. X! # ifndef OS2
  702. X  #define FINDFIRST    0x4E00
  703. X  #define FINDNEXT    0x4F00
  704. X  #define GETDTA        0x2F00
  705. X  #define SETFILETIME    0x5701
  706. X  #define GETSWITCHAR    0x3700
  707. X! #define FREESPACE    0x3600
  708. X! #define FATINFO     0x1B00
  709. X! # endif
  710. X  
  711. X! # ifdef __TURBOC__
  712. X  #define switchar()    (char)getswitchar()
  713. X! # else
  714. X! #  ifndef OS2
  715. X  static char
  716. X  switchar()
  717. X  {
  718. X***************
  719. X*** 281,294 ****
  720. X      intdos(®s, ®s);
  721. X      return regs.h.dl;
  722. X  }
  723. X! #endif /* OS2 */
  724. X! #endif
  725. X  
  726. X  long
  727. X  freediskspace(path)
  728. X  char *path;
  729. X  {
  730. X! #ifdef OS2
  731. X      struct {
  732. X          ULONG  idFileSystem;
  733. X          ULONG  cSectorUnit;
  734. X--- 305,318 ----
  735. X      intdos(®s, ®s);
  736. X      return regs.h.dl;
  737. X  }
  738. X! #  endif /* OS2 */
  739. X! # endif
  740. X  
  741. X  long
  742. X  freediskspace(path)
  743. X  char *path;
  744. X  {
  745. X! # ifdef OS2
  746. X      struct {
  747. X          ULONG  idFileSystem;
  748. X          ULONG  cSectorUnit;
  749. X***************
  750. X*** 308,317 ****
  751. X      else
  752. X          return ((long) FSInfoBuf.cSectorUnit * FSInfoBuf.cUnitAvail *
  753. X                     FSInfoBuf.cbSector);
  754. X! #else
  755. X      union REGS regs;
  756. X  
  757. X!     regs.h.ah = FREESPACE;
  758. X      if (path[0] && path[1] == ':')
  759. X          regs.h.dl = (toupper(path[0]) - 'A') + 1;
  760. X      else
  761. X--- 332,341 ----
  762. X      else
  763. X          return ((long) FSInfoBuf.cSectorUnit * FSInfoBuf.cUnitAvail *
  764. X                     FSInfoBuf.cbSector);
  765. X! # else
  766. X      union REGS regs;
  767. X  
  768. X!     regs.x.ax = FREESPACE;
  769. X      if (path[0] && path[1] == ':')
  770. X          regs.h.dl = (toupper(path[0]) - 'A') + 1;
  771. X      else
  772. X***************
  773. X*** 321,333 ****
  774. X          return -1L;        /* bad drive number */
  775. X      else
  776. X          return ((long) regs.x.bx * regs.x.cx * regs.x.ax);
  777. X! #endif /* OS2 */
  778. X  }
  779. X  
  780. X! #ifdef OS2
  781. X  FILEFINDBUF ResultBuf;
  782. X  HDIR DirHandle;
  783. X! #endif
  784. X  
  785. X  /* Functions to get filenames using wildcards
  786. X   */
  787. X--- 345,357 ----
  788. X          return -1L;        /* bad drive number */
  789. X      else
  790. X          return ((long) regs.x.bx * regs.x.cx * regs.x.ax);
  791. X! # endif /* OS2 */
  792. X  }
  793. X  
  794. X! # ifdef OS2
  795. X  FILEFINDBUF ResultBuf;
  796. X  HDIR DirHandle;
  797. X! # endif
  798. X  
  799. X  /* Functions to get filenames using wildcards
  800. X   */
  801. X***************
  802. X*** 335,347 ****
  803. X  findfirst(path)
  804. X  char *path;
  805. X  {
  806. X! #ifdef OS2
  807. X      USHORT res, SearchCount = 1;
  808. X  
  809. X      DirHandle = 1;
  810. X      res = DosFindFirst((PSZ)path,&DirHandle,0,&ResultBuf,sizeof(FILEFINDBUF),&SearchCount,0L);
  811. X      return(!res);
  812. X! #else
  813. X      union REGS regs;
  814. X      struct SREGS sregs;
  815. X  
  816. X--- 359,371 ----
  817. X  findfirst(path)
  818. X  char *path;
  819. X  {
  820. X! # ifdef OS2
  821. X      USHORT res, SearchCount = 1;
  822. X  
  823. X      DirHandle = 1;
  824. X      res = DosFindFirst((PSZ)path,&DirHandle,0,&ResultBuf,sizeof(FILEFINDBUF),&SearchCount,0L);
  825. X      return(!res);
  826. X! # else
  827. X      union REGS regs;
  828. X      struct SREGS sregs;
  829. X  
  830. X***************
  831. X*** 351,376 ****
  832. X      sregs.ds = FP_SEG(path);
  833. X      intdosx(®s, ®s, &sregs);
  834. X      return !regs.x.cflag;
  835. X! #endif /* OS2 */
  836. X  }
  837. X  
  838. X  static int
  839. X  findnext() {
  840. X! #ifdef OS2
  841. X      USHORT res, SearchCount = 1;
  842. X  
  843. X      res = DosFindNext(DirHandle,&ResultBuf,sizeof(FILEFINDBUF),&SearchCount);
  844. X      return(!res);
  845. X! #else
  846. X      union REGS regs;
  847. X  
  848. X      regs.x.ax = FINDNEXT;
  849. X      intdos(®s, ®s);
  850. X      return !regs.x.cflag;
  851. X! #endif /* OS2 */
  852. X  }
  853. X  
  854. X! #ifndef OS2
  855. X  /* Get disk transfer area, Turbo C already has getdta */
  856. X  static char *
  857. X  getdta() {
  858. X--- 375,400 ----
  859. X      sregs.ds = FP_SEG(path);
  860. X      intdosx(®s, ®s, &sregs);
  861. X      return !regs.x.cflag;
  862. X! # endif /* OS2 */
  863. X  }
  864. X  
  865. X  static int
  866. X  findnext() {
  867. X! # ifdef OS2
  868. X      USHORT res, SearchCount = 1;
  869. X  
  870. X      res = DosFindNext(DirHandle,&ResultBuf,sizeof(FILEFINDBUF),&SearchCount);
  871. X      return(!res);
  872. X! # else
  873. X      union REGS regs;
  874. X  
  875. X      regs.x.ax = FINDNEXT;
  876. X      intdos(®s, ®s);
  877. X      return !regs.x.cflag;
  878. X! # endif /* OS2 */
  879. X  }
  880. X  
  881. X! # ifndef OS2
  882. X  /* Get disk transfer area, Turbo C already has getdta */
  883. X  static char *
  884. X  getdta() {
  885. X***************
  886. X*** 380,394 ****
  887. X  
  888. X      regs.x.ax = GETDTA;
  889. X      intdosx(®s, ®s, &sregs);
  890. X! #ifdef MK_FP
  891. X      ret = MK_FP(sregs.es, regs.x.bx);
  892. X! #else
  893. X      FP_OFF(ret) = regs.x.bx;
  894. X      FP_SEG(ret) = sregs.es;
  895. X! #endif
  896. X      return ret;
  897. X  }
  898. X! #endif  /* OS2 */
  899. X  
  900. X  #else /* TOS */
  901. X  
  902. X--- 404,418 ----
  903. X  
  904. X      regs.x.ax = GETDTA;
  905. X      intdosx(®s, ®s, &sregs);
  906. X! #  ifdef MK_FP
  907. X      ret = MK_FP(sregs.es, regs.x.bx);
  908. X! #  else
  909. X      FP_OFF(ret) = regs.x.bx;
  910. X      FP_SEG(ret) = sregs.es;
  911. X! #  endif
  912. X      return ret;
  913. X  }
  914. X! # endif  /* OS2 */
  915. X  
  916. X  #else /* TOS */
  917. X  
  918. X***************
  919. X*** 488,496 ****
  920. X      long fs;
  921. X      extern saveprompt;
  922. X  
  923. X- #ifdef TOS
  924. X-     extern int _copyfile();
  925. X- #endif
  926. X      if (!ramdisk)
  927. X          return;
  928. X  
  929. X--- 512,517 ----
  930. X***************
  931. X*** 562,573 ****
  932. X      /* Last file didn't get there.
  933. X       */
  934. X      Sprintf(to, "%s%s", topath, allbones);
  935. X!     msmsg("Cannot copy `%s' to `%s' -- %s\n", from, to,
  936. X!         (status < 0) ? "can't spawn COMSPEC !" :
  937. X!         (freediskspace(topath) < filesize(from)) ?
  938. X              "insufficient disk space." : "bad path(s)?");
  939. X      if (mode == TOPERM) {
  940. X!         msmsg("Bones will be left in `%s'\n",
  941. X              *levels ? levels : hackdir);
  942. X      } else {
  943. X          /* Remove all bones files on the RAMdisk */
  944. X--- 583,596 ----
  945. X      /* Last file didn't get there.
  946. X       */
  947. X      Sprintf(to, "%s%s", topath, allbones);
  948. X!     msmsg("Can't copy \"%s\" to \"%s\" -- ", from, to);
  949. X!     if (status < 0)
  950. X!         msmsg("can't spawn \"%s\"!", comspec);
  951. X!     else
  952. X!         msmsg((freediskspace(topath) < filesize(from)) ?
  953. X              "insufficient disk space." : "bad path(s)?");
  954. X      if (mode == TOPERM) {
  955. X!         msmsg("Bones will be left in \"%s\"\n",
  956. X              *levels ? levels : hackdir);
  957. X      } else {
  958. X          /* Remove all bones files on the RAMdisk */
  959. X***************
  960. X*** 577,587 ****
  961. X      return;
  962. X  }
  963. X  
  964. X  void
  965. X  playwoRAMdisk() {
  966. X      msmsg("Do you wish to play without a RAMdisk? ");
  967. X  
  968. X!     /* Set ramdisk false *before* exit'ing (because msexit calls
  969. X       * copybones)
  970. X       */
  971. X      ramdisk = FALSE;
  972. X--- 600,634 ----
  973. X      return;
  974. X  }
  975. X  
  976. X+ #if 0 /* defined(MSDOS) && !defined(TOS) && !defined(OS2) */
  977. X+ boolean
  978. X+ removeable_drive(drive)
  979. X+ char drive;
  980. X+ /* check whether current drive is a fixed disk,
  981. X+    so we don't ask the player to insert one */
  982. X+ {
  983. X+     union REGS regs;
  984. X+     char *fat_id;
  985. X+ 
  986. X+     regs.x.ax = FATINFO;
  987. X+     intdos(®s, ®s);
  988. X+     /* also returns size info, as
  989. X+        AL (sectors/cluster) * CX (bytes/sector) * DX (clusters/disk) */
  990. X+ # ifdef MK_FP
  991. X+     fat_id = MK_FP(sregs.ds, regs.x.bx);
  992. X+ # else
  993. X+     FP_OFF(fat_id) = regs.x.bx;
  994. X+     FP_SEG(fat_id) = sregs.ds;
  995. X+ # endif
  996. X+     return (*fat_id != 0xF8);
  997. X+ }
  998. X+ #endif
  999. X+ 
  1000. X  void
  1001. X  playwoRAMdisk() {
  1002. X      msmsg("Do you wish to play without a RAMdisk? ");
  1003. X  
  1004. X!     /* Set ramdisk false *before* exit-ing (because msexit calls
  1005. X       * copybones)
  1006. X       */
  1007. X      ramdisk = FALSE;
  1008. X***************
  1009. X*** 608,616 ****
  1010. X          remember_topl();
  1011. X          home();
  1012. X          cl_end();
  1013. X!         msmsg("If save file is on a SAVE disk, put that disk in now.\n");
  1014. X          cl_end();
  1015. X!         msmsg("File name (default `%s'%s) ? ", SAVEF,
  1016. X              start ? "" : ", <Esc> cancels save");
  1017. X          getlin(buf);
  1018. X          home();
  1019. X--- 655,663 ----
  1020. X          remember_topl();
  1021. X          home();
  1022. X          cl_end();
  1023. X!         msmsg("If save file is on a save disk, insert that disk now.\n");
  1024. X          cl_end();
  1025. X!         msmsg("File name (default \"%s\"%s) ? ", SAVEF,
  1026. X              start ? "" : ", <Esc> cancels save");
  1027. X          getlin(buf);
  1028. X          home();
  1029. X***************
  1030. X*** 680,695 ****
  1031. X          if (record_exists() && comspec_exists())
  1032. X              return;
  1033. X          (void) putchar('\n');
  1034. X!         getreturn("when the GAME disk has been put in");
  1035. X      }
  1036. X      if (comspec_exists() && record_exists())
  1037. X          return;
  1038. X  
  1039. X      if (!comspec_exists())
  1040. X!         msmsg("\n\nWARNING: can't find comspec `%s'!\n", getcomspec());
  1041. X!     if (!record_exists())
  1042. X!         msmsg("\n\nWARNING: can't find record file `%s'!\n", RECORD);
  1043. X!     msmsg("If the GAME disk is not in, put it in now.\n");
  1044. X      getreturn("to continue");
  1045. X      return;
  1046. X  }
  1047. X--- 727,742 ----
  1048. X          if (record_exists() && comspec_exists())
  1049. X              return;
  1050. X          (void) putchar('\n');
  1051. X!         getreturn("when the game disk has been inserted");
  1052. X      }
  1053. X      if (comspec_exists() && record_exists())
  1054. X          return;
  1055. X  
  1056. X      if (!comspec_exists())
  1057. X!         msmsg("\n\nWARNING: can't find command processor \"%s\"!\n", getcomspec());
  1058. X!         if (!record_exists())
  1059. X!         msmsg("\n\nWARNING: can't find record file \"%s\"!\n", RECORD);
  1060. X!     msmsg("If the game disk is not in, insert it now.\n");
  1061. X      getreturn("to continue");
  1062. X      return;
  1063. X  }
  1064. X***************
  1065. X*** 735,741 ****
  1066. X  
  1067. X          /* find the '=' */
  1068. X          if (!(bufp = strchr(buf, '='))) {
  1069. X!             msmsg("Bad option line: '%s'\n", buf);
  1070. X              getreturn("to continue");
  1071. X              continue;
  1072. X          }
  1073. X--- 782,788 ----
  1074. X  
  1075. X          /* find the '=' */
  1076. X          if (!(bufp = strchr(buf, '='))) {
  1077. X!             msmsg("Bad option line: \"%s\"\n", buf);
  1078. X              getreturn("to continue");
  1079. X              continue;
  1080. X          }
  1081. X***************
  1082. X*** 773,782 ****
  1083. X              (void) strncpy(SAVEF, bufp, PATHLEN);
  1084. X              append_slash(SAVEF);
  1085. X          } else if (!strncmp(buf, "GRAPHICS", 4)) {
  1086. X!             unsigned int translate[MAXPCHARS];
  1087. X!             int i;
  1088. X  
  1089. X!              if ((i = sscanf(bufp,
  1090. X           "%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d",
  1091. X                  &translate[0], &translate[1], &translate[2],
  1092. X                  &translate[3], &translate[4], &translate[5],
  1093. X--- 820,829 ----
  1094. X              (void) strncpy(SAVEF, bufp, PATHLEN);
  1095. X              append_slash(SAVEF);
  1096. X          } else if (!strncmp(buf, "GRAPHICS", 4)) {
  1097. X!             unsigned int translate[MAXPCHARS+1];
  1098. X!             int lth;
  1099. X  
  1100. X!              if ((lth = sscanf(bufp,
  1101. X           "%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d",
  1102. X                  &translate[0], &translate[1], &translate[2],
  1103. X                  &translate[3], &translate[4], &translate[5],
  1104. X***************
  1105. X*** 788,843 ****
  1106. X                  &translate[21], &translate[22], &translate[23],
  1107. X                  &translate[24], &translate[25], &translate[26],
  1108. X                  &translate[27], &translate[28], &translate[29],
  1109. X!                 &translate[30], &translate[31])) < 0) {
  1110. X                      msmsg ("Syntax error in GRAPHICS\n");
  1111. X                      getreturn("to continue");
  1112. X              }
  1113. X! #define SETPCHAR(f, n)    showsyms.f = (i > n) ? translate[n] : defsyms.f
  1114. X!             SETPCHAR(stone, 0);
  1115. X!             SETPCHAR(vwall, 1);
  1116. X!             SETPCHAR(hwall, 2);
  1117. X!             SETPCHAR(tlcorn, 3);
  1118. X!             SETPCHAR(trcorn, 4);
  1119. X!             SETPCHAR(blcorn, 5);
  1120. X!             SETPCHAR(brcorn, 6);
  1121. X!             SETPCHAR(crwall, 7);
  1122. X!             SETPCHAR(tuwall, 8);
  1123. X!             SETPCHAR(tdwall, 9);
  1124. X!             SETPCHAR(tlwall, 10);
  1125. X!             SETPCHAR(trwall, 11);
  1126. X!             SETPCHAR(vbeam, 12);
  1127. X!             SETPCHAR(hbeam, 13);
  1128. X!             SETPCHAR(lslant, 14);
  1129. X!             SETPCHAR(rslant, 15);
  1130. X!             SETPCHAR(door, 16);
  1131. X!             SETPCHAR(room, 17);
  1132. X!             SETPCHAR(corr, 18);
  1133. X!             SETPCHAR(upstair, 19);
  1134. X!             SETPCHAR(dnstair, 20);
  1135. X!             SETPCHAR(trap, 21);
  1136. X!             SETPCHAR(web, 22);
  1137. X!             SETPCHAR(pool, 23);
  1138. X! #ifdef FOUNTAINS
  1139. X!             SETPCHAR(fountain, 24);
  1140. X! #endif
  1141. X! #ifdef SINKS
  1142. X!             SETPCHAR(sink, 25);
  1143. X! #endif
  1144. X! #ifdef THRONES
  1145. X!             SETPCHAR(throne, 26);
  1146. X! #endif
  1147. X! #ifdef ALTARS
  1148. X!             SETPCHAR(altar, 27);
  1149. X! #endif
  1150. X! #ifdef STRONGHOLD
  1151. X!             SETPCHAR(upladder, 28);
  1152. X!             SETPCHAR(dnladder, 29);
  1153. X!             SETPCHAR(dbvwall, 30);
  1154. X!             SETPCHAR(dbhwall, 31);
  1155. X! #endif
  1156. X! #undef SETPCHAR
  1157. X          } else {
  1158. X!             msmsg("Bad option line: '%s'\n", buf);
  1159. X              getreturn("to continue");
  1160. X          }
  1161. X      }
  1162. X--- 835,847 ----
  1163. X                  &translate[21], &translate[22], &translate[23],
  1164. X                  &translate[24], &translate[25], &translate[26],
  1165. X                  &translate[27], &translate[28], &translate[29],
  1166. X!                 &translate[30], &translate[31])) <= 0) {
  1167. X                      msmsg ("Syntax error in GRAPHICS\n");
  1168. X                      getreturn("to continue");
  1169. X              }
  1170. X!             assign_graphics(translate, lth);
  1171. X          } else {
  1172. X!             msmsg("Bad option line: \"%s\"\n", buf);
  1173. X              getreturn("to continue");
  1174. X          }
  1175. X      }
  1176. X***************
  1177. X*** 898,904 ****
  1178. X  getreturn(str)
  1179. X  char *str;
  1180. X  {
  1181. X!     msmsg("Hit <RETURN> %s.", str);
  1182. X      while (Getchar() != '\n') ;
  1183. X      return;
  1184. X  }
  1185. X--- 902,912 ----
  1186. X  getreturn(str)
  1187. X  char *str;
  1188. X  {
  1189. X! #ifdef TOS
  1190. X!     msmsg("Hit <Return> %s.", str);
  1191. X! #else
  1192. X!     msmsg("Hit <Enter> %s.", str);
  1193. X! #endif
  1194. X      while (Getchar() != '\n') ;
  1195. X      return;
  1196. X  }
  1197. X***************
  1198. X*** 988,994 ****
  1199. X      if (!flags.rawio) return;
  1200. X  #endif
  1201. X  #ifdef OS2
  1202. X!     KbdInfo.cb = 10;
  1203. X      KbdGetStatus(&KbdInfo,KbdHandle);
  1204. X      KbdInfo.fsMask &= 0xFFF7; /* ASCII off */
  1205. X      KbdInfo.fsMask |= 0x0004; /* BINARY on */
  1206. X--- 996,1002 ----
  1207. X      if (!flags.rawio) return;
  1208. X  #endif
  1209. X  #ifdef OS2
  1210. X!     KbdInfo.cb = sizeof(KbdInfo);
  1211. X      KbdGetStatus(&KbdInfo,KbdHandle);
  1212. X      KbdInfo.fsMask &= 0xFFF7; /* ASCII off */
  1213. X      KbdInfo.fsMask |= 0x0004; /* BINARY on */
  1214. X***************
  1215. X*** 1015,1021 ****
  1216. X      if (!flags.rawio) return;
  1217. X  #endif
  1218. X  #ifdef OS2
  1219. X!     KbdInfo.cb = 10;
  1220. X      KbdGetStatus(&KbdInfo,KbdHandle);
  1221. X      KbdInfo.fsMask &= 0xFFFB; /* BINARY off */
  1222. X      KbdInfo.fsMask |= 0x0008; /* ASCII on */
  1223. X--- 1023,1029 ----
  1224. X      if (!flags.rawio) return;
  1225. X  #endif
  1226. X  #ifdef OS2
  1227. X!     KbdInfo.cb = sizeof(KbdInfo);
  1228. X      KbdGetStatus(&KbdInfo,KbdHandle);
  1229. X      KbdInfo.fsMask &= 0xFFFB; /* BINARY off */
  1230. X      KbdInfo.fsMask |= 0x0008; /* ASCII on */
  1231. X***************
  1232. X*** 1098,1103 ****
  1233. X--- 1106,1115 ----
  1234. X  /* Chdir back to original directory
  1235. X   */
  1236. X  #undef exit
  1237. X+ #ifdef TOS
  1238. X+ extern boolean run_from_desktop;    /* set in pcmain.c */
  1239. X+ #endif
  1240. X+ 
  1241. X  void exit(int);
  1242. X  void
  1243. X  msexit(code)
  1244. X***************
  1245. X*** 1118,1124 ****
  1246. X      chdrive(orgdir);
  1247. X  #endif
  1248. X  #ifdef TOS
  1249. X!     getreturn("to continue"); /* so the user can read the score list */
  1250. X  #endif
  1251. X      exit(code);
  1252. X      return;
  1253. X--- 1130,1137 ----
  1254. X      chdrive(orgdir);
  1255. X  #endif
  1256. X  #ifdef TOS
  1257. X!     if (run_from_desktop)
  1258. X!         getreturn("to continue"); /* so the user can read the score list */
  1259. X  #endif
  1260. X      exit(code);
  1261. X      return;
  1262. X***************
  1263. X*** 1139,1144 ****
  1264. X--- 1152,1158 ----
  1265. X      CO = ModeInfo.col;
  1266. X      LI = ModeInfo.row;
  1267. X  #  else
  1268. X+ #   ifndef TOS
  1269. X      union REGS regs;
  1270. X  
  1271. X      if (!flags.IBMBIOS) {        /* assume standard screen size */
  1272. X***************
  1273. X*** 1171,1176 ****
  1274. X--- 1185,1191 ----
  1275. X  
  1276. X      LI = regs.h.dl + 1;
  1277. X      CO = regs.h.ah;
  1278. X+ #   endif /* TOS */
  1279. X  #  endif
  1280. X  }
  1281. X  # endif
  1282. X***************
  1283. X*** 1181,1186 ****
  1284. X--- 1196,1202 ----
  1285. X  
  1286. X  int
  1287. X  _copyfile(from, to)
  1288. X+ char *from, *to;
  1289. X  {
  1290. X      int fromfd, tofd, r;
  1291. X      char *buf;
  1292. X*** others/Old/oldtos.c    Wed Sep  6 15:30:57 1989
  1293. X--- others/oldtos.c    Thu Aug 31 20:27:13 1989
  1294. X***************
  1295. X*** 438,447 ****
  1296. X              append_slash(SAVEF);
  1297. X  
  1298. X          } else if (!strncmp(buf, "GRAPHICS", 4)) {
  1299. X!             unsigned int translate[MAXPCHARS];
  1300. X!             int i;
  1301. X  
  1302. X!              if ((i = sscanf(bufp,
  1303. X               "%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d",
  1304. X                  &translate[0], &translate[1], &translate[2],
  1305. X                  &translate[3], &translate[4], &translate[5],
  1306. X--- 438,447 ----
  1307. X              append_slash(SAVEF);
  1308. X  
  1309. X          } else if (!strncmp(buf, "GRAPHICS", 4)) {
  1310. X!             unsigned int translate[MAXPCHARS+1];
  1311. X!             int lth;
  1312. X  
  1313. X!              if ((lth = sscanf(bufp,
  1314. X               "%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d",
  1315. X                  &translate[0], &translate[1], &translate[2],
  1316. X                  &translate[3], &translate[4], &translate[5],
  1317. X***************
  1318. X*** 457,506 ****
  1319. X                      cprintf("Syntax error in GRAPHICS\n");
  1320. X                      getreturn("to continue");
  1321. X              }
  1322. X! #define SETPCHAR(f, n)    showsyms.f = (i > n) ? translate[n] : defsyms.f
  1323. X!             SETPCHAR(stone, 0);
  1324. X!             SETPCHAR(vwall, 1);
  1325. X!             SETPCHAR(hwall, 2);
  1326. X!             SETPCHAR(tlcorn, 3);
  1327. X!             SETPCHAR(trcorn, 4);
  1328. X!             SETPCHAR(blcorn, 5);
  1329. X!             SETPCHAR(brcorn, 6);
  1330. X!             SETPCHAR(crwall, 7);
  1331. X!             SETPCHAR(tuwall, 8);
  1332. X!             SETPCHAR(tdwall, 9);
  1333. X!             SETPCHAR(tlwall, 10);
  1334. X!             SETPCHAR(trwall, 11);
  1335. X!             SETPCHAR(vbeam, 12);
  1336. X!             SETPCHAR(hbeam, 13);
  1337. X!             SETPCHAR(lslant, 14);
  1338. X!             SETPCHAR(rslant, 15);
  1339. X!             SETPCHAR(door, 16);
  1340. X!             SETPCHAR(room, 17);
  1341. X!             SETPCHAR(corr, 18);
  1342. X!             SETPCHAR(upstair, 19);
  1343. X!             SETPCHAR(dnstair, 20);
  1344. X!             SETPCHAR(trap, 21);
  1345. X!             SETPCHAR(web, 22);
  1346. X!             SETPCHAR(pool, 23);
  1347. X! #ifdef FOUNTAINS
  1348. X!             SETPCHAR(fountain, 24);
  1349. X! #endif
  1350. X! #ifdef SINKS
  1351. X!             SETPCHAR(sink, 25);
  1352. X! #endif
  1353. X! #ifdef THRONES
  1354. X!             SETPCHAR(throne, 26);
  1355. X! #endif
  1356. X! #ifdef ALTARS
  1357. X!             SETPCHAR(altar, 27);
  1358. X! #endif
  1359. X! #ifdef STRONGHOLD
  1360. X!             SETPCHAR(upladder, 28);
  1361. X!             SETPCHAR(dnladder, 29);
  1362. X!             SETPCHAR(dbvwall, 30);
  1363. X!             SETPCHAR(dbhwall, 31);
  1364. X! #endif
  1365. X! #undef SETPCHAR
  1366. X          } else {
  1367. X              cprintf("Bad option line: '%s'\n", buf);
  1368. X              getreturn("to continue");
  1369. X--- 457,463 ----
  1370. X                      cprintf("Syntax error in GRAPHICS\n");
  1371. X                      getreturn("to continue");
  1372. X              }
  1373. X!             assign_graphics(translate, lth);
  1374. X          } else {
  1375. X              cprintf("Bad option line: '%s'\n", buf);
  1376. X              getreturn("to continue");
  1377. X*** others/Old/pcmain.c    Wed Sep  6 15:31:25 1989
  1378. X--- others/pcmain.c    Sat Sep  2 15:01:12 1989
  1379. X***************
  1380. X*** 34,41 ****
  1381. X  extern unsigned char _osmajor;
  1382. X  #endif
  1383. X  
  1384. X! #if defined(TOS) && defined(__GNUC__)
  1385. X  long _stksize = 16*1024;
  1386. X  #endif
  1387. X  
  1388. X  #ifdef OLD_TOS
  1389. X--- 34,44 ----
  1390. X  extern unsigned char _osmajor;
  1391. X  #endif
  1392. X  
  1393. X! #ifdef TOS
  1394. X! boolean run_from_desktop = TRUE;    /* should we pause before exiting?? */
  1395. X! # ifdef __GNUC__
  1396. X  long _stksize = 16*1024;
  1397. X+ # endif
  1398. X  #endif
  1399. X  
  1400. X  #ifdef OLD_TOS
  1401. X***************
  1402. X*** 52,70 ****
  1403. X      extern int x_maze_max, y_maze_max;
  1404. X      register int fd;
  1405. X      register char *dir;
  1406. X! 
  1407. X! #ifdef AMIGA
  1408. X!     /*
  1409. X!      *  Make sure screen IO is initialized before anything happens.
  1410. X!      */
  1411. X!     gettty();
  1412. X!     startup();
  1413. X! #else /* AMIGA */
  1414. X!     /* Save current directory and make sure it gets restored when
  1415. X!      * the game is exited.
  1416. X!      */
  1417. X      int (*funcp)();
  1418. X! 
  1419. X  #if defined(TOS) && defined(__GNUC__)
  1420. X      extern int _unixmode;
  1421. X      _unixmode = 0;
  1422. X--- 55,63 ----
  1423. X      extern int x_maze_max, y_maze_max;
  1424. X      register int fd;
  1425. X      register char *dir;
  1426. X! #ifndef AMIGA
  1427. X      int (*funcp)();
  1428. X! #endif
  1429. X  #if defined(TOS) && defined(__GNUC__)
  1430. X      extern int _unixmode;
  1431. X      _unixmode = 0;
  1432. X***************
  1433. X*** 73,82 ****
  1434. X  # ifdef __TURBOC__
  1435. X      if (_osmajor >= 3) hname = argv[0];    /* DOS 3.0+ */
  1436. X  # endif
  1437. X!     if (getcwd(orgdir, sizeof orgdir) == NULL) {
  1438. X!         xputs("NetHack: current directory path too long\n");
  1439. X!         return 1;
  1440. X      }
  1441. X      funcp = exit;    /* Kludge to get around LINT_ARGS of signal.
  1442. X               * This will produce a compiler warning, but that's OK.
  1443. X               */
  1444. X--- 66,97 ----
  1445. X  # ifdef __TURBOC__
  1446. X      if (_osmajor >= 3) hname = argv[0];    /* DOS 3.0+ */
  1447. X  # endif
  1448. X! # ifdef TOS
  1449. X!     if (*argv[0]) {            /* only a CLI can give us argv[0] */
  1450. X!         hname = argv[0];
  1451. X!         run_from_desktop = FALSE;
  1452. X      }
  1453. X+ # endif
  1454. X+ 
  1455. X+     /*
  1456. X+      *  Initialize screen I/O before anything is displayed.
  1457. X+      *
  1458. X+      *  startup() must be called before initoptions()
  1459. X+      *  due to ordering of graphics settings, and before
  1460. X+      *  any calls to error() due to use of termcap strings.
  1461. X+      */
  1462. X+     gettty();
  1463. X+ #ifndef AMIGA
  1464. X+     setbuf(stdout,obuf);
  1465. X+ #endif
  1466. X+     startup();
  1467. X+ 
  1468. X+ #ifndef AMIGA
  1469. X+     /* Save current directory and make sure it gets restored when
  1470. X+      * the game is exited.
  1471. X+      */
  1472. X+     if (getcwd(orgdir, sizeof orgdir) == NULL)
  1473. X+         error("NetHack: current directory path too long");
  1474. X      funcp = exit;    /* Kludge to get around LINT_ARGS of signal.
  1475. X               * This will produce a compiler warning, but that's OK.
  1476. X               */
  1477. X***************
  1478. X*** 85,93 ****
  1479. X  # endif
  1480. X  #endif /* AMIGA */
  1481. X  
  1482. X-     /* Set the default values of the presentation characters */
  1483. X-     (void) memcpy((genericptr_t) &showsyms,
  1484. X-         (genericptr_t) &defsyms, sizeof(struct symbols));
  1485. X      if ((dir = getenv("HACKDIR")) != NULL) {
  1486. X          Strcpy(hackdir, dir);
  1487. X  #ifdef CHDIR
  1488. X--- 100,105 ----
  1489. X***************
  1490. X*** 100,105 ****
  1491. X--- 112,118 ----
  1492. X          fileinfo[i] = zfinfo;
  1493. X      }
  1494. X  #endif /* DGK && !OLD_TOS */
  1495. X+ 
  1496. X      initoptions();
  1497. X      if (!hackdir[0])
  1498. X          Strcpy(hackdir, orgdir);
  1499. X***************
  1500. X*** 119,129 ****
  1501. X              argv++;
  1502. X              dir = argv[0];
  1503. X          }
  1504. X!         if(!*dir) {
  1505. X!             /* can't use error() until termcap read in */
  1506. X!             xputs("Flag -d must be followed by a directory name.\n");
  1507. X!             return 1;
  1508. X!         }
  1509. X          Strcpy(hackdir, dir);
  1510. X          }
  1511. X  
  1512. X--- 132,139 ----
  1513. X              argv++;
  1514. X              dir = argv[0];
  1515. X          }
  1516. X!         if(!*dir)
  1517. X!             error("Flag -d must be followed by a directory name.");
  1518. X          Strcpy(hackdir, dir);
  1519. X          }
  1520. X  
  1521. X***************
  1522. X*** 144,158 ****
  1523. X          }
  1524. X      }
  1525. X  
  1526. X- #ifndef AMIGA
  1527. X-     /*
  1528. X-      * It seems he really wants to play.
  1529. X-      * Remember tty modes, to be restored on exit.
  1530. X-      */
  1531. X-     gettty();
  1532. X-     setbuf(stdout,obuf);
  1533. X-     startup();
  1534. X- #endif
  1535. X      setrandom();
  1536. X      cls();
  1537. X      u.uhp = 1;    /* prevent RIP on early quits */
  1538. X--- 154,159 ----
  1539. X
  1540. END_OF_FILE
  1541. if test 34436 -ne `wc -c <'patch03b'`; then
  1542.     echo shar: \"'patch03b'\" unpacked with wrong size!
  1543. fi
  1544. # end of 'patch03b'
  1545. fi
  1546. echo shar: End of archive 2 \(of 6\).
  1547. cp /dev/null ark2isdone
  1548. MISSING=""
  1549. for I in 1 2 3 4 5 6 ; do
  1550.     if test ! -f ark${I}isdone ; then
  1551.     MISSING="${MISSING} ${I}"
  1552.     fi
  1553. done
  1554. if test "${MISSING}" = "" ; then
  1555.     echo You have unpacked all 6 archives.
  1556.     rm -f ark[1-9]isdone
  1557. else
  1558.     echo You still need to unpack the following archives:
  1559.     echo "        " ${MISSING}
  1560. fi
  1561. ##  End of shell archive.
  1562. exit 0
  1563.