Commit Graph

2803 Commits

Author SHA1 Message Date
nhmall
ce8c4c3ca2 fix reported missing closing '%' in fetch.cmd
Reported directly to devteam by email in K4336 (thank you).
2025-07-07 10:07:02 -04:00
nhmall
da132e3bb0 Revert "remove extraneous script file (Windows)"
This reverts commit 33652b8288.
2025-07-07 10:00:25 -04:00
nhmall
34b42d2354 recent qt6 requires c++20
There are warnings within the qt6 header files if c++20 is not used, for example:

usr/include/x86_64-linux-gnu/qt6/QtCore/qfuturesynchronizer.h:21:5: warning: use of the 'nodiscard' attribute is a C++20 extension [-Wc++20-attribute-extensions]
   21 |     Q_NODISCARD_CTOR_X("Use future.waitForFinished() instead.")
      |     ^
/usr/include/x86_64-linux-gnu/qt6/QtCore/qcompilerdetection.h:972:43: note: expanded from macro 'Q_NODISCARD_CTOR_X'
  972 | #    define Q_NODISCARD_CTOR_X(message) [[nodiscard(message)]]
      |                                           ^
1 warning generated.

qmake6 --version
QMake version 3.1
Using Qt version 6.8.3 in /usr/lib/x86_64-linux-gnu
2025-06-29 11:59:07 -04:00
Pasi Kallinen
8d8867007f Typofix 2025-06-27 00:28:27 +03:00
nhmall
1e5a132fa1 update tested versions of Visual Studio 2025-06-19 2025-06-19 13:44:06 -04:00
nhmall
8d0b284dc6 update tested versions of Visual Studio 2025-06-04 2025-06-04 07:37:34 -04:00
nhmall
cb12423a2e sys/unix/Makefile.utl update for sfctool 2025-06-02 21:52:38 -04:00
nhmall
d25e016140 typo fix again 2025-06-02 21:38:21 -04:00
nhmall
c85b3f87d1 GNUmakefile follow-up 2025-06-02 21:33:05 -04:00
nhmall
34c010579b update sys/windows/Makefile.nmake for sfctool 2025-06-02 21:20:47 -04:00
nhmall
5d9656c801 typo fix in sys/windows/GNUmakefile 2025-06-02 21:17:40 -04:00
nhmall
1fb403f299 sfctool MSYS2 build 2025-06-02 21:08:38 -04:00
nhmall
e33cf7a6d6 more CI, GNUmakefile interaction 2025-06-02 12:07:11 -04:00
nhmall
f262b8b015 CI mingw update 2025-06-02 12:00:42 -04:00
nhmall
40c1842010 update Windows Makefile.nmake 2025-06-02 10:42:21 -04:00
nhmall
a9c0cd624f a build fix, due to compile issue for pdcursesmod
GCC15 switched its default to -std=gnu23 and there's a bug in
pdcursesmod as a result. That impacts MSYS2/Mingw64 NetHack builds.
See: https://github.com/Bill-Gray/PDCursesMod/issues/333

The suggestion there is to force --std=gnu17 as a workaround.
2025-06-02 10:32:36 -04:00
nhmall
afafc69eed MSYS2 build fixes 2025-06-02 08:50:10 -04:00
Michael Allison
2414e56646 Xcode project update to include: cfgfiles.c sfbase.c 2025-06-01 22:04:44 -04:00
nhmall
66007e6783 remove duplicated code from sfctool.c, sftags.c
Link with hacklib to provide them instead
2025-06-01 15:32:55 -04:00
nhmall
9ef5e886ee consistent ATTRNORETURN prefix and NORETURN suffix 2025-05-30 22:01:20 -04:00
nhmall
a99944fb09 improve sfctool messages 2025-05-29 09:59:29 -04:00
nhmall
c258011fbc update tested versions of Visual Studio 2025-05-28 2025-05-28 21:32:21 -04:00
nhmall
41aee443c0 vcxproj bit for sfctool 2025-05-26 22:03:49 -04:00
nhmall
956c826223 Makefile.src bit 2025-05-26 13:34:31 -04:00
nhmall
a654d08c3b save/restore changes - part 3
This is the third of a series of savefile-related changes.

    This adds early-days experimental support for a completely optional
    'sfctool' utility (savefile conversion tool), to be able to export
    a savefile's contents into a more portable format. There are likely
    to be bugs at this stage. In this initial first-attempt, the export
    format is a very simple ascii output.

    NetHack can be built entirely, without also building this tool.
    NetHack has no dependencies on the tool.

    Attempts were made to minimize duplication of existing NetHack code.
    To achieve that, unfortunately, #ifdef SFCTOOL and #ifndef SFCTOOL
    had to be sprinkled around through some of the existing NetHack
    source code, so that it could be re-used for building the utility.

    The process for building the sfctool typically recompiles the source
    files with #define SFCTOOL and a distinct object file with SF- is
    produced.

