Snes9X savestate support

Found a bug? Please report it, but remember to follow the bug reporting guidelines.
Missing a sane feature? Let us know!
But please do NOT request ports to other systems.

Moderator: ZSNES Mods

Post Reply
adventure_of_link
Locksmith of Hyrule
Posts: 3634
Joined: Sun Aug 08, 2004 7:49 am
Location: 255.255.255.255
Contact:

Snes9X savestate support

Post by adventure_of_link »

I had someone ask me in PM on the Snes9X boards about Snes9X savestate support in ZSnes. AFAIK ZSnes states are supported in Snes9X, but I know that Snes9X states aren't compatable in ZSnes. Could this be a feature in the next release of ZSnes?
<Nach> so why don't the two of you get your own room and leave us alone with this stupidity of yours?
NSRT here.
pagefault
ZSNES Developer
ZSNES Developer
Posts: 812
Joined: Tue Aug 17, 2004 5:24 am
Location: In your garden

Post by pagefault »

Use a SRAM file insted.
adventure_of_link
Locksmith of Hyrule
Posts: 3634
Joined: Sun Aug 08, 2004 7:49 am
Location: 255.255.255.255
Contact:

Post by adventure_of_link »

Okay.
<Nach> so why don't the two of you get your own room and leave us alone with this stupidity of yours?
NSRT here.
Nightcrawler
Romhacking God
Posts: 922
Joined: Wed Jul 28, 2004 11:27 pm
Contact:

Post by Nightcrawler »

