Commit Graph

422 Commits

Author SHA1 Message Date
PatR
42245f8e67 wizard mode vs venom object names
I tried wishing for "splashes of venom" but was told that no such
thing exists even though "splashs of venom" and "2 splash of venom"
both work to produce "2 splashes of venom".  After the spurious
failure, retrying with EDIT_GETLIN enabled showed that "splashes"
had been singularized to "splashe" so fix that.

"2 splashes of venom" IDed to "2 uncursed blinding venoms" because
the base name omits "splash of" prefix.  And due to that, explicitly
wishing for "splash of {acid,blinding} venom" didn't work either.
Change the names to include the prefix, and add a hack to makedefs
to keep generating the old macro names without the prefix.  (Wishing
for "{acid,blinding} venom" still works due to post-3.6.6 changes
to " of " matching.)
2020-07-24 14:45:59 -07:00
PatR
0bd2c3154d fix default engraving/epitaph/bogusmon corruption
Fixes #369.
Fixes #370.

The default entries inserted by makedefs -s (starting in 3.6.6,
to guard against having an empty data file which led to divide by
zero crash when nethack picked a random entry) lacked a terminating
newline so the first entry from the file (for the usual case when
that data file wasn't empty) got implicitly concatenated to it.
If the first entry got chosen during play, the initial portion
corresponding to the default entry was decrypted properly but the
concatenated portion corresponding to file's first line didn't.
So gibberish was appended to default engraving or epitaph or bogus
monster; also, the input file's first line would never appear.

The newline fix in makedefs is different from pull request #370
but accomplishes the same thing.

The bulk of the patch is an enhancement to #wizrumorcheck to show
first (default inserted by makedefs), second (first in input file)
and last engravings, epitaphs, and bogusmons in addition to rumors.
The command name has become a little misleading but the limited
functionality doesn't call for separate commands.
2020-07-09 19:23:19 -07:00
nhmall
3cecb97da6 consolidate build status /patchlevel info settings in one place - patchlevel.h 2020-07-06 09:12:22 -04:00
nhmall
5a437b336a remove SYSFLAGS and MFLOPPY code
A check into github issue 364 confirmed that
ba6edbe5dc
had incorrectly updated the bwrite sizeof entry for sysflags.

The SYSFLAGS and MFLOPPY code is all in the outdated part of the tree, so just
remove it rather than re-correct it.

Closes #364
Closes #207
2020-07-05 08:50:13 -04:00
PatR
b7030d1567 resurrect 'makedefs -m'
Have 'makedefs -m' output default mons[].difficulty values in the
stub 'monstr.c' that still gets generated for that option.  It
would be better to allow specifying which monsters are of interest
but I didn't want to get bogged down by interface issues.

I needed it for mons[PM_ELF].difficulty after changing that monster's
level, so it still has a purpose.  Code is from 3.4.3, reformatted
manually.
2020-04-21 14:04:03 -07:00
PatR
5d4b9784ac more #302 - empty {bogusmon,engrave,epitaph}.txt
Have makedefs add a real data line to the output for the files that
caused trouble when empty.
2020-02-22 12:32:00 -08:00
Patric Mueller
16d32b3002 Remove left over NH_DEVEL_STATUS bits from makedefs.c
Left bits from previous version info code caused compilation errors
if NH_DEVEL_STATUS was not set to NH_STATUS_WIP.
2020-02-19 01:43:51 +01:00
nhmall
e39ec5ce3e rename new header file to fnamesiz.h
Changes to be committed:
renamed:    include/filesize.h -> include/fnamesiz.h
2020-01-29 09:56:43 -05:00
nhmall
209fab138b recover fix
recover had deviated somewhat from NetHack in its
file expectations:
1) A couple of 3.7 fields needed to be accommodated.
2) hard-coded file size values had deviated.

The file sizes are now in an added header file named "filesize.h",
which is included at the bottom of config.h.

There will likely be another commit to write the filename size ahead
of the file name so that the precise number of characters can be read,
but since that will break existing saves, it can go in along with another
save-breaking commit.

This commit doesn't not alter savefiles written by nethack so does not
require an editlevel bump. It does alter the read-in expectation in
recover to match the game and this get recover working again.
2020-01-29 09:15:55 -05:00
nhmall
d5174323eb Merge 'NetHack-3.6' updates into NetHack-3.7-Jan2020 2020-01-14 22:09:29 -05:00
nhmall
a6c46bbd85 housekeeping items for 3.6.5 - first pass 2020-01-14 11:35:06 -05:00
nhmall
17feb01d8f Merge branch 'NetHack-3.6' 2019-12-17 14:39:15 -05:00
nhmall
74a5339a5e housekeeping updates for 3.6.4
typos

README update
2019-12-17 14:11:52 -05:00
nhmall
02c43fc927 Merge branch 'NetHack-3.6' 2019-12-15 18:03:19 -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
bc8c1f8f56 remove field-level savefile code 2019-12-08 07:27:01 -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
b7689128e7 mdlib.c tweaks
Eliminate a couple of warnings about unused static routines.
That led to a couple of other things.

