Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2

This commit is contained in:
nhmall
2019-02-04 20:05:28 -05:00
10 changed files with 98 additions and 34 deletions
+3 -1
View File
@@ -1,4 +1,4 @@
$NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.245 $ $NHDT-Date: 1549157810 2019/02/03 01:36:50 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.246 $ $NHDT-Date: 1549327954 2019/02/05 00:52:34 $
This fixes36.2 file is here to capture information about updates in the 3.6.x This fixes36.2 file is here to capture information about updates in the 3.6.x
lineage following the release of 3.6.1 in April 2018. Please note, however, lineage following the release of 3.6.1 in April 2018. Please note, however,
@@ -479,6 +479,8 @@ tty: support BL_RESET in status_update to force an update to all status fields
tty: stop hitpointbar from jumping to 100% health at zero hit points tty: stop hitpointbar from jumping to 100% health at zero hit points
tty: try harder to prevent a disconnected terminal (SIGHUP) from running amok tty: try harder to prevent a disconnected terminal (SIGHUP) from running amok
and using up all available CPU time and using up all available CPU time
tty: suppress intermediate 'Count: 123' prompt and getpos autodescribe
feedback from being included in ^P message recall
MacOSX: add curses window port MacOSX: add curses window port
MacOSX: add Xcode project to sys/unixNetHack.xcodeproj MacOSX: add Xcode project to sys/unixNetHack.xcodeproj
MacOSX: add Xcode supporting files README.xcode and XCode.xcconfig MacOSX: add Xcode supporting files README.xcode and XCode.xcconfig
+2 -1
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 hack.h $NHDT-Date: 1547514631 2019/01/15 01:10:31 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.101 $ */ /* NetHack 3.6 hack.h $NHDT-Date: 1549327459 2019/02/05 00:44:19 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.102 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Pasi Kallinen, 2017. */ /*-Copyright (c) Pasi Kallinen, 2017. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -402,6 +402,7 @@ enum explosion_types {
#define PLINE_NOREPEAT 1 #define PLINE_NOREPEAT 1
#define OVERRIDE_MSGTYPE 2 #define OVERRIDE_MSGTYPE 2
#define SUPPRESS_HISTORY 4 #define SUPPRESS_HISTORY 4
#define URGENT_MESSAGE 8
/* Macros for messages referring to hands, eyes, feet, etc... */ /* Macros for messages referring to hands, eyes, feet, etc... */
enum bodypart_types { enum bodypart_types {
+11 -5
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 winprocs.h $NHDT-Date: 1502141230 2017/08/07 21:27:10 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.38 $ */ /* NetHack 3.6 winprocs.h $NHDT-Date: 1549327479 2019/02/05 00:44:39 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.46 $ */
/* Copyright (c) David Cohrs, 1992 */ /* Copyright (c) David Cohrs, 1992 */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -213,14 +213,20 @@ extern
#define WC2_DARKGRAY 0x0020L /* 06 use bold black for black glyphs */ #define WC2_DARKGRAY 0x0020L /* 06 use bold black for black glyphs */
#define WC2_HITPOINTBAR 0x0040L /* 07 show bar representing hit points */ #define WC2_HITPOINTBAR 0x0040L /* 07 show bar representing hit points */
#define WC2_FLUSH_STATUS 0x0080L /* 08 call status_update(BL_FLUSH) #define WC2_FLUSH_STATUS 0x0080L /* 08 call status_update(BL_FLUSH)
after updating status window fields */ * after updating status window fields */
#define WC2_RESET_STATUS 0x0100L /* 09 call status_update(BL_RESET) to indicate #define WC2_RESET_STATUS 0x0100L /* 09 call status_update(BL_RESET) to
draw everything */ * indicate 'draw everything' */
#define WC2_TERM_SIZE 0x0200L /* 10 support setting terminal size */ #define WC2_TERM_SIZE 0x0200L /* 10 support setting terminal size */
#define WC2_WINDOWBORDERS 0x0400L /* 11 display borders on nh windows */ #define WC2_WINDOWBORDERS 0x0400L /* 11 display borders on nh windows */
#define WC2_PETATTR 0x0800L /* 12 attributes for hilite_pet */ #define WC2_PETATTR 0x0800L /* 12 attributes for hilite_pet */
#define WC2_GUICOLOR 0x1000L /* 13 display colours outside map win */ #define WC2_GUICOLOR 0x1000L /* 13 display colours outside map win */
/* 19 free bits */ /* pline() can overload the display attributes argument passed to putstr()
with one or more flags and at most one of bold/blink/inverse/&c */
#define WC2_URGENT_MESG 0x2000L /* 14 putstr(WIN_MESSAGE) supports urgency
* via non-display attribute flag */
#define WC2_SUPPRESS_HIST 0x4000L /* 15 putstr(WIN_MESSAGE) supports history
* suppression via non-disp attr */
/* 17 free bits */
#define ALIGN_LEFT 1 #define ALIGN_LEFT 1
#define ALIGN_RIGHT 2 #define ALIGN_RIGHT 2
+3 -1
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 wintty.h $NHDT-Date: 1433806583 2015/06/08 23:36:23 $ $NHDT-Branch: master $:$NHDT-Revision: 1.24 $ */ /* NetHack 3.6 wintty.h $NHDT-Date: 1549327485 2019/02/05 00:44:45 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.32 $ */
/* Copyright (c) David Cohrs, 1991,1992 */ /* Copyright (c) David Cohrs, 1991,1992 */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -164,6 +164,8 @@ E int FDECL(has_color, (int color));
/* ### topl.c ### */ /* ### topl.c ### */
E void FDECL(show_topl, (const char *));
E void NDECL(remember_topl);
E void FDECL(addtopl, (const char *)); E void FDECL(addtopl, (const char *));
E void NDECL(more); E void NDECL(more);
E void FDECL(update_topl, (const char *)); E void FDECL(update_topl, (const char *));
+11 -7
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 wintype.h $NHDT-Date: 1461028538 2016/04/19 01:15:38 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.16 $ */ /* NetHack 3.6 wintype.h $NHDT-Date: 1549327486 2019/02/05 00:44:46 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.19 $ */
/* Copyright (c) David Cohrs, 1991 */ /* Copyright (c) David Cohrs, 1991 */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -74,12 +74,16 @@ typedef struct mi {
#define NHW_TEXT 5 #define NHW_TEXT 5
/* attribute types for putstr; the same as the ANSI value, for convenience */ /* attribute types for putstr; the same as the ANSI value, for convenience */
#define ATR_NONE 0 #define ATR_NONE 0
#define ATR_BOLD 1 #define ATR_BOLD 1
#define ATR_DIM 2 #define ATR_DIM 2
#define ATR_ULINE 4 #define ATR_ULINE 4
#define ATR_BLINK 5 #define ATR_BLINK 5
#define ATR_INVERSE 7 #define ATR_INVERSE 7
/* not a display attribute but passed to putstr() as an attribute;
can be masked with one regular display attribute */
#define ATR_URGENT 16
#define ATR_NOHISTORY 32
/* nh_poskey() modifier types */ /* nh_poskey() modifier types */
#define CLICK_1 1 #define CLICK_1 1
+2 -4
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 cmd.c $NHDT-Date: 1548978603 2019/01/31 23:50:03 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.330 $ */ /* NetHack 3.6 cmd.c $NHDT-Date: 1549327488 2019/02/05 00:44:48 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.331 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2013. */ /*-Copyright (c) Robert Patrick Rankin, 2013. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -5572,9 +5572,7 @@ boolean historical; /* whether to include in message history: True => yes */
Sprintf(qbuf, "Count: %ld", cnt); Sprintf(qbuf, "Count: %ld", cnt);
backspaced = FALSE; backspaced = FALSE;
} }
/* bypassing pline() keeps intermediate prompt out of custompline(SUPPRESS_HISTORY, "%s", qbuf);
DUMPLOG message history */
putstr(WIN_MESSAGE, 0, qbuf);
mark_synch(); mark_synch();
} }
} }
+23 -4
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 pline.c $NHDT-Date: 1541719974 2018/11/08 23:32:54 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.69 $ */ /* NetHack 3.6 pline.c $NHDT-Date: 1549327495 2019/02/05 00:44:55 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.73 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2018. */ /*-Copyright (c) Robert Patrick Rankin, 2018. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -9,6 +9,7 @@
static unsigned pline_flags = 0; static unsigned pline_flags = 0;
static char prevmsg[BUFSZ]; static char prevmsg[BUFSZ];
static void FDECL(putmesg, (const char *));
static char *FDECL(You_buf, (int)); static char *FDECL(You_buf, (int));
#if defined(MSGHANDLER) && (defined(POSIX_TYPES) || defined(__GNUC__)) #if defined(MSGHANDLER) && (defined(POSIX_TYPES) || defined(__GNUC__))
static void FDECL(execplinehandler, (const char *)); static void FDECL(execplinehandler, (const char *));
@@ -61,6 +62,23 @@ dumplogfreemessages()
} }
#endif #endif
/* keeps windowprocs usage out of pline() */
static void
putmesg(line)
const char *line;
{
int attr = ATR_NONE;
if ((pline_flags & URGENT_MESSAGE) != 0
&& (windowprocs.wincap2 & WC2_URGENT_MESG) != 0)
attr |= ATR_URGENT;
if ((pline_flags & SUPPRESS_HISTORY) != 0
&& (windowprocs.wincap2 & WC2_SUPPRESS_HIST) != 0)
attr |= ATR_NOHISTORY;
putstr(WIN_MESSAGE, attr, line);
}
/* Note that these declarations rely on knowledge of the internals /* Note that these declarations rely on knowledge of the internals
* of the variable argument handling stuff in "tradstdc.h" * of the variable argument handling stuff in "tradstdc.h"
*/ */
@@ -156,8 +174,9 @@ VA_DECL(const char *, line)
no_repeat = (pline_flags & PLINE_NOREPEAT) ? TRUE : FALSE; no_repeat = (pline_flags & PLINE_NOREPEAT) ? TRUE : FALSE;
if ((pline_flags & OVERRIDE_MSGTYPE) == 0) { if ((pline_flags & OVERRIDE_MSGTYPE) == 0) {
msgtyp = msgtype_type(line, no_repeat); msgtyp = msgtype_type(line, no_repeat);
if (msgtyp == MSGTYP_NOSHOW if ((pline_flags & URGENT_MESSAGE) == 0
|| (msgtyp == MSGTYP_NOREP && !strcmp(line, prevmsg))) && (msgtyp == MSGTYP_NOSHOW
|| (msgtyp == MSGTYP_NOREP && !strcmp(line, prevmsg))))
/* FIXME: we need a way to tell our caller that this message /* FIXME: we need a way to tell our caller that this message
* was suppressed so that caller doesn't set iflags.last_msg * was suppressed so that caller doesn't set iflags.last_msg
* for something that hasn't been shown, otherwise a subsequent * for something that hasn't been shown, otherwise a subsequent
@@ -173,7 +192,7 @@ VA_DECL(const char *, line)
if (u.ux) if (u.ux)
flush_screen(1); /* %% */ flush_screen(1); /* %% */
putstr(WIN_MESSAGE, 0, line); putmesg(line);
#if defined(MSGHANDLER) && (defined(POSIX_TYPES) || defined(__GNUC__)) #if defined(MSGHANDLER) && (defined(POSIX_TYPES) || defined(__GNUC__))
execplinehandler(line); execplinehandler(line);
+3 -3
View File
@@ -1606,9 +1606,9 @@ $(I)global.h: $(I)coord.h $(I)pcconf.h $(I)amiconf.h
-setdate $(I)global.h -setdate $(I)global.h
-wait 2 -wait 2
$(I)hack.h: $(I)config.h $(I)context.h $(I)trap.h $(I)decl.h $(I)dungeon.h $(I)hack.h: $(I)config.h $(I)context.h $(I)trap.h $(I)decl.h $(I)dungeon.h \
$(I)monsym.h $(I)mkroom.h $(I)objclass.h $(I)flag.h $(I)rm.h $(I)monsym.h $(I)mkroom.h $(I)objclass.h $(I)flag.h $(I)rm.h \
$(I)vision.h $(I)display.h $(I)wintype.h $(I)engrave.h $(I)vision.h $(I)display.h $(I)wintype.h $(I)engrave.h \
$(I)rect.h $(I)region.h $(I)trampoli.h $(I)sys.h $(I)rect.h $(I)region.h $(I)trampoli.h $(I)sys.h
-setdate $(I)hack.h -setdate $(I)hack.h
-wait 2 -wait 2
+20 -4
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 topl.c $NHDT-Date: 1540934784 2018/10/30 21:26:24 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.38 $ */ /* NetHack 3.6 topl.c $NHDT-Date: 1549327499 2019/02/05 00:44:59 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.43 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2009. */ /*-Copyright (c) Michael Allison, 2009. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -16,7 +16,6 @@
STATIC_DCL void FDECL(redotoplin, (const char *)); STATIC_DCL void FDECL(redotoplin, (const char *));
STATIC_DCL void FDECL(topl_putsym, (CHAR_P)); STATIC_DCL void FDECL(topl_putsym, (CHAR_P));
STATIC_DCL void NDECL(remember_topl);
STATIC_DCL void FDECL(removetopl, (int)); STATIC_DCL void FDECL(removetopl, (int));
STATIC_DCL void FDECL(msghistory_snapshot, (BOOLEAN_P)); STATIC_DCL void FDECL(msghistory_snapshot, (BOOLEAN_P));
STATIC_DCL void FDECL(free_msghistory_snapshot, (BOOLEAN_P)); STATIC_DCL void FDECL(free_msghistory_snapshot, (BOOLEAN_P));
@@ -144,7 +143,23 @@ const char *str;
more(); more();
} }
STATIC_OVL void /* for use by tty_putstr() */
void
show_topl(str)
const char *str;
{
struct WinDesc *cw = wins[WIN_MESSAGE];
if (!(cw->flags & WIN_STOP)) {
cw->curx = cw->cury = 0;
home();
cl_end();
addtopl(str);
}
}
/* used by update_topl(); also by tty_putstr() */
void
remember_topl() remember_topl()
{ {
register struct WinDesc *cw = wins[WIN_MESSAGE]; register struct WinDesc *cw = wins[WIN_MESSAGE];
@@ -231,7 +246,8 @@ register const char *bp;
/* If there is room on the line, print message on same line */ /* If there is room on the line, print message on same line */
/* But messages like "You die..." deserve their own line */ /* But messages like "You die..." deserve their own line */
n0 = strlen(bp); n0 = strlen(bp);
if ((ttyDisplay->toplin == 1 || (cw->flags & WIN_STOP)) && cw->cury == 0 if ((ttyDisplay->toplin == 1 || (cw->flags & WIN_STOP))
&& cw->cury == 0
&& n0 + (int) strlen(toplines) + 3 < CO - 8 /* room for --More-- */ && n0 + (int) strlen(toplines) + 3 < CO - 8 /* room for --More-- */
&& (notdied = strncmp(bp, "You die", 7)) != 0) { && (notdied = strncmp(bp, "You die", 7)) != 0) {
Strcat(toplines, " "); Strcat(toplines, " ");
+20 -4
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 wintty.c $NHDT-Date: 1545705819 2018/12/25 02:43:39 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.190 $ */ /* NetHack 3.6 wintty.c $NHDT-Date: 1549327503 2019/02/05 00:45:03 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.193 $ */
/* Copyright (c) David Cohrs, 1991 */ /* Copyright (c) David Cohrs, 1991 */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -96,7 +96,7 @@ struct window_procs tty_procs = {
| WC2_HILITE_STATUS | WC2_HITPOINTBAR | WC2_FLUSH_STATUS | WC2_HILITE_STATUS | WC2_HITPOINTBAR | WC2_FLUSH_STATUS
| WC2_RESET_STATUS | WC2_RESET_STATUS
#endif #endif
| WC2_DARKGRAY), | WC2_DARKGRAY | WC2_SUPPRESS_HIST),
tty_init_nhwindows, tty_player_selection, tty_askname, tty_get_nh_event, tty_init_nhwindows, tty_player_selection, tty_askname, tty_get_nh_event,
tty_exit_nhwindows, tty_suspend_nhwindows, tty_resume_nhwindows, tty_exit_nhwindows, tty_suspend_nhwindows, tty_resume_nhwindows,
tty_create_nhwindow, tty_clear_nhwindow, tty_display_nhwindow, tty_create_nhwindow, tty_clear_nhwindow, tty_display_nhwindow,
@@ -2574,13 +2574,29 @@ const char *str;
print_vt_code2(AVTC_SELECT_WINDOW, window); print_vt_code2(AVTC_SELECT_WINDOW, window);
switch (cw->type) { switch (cw->type) {
case NHW_MESSAGE: case NHW_MESSAGE: {
int suppress_history = (attr & ATR_NOHISTORY);
/* in case we ever support display attributes for topline
messages, clear flag mask leaving only display attr */
/*attr &= ~(ATR_URGENT | ATR_NOHISTORY);*/
/* really do this later */ /* really do this later */
#if defined(USER_SOUNDS) && defined(WIN32CON) #if defined(USER_SOUNDS) && defined(WIN32CON)
play_sound_for_message(str); play_sound_for_message(str);
#endif #endif
update_topl(str); if (!suppress_history) {
/* normal output; add to current top line if room, else flush
whatever is there to history and then write this */
update_topl(str);
} else {
/* put anything already on top line into history */
remember_topl();
/* write to top line without remembering what we're writing */
show_topl(str);
}
break; break;
}
#ifndef STATUS_HILITES #ifndef STATUS_HILITES
case NHW_STATUS: case NHW_STATUS:
ob = &cw->data[cw->cury][j = cw->curx]; ob = &cw->data[cw->cury][j = cw->curx];