Commit Graph

299 Commits

Author SHA1 Message Date
nhmall
5dcc328759 be more consistent with CROSS_TO_target macro names for cross-compiles
-DCROSS_TO_MSDOS	msdos cross-compile (djgpp cross-compiler)
-DCROSS_TO_AMIGA	Amiga cross-compile
-DCROSS_TO_WASM		wasm cross-compile (emscripten)
2020-10-08 13:49:24 -04:00
nhmall
cb223271cb add cross-compile recipe for amiga
Disclaimer: This is a minimal recipe, just to get someone else
started if they have a desire to get a full cross-compile of
NetHack-3.7 going for the Amiga. Some NetHack code bitrot was
corrected, and it does seem able to compile the game itself
to a point. See caveats below.

- If you want to obtain the cross-compiler and tools/libs for Amiga
         https://github.com/bebbo/amiga-gcc

  To our knowledge, a pre-built copy isn't available, so you have to
  obtain the source via git and build it on your system.

  The build prerequisite packages for Ubuntu are easily obtained:

    sudo apt install make wget git gcc g++ lhasa libgmp-dev \
        libmpfr-dev libmpc-dev flex bison gettext texinfo ncurses-dev \
        autoconf rsync

  The build prerequisite packages for macOS are apparently easily
  obtained via homebrew, but that was not tested:

    brew install bash wget make lhasa gmp mpfr libmpc flex gettext \
    texinfo gcc make autoconf

  After installing the prerequite packages and the cross-compiler
  it was a straightforward build:

        git clone https://github.com/bebbo/amiga-gcc.git
        cd amiga-gcc
        make update
    [Note that you may have to take ownership of the files in the
     bebbo repo via chown before succesfully carrying out the next
     steps]
        make clean
        make clean-prefix
        date; make all -j3 >&b.log; date
  The compiler pieces are installed in /opt/amiga by default which
  was satisfactory for our initial attempt, but if you want you can
  alter the prefix before you build if you want. That is all
  spelled out on the page at: https://github.com/bebbo/amiga-gcc

  The Amiga cross-compile can then be carried out by specifying
  CROSS_TO_AMIGA=1 on the make command line.

  For example:
       make CROSS_TO_AMIGA=1 all
       make CROSS_TO_AMIGA=1 package

You can explicitly include tty and curses support if desired, otherwise
you'll end up with a tty-only cross-compile build. The SDL1 pdcurses
support has not been tested.

       make WANT_WIN_TTY=1 WANT_WIN_CURSES=1 CROSS_TO_AMIGA=1 all

Also note that building the amiga targets using the make command
above, does not preclude you from building local linux or macOS
targets as well. Just drop the CROSS_TO_AMIGA=1 from the make
command line.

The cross-compiler hints additions are enclosed inside ifdef sections
and won't interfere with the non-cross-compile build in that case.

CAVEATS: The original NetHack Amiga build steps included the source for
some utilities that were built and executed on the amiga: txt2iff and
xpm2iff as part of the NetHack build procedure on amiga. Those did not
compile out-of-the-box on the linux host. They will either have to be:
    - ported to build and run on the linux or macOS cross-compile host

   or

    - their functionality will have to be rolled into amiga NetHack
      itself and executed on the target Amiga the first time the game
      is run, perhaps.

Good luck amiga aficionados, perhaps you'll be able to take this
initial effort forward and get NetHack-3.7 available on the amiga or
amiga-emulator. Let us know if you do, and we can roll changes in
if you provide them.
2020-09-28 17:30:22 -04:00
nhmall
ac9ba38449 file header bump from "NetHack 3.6" to "NetHack 3.7" 2020-08-03 22:07:36 -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
nhmall
bb1a0dd60b build warning for noreturn function that does return
The warning showed up with gcc on msdos (__DJGPP__)

end.c: In function 'nh_terminate':
end.c:1729:1: warning: 'noreturn' function does return
 }
 ^
2020-06-08 14:44:29 -04:00
nhmall
7b8c6d6b84 msdos has been tested with 3.7 2020-01-28 19:16:07 -05:00
nhmall
82bfec24f9 update some version bits 2020-01-28 19:09:40 -05:00
nhmall
033894d784 Merge branch 'NetHack-3.7' into NetHack-3.7-Jan2020 2020-01-27 08:52:17 -05:00
Pasi Kallinen
1783b9de3e Doc and sample config for MSDOS video resolution 2020-01-27 10:13:48 +02: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
bc8c1f8f56 remove field-level savefile code 2019-12-08 07:27:01 -05:00
nhmall
a9c946a05f Merge branch 'NetHack-3.6' 2019-12-01 19:30:09 -05:00
nhmall
d2d40289e6 update and/or clarify some version references 2019-12-01 19:07:28 -05:00
nhmall
d2128968fa Merge branch 'NetHack-3.7' into paxed-lua-v2-merged 2019-11-14 19:50:20 -05:00
nhmall
6c97b0f9a1 Merge branch 'NetHack-3.6' 2019-11-14 19:48:57 -05:00
nhmall
8e7888d631 introduce msdos build support for cross-compiling on other platforms 2019-11-14 14:10:56 -05:00
Pasi Kallinen
32f2fdb135 Remove leftover level compiler header 2019-11-07 19:40:41 +02: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
3ccc6e5308 Merge branch 'NetHack-3.6' 2019-10-17 20:52:10 -04:00
PatR
e4f3559acc curses on unix - terminal reset needed after abort
Noticed while investigating the message loop.  If I had level files
from an interrupted game and was asked "Destroy old game?" when
starting a new one, answering 'n' left the terminal in an unusable
state.  Executing 'stty sane' (invisibly since input echo was off)
repaired things but the user shouldn't have to do that.

