Merge branch 'NetHack-3.6.2'

This commit is contained in:
nhmall
2019-02-18 11:53:46 -05:00
3 changed files with 135 additions and 49 deletions

View File

@@ -1,5 +1,5 @@
# NetHack Makefile (VMS) - for building nethack itself. # NetHack Makefile (VMS) - for building nethack itself.
# NetHack 3.6 Makefile.src $NHDT-Date: 1549835645 2019/02/10 21:54:05 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.33 $ # NetHack 3.6 Makefile.src $NHDT-Date: 1550360058 2019/02/16 23:34:18 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.34 $
# Copyright (c) 2011 by Robert Patrick Rankin # Copyright (c) 2011 by Robert Patrick Rankin
# NetHack may be freely redistributed. See license for details. # NetHack may be freely redistributed. See license for details.
@@ -23,6 +23,7 @@ INC = [-.include]
SYSSHR = [-.sys.share] SYSSHR = [-.sys.share]
SRC = [-.src] SRC = [-.src]
TTY = [-.win.tty] TTY = [-.win.tty]
CURSES = [-.win.curses]
UTL = [-.util] UTL = [-.util]
VMS = [-.sys.vms] VMS = [-.sys.vms]
WINSHR = [-.win.share] WINSHR = [-.win.share]
@@ -74,6 +75,13 @@ WINTTYSRC = $(TTY)getline.c $(TTY)termcap.c $(TTY)topl.c $(TTY)wintty.c \
$(TERMCAPSRC) $(TERMCAPSRC)
WINTTYOBJ = getline.obj,termcap.obj,topl.obj,wintty.obj $(TERMCAPOBJ) WINTTYOBJ = getline.obj,termcap.obj,topl.obj,wintty.obj $(TERMCAPOBJ)
# #
# curses; doesn't use termcap; may or may not support TERMTABLE for non-DEC tty
WINCURSESSRC = $(CURSES)cursdial.c $(CURSES)cursmesg.c $(CURSES)cursinit.c \
$(CURSES)cursmisc.c $(CURSES)cursinvt.c $(CURSES)cursstat.c \
$(CURSES)cursmain.c $(CURSES)curswins.c
WINCURSESOBJ = cursdial.obj,cursmesg.obj,cursinit.obj,cursmisc.obj, \
cursinvt.obj,cursstat.obj,cursmain.obj,curswins.obj
#
# an X11 port (not supported under DECwindows) # an X11 port (not supported under DECwindows)
WINX11SRC = $(X11)Window.c $(X11)dialogs.c $(X11)winX.c $(X11)winmap.c \ WINX11SRC = $(X11)Window.c $(X11)dialogs.c $(X11)winX.c $(X11)winmap.c \
$(X11)winmenu.c $(X11)winmesg.c $(X11)winmisc.c $(X11)winstat.c \ $(X11)winmenu.c $(X11)winmesg.c $(X11)winmisc.c $(X11)winstat.c \
@@ -82,8 +90,33 @@ WINX11OBJ = Window.obj,dialogs.obj,winX.obj,winmap.obj,winmenu.obj,\
winmesg.obj,winmisc.obj,winstat.obj,wintext.obj,winval.obj,tile.obj winmesg.obj,winmisc.obj,winstat.obj,wintext.obj,winval.obj,tile.obj
# #
# #
# make sure both WANT_WIN_TTY and WANT_WIN_CURSES have a value
.ifndef WANT_WIN_CURSES
WANT_WIN_CURSES=0
.endif
.ifndef WANT_WIN_TTY
.if WANT_WIN_CURSES
WANT_WIN_TTY=0
.else
WANT_WIN_TTY=1
.endif
.endif
.if WANT_WIN_TTY
WINSRC = $(WINTTYSRC) WINSRC = $(WINTTYSRC)
WINOBJ = $(WINTTYOBJ) WINOBJ = $(WINTTYOBJ)
.if WANT_WIN_CURSES
WINSRC +=,$(WINCURSESSRC)
WINOBJ += $(WINCURSESOBJ)
.endif
.else
.if WANT_WIN_CURSES
WINSRC = $(WINCURSESSRC)
WINOBJ = $(WINCURSESOBJ)
.else
# Neither WANT_WIN_TTY nor WANT_WIN_CURSES?
.endif
.endif
# make NetHack for VMS # make NetHack for VMS
SYSTEM = SysVMS.timestamp; SYSTEM = SysVMS.timestamp;
@@ -344,7 +377,7 @@ vmsfiles.obj : $(VMS)vmsfiles.c $(CONFIG_H)
vmsmail.obj : $(VMS)vmsmail.c $(CONFIG_H) $(INC)mail.h \ vmsmail.obj : $(VMS)vmsmail.c $(CONFIG_H) $(INC)mail.h \
$(INC)wintype.h $(INC)winprocs.h $(INC)wintype.h $(INC)winprocs.h
# conditionally used code -- VMS always wants these # conditionally used code -- VMS always wants these
isaac64.obj : isaac64.c isaac64.obj : isaac64.c $(CONFIG_H) $(INC)isaac64.h
random.obj : random.c $(HACK_H) random.obj : random.c $(HACK_H)
random.c : $(SYSSHR)random.c random.c : $(SYSSHR)random.c
copy $(SYSSHR)random.c random.c copy $(SYSSHR)random.c random.c

