It is currently Tue May 21, 2019 12:19 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Thu May 16, 2019 7:26 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 21389
Location: NE Indiana, USA (NTSC)
In this post, mkwong proposed designing a save state format that is portable across different NES emulators. Let me describe some snags that an effort to design such a format spec would encounter:

How are you going to define a representation for the internal state of hundreds of mappers? That'd be a lot of work.

As we come to understand the NES better, we may discover more state that we need to store. Either it'll have to be a name-value pair format (except for bulk RAM contents) or there'll need to be some sort of version number for the Control Deck's state and the mapper's state.

_________________
Pin Eight | Twitter | GitHub | Patreon


Top
 Profile  
 
PostPosted: Thu May 16, 2019 7:37 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 10:59 pm
Posts: 1464
Cross-emulator save state formats have been tried in the past. They don't really work.

_________________
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.


Top
 Profile  
 
PostPosted: Thu May 16, 2019 10:30 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 4071
Location: A world gone mad
A Q post from 2005 which I wholeheartedly agree with.


Top
 Profile  
 
PostPosted: Fri May 17, 2019 2:52 am 
Offline

Joined: Mon May 30, 2011 9:01 pm
Posts: 215
tepples wrote:
How are you going to define a representation for the internal state of hundreds of mappers? That'd be a lot of work.

Yes, that is definitely a lot of work. But as all authors of emulators with save state functionality have done it already, why not spare newcomers from reinventing the wheel?


Top
 Profile  
 
PostPosted: Fri May 17, 2019 11:08 am 
Offline
User avatar

Joined: Fri Nov 19, 2004 7:35 pm
Posts: 4172
Well, if nothing else, attempt to export and import savestates from the "popular" open-source emulators. Maybe FCEUX, Nestopia, Nintendulator, etc...

You might not have complete information needed for another emulator, but some things can be extrapolated.
For example, if you have the current CPU or PPU memory map, you can fill in what the values for mapper latches should be.
If you know the PPU raster position that the save state would happen at, you can ensure that the save state is made at that time.

Even if you can't get a 100% accurate state conversion that would survive TAS-like validation, you might still get something that can let you proceed to play the game without a crash.

_________________
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!


Top
 Profile  
 
PostPosted: Fri May 17, 2019 11:48 am 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 7460
Location: Canada
mkwong98 wrote:
tepples wrote:
How are you going to define a representation for the internal state of hundreds of mappers? That'd be a lot of work.

Yes, that is definitely a lot of work. But as all authors of emulators with save state functionality have done it already, why not spare newcomers from reinventing the wheel?

Sparing them from reinventing the wheel? Why exactly are they making a new emulator for a system that has hundreds? :P

Dwedit wrote:
Well, if nothing else, attempt to export and import savestates from the "popular" open-source emulators. Maybe FCEUX, Nestopia, Nintendulator, etc...

I think the idea of a savestate converter tool might be fun.

You could do this as its own separate utility without trying to burden any emulator authors with it. It might also become a nice point of reference for the actual savestate binary formats used by various emulators, since that stuff tends not to be well documented at all.

(On the other hand, the benefits of having such a thing are probably so small that nobody would ever want to undertake a project like this.)


Top
 Profile  
 
PostPosted: Fri May 17, 2019 10:35 pm 
Offline

Joined: Mon May 30, 2011 9:01 pm
Posts: 215
Dwedit wrote:
You might not have complete information needed for another emulator, but some things can be extrapolated.
For example, if you have the current CPU or PPU memory map, you can fill in what the values for mapper latches should be.
If you know the PPU raster position that the save state would happen at, you can ensure that the save state is made at that time.

Even if you can't get a 100% accurate state conversion that would survive TAS-like validation, you might still get something that can let you proceed to play the game without a crash.

My idea is similar to yours. A minimum amount of info required for a save state is defined. Beyond that, values are defined with a default value.

rainwarrior wrote:
Sparing them from reinventing the wheel? Why exactly are they making a new emulator for a system that has hundreds? :P

Because they want to. :wink:
Anyway we can't ignore the possibility that there are people out there with new ideas and ability to create a good emulator. Mesen is a very good example of a relatively new emulator when there are already hundreds.

rainwarrior wrote:
I think the idea of a savestate converter tool might be fun.

You could do this as its own separate utility without trying to burden any emulator authors with it. It might also become a nice point of reference for the actual savestate binary formats used by various emulators, since that stuff tends not to be well documented at all.

(On the other hand, the benefits of having such a thing are probably so small that nobody would ever want to undertake a project like this.)

If we have a save state converter tool, the internal state of the tool itself can be used as the base of a cross-emulator save state format. Then we can change this tool into a lib for emulators to use and we are done! :beer:


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group