stop assessing luck penalties and lift most movement restrictions
'`' command to show discoveries for one class of objects
add "about nethack" to '?' menu as an alternate way to view 'v'+'#version'
+display version and build information at startup
Platform- and/or Interface-Specific New Features
init_nhwindows() is expected to display a gee-whiz banner window, including
the Copyright message. It is recommended that the COPYRIGHT_BANNER_A,
-COPYRIGHT_BANNER_B, and COPYRIGHT_BANNER_C macros from patchlevel.h be used
-for constructing the Copyright message. COPYRIGHT_BANNER_A is a
-quoted string that has the NetHack copyright declaration,
-COPYRIGHT_BANNER_B is a quoted string that states who the copyright
-belongs to, and COPYRIGHT_BANNER_C simply says "See License for
-details." Be sure to #include "patchlevel.h" to define these macros.
-Using the macros will prevent having to update the Copyright information
-in each window-port prior to each release.
+COPYRIGHT_BANNER_B, COPYRIGHT_BANNER_C, and COPYRIGHT_BANNER_D macros from
+patchlevel.h and date.h be used for constructing the Copyright message.
+COPYRIGHT_BANNER_A is a quoted string that has the NetHack copyright declaration,
+COPYRIGHT_BANNER_B is a quoted string that states who the copyright belongs to,
+COPYRIGHT_BANNER_C is a quoted string generated by makedefs that includes version
+and build information. and COPYRIGHT_BANNER_D simply says "See License for details."
+Be sure to #include "patchlevel.h" and date.h to define these macros. Using the
+macros will prevent having to update the Copyright information in each window-port
+prior to each release.
Ports (MSDOS, TOS, MAC, etc) _may_ use window-port specific routines in
their port specific files, _AT_THEIR_OWN_RISK_. Since "port" and
# ifdef MAC
# define PORT_ID "Mac"
# endif
+# ifdef __APPLE__
+# define PORT_ID "MacOSX"
+# endif
# ifdef MSDOS
# ifdef PC9800
# define PORT_ID "PC-9800"
# ifdef TOS
# define PORT_ID "ST"
# endif
-# ifdef UNIX
-# define PORT_ID "Unix"
+ /* Check again in case something more specific has been defined above. */
+# ifndef PORT_ID
+# ifdef UNIX
+# define PORT_ID "Unix"
+# endif
# endif
# ifdef VMS
# define PORT_ID "VMS"
#define COPYRIGHT_BANNER_A \
"NetHack, Copyright 1985-2011"
-
#define COPYRIGHT_BANNER_B \
" By Stichting Mathematisch Centrum and M. Stephenson."
-
-#define COPYRIGHT_BANNER_C \
+ /* COPYRIGHT_BANNER_C is generated by makedefs into date.h */
+#define COPYRIGHT_BANNER_D \
" See license for details."
/*
if (bannerwin != WIN_ERR) {
/* for tty; erase copyright notice and redo it in the menu */
clear_nhwindow(bannerwin);
- /* COPYRIGHT_BANNER_A, COPYRIGHT_BANNER_B, COPYRIGHT_BANNER_C */
- for (k = 1; k <= 3; ++k)
+ /* COPYRIGHT_BANNER_[ABCD] */
+ for (k = 1; k <= 4; ++k)
add_menu(tmpwin, NO_GLYPH, &any, 0, 0,
ATR_NONE, copyright_banner_line(k), MENU_UNSELECTED);
add_menu(tmpwin, NO_GLYPH, &any, 0, 0,
$(O)topl.o: $(TTY)topl.c $(HDEP) $(I)wintty.h $(I)tcap.h
$(O)wintty.o: $(TTY)wintty.c $(HDEP) $(I)wintty.h $(I)tcap.h \
- $(I)patchlevel.h
+ $(I)date.h $(I)patchlevel.h
$(O)amitty.o: $(AMI)amitty.c $(HDEP)
$(O)topl.o: $(TTY)topl.c $(HDEP) $(I)wintty.h $(I)tcap.h
$(O)wintty.o: $(TTY)wintty.c $(HDEP) $(I)wintty.h $(I)tcap.h \
- $(I)patchlevel.h
+ $(I)date.h $(I)patchlevel.h
$(O)amitty.o: $(AMI)amitty.c $(HDEP)
#include "NH:sys/amiga/winext.h"
#include "NH:sys/amiga/winproto.h"
#include "patchlevel.h"
+#include "date.h"
extern struct TagItem scrntags[];
amii_putstr( WIN_BASE, 0, COPYRIGHT_BANNER_A);
amii_putstr( WIN_BASE, 0, COPYRIGHT_BANNER_B);
amii_putstr( WIN_BASE, 0, COPYRIGHT_BANNER_C);
+ amii_putstr( WIN_BASE, 0, COPYRIGHT_BANNER_D);
amii_putstr( WIN_BASE, 0, "");
Initialized = 1;
@echo $(BCOPTS2) $(CFLAGUB) >> $(VROOMMCFG)
$(CC) $(FLAGUB) $(COBJNAM)$@ $(WTTY)\topl.c
-$(O)wintty.o: $(PCHO) $(CONFIG_H) $(WTTY)\wintty.c $(PATCHLEVEL_H)
+$(O)wintty.o: $(PCHO) $(CONFIG_H) $(WTTY)\wintty.c $(PATCHLEVEL_H) $(DATE_H)
@type schema$(SCHEMA).bc | find "$(@B)_o" > $(VROOMMCFG)
@echo $(BCOPTS1) >> $(VROOMMCFG)
@echo $(BCOPTS2) $(CFLAGUO) >> $(VROOMMCFG)
$(O)topl.o: ../win/tty/topl.c $(HACK_H) $(INCL)/tcap.h
$(CC) $(cflags) -o$@ ../win/tty/topl.c
$(O)wintty.o: ../win/tty/wintty.c $(HACK_H) $(INCL)/dlb.h \
- $(PATCHLEV_H) $(INCL)/tcap.h
+ $(INCL)/date.h $(PATCHLEV_H) $(INCL)/tcap.h
$(CC) $(cflags) -o$@ ../win/tty/wintty.c
$(O)Window.o: ../win/X11/Window.c $(INCL)/xwindowp.h $(INCL)/xwindow.h \
$(CONFIG_H)
topl.o: $(WIN)\topl.c $(HACK_H) $(INCL)\tcap.h
@$(CC) $(CFLAGS) $(SPECOPTS) /Fo$@ $(WIN)\topl.c
wintty.o: $(WIN)\wintty.c $(HACK_H) $(INCL)\dlb.h \
- $(INCL)\patchlev.h $(INCL)\tcap.h
+ $(INCL)\date.h $(INCL)\patchlev.h $(INCL)\tcap.h
@$(CC) $(CFLAGS) $(SPECOPTS) /Fo$@ $(WIN)\wintty.c
# src dependencies
$(WINCC)
$(OBJ)\topl.o : $(WIN)\$(CB) $(HACK_H) $(INCL)\tcap.h
$(WINCC)
-$(OBJ)\wintty.o : $(WIN)\$(CB) $(HACK_H) $(INCL)\tcap.h
+$(OBJ)\wintty.o : $(WIN)\$(CB) $(HACK_H) $(INCL)\tcap.h $(INCL)\date.h
$(WINCC)
#
#include "hack.h"
#include "dlb.h"
+#include "date.h"
#ifdef SHORT_FILENAMES
#include "patchlev.h"
#else
error("Your clock is incorrectly set!");
#endif
if (!dlb_init()) {
- pline("%s\n%s\n%s\n\nNetHack was unable to open the required file \"%s\".%s",
+ pline("%s\n%s\n%s\n%s\n\nNetHack was unable to open the required file \"%s\".%s",
COPYRIGHT_BANNER_A, COPYRIGHT_BANNER_B,
- COPYRIGHT_BANNER_C, DLBFILE,
+ COPYRIGHT_BANNER_C, COPYRIGHT_BANNER_D, DLBFILE,
#ifdef WIN32
"\nAre you perhaps trying to run NetHack within a zip utility?");
#else
topl.o: ../win/tty/topl.c $(HACK_H) ../include/tcap.h
$(CC) $(CFLAGS) -c ../win/tty/topl.c
wintty.o: ../win/tty/wintty.c $(HACK_H) ../include/dlb.h \
- ../include/patchlevel.h ../include/tcap.h
+ ../include/date.h ../include/patchlevel.h ../include/tcap.h
$(CC) $(CFLAGS) -c ../win/tty/wintty.c
Window.o: ../win/X11/Window.c ../include/xwindowp.h ../include/xwindow.h \
$(CONFIG_H)
termcap.obj : $(TTY)termcap.c $(HACK_H) $(INC)tcap.h
topl.obj : $(TTY)topl.c $(HACK_H) $(INC)tcap.h
wintty.obj : $(TTY)wintty.c $(HACK_H) $(INC)dlb.h \
- $(INC)patchlevel.h $(INC)tcap.h
+ $(INC)date.h $(INC)patchlevel.h $(INC)tcap.h
Window.obj : $(X11)Window.c $(INC)xwindowp.h $(INC)xwindow.h $(CONFIG_H)
dialogs.obj : $(X11)dialogs.c $(CONFIG_H)
winX.obj : $(X11)winX.c $(HACK_H) $(INC)winX.h $(INC)dlb.h \
$(O)topl.o: ..\win\tty\topl.c $(HACK_H) $(INCL)\tcap.h
$(CC) $(CFLAGSU) -Fo$@ ..\win\tty\topl.c
$(O)wintty.o: ..\win\tty\wintty.c $(HACK_H) $(INCL)\dlb.h \
- $(INCL)\patchlevel.h $(INCL)\tcap.h
+ $(INCL)\date.h $(INCL)\patchlevel.h $(INCL)\tcap.h
$(CC) $(CFLAGSU) -Fo$@ ..\win\tty\wintty.c
$(O)Window.o: ..\win\X11\Window.c $(INCL)\xwindowp.h $(INCL)\xwindow.h \
$(CONFIG_H)
#include "mhmsgwnd.h"
#include "mhcmd.h"
#include "mhmap.h"
+#include "date.h"
#include "patchlevel.h"
#define MAX_LOADSTRING 100
NH_A2W(
COPYRIGHT_BANNER_A "\n"
COPYRIGHT_BANNER_B "\n"
- COPYRIGHT_BANNER_C,
+ COPYRIGHT_BANNER_C "\n"
+ COPYRIGHT_BANNER_D,
wbuf,
NHSTR_BUFSIZE
) );
$(O)topl.o: ..\win\tty\topl.c $(HACK_H) $(INCL)\tcap.h
$(cc) $(CFLAGS) -o$@ ..\win\tty\topl.c
$(O)wintty.o: ..\win\tty\wintty.c $(HACK_H) $(INCL)\dlb.h \
- $(INCL)\patchlevel.h $(INCL)\tcap.h
+ $(INCL)\date.h $(INCL)\patchlevel.h $(INCL)\tcap.h
$(cc) $(CFLAGS) -o$@ ..\win\tty\wintty.c
$(O)Window.o: ..\win\X11\Window.c $(INCL)\xwindowp.h $(INCL)\xwindow.h \
$(CONFIG_H)
$(O)topl.o: ../win/tty/topl.c $(HACK_H) $(INCL)/tcap.h
$(cc) $(CFLAGS) -o$@ ../win/tty/topl.c
$(O)wintty.o: ../win/tty/wintty.c $(HACK_H) $(INCL)/dlb.h \
- $(INCL)/patchlevel.h $(INCL)/tcap.h
+ $(INCL)/date.h $(INCL)/patchlevel.h $(INCL)/tcap.h
$(cc) $(CFLAGS) -o$@ ../win/tty/wintty.c
$(O)Window.o: ../win/X11/Window.c $(INCL)/xwindowp.h $(INCL)/xwindow.h \
$(CONFIG_H)
$(O)topl.o: ..\win\tty\topl.c $(HACK_H) $(INCL)\tcap.h
@$(CC) $(cflagsUtil) -Fo$@ ..\win\tty\topl.c
$(O)wintty.o: ..\win\tty\wintty.c $(HACK_H) $(INCL)\dlb.h \
- $(INCL)\patchlevel.h $(INCL)\tcap.h
+ $(INCL)\date.h $(INCL)\patchlevel.h $(INCL)\tcap.h
@$(CC) $(cflagsUtil) -Fo$@ ..\win\tty\wintty.c
$(O)Window.o: ..\win\X11\Window.c $(INCL)\xwindowp.h $(INCL)\xwindow.h \
$(CONFIG_H)
static void NDECL(make_version);
static char *FDECL(version_string, (char *, const char *));
static char *FDECL(version_id_string, (char *,const char *));
+static char *FDECL(bannerc_string, (char *,const char *));
static char *FDECL(xcrypt, (const char *));
static int FDECL(check_control, (char *));
static char *FDECL(without_control, (char *));
return outbuf;
}
+static char *
+bannerc_string(outbuf, build_date)
+char *outbuf;
+const char *build_date;
+{
+ char subbuf[64], versbuf[64];
+
+ subbuf[0] = '\0';
+#ifdef PORT_SUB_ID
+ subbuf[0] = ' ';
+ Strcpy(&subbuf[1], PORT_SUB_ID);
+#endif
+#ifdef BETA
+ Strcat(subbuf, " Beta");
+#endif
+
+ Sprintf(outbuf, " Version %s %s%s, built %s.",
+version_string(versbuf, "."),
+PORT_ID, subbuf, &build_date[4]);
+#if 0
+ Sprintf(outbuf, "%s NetHack%s %s Copyright 1985-%s (built %s)",
+ PORT_ID, subbuf, version_string(versbuf,"."), RELEASE_YEAR,
+ &build_date[4]);
+#endif
+ return outbuf;
+}
+
void
do_date()
{
Fprintf(ofp,"#define VERSION_STRING \"%s\"\n", version_string(buf,"."));
Fprintf(ofp,"#define VERSION_ID \\\n \"%s\"\n",
version_id_string(buf, cbuf));
+ Fprintf(ofp,"#define COPYRIGHT_BANNER_C \\\n \"%s\"\n",
+ bannerc_string(buf, cbuf));
Fprintf(ofp,"\n");
#ifdef AMIGA
{
#else
#include "patchlevel.h"
#endif
+#include "date.h"
#ifndef NO_SIGNAL
#include <signal.h>
COPYRIGHT_BANNER_A,
COPYRIGHT_BANNER_B,
COPYRIGHT_BANNER_C,
+ COPYRIGHT_BANNER_D,
"",
"",
0
#include "hack.h"
#include "dlb.h"
+#include "date.h"
#ifdef SHORT_FILENAMES
#include "patchlev.h"
#else
tty_putstr(BASE_WINDOW, 0, COPYRIGHT_BANNER_A);
tty_putstr(BASE_WINDOW, 0, COPYRIGHT_BANNER_B);
tty_putstr(BASE_WINDOW, 0, COPYRIGHT_BANNER_C);
+ tty_putstr(BASE_WINDOW, 0, COPYRIGHT_BANNER_D);
tty_putstr(BASE_WINDOW, 0, "");
tty_display_nhwindow(BASE_WINDOW, FALSE);
}
#include "winMS.h"
#include <commdlg.h>
+#include "date.h"
#include "patchlevel.h"
#include "resource.h"
#include "mhmsg.h"
NH_A2W(
COPYRIGHT_BANNER_A "\n"
COPYRIGHT_BANNER_B "\n"
- COPYRIGHT_BANNER_C,
+ COPYRIGHT_BANNER_C "\n"
+ COPYRIGHT_BANNER_D,
wbuf,
BUFSZ
) );
#include "mhsplash.h"
#include "mhmsg.h"
#include "mhfont.h"
+#include "date.h"
#include "patchlevel.h"
#include "dlb.h"
clientrt.right - 2 * SPLASH_OFFSET_X, controlrt.bottom, TRUE);
/* Fill the text control */
- Sprintf (buf, "%s\r\n%s\r\n%s\r\n\r\n", COPYRIGHT_BANNER_A, COPYRIGHT_BANNER_B,
- COPYRIGHT_BANNER_C);
+ Sprintf (buf, "%s\r\n%s\r\n%s\r\n%s\r\n\r\n", COPYRIGHT_BANNER_A, COPYRIGHT_BANNER_B,
+ COPYRIGHT_BANNER_C, COPYRIGHT_BANNER_D);
strsize = strlen(buf);
if (show_ver) {