I hope I got host vs target right in the mdlib.c '#if's.
2019-11-30 16:59:35 -08:00
PatR
5226726c99 more lua notice from makedefs.c to mdlib.c
Add missing dependency of makedefs needing src/mdlib.c to unix
Makefile.src.
2019-11-29 17:19:37 -08:00
PatR
769799105c move lua notice to makedefs.c and dat/options
Prefix the lua notice with a one-line explanation.  One minor change:
the copyright date didn't match the one from the actual lua notice.
2019-11-29 16:05:14 -08:00
nhmall
ff39e44276 resolve 48 warning building on Mac OS X 2019-11-28 22:48:57 -05:00
nhmall
8ac2ae3a64 fix a gcc warning 2019-11-28 19:05:39 -05:00
PatR
05e64d2429 more questpgr removal from makedefs 2019-11-25 10:07:11 -08:00
Pasi Kallinen
ddd8b7d9a5 Remove vestiges of quest text data file 2019-11-25 16:30:54 +02:00
nhmall
5d778f7418 clean up some macosx build warnings 2019-11-24 17:26:35 -05:00
nhmall
95b6e27a09 add notice 2019-11-24 14:26:46 -05:00
nhmall
ac315adaf1 Revert "attempt to avoid questpgr convert woes on cross-compile by making the int sizes fixed"
This reverts commit b8a6d82c57.
2019-11-24 00:40:00 -05:00
nhmall
b8a6d82c57 attempt to avoid questpgr convert woes on cross-compile by making the int sizes fixed 2019-11-24 00:11:26 -05:00
nhmall
1e0c03b3f6 incremental improvements to cross-compiling support in NetHack 3.7
Some support of new code #defines to faciliate cross-compiling:

    OPTIONS_AT_RUNTIME    If this is defined, code to support obtaining
                          the compile time options and features is
                          included. If you define this, you'll also have
                          to compile sys/mdlib.c and link the resulting
                          object file into your game binary/executable.

    CROSSCOMPILE          Flags that this is a cross-compiled NetHack build,
                          where there are two stages:
                          1. makedefs and some other utilities are compiled
                          on the host platform and executed there to generate
                          some output files and header files needed by the
                          game.
                          2. the NetHack game files are compiled by a
                          cross-compiler to generate binary/executables for
                          a different platform than the one the build is
                          being run on. The executables produced for the
                          target platform may not be able to execute on the
                          build platform, except perhaps via a software
                          emulator.

                          The 2-stage process (1. host, 2.target) can be done
                          on the same platform to test the cross-compile
                          process. In that case, the host and target platforms
                          would be the same.

    CROSSCOMPILE_HOST     Separates/identifies code paths that should only be
                          be included in the compile on the host side, for
                          utilities that will be run on the host as part of
                          stage 1 to produce output files needed to build the
                          game. Examples are the code for makedefs, tile
                          conversion utilities, uudecode, dlb, etc.

    CROSSCOMPILE_TARGET   Separates/identifies code paths that should be
                          included on the build for the target platform
                          during stage 2, the cross-compiler stage. That
                          includes most of the pieces of the game itself
                          but the code is only flagged as such if it must
                          not execute on the host.

If you don't define any of those, things should build as before.
One follow-on change that is likely required is setting the new dependency
makedefs has on src/mdlib.c in Makefiles etc.

More information about the changes:

    makedefs

    - splinter off some of makedefs functionality into a separate file
      called src/mdlib.c.
        - src/mdlib.c, while included during the compile of makedefs.c
          for producing the makedefs utility, can also be compiled
          as a stand-alone object file for inclusion in the link step
          of your NetHack game build. The src/mdlib.c code can then
          deliver the same functionality that it provided to makedefs
          right to your NetHack game code at run-time.
          For example, do_runtime_info() will provide the caller with
          the features and options that were built into the game.
          Previously, that information was produced at build time on the
          host and stored in a dat file. Under a cross-compile situation,
          those values are highly suspect and might not even reflect the
          correct options and setting for the cross-compiled target
          platform's binary/executable. The compile of those values and
          the functionality to obtain them needs to move to the target
          cross-compiler stage of the build (stage 2).
        - date information on the target-side binary is produced from
          the cross-compiler preprocessor pre-defined macros __DATE__
          and __TIME__, as they reflect the actual compile time of the
          cross-compiled target and not host-side execution of a utility
          to produce them. The cross-compiler itself, through those
          pre-defined preprocessor macros, provides them to the target
          platform binary/executable. They reflect the actual build
          time of the target binary/executable (not values produced
          at the time the makefiles utility was built and the
          appropriate option selected to store them in a text file.)
        - most Makefiles should not require adding the new file
          src/mdlib.c because util/makedefs.c has a preprocessor
          include "../src/mdlib.c" to draw in its contents. As previously
          stated though, the Makefile dependency may be required:
		makedefs.o: ../util/makedefs.c ../src/mdlib.c
                                               ^^^^^^^^^^^^^^^
2019-11-22 22:35:48 -05:00
nhmall
220f8ddd46 Merge branch 'NetHack-3.7' into paxed-lua-v2-merged 2019-11-09 16:41:44 -05:00
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
bcb627100b Merge branch 'paxed-lua-merged3' into paxed-lua-v2-merged 2019-11-06 12:56:21 -05:00
Pasi Kallinen
9cd9280276 Lua: remove dgn_comp, use lua instead 2019-11-06 18:45:10 +02:00
Pasi Kallinen
fd55d9118e Use lua for special level files
Game is playable, and should compile on linux and Windows.
Assumes you have a lua 5.3 library available.

Removes level compiler and associated files.
Replaces special level des-files with lua scripts.
Exposes some NetHack internals to lua:
 - des-table with commands to create special levels
 - nh-table with NetHack core commands
 - nhc-table with some constants
 - u-table with some player-specific data (u-struct)
 - selection userdata

Adds some rudimentary tests.

Adds new extended command #wizloadlua to run a specific script,
and #wizloaddes to run a specific level-creation script.

nhlib.lua is loaded for every lua script.

Download and untar lua:
  mkdir lib
  cd lib
  curl -R -O http://www.lua.org/ftp/lua-5.3.5.tar.gz
  tar zxf lua-5.3.5.tar.gz

Then make nethack normally.
2019-11-06 18:43:20 +02: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