Commit Graph

2926 Commits

Author SHA1 Message Date
nhmall
3c25b83121 visual studio project file updates 2025-05-22 10:13:44 -04:00
nhmall
c5946c6a43 Windows GNUmakefile library update 2025-05-22 10:07:29 -04:00
nhmall
0c765ce207 move some Windows code: windmain.c -> windsys.c 2025-05-22 10:04:54 -04:00
nhmall
78a4fd2fb8 split config file processing into its own src file 2025-05-21 23:58:01 -04:00
nhmall
6f1bf6ec69 update tested versions of Visual Studio 2025-05-13 2025-05-13 19:49:38 -04:00
nhmall
8ac31b24f6 libnh build
The macOS.370 has not yet been tested, but it is patterned after
the linux.370 changes.
2025-05-12 08:45:26 -04:00
nhmall
8f38267775 use documented SIG_RET_TYPE for Linux with gcc 2025-04-20 13:13:30 -04:00
nhmall
01e031e639 visual studio recover project update 2025-04-16 10:10:34 -04:00
nhmall
799e252c21 GNUmakefile requires slashes between macro and file 2025-04-15 21:08:03 -04:00
nhmall
dcb0fc7654 remove unused target from Makefile.utl 2025-04-15 20:03:28 -04:00
nhmall
6cf9415b72 add define to GNUmakefile build 2025-04-15 20:01:02 -04:00
nhmall
28d2ff516c sys/windows/GNUmakefile recover 2025-04-15 19:58:25 -04:00
nhmall
5560bdb27c msdos recover 2025-04-15 19:53:50 -04:00
nhmall
46d4639d66 visual studio build fix (for recover) 2025-04-15 18:56:34 -04:00
nhmall
44af2a96a5 recover utility updates 2025-04-15 18:02:44 -04:00
nhmall
a3e12550ea savefile changes - part 1
This is the first of several savefile-related changes to
follow later. This one is groundwork for those later changes.

Remove internal compression schemes (RLECOMP and ZEROCOMP)
and discard the savefile_info struct that was primarily used to
convey which internal compression schemes had been in use.

Relocate some struct definitions into appropriate header files
for use by code to come in later changes.

Remove the two struct size-related fields from version_info and
from the nmakedefs_s. Instead, include a series of bytes near the
beginning of the savefile, representing the size of each
struct or base data type that impacts the historical savefile
content. Those are referred to as the "critical bytes".
(Related note: the "you" struct required two bytes, low and high,
due to its size).

Compare those critical bytes in a savefile against the NetHack
build that is reading the savefile. This allows mismatch detection
early in the savefile-reading process, and a clean exit, rather than
proceeding to read nonsensical values from the file. Include some
feedback on what the first mismatch was when encountering
one.

For arrays stored in the savefile, use loop-logic in the core
to write/read the array elements one at a time, rather than in
a single blob. This will be required for changes to follow later.
(impacts artiexist[], artidisco[], svd.dungeons[], svl.level_info[],
svl.level.locations[][], msrooms[] field of mapseen, svb.bases[],
svb.disco[] objects[], svm.mvitals[], svs.spl_book[], svd.doors[],
go.oracle_loc[], utrack[], wgrowtime[])

This also adds data model to the long version information.

