Commit Graph

299 Commits

Author SHA1 Message Date
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
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