Commit Graph

2150 Commits

Author SHA1 Message Date
nhmall
d20b2772eb visual studio comment follow-up 2022-04-12 14:49:34 -04:00
nhmall
1daa2806f9 build tested with updated Visual Studio versions
VS 2017 (Apr 12, 2022 version 15.9.46)
VS 2019 (Apr 12, 2022 version 16.11.12)
VS 2022 (Apr 12, 2022 version 17.1.4)
2022-04-12 14:43:28 -04:00
nhmall
4d1caf8e3a Windows keyhandling 2022-04-11 15:24:55 -04:00
nhmall
b9abd2a185 fix a Windows initializer 2022-04-10 17:18:48 -04:00
nhmall
e74f3c607a Windows build test with Visual Studio 2022 17.1.3 2022-04-02 13:45:04 -04:00
nhmall
d7630ebff8 make zip file contents pathless for msdos pkg 2022-04-01 16:11:30 -04:00
nhmall
5478baa6ee giant ant tiles or right side of msdos display 2022-03-23 22:01:01 -04:00
nhkeni
3aed0c61bc xcode cleanup:
don't use git (so tarball distribution should work)
 name the build shell scripts
2022-03-16 17:03:54 -04:00
nhkeni
41203982be Fix xcode recover install 2022-03-16 15:06:55 -04:00
nhkeni
0b4fad3cb7 NetHack.xcodeproj: update handling of Lua 2022-03-16 15:05:19 -04:00
nhmall
a61586153f Windows nmake build - separate x86 and x64 objs 2022-03-13 21:17:08 -04:00
PatR
de02301b45 revise a couple of recent changes
include/.gitignore should continue to ignore old files in case
someone checks out an older version, builds, then checks out the
current version without running 'make spotless' first.

sys/unix/Makefile.utl:  tiletxt.o depends on tilemap.c in addition
to tiletxt.c.
2022-03-13 13:58:56 -07:00
nhmall
439087ec6d remove a commented out test line from Makefile.utl 2022-03-13 11:37:00 -04:00
nhmall
c7b63d5ef9 follow-up: missed one include/tile.h 2022-03-13 11:24:19 -04:00
nhmall
2234cc256d some parallel Make glitches noticed
observed: parallel build attempts of makedefs that trampled over
one another.

attempted workaround: Add a dependency as per Pat R's suggestion.

observed: Concurrent header file movement collisions were sometimes
causing file busy errors and build failures.

workaround: Eliminate tile.h header file movement from the
Makefile build so that the collisions won't occur with that
particular file. Leave the header file tile.h in win/share as it
is in the distribution and just adjust the include path in the
rule for the specific files that use it.

observed: tiletxt.c created on-the-fly from Makefile echo statements
sometimes resulted in garbled and duplicate content in it when
parallel makes were involved, and that caused a build failure.

workaround: Instead of creating a tiletxt.c on-the-fly via echo
statements in the Makefile, simplify things and use that
same #include "tilemap.c" approach but make it an actual file
in the distribution. That makes it available for other platforms
too.
2022-03-13 11:06:45 -04:00
nhmall
2bb26da9fa Windows visual studio project updates
hide a couple of warnings in non-nethack code
get rid of an obsolete file reference
2022-03-13 10:20:41 -04:00
nhmall
3fc39f273a missed band for windows Makefile.msc 2022-03-11 07:51:12 -05:00
nhmall
fa4ad397dc some sys/windows build updates
Place built libraries for Lua and pdcurses into lib instead of the
more transient src/o subfolder.

Remove a kludge involving sys/windows/stub-pdcscrn.c.

Don't link pdcurses into NetHackW.exe (required a couple of stubs
since NetHack.exe and NetHackW.exe currently share object files
under the visual studio nmake build.

(Note: This may require a couple of follow-on minor modifications
to the mingw build. If so, the CI will flag that for us after this
commit)
2022-03-09 12:02:37 -05:00
nhmall
cceef37c8b Windows nmake build fix 2022-03-07 07:35:35 -05:00
PatR
93928640c6 github issue #688 - end of game livelog event
Requested by k21971 (hardfought admin):  classify the gameover event
as something other than achievement so that live-logging can exclude
it in order to use the xlogfile end-of-game entry instead.