This invalidates existing save and bones files due to the changes in
the information at the start of the file.
2025-04-15 15:35:17 -04:00
nhmall
eeb96c4151 update tested versions of Visual Studio 2025-04-13 2025-04-13 10:22:59 -04:00
nhmall
3ed63f9be4 more Xcode cleanup 2025-03-19 21:20:39 -04:00
nhmall
f30780e42e clean up absolute paths 2025-03-19 21:16:46 -04:00
nhmall
872a9778ed Xcode project update 2025-03-19 19:26:27 -04:00
nhmall
e70b92e200 paste error in Makefile.nmake 2025-03-19 17:31:19 -04:00
nhmall
1f99638bbf ren nhconst.h -> weight.h
The speed related values were not used, except for NORMAL_SPEED,
which has been moved back to permonst.h
2025-03-19 17:14:07 -04:00
nhmall
a943c4c10b replace some weight-related magic numbers
adds a header file include/nhconst.h  (I'm open to a better name)
2025-03-19 13:29:58 -04:00
nhmall
b169b79d36 dump monster and obj weights using --dumpweights 2025-03-15 19:55:49 -04:00
nhmall
9b0724f8f2 update tested versions of Visual Studio 2025-03-13 2025-03-13 12:57:55 -04:00
nhmall
dfe2a967fc fix a recent typo 2025-03-13 07:40:20 -04:00
nhmall
4a67caf3d7 document musl=1 in README-hints 2025-03-11 10:27:18 -04:00
nhmall
fbb8ef2fa6 follow-up: set STRIPBS in Makefiles 2025-03-10 17:18:58 -04:00
nhmall
bddca2ded5 musl libc build, rather than glibc
We've had reports of a couple of issues building against musl libc.

Issues reported:
  - build procedures utilize cat for Guidebook-creation, and cat
    is deprecated in distros that use musl libc.

  - some of the CRASHREPORT code is using library functions that
    are not available in the musl libc environment. The reported
    functions were backtrace() and backtrace_symbols(), which use
    header file /usr/include/execinfo.h.

So we'll try to accommodate this. Since we don't have a means of
autodetecting the musl libc situation during the build (as of yet), the
builder will have to specify 'make musl=1' on the make command line.

Specifying 'musl=1' on the make command line will:
1. ensure that NOCRASHREPORT gets defined in the C preprocessor.
2. set COLCMD to be '../util/stripbs' instead of 'col -bx'.

Closes #1393
2025-03-10 17:14:24 -04:00
SHIRAKATA Kentaro
83bb81c624 fix Makefile.nmake when USE_DLB=N 2025-03-01 00:12:03 +09:00
nhmall
d56b0a3b7a follow-up bit for Windows console 2025-02-26 23:14:52 -05:00
nhmall
1eaafddca3 fix dolook() on Windows console
usemap boolean wasn't being set to TRUE when it should have been
2025-02-26 23:10:30 -05:00
Keni
372ebd9d80 NOSTATICFN/NONOSTATICFN typos and logic fixes 2025-02-17 11:50:55 -05:00
nhmall
f1be2eaffa add --dumpmongen to view mongen_order[] array 2025-02-14 09:38:29 -05:00
nhmall
f8773f65db update tested versions of Visual Studio 2025-02-11 2025-02-11 19:50:08 -05:00
nhkeni
cfe39900ca Demo for downloading formatted docs
Written for MacOS, more useful for Windows (but I'm not writing that).
2025-01-31 21:48:15 -05:00
PatR
29f7580fc1 analyzer lint for sys/unix/*.c sys/share/*.c win/tty/*.c
Actually only ioctl.c for sys/share.  And with all of these, only
for the conditionals used by MacOS.
2025-01-23 12:01:46 -08:00
nhmall
8de3aa564f update tested versions of Visual Studio 2025-01-19 2025-01-19 22:02:43 -05:00
nhmall
3221665f5a updates to tradstdc.h
Define a macro NH_C to provide a shorter & simpler way to test for
which C standard the build is being carried out under (c99 or c23).

 NH_C > 202300L     Being compiled under C23 or greater
 NH_C > 199900L     Being compiled under C99 or greater
 NH_C > 198900L     Being compiled under C89 or greater,
                    or C std could not be determined.

While NetHack only requires c99, we've been taking advantage
of some c23 features (attributes), if they are available,
to allow the use of ATTRNORETURN/NORETURN and FALLTHROUGH on
compilers other than gcc.

Also add some comment documentation to tradstdc.h about NetHack's
use of c99.

The sys/unix/Makefile.top change overcomes a warning in the
Makefile-generated nhlua.h. That warning arises under some compilers
that rely on attribute [[noreturn]] ahead of a declaration
(NetHack macro ATTRNORETURN), rather than the trailing gcc
__attribute((noreturn)) (NetHack macro NORETURN). The sed command
is modified to include ATTRNORETURN at the start of the declaration
in addition to the NORETURN at the end of the declaration, in the
generated file. That's the same combination that's used for the
declaration of other functions that don't return.
2025-01-19 20:51:46 -05:00
nhmall
85965b1b32 Visual Studio project files:directory name cleanup 2025-01-07 10:00:28 -05:00
nhmall
7cc118365c quiet down mips cross-compile
Even though most of these are cast to void (but not all), the
mips cross-compiler seems determined to warn about them anyway.

Suppress that particular warning altogether to quiet the build.
That is not the ideal approach, but if the normal way of whitelisting
individual cases isn't working, I'm not sure of another course of
action.
2025-01-05 15:51:11 -05:00
nhmall
a7152ad54e CROSS_TO_WASM build fix
A couple of option processing functions, one of which was called in file.c, were
recently added to sys/unix/unixmain.c, but the wasm build does not include unixmain.c,
it uses sys/libnh/libnhmain.c.

Transcribe the functions into sys/libnh/libnhmain.c.

Also, do not #include "wintty.h" for NOTTYGRAPHICS builds.
2025-01-05 05:42:24 -05:00
nhmall
be5143bb74 window-port updates
Remove start_screen() and end_screen() from the
Window-port interface.

They were only ever used by tty, and there was a comment
carried to several window-ports about how they "really
should go away. They are tty-specific"

term_start_screen() and term_end_screen() are part of
terminal/NO_TERMS supporting routines now.
2025-01-04 23:38:34 -05:00
nhmall
37758c7e48 some tty updates
Add a note about NO_TERMS to include/wintty.h for clarity.

Rename tty_startup and tty_shutdown to term_startup() and
term_shutdown(). They are found in termcap.c for !NO_TERMS
like most of the other term_ routines, as well as having
versions for several of the NO_TERMS platforms. They aren't
part of the tty_interface called from the core. The tty
implementation does call and rely on them.

Remove some conditional #ifdef's around term_shutdown()
(formerly tty_shutdown()) and just ensure that all the
tty platforms have an implementation that they can link
with, even if it is just a stub presently.

Put the protype for nethack_exit in extern.h to reduce
maintenance to a single spot, and remove it from other
locations. A warning in the msdos cross-compile led to
this change.
2025-01-04 19:01:34 -05:00
nhmall
e20908fa4f remove an unused part of msdos cross-compile 2024-12-30 12:59:00 -05:00
nhmall
ac50b7fecc update the msdos cross-compile
date.c wasn't always being recompiled.
A couple of other bits.
2024-12-30 12:52:35 -05:00
nhmall
a65c012f45 shorten up a Makefile.src line 2024-12-30 12:48:52 -05:00
nhmall
50aff17f94 follow-up bit for sys/msdos/fetch-cross-compiler.sh 2024-12-29 13:54:06 -05:00
nhmall
7b4445f040 make msdos lib/djgpp/target folder more hierarchical
Instead of flat, have bin, lib and include folders for
the native DOS pieces.

If you have been cross-compiling for MSDOS, you will
need to carry out the following to bring things up-to-date:

    sys/msdos/fetch-cross-compiler.sh
    make CROSS_TO_MSDOS=1 WANT_DEBUG=1 package
2024-12-29 12:11:03 -05:00
nhmall
556f1c9839 Windows: remove troublesome template lines
Closes #1345
2024-12-26 17:38:03 -05:00