Change unixtty.c's error() to shut down windowing if that has been
initialized.  This might need some tweaking for tty, which will now
clear the screen before showing the startup error message.  Other
systems besides unix use unixtty.c so are affected, but I think the
change doesn't introduce anything that should cause trouble (aside
from the potential screen erasure).
2019-10-09 13:18:34 -07:00
nhmall
fe1b2d6e82 Merge branch 'NetHack-3.6' 2019-10-06 09:16:23 -04:00
PatR
0d76f68f2c tty xputc()
Another part of github issue 227.  Casting a function pointer when
passing it to another function is iffy when lying about the return
type.  tputs() expects a routine which returns int, so give it one.
Other xputc() usage is equivalent to putchar(), so define xputc()
with the same function signature as that has.

The tputs() declarations in system.h should probably be changed
(third argument is a function which takes an int rather than
unspecified parameters) but I've left them alone.  I made that change
to tputs() in sys/share/tclib.c though.

NT and MSDOS changes are untested.  tclib.c compiles ok with clang-
as-gcc on OSX but hasn't been tested with the port that uses it (VMS).
2019-10-05 16:49:34 -07:00
nhmall
8c20c52ecf remove STATIC_DCL, STATIC_OVL, STATIC_VAR, STATIC_PTR from sys/share 2019-07-14 17:28:48 -04:00
nhmall
efbe179f64 fix the msdos build for NetHack-3.7 2019-07-02 22:05:36 -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
Pasi Kallinen
217671e00f Remove built-in speaker support
The changes to amiga, mac and msdos builds are untested.
2019-05-11 11:10:00 +03:00
nhmall
7e79bb2169 Merge branch 'NetHack-3.6.2' 2019-03-08 10:38:18 -05:00
PatR
62507fa40f sys/share/*_yacc.c update
For the pre-generated yacc sources, revert to the version of byacc
used for 3.6.1 and 3.6.0 to avoid unnecessary changes for 3.6.2.
2019-03-06 11:43:27 -08:00
nhmall
b367b4e868 Merge branch 'NetHack-3.6.2' 2019-01-29 17:23:22 -05:00
nhmall
97fdc3f3e4 build bits - mostly for Windows
Allow sys/share/random.c to be included in the build
always, even if USE_ISAAC64 is defined, by making most
of its contents conditional in that case.

That avoids Makefile tinkering when going back and
forth between USE_ISAAC64 and not during testing.
2019-01-29 11:31:41 -05:00
nhmall
befa1d94e9 Merge branch 'NetHack-3.6.2' 2019-01-25 21:08:03 -05:00
PatR
d63c9d866c band-aid for #H4041 - build warning: has_colors()
Since no one has come up with a better fix for has_colors() being
implicitly declared, add a hack for suppressing a compiler complaint
about has_colors() on linux and/or sco unix that use sufficiently old
<curses.h>.

Report was right after release of 3.6.0 but my fix at the time broke
compile when using more recent <curses.h>.
2019-01-24 15:25:50 -08:00
nhmall
f0defb1111 Merge branch 'NetHack-3.6.2' 2019-01-01 19:51:41 -05:00
nhw_cron
94aecd5ca0 This is cron-daily v1-Dec-30-2019. levcomp updated: sys/share/lev_comp.h sys/share/lev_yacc.c 2019-01-01 17:19:21 -05:00
nhw_cron
a2649ae879 This is cron-daily v1-Dec-30-2019. dgncomp updated: sys/share/dgn_comp.h sys/share/dgn_yacc.c 2019-01-01 17:19:11 -05:00
Bart House
ed096f74c3 shk followmsg moved to instance globals. early_init introduced. 2018-12-25 17:46:52 -08:00
Bart House
769ad91cc3 mthrowu, nhlan, options, regions, rip and role globals moved to g. 2018-12-25 16:26:27 -08:00
Bart House
64be5fd35a lock -> g.lock 2018-12-25 13:05:43 -08:00
Bart House
c67f7e5122 globals from files.c moved to instance globals. 2018-12-25 12:56:27 -08:00
Bart House
16db7498d0 UNIX, VMS, DEF_PAGER, MICRO and MFLOPPY globals moved to g. 2018-12-25 09:34:24 -08:00
Bart House
9069615861 Global changes for qt, qt4, amiga, x11 and curses. 2018-12-24 21:28:44 -08:00
Bart House
e5e906dc3b Changes needed in various ports due to globals changes. 2018-12-24 14:47:51 -08:00
Bart House
9567526586 Changed references from hname to g.hname. 2018-12-22 14:51:26 -08:00
Bart House
c9565d4ef6 Change references from hackpid to g.hackpid in various ports. 2018-12-22 14:43:50 -08:00
Bart House
cb42021389 Last big push for moving globals to instance_globals. 2018-12-19 20:01:56 -08:00