// (nothing at all if unchanged)
#define LEVEL_CHUNK_ELEM_UNCHANGED 0
-#define TAPE_CHUNK_VERS_SIZE 8 // size of file version chunk
+#define TAPE_CHUNK_VERS_SIZE 8 // size of standard tape versions chunk
+#define TAPE_CHUNK_VERX_SIZE 8 // size of extended tape versions chunk
#define TAPE_CHUNK_HEAD_SIZE 20 // size of tape file header
#define TAPE_CHUNK_SCRN_SIZE 2 // size of screen size chunk
return chunk_size;
}
+static int LoadTape_VERX(File *file, int chunk_size, struct TapeInfo *tape)
+{
+ tape->game_version |= getFileVersionExtended(file);
+ tape->engine_version |= getFileVersionExtended(file);
+
+ return chunk_size;
+}
+
static int LoadTape_SCRN(File *file, int chunk_size, struct TapeInfo *tape)
{
tape->scr_fieldx = getFile8Bit(file);
{
{ "VERS", TAPE_CHUNK_VERS_SIZE, LoadTape_VERS },
{ "HEAD", TAPE_CHUNK_HEAD_SIZE, LoadTape_HEAD },
+ { "VERX", TAPE_CHUNK_VERX_SIZE, LoadTape_VERX },
{ "SCRN", TAPE_CHUNK_SCRN_SIZE, LoadTape_SCRN },
{ "INFO", -1, LoadTape_INFO },
{ "BODY", -1, LoadTape_BODY },
putFileVersion(file, tape->engine_version);
}
+static void SaveTape_VERX(FILE *file, struct TapeInfo *tape)
+{
+ putFileVersionExtended(file, tape->game_version);
+ putFileVersionExtended(file, tape->engine_version);
+}
+
static void SaveTape_SCRN(FILE *file, struct TapeInfo *tape)
{
putFile8Bit(file, tape->scr_fieldx);
putFileChunkBE(file, "HEAD", TAPE_CHUNK_HEAD_SIZE);
SaveTape_HEAD(file, &tape);
+ putFileChunkBE(file, "VERX", TAPE_CHUNK_VERX_SIZE);
+ SaveTape_VERX(file, &tape);
+
if (checkSaveTape_SCRN(&tape))
{
putFileChunkBE(file, "SCRN", TAPE_CHUNK_SCRN_SIZE);
return VERSION_IDENT(version_super, version_major, version_minor, version_patch);
}
+VersionType getFileVersionExtended(File *file)
+{
+ return getFileVersion(file) >> 32;
+}
+
int putFileVersion(FILE *file, VersionType version)
{
if (file != NULL)
return 4;
}
+int putFileVersionExtended(FILE *file, VersionType version)
+{
+ return putFileVersion(file, version << 32);
+}
+
void ReadBytesFromFile(File *file, byte *buffer, unsigned int bytes)
{
int i;
boolean getFileChunk(File *, char *, int *, int);
int putFileChunk(FILE *, char *, int, int);
VersionType getFileVersion(File *);
+VersionType getFileVersionExtended(File *);
int putFileVersion(FILE *, VersionType);
+int putFileVersionExtended(FILE *, VersionType);
void ReadBytesFromFile(File *, byte *, unsigned int);
void WriteBytesToFile(FILE *, byte *, unsigned int);