View File

@@ -1,24 +1,30 @@
$ ! vms/vmsbuild.com -- compile and link NetHack 3.6.* [pr] $ ! vms/vmsbuild.com -- compile and link NetHack 3.6.* [pr]
$ version_number = "3.6.2" $ version_number = "3.6.2"
$ ! $NHDT-Date: 1549835647 2019/02/10 21:54:07 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.21 $ $ ! $NHDT-Date: 1550360057 2019/02/16 23:34:17 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.22 $
$ ! Copyright (c) 2018 by Robert Patrick Rankin $ ! Copyright (c) 2018 by Robert Patrick Rankin
$ ! NetHack may be freely redistributed. See license for details. $ ! NetHack may be freely redistributed. See license for details.
$ ! $ !
$ ! usage: $ ! usage:
$ ! $ set default [.src] !or [-.-.src] if starting from [.sys.vms] $ ! $ set default [.src] !or [-.-.src] if starting from [.sys.vms]
$ ! $ @[-.sys.vms]vmsbuild [compiler-option] [link-option] [cc-switches] $ ! $ @[-.sys.vms]vmsbuild [compiler-option] [link-option] [cc-switches] -
$ ! [linker-switches] [interface]
$ ! options: $ ! options:
$ ! compiler-option : either "VAXC", "DECC" or "GNUC" or "" !default VAXC $ ! compiler-option : either "VAXC", "DECC" or "GNUC" or "" !default VAXC
$ ! link-option : either "SHARE[able]" or "LIB[rary]" !default SHARE $ ! link-option : either "SHARE[able]" or "LIB[rary]" !default SHARE
$ ! cc-switches : optional qualifiers for CC (such as "/noOpt/Debug") $ ! cc-switches : optional qualifiers for CC (such as "/noOpt/Debug")
$ ! linker-switches : optional qualifers for LINK (/Debug or /noTraceback)
$ ! interface : "TTY" or "CURSES" or "TTY+CURSES" or "CURSES+TTY"
$ ! notes: $ ! notes:
$ ! If the symbol "CC" is defined, compiler-option is not used. $ ! If the symbol "CC" is defined, compiler-option is not used (unless it
$ ! is "LINK").
$ ! The link-option refers to VAXCRTL (C Run-Time Library) handling; $ ! The link-option refers to VAXCRTL (C Run-Time Library) handling;
$ ! to specify it while letting compiler-option default, use "" as $ ! to specify it while letting compiler-option default, use "" as
$ ! the compiler-option. $ ! the compiler-option.
$ ! To re-link without compiling, use "LINK" as special 'compiler-option'; $ ! To re-link without compiling, use "LINK" as special 'compiler-option';
$ ! to re-link with GNUC library, 'CC' must begin with "G" (or "g"). $ ! to re-link with GNUC library, 'CC' must begin with "G" (or "g").
$ ! Default wizard definition moved to include/vmsconf.h. $ ! All options are positional; to specify a later one without an earlier
$ ! one, use "" in the earlier one's position, such as
$ ! $ @[-.sys.vms]vmsbuild "" "" "" "" "TTY+CURSES"
$ $
$ decc_dflt = f$trnlnm("DECC$CC_DEFAULT") $ decc_dflt = f$trnlnm("DECC$CC_DEFAULT")
$ j = (decc_dflt.nes."") .and. 1 $ j = (decc_dflt.nes."") .and. 1
@@ -233,6 +239,18 @@ $ if f$search("random.c").eqs."" then copy [-.sys.share]random.c []*.*
$ if f$search("tclib.c") .eqs."" then copy [-.sys.share]tclib.c []*.* $ if f$search("tclib.c") .eqs."" then copy [-.sys.share]tclib.c []*.*
$ if f$search("[-.util]lev_yacc.c").eqs."" then @[-.sys.vms]spec_lev.com $ if f$search("[-.util]lev_yacc.c").eqs."" then @[-.sys.vms]spec_lev.com
$! $!
$ p5 := 'p5'
$ ttysrc = "[-.win.tty]getline,[-.win.tty]termcap" -
+ ",[-.win.tty]topl,[-.win.tty]wintty"
$ cursessrc = "[-.win.curses]cursdial,[-.win/curses]cursmesg" -
+ ",[-.win.curses]cursinit,[-.win.curses]cursmisc" -
+ ",[-.win.curses]cursinvt,[-.win.curses]cursstat" -
+ ",[-.win.curses]cursmain,[-.win.curses]curswins"
$ interface = ttysrc !default
$ if p5.eqs."CURSES" then interface = cursessrc
$ if p5.eqs."TTY+CURSES" then interface = ttysrc + "," + cursessrc
$ if p5.eqs."CURSES+TTY" then interface = cursessrc + "," + ttysrc
$!
$! create object library $! create object library
$! $!
$ if c_opt.ne.o_SPCL .or. f$search(nethacklib).eqs."" then - $ if c_opt.ne.o_SPCL .or. f$search(nethacklib).eqs."" then -
@@ -265,8 +283,7 @@ $ c_list = "decl,version,[-.sys.vms]vmsmain,[-.sys.vms]vmsunix" -
+ ",[]isaac64" - !already in [.src] + ",[]isaac64" - !already in [.src]
+ ",[]random,[]tclib,[]pmatchregex" !copied from [-.sys.share] + ",[]random,[]tclib,[]pmatchregex" !copied from [-.sys.share]
$ gosub compile_list $ gosub compile_list
$ c_list = "[-.win.tty]getline,[-.win.tty]termcap" - $ c_list = interface !ttysrc or cursessrc or both
+ ",[-.win.tty]topl,[-.win.tty]wintty"
$ gosub compile_list $ gosub compile_list
$ c_list = "allmain,apply,artifact,attrib,ball,bones,botl,cmd,dbridge,detect" - $ c_list = "allmain,apply,artifact,attrib,ball,bones,botl,cmd,dbridge,detect" -
+ ",dig,display,do,do_name,do_wear,dog,dogmove,dokick,dothrow,drawing" - + ",dig,display,do,do_name,do_wear,dog,dogmove,dokick,dothrow,drawing" -

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 makedefs.c $NHDT-Date: 1539804926 2018/10/17 19:35:26 $ $NHDT-Branch: keni-makedefsm $:$NHDT-Revision: 1.126 $ */ /* NetHack 3.6 makedefs.c $NHDT-Date: 1550444428 2019/02/17 23:00:28 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.141 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Kenneth Lorber, Kensington, Maryland, 2015. */ /*-Copyright (c) Kenneth Lorber, Kensington, Maryland, 2015. */
/* Copyright (c) M. Stephenson, 1990, 1991. */ /* Copyright (c) M. Stephenson, 1990, 1991. */
@@ -186,6 +186,7 @@ static boolean FDECL(d_filter, (char *));
static boolean FDECL(h_filter, (char *)); static boolean FDECL(h_filter, (char *));
static void NDECL(build_savebones_compat_string); static void NDECL(build_savebones_compat_string);
static void NDECL(windowing_sanity); static void NDECL(windowing_sanity);
static void FDECL(opt_out_words, (char *, int *));
static boolean FDECL(qt_comment, (char *)); static boolean FDECL(qt_comment, (char *));
static boolean FDECL(qt_control, (char *)); static boolean FDECL(qt_control, (char *));
@@ -1665,10 +1666,23 @@ struct win_info {
}; };
static struct win_info window_opts[] = { static struct win_info window_opts[] = {
#ifdef TTY_GRAPHICS #ifdef TTY_GRAPHICS
{ "tty", "traditional tty-based graphics" }, { "tty",
/* testing 'USE_TILES' here would bring confusion because it could
apply to another interface such as X11, so check MSDOS explicitly
instead; even checking TTY_TILES_ESCCODES would probably be
confusing to most users (and it will already be listed separately
in the compiled options section so users aware of it can find it) */
#ifdef MSDOS
"traditional text with optional 'tiles' graphics"
#else
/* assume that one or more of IBMgraphics, DECgraphics, or MACgraphics
can be enabled; we can't tell from here whether that is accurate */
"traditional text with optional line-drawing"
#endif
},
#endif #endif
#ifdef CURSES_GRAPHICS #ifdef CURSES_GRAPHICS
{ "curses", "terminal-based graphics using curses libraries" }, { "curses", "terminal-based graphics" },
#endif #endif
#ifdef X11_GRAPHICS #ifdef X11_GRAPHICS
{ "X11", "X11" }, { "X11", "X11" },
@@ -1736,12 +1750,38 @@ windowing_sanity()
#endif /*DEFAULT_WINDOW_SYS*/ #endif /*DEFAULT_WINDOW_SYS*/
} }
static const char opt_indent[] = " ";
static void
opt_out_words(str, length_p)
char *str; /* input, but modified during processing */
int *length_p; /* in/out */
{
char *word;
while (*str) {
word = index(str, ' ');
#if 0
/* treat " (" as unbreakable space */
if (word && *(word + 1) == '(')
word = index(word + 1, ' ');
#endif
if (word)
*word = '\0';
if (*length_p + (int) strlen(str) > COLNO - 5)
Fprintf(ofp, "\n%s", opt_indent),
*length_p = (int) strlen(opt_indent);
else
Fprintf(ofp, " "), (*length_p)++;
Fprintf(ofp, "%s", str), *length_p += (int) strlen(str);
str += strlen(str) + (word ? 1 : 0);
}
}
void void
do_options() do_options()
{ {
static const char indent[] = " "; char buf[BUFSZ];
const char *str, *sep;
char *word, buf[BUFSZ];
int i, length, winsyscnt; int i, length, winsyscnt;
windowing_sanity(); windowing_sanity();
@@ -1757,56 +1797,52 @@ do_options()
} }
build_savebones_compat_string(); build_savebones_compat_string();
Fprintf(ofp, Fprintf(ofp, "\n%sNetHack version %d.%d.%d%s\n",
opt_indent,
VERSION_MAJOR, VERSION_MINOR, PATCHLEVEL,
#ifdef BETA #ifdef BETA
"\n NetHack version %d.%d.%d [beta]\n", " [beta]"
#else #else
"\n NetHack version %d.%d.%d\n", ""
#endif #endif
VERSION_MAJOR, VERSION_MINOR, PATCHLEVEL); );
Fprintf(ofp, "\nOptions compiled into this edition:\n"); Fprintf(ofp, "\nOptions compiled into this edition:\n");
length = COLNO + 1; /* force 1st item onto new line */ length = COLNO + 1; /* force 1st item onto new line */
for (i = 0; i < SIZE(build_opts); i++) { for (i = 0; i < SIZE(build_opts); i++) {
str = strcat(strcpy(buf, build_opts[i]), opt_out_words(strcat(strcpy(buf, build_opts[i]),
(i < SIZE(build_opts) - 1) ? "," : "."); (i < SIZE(build_opts) - 1) ? "," : "."),
while (*str) { &length);
word = index(str, ' ');
if (word)
*word = '\0';
if (length + strlen(str) > COLNO - 5)
Fprintf(ofp, "\n%s", indent), length = strlen(indent);
else
Fprintf(ofp, " "), length++;
Fprintf(ofp, "%s", str), length += strlen(str);
str += strlen(str) + (word ? 1 : 0);
}
} }
Fprintf(ofp, "\n"); /* terminate last line of words */
winsyscnt = SIZE(window_opts) - 1; winsyscnt = SIZE(window_opts) - 1;
Fprintf(ofp, "\n\nSupported windowing system%s:\n", Fprintf(ofp, "\nSupported windowing system%s:\n",
(winsyscnt > 1) ? "s" : ""); (winsyscnt > 1) ? "s" : "");
length = COLNO + 1; /* force 1st item onto new line */ length = COLNO + 1; /* force 1st item onto new line */
for (i = 0; i < winsyscnt; i++) { for (i = 0; i < winsyscnt; i++) {
str = window_opts[i].name; Sprintf(buf, "\"%s\"", window_opts[i].id);
if (length + strlen(str) > COLNO - 5) if (strcmp(window_opts[i].name, window_opts[i].id))
Fprintf(ofp, "\n%s", indent), length = strlen(indent); Sprintf(eos(buf), " (%s)", window_opts[i].name);
else /*
Fprintf(ofp, " "), length++; * 1 : foo.
Fprintf(ofp, "%s", str), length += strlen(str); * 2 : foo and bar (note no period; comes from 'with default' below)
sep = (winsyscnt == 1) * 3+: for, bar, and quux
? "." */
: (winsyscnt == 2) opt_out_words(strcat(buf, (winsyscnt == 1) ? "." /* no 'default' */
? ((i == 0) ? " and" : "") : (winsyscnt == 2 && i == 0) ? " and"
: (i < winsyscnt - 2) : (i == winsyscnt - 2) ? ", and"
? "," : ","),
: ((i == winsyscnt - 2) ? ", and" : ""); &length);
Fprintf(ofp, "%s", sep), length += strlen(sep);
} }
if (winsyscnt > 1) if (winsyscnt > 1) {
Fprintf(ofp, "\n%swith a default of %s.", indent, DEFAULT_WINDOW_SYS); Sprintf(buf, "with a default of \"%s\".", DEFAULT_WINDOW_SYS);
Fprintf(ofp, "\n\n"); opt_out_words(buf, &length);
}
Fprintf(ofp, "\n"); /* terminate last line of words */
/* end with a blank line */
Fprintf(ofp, "\n");
Fclose(ofp); Fclose(ofp);
return; return;
} }