sfctool notes:

    Universal ctags is used and required to produce the sfctool utility.

    Some targets were added to the Unix and Windows Makefiles to
    facilitate the build process.

         make sfctool

    That should build a copy in util.

    Note: At present, the Unix Makefiles do not copy sfctool over to the
          NetHack playground during 'make install' or 'make update'.
          Until that gets resolved by someone, The tool will
          have to be manually copied there by the builder/admin if
          desired.
          cp util/sfctool ~/nh/install/games/lib/nethackdir/sfctool

    Also, a separate Visual Studio sfctool.sln solution was written and
    placed in sys/windows/vs. That has has only very limited testing.

    Usage:

      i)  To convert an existing savefile to an exportascii format
          that co-resides with the savefile:

          sfctool -c savefile

          That *must* be executed on the same platform / architecture /
          data model that produced the save file in the first place.

     ii)  To unconvert an existing exportascii format export file to a
          historical format savefile that can then be used by NetHack:

          sfctool -u savefile

          That must be executed on the same target platform / architecture /
          data model that was used to build the NetHack that will
          utilize the save file that results.

     A Windows example:

          sfctool -c Fred.NetHack-saved-game

          That should result in creation of Fred.NetHack-saved-game.exportascii
          from existing savefile:
              %USERPROFILE%\AppData\Local\NetHack\3.7\Fred.NetHack-saved-game

     A Unix example:

          sfctool -c 1000wizard

          That should result in creation of 1000wizard.exportascii.gz
          from existing savefile in the playground save directory:
              1000wizard.gz

  Current Mechanics:
     1. Makefile recipe, or script uses universal ctags to produce
        util/sf.tags.

     2. util/sftags is built and executed to read util/sf.tags and
        generate: include/sfproto.h and src/sfdata.c.

     3. util/sfctool is built from the following:
        generated file compiled with -DSFCTOOL:
                    src/sfdata.c       -> sfdata.o
        existing files compiled with -DSFCTOOL:
                    util/sfctool.c     -> sfctool.o
                    util/sfexpasc.c    -> sfexpasc.o
                    src/alloc.c        -> sf-alloc.o
                    src/monst.c        -> sf-monst.o
                    src/objects.c      -> sf-objects.o
                    src/sfbase.c       -> sfbase.o
                    src/sfstruct.c     -> sfstruct.o
                    src/nhlua.c        -> sf-nhlua.o
                    util/panic.c       -> panic.o
                    src/date.c         -> sf-date.o
                    src/decl.c         -> sf-decl.o
                    src/artifact.c     -> sf-artifact.o
                    src/dungeon.c      -> sf-dungeon.o
                    src/end.c          -> sf-end.o
                    src/engrave.c      -> sf-engrave.o
                    src/cfgfiles.c     -> sf-cfgfiles.o
                    src/files.c        -> sf-files.o
                    src/light.c        -> sf-light.o
                    src/mdlib.c        -> sf-mdlib.o
                    src/mkmaze.c       -> sf-mkmaze.o
                    src/mkroom.c       -> sf-mkroom.o
                    src/o_init.c       -> sf-o_init.o
                    src/region.c       -> sf-region.o
                    src/restore.c      -> sf-restore.o
                    src/rumors.c       -> sf-rumors.o
                    src/sys.c          -> sf-sys.o
                    src/timeout.c      -> sf-timeout.o
                    src/track.c        -> sf-track.o
                    src/version.c      -> sf-version.o
                    src/worm.c         -> sf-worm.o
                    src/strutil.c      -> strutil.o
2025-05-25 20:38:17 -04:00
nhmall
e747935975 msdos build fix 2025-05-25 15:43:14 -04:00
nhmall
2cf7acc93b Windows Makefile follow-up 2025-05-25 15:37:46 -04:00
nhmall
f4a6da2e52 save/restore changes - part 2
This is the second of a series of changes related to save/restore.

    No EDITLEVEL bump has been included, because although the code
    is changed extensively by this, the content of the savefiles have
    not been changed.

    Push the use of the structlevel bwrite() and mread() function use
    out of the core and into sfstruct.c. This is groundwork for upcoming
    changes.

    In the core, replace the bwrite() and mread() calls with the
    use of type-specific savefile output (Sfo) and savefile
    input (Sfi) macros.  The macros are defined in a new header file
    savefile.h, which also contains the prototypes for the sfo_* and
    sfi_* functions that the macros ultimately expand to. The functions
    themselves are in src/sfbase.c.

    On C99, each Sfo or Sfi macro expansion refers directly to the
    corresponding  type-specific sfo_* or sfi_* function.

    If C23 or later is is use, the majority (all but 3 types) of the
    macros refer to a single _Generic output routine sfo(nhfp, dt, tag),
    and a single _Generic input routine sfi(nhfp, dt, tag), which handles
    the dispatch of the type-specific underlying functions. This was
    somewhat experimental, but turned out to be practical because the
    compiler would gripe if the type for a variable was not included in
    the _Generic when passed as an argument, so it could be fixed.

    This alters the savefile verication process by having a common set
    return values for the related functions such as uptodate(),
    check_version(), etc. The new return values return more information
    about savefile incompatibilities, beyond failure/sucess. The
    additional information will be useful for an upcoming addition.
    The expanded return values are:
     SF_UPTODATE                     (0) everything matched and looks good
     SF_OUTDATED                     (1) savefile is outdated
     SF_CRITICAL_BYTE_COUNT_MISMATCH (2) critical size count mismatch
     SF_DM_IL32LLP64_ON_ILP32LL64    (3) Windows x64 savefile on x86
     SF_DM_I32LP64_ON_ILP32LL64      (4) Unix 64 savefile on x86
     SF_DM_ILP32LL64_ON_I32LP64      (5) x86 savefile on Unix 64
     SF_DM_ILP32LL64_ON_IL32LLP64    (6) x86 savefile on Windows x64
     SF_DM_I32LP64_ON_IL32LLP64      (7) Unix 64 savefile on Windows x64
     SF_DM_IL32LLP64_ON_I32LP64      (8) Windows x64 savefile on Unix 64
     SF_DM_MISMATCH                  (9) some other mismatch
    The callers in the core have been adjusted to deal with the expanded
    return values.

    Other miscellaneous inclusions:

       - go.oracle_loc -> svo.oracle_loc.
       - add a bit (1UL << 30) to  called SFCTOOL_BIT as groundwork
         for changes to follow.
2025-05-25 15:03:13 -04:00
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