It had been classified as an achievement because that was the only
category being treated as 'major' so written to final dumplog.  Give
is a new classification 'dump' which is distinct from achievement
and intended to explicitly request that an event go into dumplog.
The gameover event is the only one in that category, at least for now.

Add a bunch of other classifications besides achievement and dump to
be treated as 'major' for dumplog.  The new list is
  wish, achieve, umonst (death of unique monster), divinegift,
  lifesave (via amulet, not explore-/wizard-mode decline to die),
  artifact, genocide, dump
and may still need further tuning.  Currently excluded are
  conduct (first violation of any conduct), killedpet, alignment
  (changed, either via helmet or conversion), minorac (minor
  achievement such as level gain or entering the mines), and spoiler
  (currently only applies to finding Mines' End luckstone which is
  also 'achieve' so will be in dumplog).

This doesn't remove the reference to unimplemented LLC_TURNS that is
mentioned in the template sysconf.

Closes #688
2022-03-03 07:47:56 -08:00
PatR
cf9e8da56c fix issue #689 - ?: warning
From copperwater:  a recently added use of <test> ? <if> : <else>
had a ptrdiff_t (signed) expression for <if> and a size_t (unsigned)
expression for <else> which triggered a sign-compare warning when
the two expressions are implicitly converted into the same type.

Use casts to convert both expressions to long rather that convert
the size_t half to ptrdiff_t or vice versa.  The final result gets
cast to int already.

Fixes #689
2022-03-03 05:27:05 -08:00
PatR
54df272f50 remove references to old Qt 'moc' timestamp files
src/moc.qt[56] existed briefly but got replaced by src/Qt[56].h-t
(controlled by hints/include/compiler.370).  The old names were
deliberately left in src/.gitignore and sys/unix/Makefile.src's
'clean' target to give some time for anyone who had generated them
to run 'make clean' to get rid of them.  That time is now up.  It's
only been about three weeks but if I wait any longer I'll probably
forget.
2022-02-25 10:39:45 -08:00
PatR
5fa2576f7a Unix command line bit
For the !SYSCF configuration, the command line processing still checks
for a value for maximum number of simultaneous players.  The recent
revisions would have accepted a negative value.  I don't know whether
anything interesting would have happened if someone did that.
2022-02-21 10:59:42 -08:00
PatR
45bc2dafa9 Unix command line parsing
Move a bunch of stuff out of main() into new early_options(): '-dpath'
playground directory handling, '-s ...' show scores instead of playing,
and the 'argcheck()' options:  --version, --showpaths, --dumpenums,
and --debug (not to be confused with -D).  Also introduce
| --nethackrc=filename
| --no-nethackrc
to control RC file without using NETHACKOPTIONS so that that is still
available for setting other options.  They can start with either one
or two dashes.  --no-nethackrc is just --nethackrc=/dev/null under the
hood.  '-dpath' can now be '--directory=path' or '--directory path'
but the old syntax should still work.  '-s ...' can be '--scores ...'.

Basic call sequence in unixmain relating to options is now
|main() {
|  early_options(argc, argv[]);
|  initoptions(); /* process sysconf, .nethackrc, NETHACKOPTIONS */
|  process_options(possibly_modified_argc, possibly_modified_argv[]);
|}
Options processed by early_options() that don't terminate the program
are moved to the end of argv[], with argc reduced accordingly.  Then
process_options() only sees the ones that early_options() declines to
handle.

Most early options were using plain exit() instead of nh_terminate()
so not performing any nethack-specific cleanup.  However, since they
run before the game starts, there wasn't much cleanup being overlooked.

chdirx() takes a boolean as second argument but all its callers were
passing int (with value of 1 or 0, so it still worked after being
implicitly fixed by prototype).  Change them to pass TRUE or FALSE.

