add some foundational work for uplifts

Be able to carry out uplifts during minor release
lifetimes.

Document a way to be able to uplift struct content
without incrementing EDITLEVEL and breaking existing savefiles.
Use the mechanics outlined to uplift the contents instead, where
it is feasible to do so. The uplift is currently one-way only. An
uplifted savefile cannot be used with an earlier build of NetHack
, one built with a lower SAVEFILE_REVISION_LEVEL, than the one which
wrote the savefile.

The final byte (byte 79) of the 80 critical bytes in the savefile,
of which 10 are reserved for future expansion and not currently
used, will now be used for holding the savefile revision level
(SAVEFILE_REVISION_LEVEL in include/patchlevel.h) at the time
the savefile was written.

That leaves 9 of the bytes available for future use.
This commit is contained in:
nhmall
2026-05-27 16:14:20 -04:00
parent e352048612
commit ce31feb231
21 changed files with 526 additions and 117 deletions
+8
View File
@@ -43,6 +43,14 @@
#define COPYRIGHT_BANNER_C nomakedefs.copyright_banner_c
#define COPYRIGHT_BANNER_D " See license for details."
/*
* SAVEFILE_REVISION_LEVEL
* Increment this if there has been a change to a data structure
* that the source code is prepared to handle and convert properly.
* The SAVEFILE_REVISION_LEVEL value needs to fit into an unsigned byte.
*/
#define SAVEFILE_REVISION_LEVEL 0x00
/*
* If two or more successive releases have compatible data files, define
* this with the version number of the oldest such release so that the