(Link to AcmlmWiki) Offline: thank ||bass
Register | Login
Views: 13,040,846
Main | Memberlist | Active users | Calendar | Chat | Online users
Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album
05-19-24 09:50 AM
0 users currently in ROM Hacking.
Acmlm's Board - I3 Archive - ROM Hacking - Savestates: Snes9x vs ZSNES
  
User name:
Password:
Reply:
 
Options: - -
Quik-Attach:
Preview for more options

Max size 1.00 MB, types: png, gif, jpg, txt, zip, rar, tar, gz, 7z, ace, mp3, ogg, mid, ips, bz2, lzh, psd

UserPost
Padri Nuestro
Posts: 3/11
Thanks for the information. Maybe now I can make some sense of this, find the palettes... You know, that stuff. <3
creaothceann
Posts: 3/43
Originally posted by Padri Nuestro
Does anyone here know where I could find information about the formats of these two emulators' savestates? Tile Molester is able to extract palette information from ZSNES savestates, but not from Snes9x, and I would like to find out where the palettes and such are stored in Snes9x's saves.

So far I've figured out that Snes9x saves are compressed with gzip, but decompressing still doesn't yield anything ZSNES-compatible. Unfortunately, I don't have access to ZSNES as I am a Mac user and that emulator is heavily tied to the x86 platform.

Thanks for any help you can offer.


SNES9x savestates (called "freeze files") are compressed via GZIP. A GZIP stream can be
read like a file, and is decompressed on-the-fly.


The file header:
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
00. signature Array[0..7] of Char ('#!snes9x')
01. ':' Char
02. version Array[0..3] of Char (in text format, should be '0001')
03. #10 Char


The following file blocks come after the file header:
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
00. 'NAM' cartridge name
01. 'CPU' CPU status
02. 'REG' CPU registers
03. 'PPU' PPU status
04. 'DMA' DMA status
05. 'VRA' VRAM
06. 'RAM' WRAM
07. 'SRA' SRAM
08. 'FIL' FillRAM
09. 'APU' APU status (only if the APU was emulated)
10. 'ARE' APU registers (only if there's an APU block)
11. 'ARA' APU RAM (only if there's an APU block)
12. 'SOU' sound data (only if there's an APU block)
13. 'SA1' SA1 status (only if the SA1 was emulated)
14. 'SAR' SA1 registers (only if there's an SA1 block)
15. 'SP7' SPC7110 status
16. 'RTC' SPC7110 RTC status (only if the SPC7110 RTC was emulated)


The file blocks have the following structure:
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
00. name Array[0..2] of Char
01. ':' Char
02. size Array[0..5] of Char (in text format)
03. ':' Char


See \snes9x\snapshot.cpp for the source. You'll eventually see that there are no padding
bytes between the fields of a file block, but that the size of a file block is the offset
of the last field plus the size of this field minus the offset of the field's structure.
In other words, simply read the packed data and jump to the next block.

The source distinguishes between data blocks and structures. Data blocks (VRAM, WRAM, SRAM,
FillRAM and APU RAM) are written directly into the file. Structures are filled by writing
the bytes of their fields in REVERSE order, then the structure is written into the file.


See http://www.geocities.com/illegal_eagle_2003/vsnes/index.htm for more info. Note that the "reverse order" thing is from my "x86" point-of-view.

Originally posted by Padri Nuestro
Why, oh why, can't they just use the same format? Maybe when the Intel Macs are available we'll have ZSNES too...

Probably. The formats are different because the programs are different. Storing additional info to represent the "complete SNES status" wasn't / isn't the goal of the emulator authors.

SRM files are 100% interchangeable though.
MathOnNapkins
Posts: 19/1106
Once you un-gzip the Snes9x format, you'll get this. As far as registers and APU, etc, I haven't explored that quite yet.

$C63 - $10C62 : VRAM

$10C6E - $30C6D: WRAM (i.e. $7E:0000 to $7F:FFFF)

$30C79 - $32C78: SRAM
Padri Nuestro
Posts: 2/11
Now that you mention it, I believe Snes9x does store the sram in its states. I distinctly remember accidentally loading an old state while playing Tales of Phantasia, thinking to myself, "Oh, well, I can load this more recent sram save..." and then kicking myself when I realised that the sram had been reset to an older save as well.

Why, oh why, can't they just use the same format? Maybe when the Intel Macs are available we'll have ZSNES too...
Euclid
Posts: 8/83
I only remember the zsnes format

0 - C12 header information
C13 - 10C12 stuff in bank $7E
10C13 - 20C12 stuff in bank $7F
20C13 - end stuff in vram

I'm not entirely sure of where the stuff in the APU gets stored...

as for the snes9x savestate, the format is similar except it's gzipped, i also think it has a bigger header or something similar and it might also be saving the sram.
Padri Nuestro
Posts: 1/11
Does anyone here know where I could find information about the formats of these two emulators' savestates? Tile Molester is able to extract palette information from ZSNES savestates, but not from Snes9x, and I would like to find out where the palettes and such are stored in Snes9x's saves.

So far I've figured out that Snes9x saves are compressed with gzip, but decompressing still doesn't yield anything ZSNES-compatible. Unfortunately, I don't have access to ZSNES as I am a Mac user and that emulator is heavily tied to the x86 platform.

Thanks for any help you can offer.
Acmlm's Board - I3 Archive - ROM Hacking - Savestates: Snes9x vs ZSNES


ABII

Acmlmboard 1.92.999, 9/17/2006
©2000-2006 Acmlm, Emuz, Blades, Xkeeper

Page rendered in 0.003 seconds; used 356.80 kB (max 401.43 kB)