You are not logged in.
Pages: 1
I have looked through the source (specifically, saves.cpp) for the format used to compress the savestates. I have figured out it uses zlib, a 16 byte 'magic number' and a 32 byte (total) header. I am not a c++ pro (or even know anything about it) but that is what I have deciphered so far.
I am wanting the format so that I can decompress the states and edit them in my own external program.
Thanks, in advance.
Offline
there is no documentation of the format. you must debug the code until you understand it. its not really hard. SubWrite is a bit tricky, which is what writes half the data. it just walks through the memory structures which are clearly defined (such as SF_ARM7) and writes each unit of data. the other half of the savestate is custom serialization code sprinkled around the program which is not tricky at all.
the savestate format is subject to change at any time.
Offline
That's not really what I wanted. I want to know how to decompress the savestate (since they are compressed by DeSmuME) so I can edit it in my own program.
Other program's savestates are also compressed but are in easily recognizable formats (iDeaS is a simple PK zip file while VBA uses gzip).
Thanks for the quick response.
Offline
i don't think anyone is going to give you a tutorial in using zlib. savestate_load() is pretty much as clear as it gets. you could almost drop it in your program directly. read the header, read `comprlen` bytes, allocate `len` bytes, and use zlib's `uncompress` function
Offline
Pages: 1