(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-06-24 03:56 PM
0 users currently in ROM Hacking.
Acmlm's Board - I3 Archive - ROM Hacking - Savestates: Snes9x vs ZSNES New poll | |
Add to favorites | Next newer thread | Next older thread
User Post
Padri Nuestro

Micro-Goomba


 





Since: 11-28-05

Last post: 6714 days
Last view: 6714 days
Posted on 11-28-05 12:03 AM Link | Quote
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.
Euclid



 





Since: 11-17-05
From: Australia
hmm...

Last post: 6293 days
Last view: 6287 days
Posted on 11-28-05 12:22 AM Link | Quote
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

Micro-Goomba


 





Since: 11-28-05

Last post: 6714 days
Last view: 6714 days
Posted on 11-28-05 12:38 AM Link | Quote
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...
MathOnNapkins

1100

In SPC700 HELL


 





Since: 11-18-05

Last post: 6286 days
Last view: 6286 days
Posted on 11-28-05 01:40 AM Link | Quote
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
creaothceann

Red Goomba








Since: 11-22-05

Last post: 6482 days
Last view: 6482 days
Posted on 11-28-05 03:30 AM Link | Quote
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.


(edited by creaothceann on 11-28-05 02:32 AM)
Padri Nuestro

Micro-Goomba


 





Since: 11-28-05

Last post: 6714 days
Last view: 6714 days
Posted on 11-28-05 01:13 PM Link | Quote
Thanks for the information. Maybe now I can make some sense of this, find the palettes... You know, that stuff. <3
Add to favorites | Next newer thread | Next older thread
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.013 seconds; used 373.93 kB (max 453.99 kB)