argcheck() was refusing (argc,argv[]) with count of 1 but then it was
checking 0..N-1 rather than 1..N-1, so it tested whether argv[0] was
an argument instead of skipping that as the program name.  Change to
allow count of 1 with modified argv that has an option name in argv[0].
That happens to fit well with how early_options() wanted to use it.
2022-02-18 14:38:24 -08:00
nhmall
f845df9eeb build tested with visual studio 2022 17.1.0 2022-02-16 15:57:03 -05:00
nhmall
a7009e2a54 obsolete nhlan.c follow-up
- visual studio project files
- .gitattributes
2022-02-15 15:22:34 -05:00
nhmall
c0a4b38bf6 remove obsolete function and references 2022-02-15 08:13:27 -05:00
PatR
47c1df6e6f Unix argcheck() usage
The checking for command line flags --version, --showpath, and one
or two others was inside #if CHDIR.  I don't know whether anyone
ever disables that configuration option, but it shouldn't control
whether those flags are handled.
2022-02-14 11:18:08 -08:00
nhmall
6005717e6d cut error 2022-02-13 09:10:53 -05:00
nhmall
99ffd027ae remove NHAccess symset, github issue #638
Closes #638
2022-02-13 09:07:41 -05:00
PatR
a1bb10e8f6 unix command line
I wanted to be able to specify -windowtype:foo on the command line so
that I didn't have to use "NETHACKOPTIONS='windowtype:foo' nethack"
and it turned out that such an option already exists, as "-wfoo".
I either never knew about that or had completely forgotten it.  Anyway,
this makes specifying windowtype be more versatile.

"-wX11" still works; now "-w X11", "-windowtype=X11", "-windowtype:X11"
work too, with "--" variations of the latter too also supported.  The
long name can be truncated to any leading substring of "windowtype",
although it has to be at least "wi" for "--"; "--w" is rejected.

Also, any errors reported while processing the command line are
treated like config file processing errors rather than just delivered
with raw_printf().  On tty at least, they used to vanish when the
screen cleared to start the game, with no chance to read them.  Here's
an example from after this change.  It sets windowtype to tty and then
overrides that with X11.

|% ./nethack --w:Qt --win tty -wX11 -windowtype
|
|
| * Unknown option: --w:Qt.
| * Window type [nothing] not recognized.  Choices are:  tty, curses, X11, Qt.
|
|2 errors on command line.
|
|
|Hit return to continue:

This should probably be better integrated with argcheck() or vice
versa but the only change to that was a couple of formatting bits.

Anything that already worked should continue to work just the same,
aside from the improvement to the error feedback.
2022-02-12 11:42:17 -08:00
PatR
9b6d6d3133 apple pasteboard
Turning on -Wformat-noliteral for Mac triggered a new warning.
Blindly suppressing the warning would have silenced it but would
also have left a real bug in place.  The former format was passing
a string argument to %d format.

This converts the format to a literal with an additional argument
for the non-literal part.  It compiles cleanly but I don't know how
to test it, let alone force an error for it to report.
2022-02-11 14:43:01 -08:00
nhmall
246abbbf5c update tested versions of visual studio 2022-02-10 18:58:06 -05:00
Pasi Kallinen
1e90f89203 Chronicle of major events, and livelog
Log game events, such as entering a new dungeon level, breaking
a conduct, or killing a unique monster, in a new "Major events"
chronicle. The entries record the turn when the event happened.
The log can be viewed with #chronicle -command, and the entries
also show up in the end-of-game dump, if that is available.

This feature is on by default, but can be disabled by
defining NO_CHRONICLE compile-time option.

This also contains "live logging", writing the events as they
happen into a single livelog-file. This is mostly useful for
public servers. The livelog is off by default, and must be
compiled in with LIVELOG, and then turned on in sysconf.

Mostly this a version of livelogging from the Hardfought server,
with some changes.
2022-02-09 22:49:25 +02:00
nhmall
c2cb89cae9 vms bits to c99 2022-02-07 15:15:14 -05:00
nhmall
96c71660c6 fix two reported warnings with SERVER_ADMIN_MSG defined
Report stated a -Wformat-nonliteral at line 612,
and a -Wformat-security at line 614

