Commit Graph

266 Commits

Author SHA1 Message Date
nhmall
a6c46bbd85 housekeeping items for 3.6.5 - first pass 2020-01-14 11:35:06 -05:00
nhmall
74a5339a5e housekeeping updates for 3.6.4
typos

README update
2019-12-17 14:11:52 -05:00
nhmall
a2a000656f mistake file 2019-12-15 17:59:48 -05:00
nhmall
3ad628d1e5 more makedefs 2019-12-15 17:41:27 -05:00
nhmall
c201c5608b report post-release in makedefs if someone happens to build post-release code 2019-12-15 17:22:11 -05:00
nhmall
7a3ce901ab make this branch recognizable for post-3.6.3 patch commits and patch tests 2019-12-06 16:35:47 -05:00
nhmall
cfb382c626 more prep bits 2019-12-04 11:51:24 -05:00
PatR
a9e8348dfa no-return usage in dlb_main.c
More from github issue 229:  mark routines in util/dlb_main.c which
don't return as such and add some 'break' statements for compilers
that don't have support for that.
2019-10-04 23:55:49 -07:00
nhmall
64cc11d9b4 makedefs doesn't use STATIC_OVL macro 2019-07-13 00:28:51 -04:00
nhmall
638d9f9363 if prototype is declared static make function static to match
Today, a compiler was encountered that considered it an error
to have the prototype declared static and the function body
not
2019-07-13 00:17:23 -04:00
PatR
88a48cd6ff makedefs dat/options TERMINFO
Noticed after building a curses-only binary; configuration setting
"terminal info library" is only of interest as an optional feature
when the build includes tty.  There were several other settings that
apply to some interfaces and not others but would be listed if the
feature was defined (possibly after building for an interface which
supported it, then left in place when switching to another which
doesn't).

I left most of those with commented out conditionals in case other
interfaces start supporting them.  So you might still get something
like "tiles file in XPM format" for a binary that doesn't support
tiles if USE_XPM has been defined for some reason.
2019-07-03 11:57:19 -07:00
nhmall
0b74f2adeb makedefs: add enum support when generating pm.h
Only changes pm.h content if ENUM_PM is defined when compiling
util/makedefs.c

While NON_PM and LOW_PM could be included, it would require
for the makedefs.c compile, as well as an
around their macro definitions in permonst.h so for now those
particular lines are commented out in makedefs.c
2019-06-02 17:21:35 -04:00
nhmall
75f293c369 add VERSION_IN_DLB_FILENAME to makedefs detection 2019-05-12 15:14:31 -04:00
nhmall
bcd05308aa support version-specific dlb file
There was a post-3.6.2 discussion on a forum where someone had
tried to copy the NetHack 3.6.2 exe file overtop of an
existing NetHack 3.6.0 playground, and then try to run it.

We have never suggested trying that, nor do we attempt to
provide any backward or forward compatibility between the
supporting files found in nhdat that would allow that. Any
particular version of NetHack expects to have matching
support files designed and matched to that version.

This adds optional support for helping to prevent the
opening of nhdat containing support files from an
unmatched version of NetHack.

If you #define VERSION_IN_DLB_FILENAME in your
platform's include/*conf.h file, it will use a
name such as nhdat362, instead of plain nhdat, and
will exit more gracefully than the fault/crash
mentioned in the discussion if it doesn't find the
file it is looking for.

Developers - please note that if you do
to cause NetHack to look for an nhdat* file with
the version info appended to the name, you will likely
have to modify your build/clean/spotless mechanics
beyond the C compile itself to properly deal with the
new generated file name.
2019-05-12 14:51:26 -04:00
nhmall
5f56440956 instead of BETA or not, have devel states of release, wip, beta
Now that development sources are made public prior to
BETA testing, it is useful to have a work-in-progress
state prior to BETA.
2019-05-10 14:59:03 -04:00
nhmall
39320dec2b NetHack 3.6.2 release-related updates 2019-05-07 14:39:24 -04:00
PatR
6b54456c45 extended #version windowing options
When makedefs generates dat/options for #version, enhance the
formatting of the 'supported windowing systems' section with more
thorough word fill and also emphasize the actual window system names
so that user can tell what value to give to OPTIONS=window_system:%s
when picking one of them.  Before and after

Supported windowing systems:
    traditional tty-based graphics,
    terminal-based graphics using curses libraries, and X11
    with a default of tty.

Supported windowing systems:
    "tty" (traditional text with optional line-drawing), "curses"
    (terminal-based graphics), and "X11", with a default of "tty".
2019-02-17 15:00:43 -08:00
PatR
109a9707ae array lint
Suppress a diagnostic from the VMS compiler that the '&' in '&array'
has no effect.
2019-02-13 16:11:23 -08:00
nhmall
4150d0b443 use the NetHack macro NHSTDC in makedefs 2019-02-11 12:28:57 -05:00
nhmall
c456b313a7 Revert "adjust sample config file when STATUS_HILITES isn't defined"
This reverts commit 03e6c26af6.
2019-01-31 13:03:00 -05:00
Pasi Kallinen
6a953231a3 Silence sprintf format warnings and dehardcode buffer sizes 2019-01-31 09:42:07 +02:00
nhmall
f7b6723053 update the long version info generated by makedefs 2019-01-29 20:01:31 -05:00
Pasi Kallinen
6ac681b5fa X11: default to XPM-format tile file and rip screen
People have been wondering how to change the tiles on the X11
version, and the old default of NetHack-specific binary tile data
isn't directly editable with image editing tools.

Also show in the #version info if xpm and graphic rip are enabled.
2018-12-29 07:19:24 +02:00
PatR
4510bc7e50 warn_unused_result in recover.c
There is only one warn_unused_result warning from gcc in recover.c,
so actually use that result.

Plus a bit of reformatting (tab replacement).
2018-12-18 14:01:57 -08:00
Patric Mueller
7d15535923 Fix always trapped castle chest 2018-12-15 22:40:30 +01:00
PatR
5d2686e7c1 lev_comp int vs long
Fix lev_comp's variable argument usage by changing it to make
add_opvars() expect an int rather than a long when given the "i"
indicator, and add "l" for really passing a long.  The ints are
conveted to longs when setting up the interpreter.  I think I changed
just about all the integer opvars to int, although there is one use
of "l" in lev_main.c just to make sure it works.  There could be
arguments that really do need to be 'long'; if so, the add_opvars()
calls for them will have to have its indicator string updated and
possibly add or remove some casts.

There's a lot of reformatting included but it's not consistent about
tab replacement.  Some of the changes are due to renaming long-named
'variable_definitions' to 'vardefs' to shorten a bunch of lines.

Updated sys/share/*_yacc.c will be checked in separately.  The ones
currently in the repository won't work with patched lev_main.c due to
that renamed variable.
2018-11-27 18:21:58 -08:00
nhmall
03e6c26af6 adjust sample config file when STATUS_HILITES isn't defined
On Windows, if you build without STATUS_HILITES defined,
you'll be greeted by the following barrage of errors when
you start the game.

On Windows, use makedefs to detect that STATUS_HILITES
isn't defined, and comment out the offending lines in
the sample config file.

Errors received before this change:

OPTIONS=statushilites
  * Line 197: 'statushilites' is not supported.

 OPTIONS=hilite_status:hitpoints/100%/gray&normal
  * Line 200: 'hilite_status' is not supported.

 OPTIONS=hilite_status:hitpoints/<100%/green&normal
  * Line 201: 'hilite_status' is not supported.

 OPTIONS=hilite_status:hitpoints/<66%/yellow&normal
  * Line 202: 'hilite_status' is not supported.

 OPTIONS=hilite_status:hitpoints/<50%/orange&normal
  * Line 203: 'hilite_status' is not supported.

 OPTIONS=hilite_status:hitpoints/<33%/red&bold
  * Line 204: 'hilite_status' is not supported.

 OPTIONS=hilite_status:hitpoints/<15%/red&inverse
  * Line 205: 'hilite_status' is not supported.

 OPTIONS=hilite_status:power/100%/gray&normal
  * Line 208: 'hilite_status' is not supported.

 OPTIONS=hilite_status:power/<100%/green&normal
  * Line 209: 'hilite_status' is not supported.

 OPTIONS=hilite_status:power/<66%/yellow&normal
  * Line 210: 'hilite_status' is not supported.

 OPTIONS=hilite_status:power/<50%/orange&normal
  * Line 211: 'hilite_status' is not supported.

 OPTIONS=hilite_status:power/<33%/red&bold
  * Line 212: 'hilite_status' is not supported.

 OPTIONS=hilite_status:cap/burdened/yellow/stressed/orange/strained/red&bold/ove
 rtaxed/red&inverse/overloaded/red&inverse&blink
  * Line 215: 'hilite_status' is not supported.

 OPTIONS=hilite_status:hunger/satiated/yellow/hungry/orange/weak/red&bold/fainti
 ng/red&inverse/fainted/red&inverse&blink
  * Line 218: 'hilite_status' is not supported.
 Hit <Enter> to continue.
2018-11-24 23:14:20 -05:00
nhmall
dbf2b0e852 Revert "Added nhassert() support."
This reverts commit 31dc1c9233.
2018-11-23 22:17:26 -05:00
nhmall
3cbc6d4cf5 Revert "Modified objects initialization to support re-entry."
This reverts commit c3eefefc99.
2018-11-23 22:16:24 -05:00
Bart House
c3eefefc99 Modified objects initialization to support re-entry. 2018-11-23 15:22:55 -08:00
Bart House
31dc1c9233 Added nhassert() support. 2018-11-23 15:22:51 -08:00
nhmall
b4be8852a4 suppress compiler warning differently 2018-11-20 20:30:44 -05:00
nhmall
4228cf534e follow-up bits 2018-11-20 19:09:05 -05:00
Bart House
be11d50d91 Added use of SCCS_Id to quite compiler warnings. 2018-11-20 10:33:36 -08:00
Bart House
aa48ed18e7 Initial check-in of work in progress xcode build of NetHack.
Buyer beware.  This is a check-point of the xcode work to allow others
to play.
2018-11-19 09:22:11 -08:00
nhmall
cb43061076 curses changes to existing files 2018-11-16 20:51:22 -05:00
Bart House
8944235282 Enforced the inclusion of windows headers before nethack headers.
Moved the code page 437 mapping table to winnt.c so that it could be
used in window and console clients.
Added check that fonts support unicode values we use from code page 437.
Use unicode to draw text if font supports it otherwise use ASCII.
2018-11-12 01:58:56 -08:00
nhmall
a0b53ee391 merge 2018-11-11 10:29:52 -05:00
Pasi Kallinen
afd793e9b7 Fix memory leak in makedefs 2018-11-08 17:38:36 +02:00
keni
f222023bd8 Deprecate "makedefs -m".
mons[].difficulty takes over for monstr[]
Invoking "makedefs -m" gives a deprecation message; it is also included
in the (now mostly empty) monstr.c.
Ports should now remove "makedefs -m" from their build procedures but this
commit does not include that change.
2018-10-20 23:14:33 -04:00
Ray Chason
8dbaafbb7b Ignore Win32 build products 2018-09-10 21:13:10 +03:00
nhmall
84d4fcc4c8 another beta bit 2018-05-16 23:31:27 -04:00
nhmall
05e84babb8 beta bit
Display the word beta in a better spot on the line
2018-05-16 23:23:08 -04:00
keni
09502df9f1 force expand unexpanded substitution variables 2018-04-25 15:36:11 -04:00
keni
d8c49ec9d1 Add updated copyright lines, part 1. 2018-04-25 15:00:13 -04:00
Pasi Kallinen
2548d68dd3 Fix some warnings
Remove an unused variable, add missing FALLTHRUs, and use the same
FALLTHRU wording where it wasn't recognized by gcc
2018-03-30 19:42:50 +03:00
nhmall
d4ea0f6ce6 date bit 2018-03-02 15:35:07 -05:00
nhmall
65655d2cee Incorporate some git information into NetHack
Incorporate some git information into NetHack so that it
is potentially visible to a player. That's useful when
collecting details about the version that they are
running and, if the gitinfo is present, it can tie the
code to a specific git commit in the repository.

This modifies 'makedefs -v' to check for the presence of a data file
called dat/gitinfo.txt and if it is there, parse out its
contents, then write additional lines to include/date.h beyond
what 'makedefs -v' was previously putting in there, similar to
this sample:

      #define NETHACK_GIT_SHA "0c84e564c78e2024e562d39539376ce2e21eec8e"
      #define NETHACK_GIT_BRANCH "NetHack-3.6.0"

The contents of an appropriate dat/gitinfo.txt are as follows,
and trailing/leading whitespace is not significant:

      githash = 0c84e564c78e2024e562d39539376ce2e21eec8e
      gitbranch = NetHack-3.6.0

It also adjusts the contents of the 'v' version information to
include the additional git info when available.

Also adds some hooks DEVEL/hooksdir and a perl file to DEVEL
for simplifying and automating the deposit of dat/gitinfo.txt
so that it generally reflects the most current git commit.

DEVEL/gitinfo.pl can be used to build dat/gitinfo.txt at any
time without doing a commit, merge, or checkout.
    	perl DEVEL/gitinfo.pl

command line --version and -version support

To complement the extra information being provided in the
version by the 'v' command, this also adds support for the
following new command line arguments:
    --version
     -version            Output the NetHack version string then exit.

    --version:paste      Output the NetHack version string and also copy it to
     -version:paste      the platform's paste buffer for insertion somewhere,
                         then exit.

If the paste variation of -version is requested on a platform that
hasn't incorporated any support for the capability, it will deliver
the version info then an error message, prior to exiting.

To support the extended -version:paste variation, a port needs to:
    - provide a port-specific routine to perform
      the paste buffer copy in a port code file.
    - #define RUNTIME_PASTEBUF_SUPPORT in the include/portconf.h header file.

    --skeleton--
    void port_insert_pastebuf(buf)
    char *buf;
    {
    	/* insert code to copy the version info from buf into
    	   platform's paste buffer in a supported way */
    }

macosx and Windows have both added support for RUNTIME_PASTEBUF_SUPPORT
2018-02-23 19:34:44 -05:00
nhmall
1eb5919a85 I noticed makedefs was segfaulting when argc == 1 2018-02-16 14:52:02 -05:00
PatR
32890d1bc1 fix 'makedefs -z' for config using FILE_PREFIX
Apply user-contributed patch to make do_vision() handle FILE_PREFIX
correctly.  It was putting that value into the filename buffer, then
overwriting it with the ordinary filename instead of appending.

Deletion of just-made vis_tab.h when creation of vis_tab.c fails would
have failed too if FILE_PREFIX had been working.

The patch was against 3.4.3 and didn't apply cleanly to current code,
but it is a staightforward fix, although the file deletion case was
buggy (failed to clear "vis_tab.c" from buffer before reconstructing
"vis_tab.h" via appending stuff).  FILE_PREFIX seems to be Amiga-only
so I've only tested the usual case where it isn't defined.
2018-01-23 00:52:57 -08:00