[Scummvm-devel] Savefile changes (ATTN porters)
Marcus Comstedt
marcus at mc.pp.se
Sun Feb 18 12:37:15 CET 2007
Max Horn <max at quendi.de> writes:
> Hi folks,
>
> as you may have noticed, I made two changes to the savefile system
> today:
>
> 1) I introduced OutSaveFile::finalize(). This method is supposed to
> be called just before client code disposes a OutSaveFile --
Just before client code calls ioFailed() to check if everything
went ok, I take it that you mean... :-)
[...]
> The DC port justs uses zlib's (un)compress -- with some luck, the new
> compression code can already open such savegames (in theory it should
> be able to load both the gzip and the zlib format...). Alas, I can't
> test that.
I shouldn't think so, given the code
bool isCompressed = (toBeWrapped->readUint16BE() == 0x1F8B);
in wrapInSaveFile(). zlib compressed data starts with 0x08, 0x18,
0x28, 0x38, 0x48, 0x58, 0x68, or 0x78, depending on the compression
window size used. Never 0x1f. If the first Uint16BE is stored in x,
the correct method of checking for a zlib header is
((x & 0xf00) == 0x800 && (x % 31) == 0)
// Marcus
More information about the Scummvm-devel
mailing list