Haha I guess that's a no.
[url=http://transcorp.romhacking.net]TransCorp[/url] - Home of the Dual Orb 2, Cho Mahou Tairyku Wozz, and Emerald Dragon SFC/SNES translations.
[url=http://www.romhacking.net]ROMhacking.net[/url] - The central hub of the ROM hacking community.
xamenus
Veteran
Posts: 907
Joined: Fri Jul 30, 2004 12:26 am

Post by xamenus »

I asked this in the old forum (with the same exact thread title, in fact), and it looks like pagefault is going to make (or has made) so many changes in the savestate code that Snes9x savestates will simply not be compatible with ZSNES.
Warrax

Post by Warrax »

IceFox wrote:I asked this in the old forum (with the same exact thread title, in fact), and it looks like pagefault is going to make (or has made) so many changes in the savestate code that Snes9x savestates will simply not be compatible with ZSNES.
Thanks for the instructive reply I was wondering too.
Nightcrawler
Romhacking God
Posts: 922
Joined: Wed Jul 28, 2004 11:27 pm
Contact:

Post by Nightcrawler »

IceFox wrote:I asked this in the old forum (with the same exact thread title, in fact), and it looks like pagefault is going to make (or has made) so many changes in the savestate code that Snes9x savestates will simply not be compatible with ZSNES.
What's that got to do with it? Changing the savestate format now should have no bearing on loading SNES9x savestates. They have been much different than ZSNES savestates for quite a long time.
[url=http://transcorp.romhacking.net]TransCorp[/url] - Home of the Dual Orb 2, Cho Mahou Tairyku Wozz, and Emerald Dragon SFC/SNES translations.
[url=http://www.romhacking.net]ROMhacking.net[/url] - The central hub of the ROM hacking community.
xamenus
Veteran
Posts: 907
Joined: Fri Jul 30, 2004 12:26 am

Post by xamenus »

Well, I can't remember the details, but if pagefault says no to this, I'm sure he knows what he's doing. :)
Nightcrawler
Romhacking God
Posts: 922
Joined: Wed Jul 28, 2004 11:27 pm
Contact:

Post by Nightcrawler »

I think it's more like he just doesn't want to do it.
[url=http://transcorp.romhacking.net]TransCorp[/url] - Home of the Dual Orb 2, Cho Mahou Tairyku Wozz, and Emerald Dragon SFC/SNES translations.
[url=http://www.romhacking.net]ROMhacking.net[/url] - The central hub of the ROM hacking community.
Aerdan
Winter Knight
Posts: 467
Joined: Mon Aug 16, 2004 10:16 pm
Contact:

Post by Aerdan »

According to memory, pf said that ZSNES savestates would contain far more detail than SNES9x's states, so there'd be very little reason for implementing SNES9x states.
paulom
New Member
Posts: 5
Joined: Mon Feb 21, 2005 6:30 pm

Post by paulom »

Aerdan wrote:According to memory, pf said that ZSNES savestates would contain far more detail than SNES9x's states, so there'd be very little reason for implementing SNES9x states.
Well, there is a good reason why I would like to load Snes9x savestates in Zsnes:
Zsnes has always been my favorite emulator. But the last upgrading of my Linux distro, a few months ago, had a bug in SDL sound that affected Zsnes. So I tried Snes9x, which wasn't affected, and used it to play for some time. By the way, Snes9x for Linux can't handle cheating codes.
Now I have corrected the bug and I'm back to Zsnes. But I have played some nice games with Snes9x (without cheating!), and it would be great to continue them in Zsnes. That's it!
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Post by grinvader »

With the latest changes made to ZSNES states, I don't think snes9x is compatible anymore.

Use SRMs. They will always be compatible.
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
jdratlif
Regular
Posts: 317
Joined: Tue Sep 14, 2004 12:48 am
Location: In a small padded white room
Contact:

Post by jdratlif »

grinvader wrote:With the latest changes made to ZSNES states, I don't think snes9x is compatible anymore.

Use SRMs. They will always be compatible.
Snes9x 1.43 wouldn't load some savestates I made with the Apr 04 ZSNES WIP. I'm using Geiger's debugger version though, although since it's based on the 1.43 base, this doesn't seem like it would be affected.
http://jdrrant.blogspot.com/ - CODEpendent Blog
http://games.technoplaza.net/ - Emulation Goodies
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Post by grinvader »

If they didn't change their ZST loading routines, snes9x won't be able to load most recent states.
We save more stuff than in the old ones, and this new stuff is in the middle of the rest, so it would badly screw if you loaded one as if it was an old state.
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
Nightcrawler
Romhacking God
Posts: 922
Joined: Wed Jul 28, 2004 11:27 pm
Contact:

Post by Nightcrawler »

Why wasn't additional information added to the end to keep backwards compatibility? I'm going to assume this would promote disorganization.
[url=http://transcorp.romhacking.net]TransCorp[/url] - Home of the Dual Orb 2, Cho Mahou Tairyku Wozz, and Emerald Dragon SFC/SNES translations.
[url=http://www.romhacking.net]ROMhacking.net[/url] - The central hub of the ROM hacking community.
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Post by grinvader »

Nightcrawler wrote:Why wasn't additional information added to the end to keep backwards compatibility? I'm going to assume this would promote disorganization.
You assume correctly.

States are saved using chip-dependant code. If you're playing a SA1 game, you save:
5A22 stuff, WRAM, VRAM, SPC700 stuff, SA-1 old stuff + SA-1 new stuff, new emulation vars, SRAM if enabled

As you can see, the new emulation vars/SRAM are added at the end. But the SA-1 stuff is saved when the SA-1 test is done.
We're not gonna add new chip tests at the end and write bad code just so that snes9x can still load our states.
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
anomie
Lurker
Posts: 151
Joined: Tue Dec 07, 2004 1:40 am

Post by anomie »

grinvader wrote:We're not gonna add new chip tests at the end and write bad code just so that snes9x can still load our states.
And we wouldn't want you to, if i may speak for snes9x.

snes9x's savestates need a major overhaul too, BTW. The annoying part is keeping the ability to load old snes9x savestates in overhauled versions of '9x.
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

anomie wrote:
grinvader wrote:We're not gonna add new chip tests at the end and write bad code just so that snes9x can still load our states.
And we wouldn't want you to, if i may speak for snes9x.

snes9x's savestates need a major overhaul too, BTW. The annoying part is keeping the ability to load old snes9x savestates in overhauled versions of '9x.
I'll help you overhaul if you want. It was tricky overhauling ZSNES save states, we did it in a way that old save states work in current ZSNES, and current states still load in older ZSNESs.

Some of the tricks I used to do that was arranging the new data in such a way that older ZSNESs would ignore it or think it's part of the thumbnail.

For loading old states in current, I did some function pointer magic to calculate various offsets in advance based on a version # and other factors to get everything in the right area. The technique I used also made it that saving and loading save states, rewind states, and other types of state related things all use the same function for copying data around.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
anomie
Lurker
Posts: 151
Joined: Tue Dec 07, 2004 1:40 am

Post by anomie »

My problem is just that with all the newly emulated features requiring new variables, I have to find some way to pull those out of old savestates and guess/recalculate what value they should have. Major pain.

I can't say I care about trying to write things so old versions can use new states though, it's more cruft than it's worth. And '9x savestates make it very easy to add things to the end of a block, each block has a tag and a length.
Kagerato
Lurker
Posts: 153
Joined: Mon Aug 09, 2004 1:40 am
Contact:

Post by Kagerato »

I can't say I care about trying to write things so old versions can use new states though, it's more cruft than it's worth.
As a matter of programming philosopy, I'd have to agree there. Backwards compatibility is one thing, and it's well and good for a while (until there comes a time when you need to be truly innovative). However, promising forward compatibility with future versions is simply too limiting and too hard to maintain, I feel.

There are a number of structures for data out there, in numerous applications, where the original format was designed to be highly extensible. Generally, the overall structure of the data becomes a sort of expandable "container" for the internal content. This makes it much easier to dynamically change what's actually stored inside that structure. Call it foresight on part of the developer(s).
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

The reason why we strive to contain insane compatibility in ZSNES, is that if we see a bug in a new version of ZSNES, we can load the save state in and old one and see if it's a new bug or not. Otherwise we may have to do a lot more game playing than we'd want to.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
Qb_Master
New Member
Posts: 6
Joined: Sun Apr 24, 2005 4:01 am
Contact:

Hmm...

Post by Qb_Master »

I'm sure that if enough people really want a snes9x to zsnes savestate conversion tool(and vice-versa) that somebody will probably just make a tool to do so.

If I knew enough about both types of savestates, and had a lot more time on my hands than I do now, I would prolly attempt it :P.
Qb_Master
Post Reply