You are not logged in.

Read the FAQ and Knowledge Base before posting.
We won't make a 3DS/2DS emulator.



#1 2011-01-31 03:52:01

Someoneyoudontknow
Member
Registered: 2011-01-31
Posts: 2

Save State Format

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

#2 2011-01-31 03:59:34

zeromus
Radical Ninja
Registered: 2009-01-05
Posts: 6,241

Re: Save State Format

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

#3 2011-01-31 04:21:26

Someoneyoudontknow
Member
Registered: 2011-01-31
Posts: 2

Re: Save State Format

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

#4 2011-01-31 05:07:19

zeromus
Radical Ninja
Registered: 2009-01-05
Posts: 6,241

Re: Save State Format

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

Board footer

Powered by FluxBB