Commit Graph

101 Commits

Author SHA1 Message Date
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
bed6747342 line-length follow-up bit 2024-03-11 12:02:47 -04:00
nhmall
2bece65394 README update 2024-03-11 11:59:59 -04:00
nulla-git
e70a40c2b2 update readme with latest release version 2023-03-08 11:54:57 -06:00
nhmall
b4f97ff18c typo in README 2022-11-30 10:21:41 -05:00
nhmall
02a48aa8cf split g into multiple structures
The consolidation of global variables from scattered source
files into decl.c and declared in decl.h was begun in 3.7.0.
Their placement in common files was done for centralized
initialization and potential re-initialization during a
"play again" scenario.

It wasn't really necessary for all of them to be housed in a
single huge structure to meet the "play again" requirement,
and the single huge structure has been a little unwieldy when
it comes to maintenance.

Following this commit, instead of one single extremely large structure
named 'g' to house all of the relocated global variables, they
are distributed into several ga through gz.

To make things easy for the developer, each variable is placed
into the struct corresponding to the starting letter of the variable.
That way, no lookup is required in order to know which struct houses
a particular variable, it is a simple match to the starting letter
for all the centralized global variables.

A global variable named 'amulets', would be found in ga.
    ga.amulets
     ^ ^
A global varable named 'move', would be found in gm.
    gm.moves
     ^ ^
A global variable named 'val_for_n_or_more' would be found in gv.
    gv.val_for_n_or_more
     ^ ^
A global variable named 'youmonst' would be found in gy.
    gy.youmonst
     ^ ^
2022-11-29 21:53:21 -05:00
nhmall
ad23b4e8e1 grammar: "foo based" to "foo-based"
There seems to be a need to locate these in the distribution every decade or so.
2022-10-30 16:08:14 -04:00
nhmall
1cf4f9f7f9 another README update 2022-10-26 10:34:22 -04:00
nhmall
8e2ccb3ccc another README update
macOS Ventura (macOS 13) was tested
- successful NetHack build
- game start/save/restore
2022-10-26 10:29:27 -04:00
nhmall
faaea0c057 README update 2022-10-26 09:07:44 -04:00
nhmall
6c12b85a0e missed a reference in README 2022-05-09 17:58:26 -04:00
nhmall
4f851e0165 update README to reflect a recent file name change 2022-05-09 17:55:49 -04:00
nhmall
3db819478f update OS terminology used in some text references 2022-02-04 11:26:14 -05:00
nhmall
9ea45d7a1f remove some trailing whitespace 2020-11-25 07:23:23 -05:00
nhmall
cc61ac61a4 README bit 2020-03-06 11:00:51 -05:00
nhmall
2af37f44d4 Merge March 2020 changes into NetHack 3.7 2020-03-06 10:59:50 -05:00
nhmall
e20024e42b March 2020 updates 2020-03-06 10:31:51 -05:00
nhmall
abdd3254ae updates for 3.6 March 2020 2020-03-04 10:41:57 -05:00
nhmall
efd0911f89 Merge recent changes into NetHack-3.7 2020-01-27 16:49:31 -05:00
nhmall
bd83b6e194 one more missed inconsistency and README updates 2020-01-27 15:05:45 -05:00
PatR
858bd2f376 Readme tweaks
Replace a few tabs, remove a few trailing spaces, and shorten a few
long lines.

Readme still needs another fix:  if falsely claims to contain all bug
fixes since 3.6.4.  I wasn't sure how to reword that so didn't try.

Also, fix a couple of old typos in Install.vms.
2020-01-27 11:53:18 -08:00
nhmall
78d206398d another typo 2020-01-27 12:27:41 -05:00
nhmall
b04028ec81 typo 2020-01-27 11:50:19 -05:00
nhmall
9e165b9e2a release prep bits 2020-01-25 23:42:36 -05:00
nhmall
b6efb765dc update README and patchlevel.h 2020-01-20 16:58:12 -05:00
nhmall
56be3361e3 update a sentence in README 2020-01-18 11:46:35 -05:00
nhmall
a6c46bbd85 housekeeping items for 3.6.5 - first pass 2020-01-14 11:35:06 -05:00
nhmall
7f4842d35d another version reference update 2019-12-19 15:44:23 -05:00
nhmall
82cda4fb0d fix file name in README 2019-12-19 15:40:53 -05:00
nhmall
5be18f5aca Merge branch 'NetHack-3.6' 2019-12-18 17:21:23 -05:00
nhmall
f71cecb8ed Merge branch 'NetHack-3.6' 2019-12-18 10:06:08 -05:00
nhmall
8cbed3877d README bit 2019-12-18 10:01:54 -05:00
nhmall
96155c7e02 housekeeping updates 2019-12-17 23:38: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
13f2a30d14 README verbiage 2019-12-05 20:36:55 -05:00
nhmall
7ea41cd31d another bit 2019-12-05 18:24:04 -05:00
nhmall
3f2abab48c README bit 2019-12-05 18:18:17 -05:00
nhmall
8b7aa58b45 yet more README 2019-12-05 16:20:46 -05:00
nhmall
5a9acceee6 more README updates 2019-12-05 16:11:20 -05:00
nhmall
1c6f61bbbd typo "may may" 2019-12-05 14:35:12 -05:00
nhmall
a2e77064e8 README update 2019-12-05 13:29:22 -05:00
nhmall
1e6b4c1a6d doc updates for release 2019-12-04 11:36:01 -05:00
nhmall
5a3b8e7b38 README update Dec 2 2019-12-02 12:05:18 -05:00
nhmall
4ece8ef31d spelling bit 2019-11-25 11:42:24 -05:00
nhmall
a1276d3c8c README update 2019-11-25 11:12:27 -05:00
nhmall
e85646816c mark source tree as beta, previously marked work-in-progress 2019-11-17 20:06:21 -05:00
nhmall
817efa4381 updates to README and doc/fixes37.0 2019-11-08 16:09:18 -05:00
nhmall
96e7e11a5e typo 2019-11-07 10:59:20 -05:00
nhmall
71d229a99d Update README and include/patchlevel.h 2019-11-07 10:50:14 -05:00