I was only seeing the latter, so I added the former to the
flags in sys/unix/hints/include/compiler.370. Some compiler
versions have that warning on by default internally and others
don't. If the format string isn't a string literal, there's no
inteference with printf argument checking because that only
operates on string literals.
2022-02-07 09:16:31 -05:00
nhmall
19ff846645 prevent Windows back_buffer_flip() early on 2022-02-06 10:47:41 -05:00
nhmall
787d184570 some Makefile.mingw32 tweaking 2022-02-06 01:02:27 -05:00
nhmall
3d111a6825 change order of exe dependency in Makefile.mingw32 2022-02-05 21:51:50 -05:00
nhmall
8aa29f8a08 adjust Makefile.mingw32 for 3.7 date and time stamping
NetHack 3.7 stores timestamp information, as well as github
commit hashs information if available, internally by compiling
date.c. It is important to ensure that date.c is always
recompiled after any other NetHack source files are compiled.
2022-02-05 21:34:55 -05:00
nhmall
05f3e6efd3 update the dependencies in sys/windows/Makefile.msc
As usual for the visual studio nmake Makefile.msc, steal the generated
dependencies from the tail of sys/unix/Makefile.src, and adjust the text
to suit the Windows build.
2022-02-05 20:12:10 -05:00
PatR
f9f209bb49 Qt 5 vs Qt 6 revisited plus 'make depend' update
Rename the recently added timestamp file used to throw away old qt
'moc' files from moc.qt5 or moc.qt6 to Qt5.h-t or Qt6.h-t and use
that to also throw away old qt_*.o when switching from Qt 5 to Qt 6
or vice versa.  Temporarily the old names remain in Makefile.src's
'clean' target and in src/.gitignore but those will be removed soon.

Update 'make depend' to add the timestamp file to qt_*.o dependencies.
Have it generate rules to build qt_*.moc from ../win/Qt/qt_*.h instead
of using a template rule in hints/include/compiler.370.  So building
the Qt interface doesn't require use of that hints file anymore and
someone reading Makefile.src won't have to know about it, but using
those hints will make their life easier.

Simplify the Qt timestamp handling portion of compiler.370.  Only one
extra rule gets added when creating src/Makefile.

src/Makefile generated from sys/unix/Makefile.src that's been rebuilt
with 'make depend' got broken by uncommenting '#include "amiconf.h"'
in global.h.  That file isn't in include/ but every object file now
depended on it and make didn't know what to do about that.  Have
depend.awk treat it as a special case so that no object files depend
on it.  That means that actually modifying it won't trigger a rebuild;
anyone fiddling with that will have to always do 'make clean' or
'touch config.h-t' after changing it.  The alternative is to move it
from outdated/include/ back to include/.

In depend.awk, recent gawk complained that "\." wasn't a defined
escape sequence in regular expressions so it would be treated as ".".
That's exactly what is intended but change it to "[.]" to avoid the
warning.  Similarly for one instance each of "\#" and '\"'.  I also
tried changing "\/" to "[/]" even though that is a defined sequence
and doesn't trigger any warning.  gawk accepted it but the awk that
comes with OSX choked on it so I changed it back to "\/".
2022-02-05 04:15:51 -08:00
nhmall
2e3e53883f remove a workaround in Makefile.mingw32 2022-02-04 23:07:22 -05:00
nhmall
e795dd107e fix Makefile.mingw32 2022-02-04 20:26:05 -05:00
nhmall
0fba9cf896 .gitattributes for Xcode directory 2022-02-04 19:01:11 -05:00
nhmall
2f83190f8a macOS.370 Lua 2022-02-04 18:55:12 -05:00
nhmall
ee1eff538c Lua link on Jammy Jellyfish 2022-02-04 18:03:08 -05:00
PatR
5b28db5f23 more obsolete files: DECUS C's preprocessor
Get rid sys/share/cpp[123].shr, the pre-ANSI C preprocessor that was
included in the source distribution for use on systems with ancient
C compilers whose preprocessor that couldn't cope with nethack's large
number of macros.
2022-02-04 14:34:46 -08:00
nhmall
6af710bc97 provide a Makefile target to clean the Lua submodule 2022-02-04 17:11:09 -05:00
nhmall
a25259a97a more obsolete file references 2022-02-04 15:52:42 -05:00