Commit Graph

286 Commits

Author SHA1 Message Date
nhmall
75d22a2dbf separate MAIL functionality from MAIL-related structure inclusion
With 3.7+ aspirations of improving savefile interoperability between 32-bit
and 64-bit builds, as well as between platforms, it is better to not have
the underlying struct/array content be conditional.

This splits off some of the MAIL code into MAIL_STRUCTURES code. In theory,
since MAIL_STRUCTURES is unconditionally included, the macro could
just go away and leave that code unconditional, but this commit doesn't
go that far.
2019-11-09 16:19:05 -05:00
nhmall
f7dded60b3 Merge branch 'NetHack-3.6' 2019-10-05 08:40:38 -04: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
781b32173c Merge branch 'master' into NetHack-3.7 2019-07-13 01:07:05 -04:00
nhmall
d187955838 another merge bit 2019-07-13 01:05:53 -04:00
nhmall
505c1e4b02 Merge branch 'master' into NetHack-3.7 2019-07-13 00:38:40 -04:00
nhmall
77fd719e05 Merge branch 'NetHack-3.6' 2019-07-13 00:38:10 -04: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
nhmall
ddf816ba96 Merge branch 'master' into NetHack-3.7 2019-07-03 18:27:11 -04:00
nhmall
21de4c06ef Merge branch 'NetHack-3.6' 2019-07-03 18:25:55 -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
bbedd61c9e even more macosx warnings 2019-06-25 01:07:18 -04:00
nhmall
972284061d yet more macosx warnings 2019-06-25 00:55:01 -04:00
nhmall
f6ab39fde1 more macosx warnings 2019-06-25 00:44:05 -04:00
nhmall
560f21f5db quiet some macosx warnings 2019-06-24 23:48:37 -04:00
nhmall
7054e06e42 NetHack minor release checklist items - savefiles
Make some progress on a couple of next minor release checklist
items, hopefully without introducing too many new bugs. This
is just the initial commit, and work continues.

Checklist items:

Savefiles compatible between Windows versions, whether 64-bit
or 32-bit in little-endian field format.

Selection of file formats:
 historical (structlevel saves),
 lendian (little-endian, fieldlevel saves),
 and just for proof-of-concept, ascii fieldlevel saves
 (the ascii is huge! 10x bigger than little-endian).

For the fieldlevel save, all complex data structures recursively
get broken down until until it is one of the simple types that
can't be broken down any further, and that gets when it gets
written to the output file.

New files needed for this build:

hand-coded:
include/sfprocs.h
src/sfbase.c      - really a dispatcher to one of the
                    output/input format routines.
src/sflendian.c   - little-endian output writer/reader.
src/sfascii.c     - ascii text output writer/reader.

auto-coded (generated):
include/sfproto.h
src/sfdata.c

This is just one approach. I'm sure there are countless others
and they have different pros and cons.

For producing the auto-coded files a utility called
universal-ctags, that is actively maintained and evolving,
was used to do all the heavy-lifting of parsing the
NetHack C sources to tabulate the data fields, and store
them in an intermediate file called util/nethack.tags
(not required for building NetHack if you already have a
generated include/sfproto.h and src/sfdata.c)

util/readtags (also not required for building NetHack
itself) will decipher the nethack.tags file and produce
the functions that can deal with the NetHack struct data
fields.

You can obtain the source for universal-ctags by cloning it
from here:
https://github.com/universal-ctags/ctags.git

The combination universal-ctags + util/readtags has been
tried and tested under both Windows and Linux, so it is
not tied to a particular platform.

Note: util/readtags will work only with universal-ctags
output, so other ctags are unlikely to work as-is.
Universal-ctags can be build from source very easily
under Linux, or under Windows using visual studio.
2019-06-23 00:11:46 -04:00
nhmall
bfc4445537 Merge branch 'NetHack-3.6' 2019-06-05 08:08:32 -04: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
357165cf68 Merge branch 'NetHack-3.6' 2019-05-12 15:31:31 -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
145bb3f172 Merge branch 'NetHack-3.6' 2019-05-10 15:01:59 -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
3be48695a5 Merge branch 'NetHack-3.6.2' 2019-05-07 21:18:51 -04:00
nhmall
39320dec2b NetHack 3.6.2 release-related updates 2019-05-07 14:39:24 -04:00
nhmall
670f07a315 Merge branch 'NetHack-3.6.2' 2019-02-18 11:53:46 -05: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
nhmall
73f186f5cc Merge branch 'NetHack-3.6.2' 2019-02-15 15:25:07 -05: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
9bb43c39fb Merge branch 'NetHack-3.6.2' 2019-02-13 15:09:02 -05:00
nhmall
4150d0b443 use the NetHack macro NHSTDC in makedefs 2019-02-11 12:28:57 -05:00
nhmall
16d5d3f2e5 Merge branch 'NetHack-3.6.2' 2019-01-31 19:48:51 -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
05ec7f36a8 Merge branch 'NetHack-3.6.2' 2019-01-29 22:34:07 -05:00
nhmall
f7b6723053 update the long version info generated by makedefs 2019-01-29 20:01:31 -05:00
nhmall
a09d2248cb Merge branch 'NetHack-3.6.2' 2018-12-29 08:47:16 -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
Bart House
c67f7e5122 globals from files.c moved to instance globals. 2018-12-25 12:56:27 -08:00
Bart House
576eece500 More globals moved to instance_globals. 2018-12-19 21:26:35 -08:00
Bart House
74caa8d8e4 Moved pray.c globals to instance_globals. 2018-12-19 20:00:35 -08:00
Bart House
912886a73f First set of changes to move globals to instance_globals. 2018-12-19 20:00:35 -08: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