home *** CD-ROM | disk | FTP | other *** search
- Path: uunet!zephyr.ens.tek.com!tekgen!tekred!saab!billr
- From: billr@saab.CNA.TEK.COM (Bill Randle)
- Newsgroups: comp.sources.games
- Subject: v08i017: NetHack3 - display oriented dungeons & dragons (Ver. 3.0), Patch3b
- Message-ID: <4536@tekred.CNA.TEK.COM>
- Date: 7 Sep 89 21:48:39 GMT
- Sender: nobody@tekred.CNA.TEK.COM
- Lines: 1552
- Approved: billr@saab.CNA.TEK.COM
-
- Submitted-by: Izchak Miller <izchak@linc.cis.upenn.edu>
- Posting-number: Volume 8, Issue 17
- Archive-name: NetHack3/Patch3b
- Patch-To: NetHack3: Volume 7, Issue 56-93
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 2 (of 6)."
- # Contents: UPDATE3 patch03b
- # Wrapped by billr@saab on Thu Sep 7 14:38:20 1989
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'UPDATE3' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'UPDATE3'\"
- else
- echo shar: Extracting \"'UPDATE3'\" \(1310 characters\)
- sed "s/^X//" >'UPDATE3' <<'END_OF_FILE'
- XDate: Thu, 7 Sep 89 09:38:37 EDT
- XFrom: Izchak Miller <izchak@linc.cis.upenn.edu>
- X
- XThe main changes included in patch kit 3 are as follows:
- X
- XA few new objects were added to objects.c, so old save/bones files
- Xshould be thrown out.
- X
- XPrototypes were adapted to satisfy ANSI C. Hopefully, we will not see
- Xanymore postings which helpfully fix prototypes for ANSI, while breaking
- Xthem for the MSDOS compilers they were, originally, set up for.
- X
- XUse of $(MAKE), and a better use of $PAGER, in scripts.
- X
- XImprovements to OS/2 and TOS code, including their Makefiles.
- X
- XGraphics setting was centralized.
- X
- XAlignment was added to artifacts, and their suitability was improved.
- X
- XDiscover mode games no longer use up bones files.
- X
- XSome excess 'register's that were giving Xenix trouble were removed.
- X
- XWe settled an (amusing) argument over "rights" to available bits which
- Xwas responsible (unintentionally) for ring-wielding bestowing
- Xlong-lasting intrinsic attributes.
- X
- XIn addition, many bugs were fixed. Among those were the problems
- Xwith polymorphing creatures that swallowed you, finishing with
- Xcontainers, having chains eaten, external pagers, statue weights, wishing
- Xloopholes, parsing endgame options, and monsters growing up.
- X
- XIn other words, this is a nuts and bolts patch, nothing dramatic but
- Xlots of cleanup.
- X
- END_OF_FILE
- if test 1310 -ne `wc -c <'UPDATE3'`; then
- echo shar: \"'UPDATE3'\" unpacked with wrong size!
- fi
- # end of 'UPDATE3'
- fi
- if test -f 'patch03b' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'patch03b'\"
- else
- echo shar: Extracting \"'patch03b'\" \(34436 characters\)
- sed "s/^X//" >'patch03b' <<'END_OF_FILE'
- X*** others/Old/Makefile.os2 Wed Sep 6 15:28:55 1989
- X--- others/Makefile.os2 Mon Aug 21 12:24:24 1989
- X***************
- X*** 1,8 ****
- X! # SCCS Id: @(#)Makefile.os2 3.0 89/08/10
- X # PC NetHack 3.0 Makefile for Microsoft(tm) C 5.1 and OS/2
- X #
- X! # NDMAKE ver 4.3+ is required, MS-MAKE does *not* work
- X #
- X # Large memory model
- X CC = cl
- X LINK = link
- X--- 1,16 ----
- X! # SCCS Id: @(#)Makefile.os2 3.0 89/08/19
- X # PC NetHack 3.0 Makefile for Microsoft(tm) C 5.1 and OS/2
- X #
- X! # NDMAKE ver 4.3+ is required, MS-MAKE does not work
- X! # without (probably large) modifications -- Timo Hakulinen
- X #
- X+ # Copy pctty.c, pcunix.c, pcmain.c, msdos.c and this file
- X+ # (+ termcap sources if used) into $(SRC) directory, then
- X+ # compile and link in real mode inside $(SRC).
- X+ #
- X+ # To use CodeView define OS2_CODEVIEW in pcconf.h and set
- X+ # HACKDIR (+ TERM and TERMCAP if used) in OS/2 config.sys.
- X+ #
- X # Large memory model
- X CC = cl
- X LINK = link
- X***************
- X*** 50,58 ****
- X # Optional high-quality BSD random number generation routines (see pcconf.h).
- X # Set to nothing if not used.
- X RANDOM = o\random.o
- X
- X! # Termcap objs
- 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
- X
- X # For NDMAKE, to handle the .o suffix.
- X .SUFFIXES: .exe .o .c .y .l
- X--- 58,69 ----
- X # Optional high-quality BSD random number generation routines (see pcconf.h).
- X # Set to nothing if not used.
- X RANDOM = o\random.o
- X+ #RANDOM=
- X
- X! # Termcap objs. Set to nothing if TERMLIB not defined in pcconf.h. In that
- X! # case a dummy termlib.lib is created.
- 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
- X! TERMOBJS=
- X
- X # For NDMAKE, to handle the .o suffix.
- X .SUFFIXES: .exe .o .c .y .l
- X***************
- X*** 111,118 ****
- X $(GAMEDIR)\$(GAME).exe: o $(HOBJ) $(OS2DEFS) $(TERMLIB)
- X $(LINK) $(HOBJ),$(GAMEDIR)\$(GAME),$(GAME),$(PLIBS) $(TERMLIB),$(OS2DEFS) $(LFLAGS) ;
- X
- X! # NDMAKE automatically generates LINK response files, so you can
- X! # uncomment the second line if you are using NDMAKE.
- X
- X $(GAME): $(GAMEDIR)\$(GAME).exe
- X $(GAME).exe: $(GAMEDIR)\$(GAME).exe
- X--- 122,128 ----
- X $(GAMEDIR)\$(GAME).exe: o $(HOBJ) $(OS2DEFS) $(TERMLIB)
- X $(LINK) $(HOBJ),$(GAMEDIR)\$(GAME),$(GAME),$(PLIBS) $(TERMLIB),$(OS2DEFS) $(LFLAGS) ;
- X
- X! # NDMAKE automatically generates LINK and LIB response files
- X
- X $(GAME): $(GAMEDIR)\$(GAME).exe
- X $(GAME).exe: $(GAMEDIR)\$(GAME).exe
- X***************
- X*** 186,192 ****
- X # Secondary targets
- X #
- X
- X! auxil: spec_levs
- X xcopy $(AUX)\*. $(GAMEDIR)
- X
- X spec_levs: $(AUX)\castle.des $(AUX)\endgame.des $(AUX)\tower.des
- X--- 196,202 ----
- X # Secondary targets
- X #
- X
- X! auxil: spec_levs data rumors
- X xcopy $(AUX)\*. $(GAMEDIR)
- X
- X spec_levs: $(AUX)\castle.des $(AUX)\endgame.des $(AUX)\tower.des
- X***************
- X*** 211,217 ****
- X echo foo> $(GAMEDIR)\record
- X
- X clean:
- X! del o\*.obj
- X rmdir o
- X
- X spotless: clean
- X--- 221,227 ----
- X echo foo> $(GAMEDIR)\record
- X
- X clean:
- X! del o\*.o
- X rmdir o
- X
- X spotless: clean
- X***************
- X*** 218,226 ****
- X del $(INCL)\date.h
- X del $(INCL)\onames.h
- X del $(INCL)\pm.h
- X- touch $(INCL)\date.h $(INCL)\onames.h $(INCL)\pm.h
- X del makedefs.exe
- X! if exist lev_comp.exe del lev_comp.exe
- X
- X #
- X # Other dependencies
- X--- 228,243 ----
- X del $(INCL)\date.h
- X del $(INCL)\onames.h
- X del $(INCL)\pm.h
- X del makedefs.exe
- X! del lev_comp.exe
- X! del $(TERMLIB)
- X! del *.def
- X! del *.map
- X! del $(AUX)\data
- X! del $(AUX)\rumors
- X! del castle
- X! del endgame
- X! del tower?
- X
- X #
- X # Other dependencies
- X*** others/Old/Makefile.st Wed Sep 6 15:29:25 1989
- X--- others/Makefile.st Wed Sep 6 12:27:21 1989
- X***************
- X*** 8,20 ****
- X # the dependencies for monst1.o and monst2.o. If they ever change
- X # the loader, this kludge might break.
- X #
- X- # MODEL = -mshort for 16 bit integers; then use -lcurses16 for TERMCAP
- X- # (I haven't tried this yet, and am not confident of its success.)
- X- #
- X CC = d:\gnu\bin\gcc.ttp
- X LD = d:\gnu\bin\gcc-ld.ttp
- X! MODEL =
- X! TERMCAP = -lcurses
- X
- X # Directories (makedefs hardcodes these, don't change them)
- X INCL = ..\include
- X--- 8,25 ----
- X # the dependencies for monst1.o and monst2.o. If they ever change
- X # the loader, this kludge might break.
- X #
- X CC = d:\gnu\bin\gcc.ttp
- X LD = d:\gnu\bin\gcc-ld.ttp
- X! YACC = d:\gnu\bin\bison.ttp -y
- X! LEX = d:\gnu\bin\flex.ttp
- X! #
- X! # for 32 bit integers (slow, but type mismatches are no problem)
- X! # MODEL =
- X! # TERMCAP = -lcurses
- X! #
- X! # for 16 bit integers (faster, but more finicky)
- X! MODEL = -mshort
- X! TERMCAP = -lcurses16
- X
- X # Directories (makedefs hardcodes these, don't change them)
- X INCL = ..\include
- X***************
- X*** 89,95 ****
- X
- X $(GAME): $(GAMEDIR)\$(GAME).ttp
- X
- X! all: $(GAME) auxil
- X @echo Done.
- X
- X makedefs.ttp: $(MAKEOBJS)
- X--- 94,100 ----
- X
- X $(GAME): $(GAMEDIR)\$(GAME).ttp
- X
- X! all: $(GAME) lev_comp.ttp auxil
- X @echo Done.
- X
- X makedefs.ttp: $(MAKEOBJS)
- X***************
- X*** 105,115 ****
- X lev_main.o: $(HACK_H) $(INCL)\sp_lev.h
- X
- X # If you have yacc or lex programs, and make any changes,
- X! # add some .y.c and .l.c rules to your Make.ini.
- X!
- X lev_comp.c: lev_comp.y
- X! lev_lex.c: lev_comp.l
- X
- X #
- X # The following include files depend on makedefs to be created.
- X #
- X--- 110,131 ----
- X lev_main.o: $(HACK_H) $(INCL)\sp_lev.h
- X
- X # If you have yacc or lex programs, and make any changes,
- X! # you'll need rules like these. The names of the output
- X! # files (e.g. lex,yy.c) vary widely among different ST implementations
- X! # of YACC and LEX.
- X! #
- X! # Also: for some reason the supplied lev_lex.c causes the GCC to abort
- X! # on my machine (maybe not enough memory?) when compiled with -mshort.
- X! # With MODEL=-mshort, I had to delete lev_lex.c and use these rules.
- X! #
- X lev_comp.c: lev_comp.y
- X! $(YACC) -d lev_comp.y
- X! mv y,tab.c lev_comp.c
- X! mv y,tab.h ..\include\lev_comp.h
- X
- X+ lev_lex.c: lev_comp.l
- X+ $(LEX) lev_comp.l
- X+ mv lex,yy.c lev_lex.c
- X #
- X # The following include files depend on makedefs to be created.
- X #
- X***************
- X*** 151,156 ****
- X--- 167,178 ----
- X rip.o: $(HACK_H)
- X $(CC) -c $(CFLAGS) -fwritable-strings rip.c
- X #
- X+ # GCC 1.35 + bones.c + -mshort + -O == incorrect code. Don't ask me why.
- X+ # So we just omit the -O on bones.c
- X+ #
- X+ bones.o: $(HACK_H)
- X+ $(CC) -c $(MODEL) -I$(INCL) bones.c
- X+ #
- X # Secondary targets
- X #
- X
- X***************
- X*** 159,168 ****
- X cp *. $(GAMEDIR)
- X
- X spec_levs: $(AUX)\castle.des $(AUX)\endgame.des $(AUX)\tower.des
- X- lev_comp $(AUX)\castle.des
- X- lev_comp $(AUX)\endgame.des
- X- lev_comp $(AUX)\tower.des
- X cd $(AUX)
- X cp castle $(GAMEDIR)
- X rm castle
- X cp endgame $(GAMEDIR)
- X--- 181,190 ----
- X cp *. $(GAMEDIR)
- X
- X spec_levs: $(AUX)\castle.des $(AUX)\endgame.des $(AUX)\tower.des
- X cd $(AUX)
- X+ ..\src\lev_comp castle.des
- X+ ..\src\lev_comp endgame.des
- X+ ..\src\lev_comp tower.des
- X cp castle $(GAMEDIR)
- X rm castle
- X cp endgame $(GAMEDIR)
- X***************
- X*** 193,199 ****
- X apply.o: $(HACK_H) $(INCL)\edog.h
- X artifact.o: $(HACK_H) $(INCL)\artifact.h
- X attrib.o: $(HACK_H)
- X! bones.o: $(HACK_H)
- X cmd.o: $(HACK_H) $(INCL)\func_tab.h
- X dbridge.o: $(HACK_H)
- X decl.o: $(HACK_H)
- X--- 215,221 ----
- X apply.o: $(HACK_H) $(INCL)\edog.h
- X artifact.o: $(HACK_H) $(INCL)\artifact.h
- X attrib.o: $(HACK_H)
- X! #bones.o: $(HACK_H)
- X cmd.o: $(HACK_H) $(INCL)\func_tab.h
- X dbridge.o: $(HACK_H)
- X decl.o: $(HACK_H)
- X*** others/Old/msdos.c Wed Sep 6 15:30:16 1989
- X--- others/msdos.c Mon Sep 4 14:39:46 1989
- X***************
- X*** 9,20 ****
- X # include <osbind.h>
- X # else
- X # ifdef __TURBOC__ /* avoid incompatible redeclaration */
- X- # define getdate quux
- X- # endif
- X- # include <dos.h>
- X- # ifdef __TURBOC__
- X # undef getdate
- X # endif
- X # endif
- X #ifdef OS2
- X # include "def_os2.h" /* OS2 definitions (Timo Hakulinen) */
- X--- 9,17 ----
- X # include <osbind.h>
- X # else
- X # ifdef __TURBOC__ /* avoid incompatible redeclaration */
- X # undef getdate
- X # endif
- X+ # include <dos.h>
- X # endif
- X #ifdef OS2
- X # include "def_os2.h" /* OS2 definitions (Timo Hakulinen) */
- X***************
- X*** 101,113 ****
- X
- X if (comspec = getcomspec()) {
- X #ifdef DGK
- X! settty("To return to NetHack, type \"exit\" at the DOS prompt.\n");
- X #else
- X settty((char *)0);
- X #endif /* DGK */
- X chdirx(orgdir, 0);
- X if (spawnl(P_WAIT, comspec, comspec, NULL) < 0) {
- X! Printf("\nCan't spawn %s !\n", comspec);
- X flags.toplin = 0;
- X more();
- X }
- X--- 98,110 ----
- X
- X if (comspec = getcomspec()) {
- X #ifdef DGK
- X! settty("To return to NetHack, enter \"exit\" at the DOS prompt.\n");
- X #else
- X settty((char *)0);
- X #endif /* DGK */
- X chdirx(orgdir, 0);
- X if (spawnl(P_WAIT, comspec, comspec, NULL) < 0) {
- X! Printf("\nCan't spawn \"%s\"!\n", comspec);
- X flags.toplin = 0;
- X more();
- X }
- X***************
- X*** 117,129 ****
- X docrt();
- X } else
- X #ifdef OS2
- X! pline("Cannot exec CMD.EXE");
- X! #else
- X! #ifdef TOS
- X! pline("Cannot find SHELL");
- X #else
- X! pline("Cannot exec COMMAND.COM");
- X! #endif
- X #endif /* OS2 */
- X return 0;
- X }
- X--- 114,126 ----
- X docrt();
- X } else
- X #ifdef OS2
- X! pline("Can't execute CMD.EXE");
- X #else
- X! # ifdef TOS
- X! pline("Can't find SHELL");
- X! # else
- X! pline("Can't execute COMMAND.COM");
- X! # endif
- X #endif /* OS2 */
- X return 0;
- X }
- X***************
- X*** 134,148 ****
- X * Shift characters are output when either shift key is pushed.
- X */
- X #ifdef TOS
- X! #define KEYPADHI 113
- X! #define KEYPADLOW 103
- X #else
- X! #define KEYPADHI 83
- X! #define KEYPADLOW 71
- X #endif
- X
- X! #define PADKEYS (KEYPADHI - KEYPADLOW + 1)
- X! #define iskeypad(x) (KEYPADLOW <= (x) && (x) <= KEYPADHI)
- X static const struct pad {
- X char normal, shift;
- X } keypad[PADKEYS] = {
- X--- 131,146 ----
- X * Shift characters are output when either shift key is pushed.
- X */
- X #ifdef TOS
- X! #define KEYPADLO 0x67
- X! #define KEYPADHI 0x71
- X #else
- X! #define KEYPADLO 0x47
- X! #define KEYPADHI 0x53
- X #endif
- X
- X! #define PADKEYS (KEYPADHI - KEYPADLO + 1)
- X! #define iskeypad(x) (KEYPADLO <= (x) && (x) <= KEYPADHI)
- X!
- X static const struct pad {
- X char normal, shift;
- X } keypad[PADKEYS] = {
- X***************
- X*** 150,156 ****
- X {'k', 'K'}, /* 8 */
- X {'u', 'U'}, /* 9 */
- X #ifndef TOS
- X! {'m', CTRL('P')}, /* - */
- X #endif
- X {'h', 'H'}, /* 4 */
- X #ifdef TOS
- X--- 148,154 ----
- X {'k', 'K'}, /* 8 */
- X {'u', 'U'}, /* 9 */
- X #ifndef TOS
- X! {'m', C('p')}, /* - */
- X #endif
- X {'h', 'H'}, /* 4 */
- X #ifdef TOS
- X***************
- X*** 168,202 ****
- X {'i', 'I'}, /* Ins */
- X {'.', ':'} /* Del */
- X }, numpad[PADKEYS] = {
- X! {'7', '7'}, /* 7 */
- X! {'8', '8'}, /* 8 */
- X! {'9', '9'}, /* 9 */
- X #ifndef TOS
- X! {'m', CTRL('P')}, /* - */
- X #endif
- X! {'4', '4'}, /* 4 */
- X #ifdef TOS
- X {'.', '.'}, /* 5 */
- X #else
- X {'g', 'G'}, /* 5 */
- X #endif
- X! {'6', '6'}, /* 6 */
- X #ifndef TOS
- X {'p', 'P'}, /* + */
- X #endif
- X! {'1', '1'}, /* 1 */
- X! {'2', '2'}, /* 2 */
- X! {'3', '3'}, /* 3 */
- X {'i', 'I'}, /* Ins */
- X {'.', ':'} /* Del */
- X };
- X
- X /* BIOSgetch gets keys directly with a BIOS call.
- X */
- X #define SHIFT (0x1 | 0x2)
- X! /* #define CTRL 0x4 */
- X! /* #define ALT 0x8 */
- X! #ifndef OS2
- X #define KEYBRD_BIOS 0x16
- X #endif
- X
- X--- 166,220 ----
- X {'i', 'I'}, /* Ins */
- X {'.', ':'} /* Del */
- X }, numpad[PADKEYS] = {
- X! {'7', M('7')}, /* 7 */
- X! {'8', M('8')}, /* 8 */
- X! {'9', M('9')}, /* 9 */
- X #ifndef TOS
- X! {'m', C('p')}, /* - */
- X #endif
- X! {'4', M('4')}, /* 4 */
- X #ifdef TOS
- X {'.', '.'}, /* 5 */
- X #else
- X {'g', 'G'}, /* 5 */
- X #endif
- X! {'6', M('6')}, /* 6 */
- X #ifndef TOS
- X {'p', 'P'}, /* + */
- X #endif
- X! {'1', M('1')}, /* 1 */
- X! {'2', M('2')}, /* 2 */
- X! {'3', M('3')}, /* 3 */
- X {'i', 'I'}, /* Ins */
- X {'.', ':'} /* Del */
- X };
- X
- X+ /*
- X+ * INT 16h function 00h does not return a letter if Alt is pressed,
- X+ * but it does return the letter's scan code. So, in order to convent
- X+ * Alt-letter to a letter with the meta bit set, we use a scan code
- X+ * table to translate the scan codes into letters, then set the
- X+ * "meta" bit for them. -3.
- X+ */
- X+ #ifdef MSDOS
- X+ #define SCANLO 0x10
- X+ #define SCANHI 0x32
- X+ #define SCANKEYS (SCANHI - SCANLO + 1)
- X+ #define inmap(x) (SCANLO <= (x) && (x) <= SCANHI)
- X+
- X+ static const char scanmap[SCANKEYS] = { /* ... */
- X+ 'q','w','e','r','t','y','u','i','o','p','[',']', '\n',
- X+ 0, 'a','s','d','f','g','h','j','k','l',';','\'', '`',
- X+ 0, '\\', 'z','x','c','v','b','N','m' /* ... */
- X+ };
- X+ #endif
- X+
- X /* BIOSgetch gets keys directly with a BIOS call.
- X */
- X #define SHIFT (0x1 | 0x2)
- X! #define CTRL 0x4
- X! #define ALT 0x8
- X! #if !defined(OS2) && !defined(TOS)
- X #define KEYBRD_BIOS 0x16
- X #endif
- X
- X***************
- X*** 215,277 ****
- X scan = CharData.chScan;
- X shift = CharData.fsState;
- X #else /* OS2 */
- X! #ifdef TOS
- X long x;
- X! #else
- X union REGS regs;
- X! #endif
- X
- X /* Get scan code.
- X */
- X! #ifdef TOS
- X x = Crawcin();
- X ch = x & 0x0ff;
- X scan = (x & 0x00ff0000L) >> 16;
- X! #else
- X regs.h.ah = 0;
- X int86(KEYBRD_BIOS, ®s, ®s);
- X ch = regs.h.al;
- X scan = regs.h.ah;
- X! #endif
- X /* Get shift status.
- X */
- X! #ifdef TOS
- X shift = Kbshift(-1);
- X! #else
- X regs.h.ah = 2;
- X int86(KEYBRD_BIOS, ®s, ®s);
- X shift = regs.h.al;
- X! #endif
- X #endif /* OS2 */
- X
- X /* If scan code is for the keypad, translate it.
- X */
- X- kpad = flags.num_pad ? numpad : keypad;
- X if (iskeypad(scan)) {
- X if (shift & SHIFT) {
- X /* if number_pad is on, this makes little difference */
- X! ch = (*kpad)[scan - KEYPADLOW].shift;
- X } else
- X! ch = (*kpad)[scan - KEYPADLOW].normal;
- X }
- X return ch;
- X }
- X
- X #ifndef TOS
- X
- X! #ifndef OS2
- X #define FINDFIRST 0x4E00
- X #define FINDNEXT 0x4F00
- X #define GETDTA 0x2F00
- X #define SETFILETIME 0x5701
- X #define GETSWITCHAR 0x3700
- X! #define FREESPACE 0x36
- X! #endif
- X
- X! #ifdef __TURBOC__
- X #define switchar() (char)getswitchar()
- X! #else
- X! #ifndef OS2
- X static char
- X switchar()
- X {
- X--- 233,301 ----
- X scan = CharData.chScan;
- X shift = CharData.fsState;
- X #else /* OS2 */
- X! # ifdef TOS
- X long x;
- X! # else
- X union REGS regs;
- X! # endif
- X
- X /* Get scan code.
- X */
- X! # ifdef TOS
- X x = Crawcin();
- X ch = x & 0x0ff;
- X scan = (x & 0x00ff0000L) >> 16;
- X! # else
- X regs.h.ah = 0;
- X int86(KEYBRD_BIOS, ®s, ®s);
- X ch = regs.h.al;
- X scan = regs.h.ah;
- X! # endif
- X /* Get shift status.
- X */
- X! # ifdef TOS
- X shift = Kbshift(-1);
- X! # else
- X regs.h.ah = 2;
- X int86(KEYBRD_BIOS, ®s, ®s);
- X shift = regs.h.al;
- X! # endif
- X #endif /* OS2 */
- X
- X /* If scan code is for the keypad, translate it.
- X */
- X if (iskeypad(scan)) {
- X+ kpad = flags.num_pad ? numpad : keypad;
- X if (shift & SHIFT) {
- X /* if number_pad is on, this makes little difference */
- X! ch = (*kpad)[scan - KEYPADLO].shift;
- X } else
- X! ch = (*kpad)[scan - KEYPADLO].normal;
- X }
- X+ if (shift & ALT) {
- X+ if (!ch && inmap(scan))
- X+ ch = scanmap[scan - SCANLO];
- X+ return (isprint(ch) ? M(ch) : ch);
- X+ }
- X return ch;
- X }
- X
- X #ifndef TOS
- X
- X! # ifndef OS2
- X #define FINDFIRST 0x4E00
- X #define FINDNEXT 0x4F00
- X #define GETDTA 0x2F00
- X #define SETFILETIME 0x5701
- X #define GETSWITCHAR 0x3700
- X! #define FREESPACE 0x3600
- X! #define FATINFO 0x1B00
- X! # endif
- X
- X! # ifdef __TURBOC__
- X #define switchar() (char)getswitchar()
- X! # else
- X! # ifndef OS2
- X static char
- X switchar()
- X {
- X***************
- X*** 281,294 ****
- X intdos(®s, ®s);
- X return regs.h.dl;
- X }
- X! #endif /* OS2 */
- X! #endif
- X
- X long
- X freediskspace(path)
- X char *path;
- X {
- X! #ifdef OS2
- X struct {
- X ULONG idFileSystem;
- X ULONG cSectorUnit;
- X--- 305,318 ----
- X intdos(®s, ®s);
- X return regs.h.dl;
- X }
- X! # endif /* OS2 */
- X! # endif
- X
- X long
- X freediskspace(path)
- X char *path;
- X {
- X! # ifdef OS2
- X struct {
- X ULONG idFileSystem;
- X ULONG cSectorUnit;
- X***************
- X*** 308,317 ****
- X else
- X return ((long) FSInfoBuf.cSectorUnit * FSInfoBuf.cUnitAvail *
- X FSInfoBuf.cbSector);
- X! #else
- X union REGS regs;
- X
- X! regs.h.ah = FREESPACE;
- X if (path[0] && path[1] == ':')
- X regs.h.dl = (toupper(path[0]) - 'A') + 1;
- X else
- X--- 332,341 ----
- X else
- X return ((long) FSInfoBuf.cSectorUnit * FSInfoBuf.cUnitAvail *
- X FSInfoBuf.cbSector);
- X! # else
- X union REGS regs;
- X
- X! regs.x.ax = FREESPACE;
- X if (path[0] && path[1] == ':')
- X regs.h.dl = (toupper(path[0]) - 'A') + 1;
- X else
- X***************
- X*** 321,333 ****
- X return -1L; /* bad drive number */
- X else
- X return ((long) regs.x.bx * regs.x.cx * regs.x.ax);
- X! #endif /* OS2 */
- X }
- X
- X! #ifdef OS2
- X FILEFINDBUF ResultBuf;
- X HDIR DirHandle;
- X! #endif
- X
- X /* Functions to get filenames using wildcards
- X */
- X--- 345,357 ----
- X return -1L; /* bad drive number */
- X else
- X return ((long) regs.x.bx * regs.x.cx * regs.x.ax);
- X! # endif /* OS2 */
- X }
- X
- X! # ifdef OS2
- X FILEFINDBUF ResultBuf;
- X HDIR DirHandle;
- X! # endif
- X
- X /* Functions to get filenames using wildcards
- X */
- X***************
- X*** 335,347 ****
- X findfirst(path)
- X char *path;
- X {
- X! #ifdef OS2
- X USHORT res, SearchCount = 1;
- X
- X DirHandle = 1;
- X res = DosFindFirst((PSZ)path,&DirHandle,0,&ResultBuf,sizeof(FILEFINDBUF),&SearchCount,0L);
- X return(!res);
- X! #else
- X union REGS regs;
- X struct SREGS sregs;
- X
- X--- 359,371 ----
- X findfirst(path)
- X char *path;
- X {
- X! # ifdef OS2
- X USHORT res, SearchCount = 1;
- X
- X DirHandle = 1;
- X res = DosFindFirst((PSZ)path,&DirHandle,0,&ResultBuf,sizeof(FILEFINDBUF),&SearchCount,0L);
- X return(!res);
- X! # else
- X union REGS regs;
- X struct SREGS sregs;
- X
- X***************
- X*** 351,376 ****
- X sregs.ds = FP_SEG(path);
- X intdosx(®s, ®s, &sregs);
- X return !regs.x.cflag;
- X! #endif /* OS2 */
- X }
- X
- X static int
- X findnext() {
- X! #ifdef OS2
- X USHORT res, SearchCount = 1;
- X
- X res = DosFindNext(DirHandle,&ResultBuf,sizeof(FILEFINDBUF),&SearchCount);
- X return(!res);
- X! #else
- X union REGS regs;
- X
- X regs.x.ax = FINDNEXT;
- X intdos(®s, ®s);
- X return !regs.x.cflag;
- X! #endif /* OS2 */
- X }
- X
- X! #ifndef OS2
- X /* Get disk transfer area, Turbo C already has getdta */
- X static char *
- X getdta() {
- X--- 375,400 ----
- X sregs.ds = FP_SEG(path);
- X intdosx(®s, ®s, &sregs);
- X return !regs.x.cflag;
- X! # endif /* OS2 */
- X }
- X
- X static int
- X findnext() {
- X! # ifdef OS2
- X USHORT res, SearchCount = 1;
- X
- X res = DosFindNext(DirHandle,&ResultBuf,sizeof(FILEFINDBUF),&SearchCount);
- X return(!res);
- X! # else
- X union REGS regs;
- X
- X regs.x.ax = FINDNEXT;
- X intdos(®s, ®s);
- X return !regs.x.cflag;
- X! # endif /* OS2 */
- X }
- X
- X! # ifndef OS2
- X /* Get disk transfer area, Turbo C already has getdta */
- X static char *
- X getdta() {
- X***************
- X*** 380,394 ****
- X
- X regs.x.ax = GETDTA;
- X intdosx(®s, ®s, &sregs);
- X! #ifdef MK_FP
- X ret = MK_FP(sregs.es, regs.x.bx);
- X! #else
- X FP_OFF(ret) = regs.x.bx;
- X FP_SEG(ret) = sregs.es;
- X! #endif
- X return ret;
- X }
- X! #endif /* OS2 */
- X
- X #else /* TOS */
- X
- X--- 404,418 ----
- X
- X regs.x.ax = GETDTA;
- X intdosx(®s, ®s, &sregs);
- X! # ifdef MK_FP
- X ret = MK_FP(sregs.es, regs.x.bx);
- X! # else
- X FP_OFF(ret) = regs.x.bx;
- X FP_SEG(ret) = sregs.es;
- X! # endif
- X return ret;
- X }
- X! # endif /* OS2 */
- X
- X #else /* TOS */
- X
- X***************
- X*** 488,496 ****
- X long fs;
- X extern saveprompt;
- X
- X- #ifdef TOS
- X- extern int _copyfile();
- X- #endif
- X if (!ramdisk)
- X return;
- X
- X--- 512,517 ----
- X***************
- X*** 562,573 ****
- X /* Last file didn't get there.
- X */
- X Sprintf(to, "%s%s", topath, allbones);
- X! msmsg("Cannot copy `%s' to `%s' -- %s\n", from, to,
- X! (status < 0) ? "can't spawn COMSPEC !" :
- X! (freediskspace(topath) < filesize(from)) ?
- X "insufficient disk space." : "bad path(s)?");
- X if (mode == TOPERM) {
- X! msmsg("Bones will be left in `%s'\n",
- X *levels ? levels : hackdir);
- X } else {
- X /* Remove all bones files on the RAMdisk */
- X--- 583,596 ----
- X /* Last file didn't get there.
- X */
- X Sprintf(to, "%s%s", topath, allbones);
- X! msmsg("Can't copy \"%s\" to \"%s\" -- ", from, to);
- X! if (status < 0)
- X! msmsg("can't spawn \"%s\"!", comspec);
- X! else
- X! msmsg((freediskspace(topath) < filesize(from)) ?
- X "insufficient disk space." : "bad path(s)?");
- X if (mode == TOPERM) {
- X! msmsg("Bones will be left in \"%s\"\n",
- X *levels ? levels : hackdir);
- X } else {
- X /* Remove all bones files on the RAMdisk */
- X***************
- X*** 577,587 ****
- X return;
- X }
- X
- X void
- X playwoRAMdisk() {
- X msmsg("Do you wish to play without a RAMdisk? ");
- X
- X! /* Set ramdisk false *before* exit'ing (because msexit calls
- X * copybones)
- X */
- X ramdisk = FALSE;
- X--- 600,634 ----
- X return;
- X }
- X
- X+ #if 0 /* defined(MSDOS) && !defined(TOS) && !defined(OS2) */
- X+ boolean
- X+ removeable_drive(drive)
- X+ char drive;
- X+ /* check whether current drive is a fixed disk,
- X+ so we don't ask the player to insert one */
- X+ {
- X+ union REGS regs;
- X+ char *fat_id;
- X+
- X+ regs.x.ax = FATINFO;
- X+ intdos(®s, ®s);
- X+ /* also returns size info, as
- X+ AL (sectors/cluster) * CX (bytes/sector) * DX (clusters/disk) */
- X+ # ifdef MK_FP
- X+ fat_id = MK_FP(sregs.ds, regs.x.bx);
- X+ # else
- X+ FP_OFF(fat_id) = regs.x.bx;
- X+ FP_SEG(fat_id) = sregs.ds;
- X+ # endif
- X+ return (*fat_id != 0xF8);
- X+ }
- X+ #endif
- X+
- X void
- X playwoRAMdisk() {
- X msmsg("Do you wish to play without a RAMdisk? ");
- X
- X! /* Set ramdisk false *before* exit-ing (because msexit calls
- X * copybones)
- X */
- X ramdisk = FALSE;
- X***************
- X*** 608,616 ****
- X remember_topl();
- X home();
- X cl_end();
- X! msmsg("If save file is on a SAVE disk, put that disk in now.\n");
- X cl_end();
- X! msmsg("File name (default `%s'%s) ? ", SAVEF,
- X start ? "" : ", <Esc> cancels save");
- X getlin(buf);
- X home();
- X--- 655,663 ----
- X remember_topl();
- X home();
- X cl_end();
- X! msmsg("If save file is on a save disk, insert that disk now.\n");
- X cl_end();
- X! msmsg("File name (default \"%s\"%s) ? ", SAVEF,
- X start ? "" : ", <Esc> cancels save");
- X getlin(buf);
- X home();
- X***************
- X*** 680,695 ****
- X if (record_exists() && comspec_exists())
- X return;
- X (void) putchar('\n');
- X! getreturn("when the GAME disk has been put in");
- X }
- X if (comspec_exists() && record_exists())
- X return;
- X
- X if (!comspec_exists())
- X! msmsg("\n\nWARNING: can't find comspec `%s'!\n", getcomspec());
- X! if (!record_exists())
- X! msmsg("\n\nWARNING: can't find record file `%s'!\n", RECORD);
- X! msmsg("If the GAME disk is not in, put it in now.\n");
- X getreturn("to continue");
- X return;
- X }
- X--- 727,742 ----
- X if (record_exists() && comspec_exists())
- X return;
- X (void) putchar('\n');
- X! getreturn("when the game disk has been inserted");
- X }
- X if (comspec_exists() && record_exists())
- X return;
- X
- X if (!comspec_exists())
- X! msmsg("\n\nWARNING: can't find command processor \"%s\"!\n", getcomspec());
- X! if (!record_exists())
- X! msmsg("\n\nWARNING: can't find record file \"%s\"!\n", RECORD);
- X! msmsg("If the game disk is not in, insert it now.\n");
- X getreturn("to continue");
- X return;
- X }
- X***************
- X*** 735,741 ****
- X
- X /* find the '=' */
- X if (!(bufp = strchr(buf, '='))) {
- X! msmsg("Bad option line: '%s'\n", buf);
- X getreturn("to continue");
- X continue;
- X }
- X--- 782,788 ----
- X
- X /* find the '=' */
- X if (!(bufp = strchr(buf, '='))) {
- X! msmsg("Bad option line: \"%s\"\n", buf);
- X getreturn("to continue");
- X continue;
- X }
- X***************
- X*** 773,782 ****
- X (void) strncpy(SAVEF, bufp, PATHLEN);
- X append_slash(SAVEF);
- X } else if (!strncmp(buf, "GRAPHICS", 4)) {
- X! unsigned int translate[MAXPCHARS];
- X! int i;
- X
- X! if ((i = sscanf(bufp,
- 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",
- X &translate[0], &translate[1], &translate[2],
- X &translate[3], &translate[4], &translate[5],
- X--- 820,829 ----
- X (void) strncpy(SAVEF, bufp, PATHLEN);
- X append_slash(SAVEF);
- X } else if (!strncmp(buf, "GRAPHICS", 4)) {
- X! unsigned int translate[MAXPCHARS+1];
- X! int lth;
- X
- X! if ((lth = sscanf(bufp,
- 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",
- X &translate[0], &translate[1], &translate[2],
- X &translate[3], &translate[4], &translate[5],
- X***************
- X*** 788,843 ****
- X &translate[21], &translate[22], &translate[23],
- X &translate[24], &translate[25], &translate[26],
- X &translate[27], &translate[28], &translate[29],
- X! &translate[30], &translate[31])) < 0) {
- X msmsg ("Syntax error in GRAPHICS\n");
- X getreturn("to continue");
- X }
- X! #define SETPCHAR(f, n) showsyms.f = (i > n) ? translate[n] : defsyms.f
- X! SETPCHAR(stone, 0);
- X! SETPCHAR(vwall, 1);
- X! SETPCHAR(hwall, 2);
- X! SETPCHAR(tlcorn, 3);
- X! SETPCHAR(trcorn, 4);
- X! SETPCHAR(blcorn, 5);
- X! SETPCHAR(brcorn, 6);
- X! SETPCHAR(crwall, 7);
- X! SETPCHAR(tuwall, 8);
- X! SETPCHAR(tdwall, 9);
- X! SETPCHAR(tlwall, 10);
- X! SETPCHAR(trwall, 11);
- X! SETPCHAR(vbeam, 12);
- X! SETPCHAR(hbeam, 13);
- X! SETPCHAR(lslant, 14);
- X! SETPCHAR(rslant, 15);
- X! SETPCHAR(door, 16);
- X! SETPCHAR(room, 17);
- X! SETPCHAR(corr, 18);
- X! SETPCHAR(upstair, 19);
- X! SETPCHAR(dnstair, 20);
- X! SETPCHAR(trap, 21);
- X! SETPCHAR(web, 22);
- X! SETPCHAR(pool, 23);
- X! #ifdef FOUNTAINS
- X! SETPCHAR(fountain, 24);
- X! #endif
- X! #ifdef SINKS
- X! SETPCHAR(sink, 25);
- X! #endif
- X! #ifdef THRONES
- X! SETPCHAR(throne, 26);
- X! #endif
- X! #ifdef ALTARS
- X! SETPCHAR(altar, 27);
- X! #endif
- X! #ifdef STRONGHOLD
- X! SETPCHAR(upladder, 28);
- X! SETPCHAR(dnladder, 29);
- X! SETPCHAR(dbvwall, 30);
- X! SETPCHAR(dbhwall, 31);
- X! #endif
- X! #undef SETPCHAR
- X } else {
- X! msmsg("Bad option line: '%s'\n", buf);
- X getreturn("to continue");
- X }
- X }
- X--- 835,847 ----
- X &translate[21], &translate[22], &translate[23],
- X &translate[24], &translate[25], &translate[26],
- X &translate[27], &translate[28], &translate[29],
- X! &translate[30], &translate[31])) <= 0) {
- X msmsg ("Syntax error in GRAPHICS\n");
- X getreturn("to continue");
- X }
- X! assign_graphics(translate, lth);
- X } else {
- X! msmsg("Bad option line: \"%s\"\n", buf);
- X getreturn("to continue");
- X }
- X }
- X***************
- X*** 898,904 ****
- X getreturn(str)
- X char *str;
- X {
- X! msmsg("Hit <RETURN> %s.", str);
- X while (Getchar() != '\n') ;
- X return;
- X }
- X--- 902,912 ----
- X getreturn(str)
- X char *str;
- X {
- X! #ifdef TOS
- X! msmsg("Hit <Return> %s.", str);
- X! #else
- X! msmsg("Hit <Enter> %s.", str);
- X! #endif
- X while (Getchar() != '\n') ;
- X return;
- X }
- X***************
- X*** 988,994 ****
- X if (!flags.rawio) return;
- X #endif
- X #ifdef OS2
- X! KbdInfo.cb = 10;
- X KbdGetStatus(&KbdInfo,KbdHandle);
- X KbdInfo.fsMask &= 0xFFF7; /* ASCII off */
- X KbdInfo.fsMask |= 0x0004; /* BINARY on */
- X--- 996,1002 ----
- X if (!flags.rawio) return;
- X #endif
- X #ifdef OS2
- X! KbdInfo.cb = sizeof(KbdInfo);
- X KbdGetStatus(&KbdInfo,KbdHandle);
- X KbdInfo.fsMask &= 0xFFF7; /* ASCII off */
- X KbdInfo.fsMask |= 0x0004; /* BINARY on */
- X***************
- X*** 1015,1021 ****
- X if (!flags.rawio) return;
- X #endif
- X #ifdef OS2
- X! KbdInfo.cb = 10;
- X KbdGetStatus(&KbdInfo,KbdHandle);
- X KbdInfo.fsMask &= 0xFFFB; /* BINARY off */
- X KbdInfo.fsMask |= 0x0008; /* ASCII on */
- X--- 1023,1029 ----
- X if (!flags.rawio) return;
- X #endif
- X #ifdef OS2
- X! KbdInfo.cb = sizeof(KbdInfo);
- X KbdGetStatus(&KbdInfo,KbdHandle);
- X KbdInfo.fsMask &= 0xFFFB; /* BINARY off */
- X KbdInfo.fsMask |= 0x0008; /* ASCII on */
- X***************
- X*** 1098,1103 ****
- X--- 1106,1115 ----
- X /* Chdir back to original directory
- X */
- X #undef exit
- X+ #ifdef TOS
- X+ extern boolean run_from_desktop; /* set in pcmain.c */
- X+ #endif
- X+
- X void exit(int);
- X void
- X msexit(code)
- X***************
- X*** 1118,1124 ****
- X chdrive(orgdir);
- X #endif
- X #ifdef TOS
- X! getreturn("to continue"); /* so the user can read the score list */
- X #endif
- X exit(code);
- X return;
- X--- 1130,1137 ----
- X chdrive(orgdir);
- X #endif
- X #ifdef TOS
- X! if (run_from_desktop)
- X! getreturn("to continue"); /* so the user can read the score list */
- X #endif
- X exit(code);
- X return;
- X***************
- X*** 1139,1144 ****
- X--- 1152,1158 ----
- X CO = ModeInfo.col;
- X LI = ModeInfo.row;
- X # else
- X+ # ifndef TOS
- X union REGS regs;
- X
- X if (!flags.IBMBIOS) { /* assume standard screen size */
- X***************
- X*** 1171,1176 ****
- X--- 1185,1191 ----
- X
- X LI = regs.h.dl + 1;
- X CO = regs.h.ah;
- X+ # endif /* TOS */
- X # endif
- X }
- X # endif
- X***************
- X*** 1181,1186 ****
- X--- 1196,1202 ----
- X
- X int
- X _copyfile(from, to)
- X+ char *from, *to;
- X {
- X int fromfd, tofd, r;
- X char *buf;
- X*** others/Old/oldtos.c Wed Sep 6 15:30:57 1989
- X--- others/oldtos.c Thu Aug 31 20:27:13 1989
- X***************
- X*** 438,447 ****
- X append_slash(SAVEF);
- X
- X } else if (!strncmp(buf, "GRAPHICS", 4)) {
- X! unsigned int translate[MAXPCHARS];
- X! int i;
- X
- X! if ((i = sscanf(bufp,
- 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",
- X &translate[0], &translate[1], &translate[2],
- X &translate[3], &translate[4], &translate[5],
- X--- 438,447 ----
- X append_slash(SAVEF);
- X
- X } else if (!strncmp(buf, "GRAPHICS", 4)) {
- X! unsigned int translate[MAXPCHARS+1];
- X! int lth;
- X
- X! if ((lth = sscanf(bufp,
- 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",
- X &translate[0], &translate[1], &translate[2],
- X &translate[3], &translate[4], &translate[5],
- X***************
- X*** 457,506 ****
- X cprintf("Syntax error in GRAPHICS\n");
- X getreturn("to continue");
- X }
- X! #define SETPCHAR(f, n) showsyms.f = (i > n) ? translate[n] : defsyms.f
- X! SETPCHAR(stone, 0);
- X! SETPCHAR(vwall, 1);
- X! SETPCHAR(hwall, 2);
- X! SETPCHAR(tlcorn, 3);
- X! SETPCHAR(trcorn, 4);
- X! SETPCHAR(blcorn, 5);
- X! SETPCHAR(brcorn, 6);
- X! SETPCHAR(crwall, 7);
- X! SETPCHAR(tuwall, 8);
- X! SETPCHAR(tdwall, 9);
- X! SETPCHAR(tlwall, 10);
- X! SETPCHAR(trwall, 11);
- X! SETPCHAR(vbeam, 12);
- X! SETPCHAR(hbeam, 13);
- X! SETPCHAR(lslant, 14);
- X! SETPCHAR(rslant, 15);
- X! SETPCHAR(door, 16);
- X! SETPCHAR(room, 17);
- X! SETPCHAR(corr, 18);
- X! SETPCHAR(upstair, 19);
- X! SETPCHAR(dnstair, 20);
- X! SETPCHAR(trap, 21);
- X! SETPCHAR(web, 22);
- X! SETPCHAR(pool, 23);
- X! #ifdef FOUNTAINS
- X! SETPCHAR(fountain, 24);
- X! #endif
- X! #ifdef SINKS
- X! SETPCHAR(sink, 25);
- X! #endif
- X! #ifdef THRONES
- X! SETPCHAR(throne, 26);
- X! #endif
- X! #ifdef ALTARS
- X! SETPCHAR(altar, 27);
- X! #endif
- X! #ifdef STRONGHOLD
- X! SETPCHAR(upladder, 28);
- X! SETPCHAR(dnladder, 29);
- X! SETPCHAR(dbvwall, 30);
- X! SETPCHAR(dbhwall, 31);
- X! #endif
- X! #undef SETPCHAR
- X } else {
- X cprintf("Bad option line: '%s'\n", buf);
- X getreturn("to continue");
- X--- 457,463 ----
- X cprintf("Syntax error in GRAPHICS\n");
- X getreturn("to continue");
- X }
- X! assign_graphics(translate, lth);
- X } else {
- X cprintf("Bad option line: '%s'\n", buf);
- X getreturn("to continue");
- X*** others/Old/pcmain.c Wed Sep 6 15:31:25 1989
- X--- others/pcmain.c Sat Sep 2 15:01:12 1989
- X***************
- X*** 34,41 ****
- X extern unsigned char _osmajor;
- X #endif
- X
- X! #if defined(TOS) && defined(__GNUC__)
- X long _stksize = 16*1024;
- X #endif
- X
- X #ifdef OLD_TOS
- X--- 34,44 ----
- X extern unsigned char _osmajor;
- X #endif
- X
- X! #ifdef TOS
- X! boolean run_from_desktop = TRUE; /* should we pause before exiting?? */
- X! # ifdef __GNUC__
- X long _stksize = 16*1024;
- X+ # endif
- X #endif
- X
- X #ifdef OLD_TOS
- X***************
- X*** 52,70 ****
- X extern int x_maze_max, y_maze_max;
- X register int fd;
- X register char *dir;
- X!
- X! #ifdef AMIGA
- X! /*
- X! * Make sure screen IO is initialized before anything happens.
- X! */
- X! gettty();
- X! startup();
- X! #else /* AMIGA */
- X! /* Save current directory and make sure it gets restored when
- X! * the game is exited.
- X! */
- X int (*funcp)();
- X!
- X #if defined(TOS) && defined(__GNUC__)
- X extern int _unixmode;
- X _unixmode = 0;
- X--- 55,63 ----
- X extern int x_maze_max, y_maze_max;
- X register int fd;
- X register char *dir;
- X! #ifndef AMIGA
- X int (*funcp)();
- X! #endif
- X #if defined(TOS) && defined(__GNUC__)
- X extern int _unixmode;
- X _unixmode = 0;
- X***************
- X*** 73,82 ****
- X # ifdef __TURBOC__
- X if (_osmajor >= 3) hname = argv[0]; /* DOS 3.0+ */
- X # endif
- X! if (getcwd(orgdir, sizeof orgdir) == NULL) {
- X! xputs("NetHack: current directory path too long\n");
- X! return 1;
- X }
- X funcp = exit; /* Kludge to get around LINT_ARGS of signal.
- X * This will produce a compiler warning, but that's OK.
- X */
- X--- 66,97 ----
- X # ifdef __TURBOC__
- X if (_osmajor >= 3) hname = argv[0]; /* DOS 3.0+ */
- X # endif
- X! # ifdef TOS
- X! if (*argv[0]) { /* only a CLI can give us argv[0] */
- X! hname = argv[0];
- X! run_from_desktop = FALSE;
- X }
- X+ # endif
- X+
- X+ /*
- X+ * Initialize screen I/O before anything is displayed.
- X+ *
- X+ * startup() must be called before initoptions()
- X+ * due to ordering of graphics settings, and before
- X+ * any calls to error() due to use of termcap strings.
- X+ */
- X+ gettty();
- X+ #ifndef AMIGA
- X+ setbuf(stdout,obuf);
- X+ #endif
- X+ startup();
- X+
- X+ #ifndef AMIGA
- X+ /* Save current directory and make sure it gets restored when
- X+ * the game is exited.
- X+ */
- X+ if (getcwd(orgdir, sizeof orgdir) == NULL)
- X+ error("NetHack: current directory path too long");
- X funcp = exit; /* Kludge to get around LINT_ARGS of signal.
- X * This will produce a compiler warning, but that's OK.
- X */
- X***************
- X*** 85,93 ****
- X # endif
- X #endif /* AMIGA */
- X
- X- /* Set the default values of the presentation characters */
- X- (void) memcpy((genericptr_t) &showsyms,
- X- (genericptr_t) &defsyms, sizeof(struct symbols));
- X if ((dir = getenv("HACKDIR")) != NULL) {
- X Strcpy(hackdir, dir);
- X #ifdef CHDIR
- X--- 100,105 ----
- X***************
- X*** 100,105 ****
- X--- 112,118 ----
- X fileinfo[i] = zfinfo;
- X }
- X #endif /* DGK && !OLD_TOS */
- X+
- X initoptions();
- X if (!hackdir[0])
- X Strcpy(hackdir, orgdir);
- X***************
- X*** 119,129 ****
- X argv++;
- X dir = argv[0];
- X }
- X! if(!*dir) {
- X! /* can't use error() until termcap read in */
- X! xputs("Flag -d must be followed by a directory name.\n");
- X! return 1;
- X! }
- X Strcpy(hackdir, dir);
- X }
- X
- X--- 132,139 ----
- X argv++;
- X dir = argv[0];
- X }
- X! if(!*dir)
- X! error("Flag -d must be followed by a directory name.");
- X Strcpy(hackdir, dir);
- X }
- X
- X***************
- X*** 144,158 ****
- X }
- X }
- X
- X- #ifndef AMIGA
- X- /*
- X- * It seems he really wants to play.
- X- * Remember tty modes, to be restored on exit.
- X- */
- X- gettty();
- X- setbuf(stdout,obuf);
- X- startup();
- X- #endif
- X setrandom();
- X cls();
- X u.uhp = 1; /* prevent RIP on early quits */
- X--- 154,159 ----
- X
- END_OF_FILE
- if test 34436 -ne `wc -c <'patch03b'`; then
- echo shar: \"'patch03b'\" unpacked with wrong size!
- fi
- # end of 'patch03b'
- fi
- echo shar: End of archive 2 \(of 6\).
- cp /dev/null ark2isdone
- MISSING=""
- for I in 1 2 3 4 5 6 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 6 archives.
- rm -f ark[1-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
-