Jump to content
Steve Mynott

Migrating State between Hardware and Emulation?

Recommended Posts

In Atari800 and Altirra emulators it's possible to take a snapshot of system state (half way through a game or whatever).


Is there any software which runs on actual hardware (maybe U1Meg?) which allows those snapshots to be restored and re snapshoted in a way that the state can be migrated back to emulation?

Share this post

Link to post
Share on other sites

IIRC Altirra can generate a loadable state file that will often work on real hardware.


Supposedly the QMeg OS can do it. And I think "The Freezer" can also.


I made a freezer in software in the day - though it worked by dumping Ram contents to an inserted disk with an extra stage you ran later which generated an executable. The plan was to give it decent RLE compression but I think I only went as far as omitting blocks of 128 bytes if they were all zeros. The whole thing also relied on a warmstart to get it going again which for some software won't work.


The best way to do a save/restore is to preserve hardware register states and also do the resume on the exact cycle that the stop occurred on - though that's mainly critical for games and demos. The problem we have on Atari is that most hw regs are read or write only so it can be next to impossible to know what to put in them.

For that purpose, I believe the Freezer does mirroring, using some extra Ram to shadow what's written to them.


In the modern day with U1Meg in theory you could dedicate some of the expanded Ram to hold snapshots of the base 64K and do it that way. But it'd be hit and miss - you can't really stop programs writing to it if they want to, which can mess the whole thing up. Plus you need executing code running in main Ram to do the snapshot, and protecting that is really hard. This is where a custom OS that does most or all of the work can be really handy.

Share this post

Link to post
Share on other sites

I recalled (and found!) a previous thread I was impressed with where Larry using the Turbo Freezer to do the reverse: take a snapshot of real hardware during a Happy-backup of protected software at the disk-change intervals, restore the snapshot in emulation, and write out the protected disk to an ATX file.



  • Like 3

Share this post

Link to post
Share on other sites



I was wondering about this, but don't have too much experience with emulators, so am just speculating. Probably for restoring state, system reset would be a problem because that's going to restart the program (hopefully), so wiping out any progress in whatever game you are playing. That might not be the case for a program like a document editor, but then you might be better off saving files, and transferring those instead.


If you were going to save state, probably starting during a VBI would be best, as the hardware is not doing so much (and I vaguely remember this is maybe where keystrokes start getting processed, but I can't remember for sure). Also, in emulation, you would be keeping track of everything you need to save state, as that is how saving state works, for real hardware you would need to save the os shadow registers, etc. I was wondering about using hardware like the turbo-freezer, and writing a save-state <-> freezer format convertor - I think all the sources are available, but I'm guessing the emulators don't use a common file format for save states too (though I think the sources are available). You could possibly do this with the Sys-Check 2 card and an adapted OS, though I am not very certain of this.


You would also need to consider if you actually had the real hardware to run the save state, presumably the machine configuration is stored in the save state file somewhere.


What is the use case - presumably something that won't let you save your progress, but takes a long time to complete, such as?

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...