24 September 2006, 20:27 | #1 |
Registered User
Join Date: Apr 2002
Location: Germany
Age: 43
Posts: 742
|
Savestate also for Harddisks
I thought I read about this some time ago, but I couldn't find anything about it. However is it possible to make hd's also work with savestates ?
But I'm sure that there's a reason why Tony didn't add this until now, am I right ? |
26 September 2006, 14:40 | #2 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,502
|
I can't find it either..
It can never work properly. OS and applications can easily get confused and worst case is data loss if any program writes to HD between saving and restoring state files. For example: State file saved, you continue playing the game/using text editor/etc, it decides to do autosave (or maybe update highscores or just write something to HD), load state file, AmigaOS or game's internal state is now incorrect (there is already autosave saved on HD but AmigaOS/game thinks the file is not there) -> program writes to disk again -> possible data loss or crashes etc.. IMHO best option is to implement WHDLoad specific statefiles (with possible help from emulation side), only safe and compatible way to do it. (but it won't be trivial either) |
26 September 2006, 15:02 | #3 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 6,985
|
Couldn't you calculate a CRC sum of the HDF and if the CRC does not match on load, tell the user that the HDF has been changed and ask him if he wants to continue anyway with the risk of data loss ?
Also, doesn't the same problem apply to ADFs, too ? Or do you store the entire ADF in the state file ? |
26 September 2006, 15:32 | #4 |
Lesser Talent
Join Date: Jan 2003
Location: UK
Age: 42
Posts: 7,957
|
Maybe the possibity of read-only hdfs?
|
26 September 2006, 17:01 | #5 | |
Registered User
Join Date: Jun 2002
Location: .
Age: 48
Posts: 5,562
|
Quote:
|
|
26 September 2006, 17:52 | #6 | ||
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,502
|
Quote:
I won't implement features that can cause easy HD data loss. Directory harddrive support is less dangerous (only currently open files can be lost or system can "only" crash) but it won't be too realiable either.. Quote:
|
||
26 September 2006, 18:33 | #7 | ||
Retro Gamer
Join Date: Jan 2005
Location: Underworld
Age: 51
Posts: 4,058
|
Quote:
Quote:
|
||
26 September 2006, 21:09 | #8 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,502
|
Cabinet discussion moved to http://eab.abime.net/showthread.php?t=25801
|
27 September 2006, 10:54 | #9 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,502
|
I have quite crazy idea... implement trackdisk.device patch that allows use of really big adfs. (=regular partition hardfiles)
Statefile problem fixed |
27 September 2006, 11:48 | #10 |
Registered User
Join Date: Jun 2002
Location: .
Age: 48
Posts: 5,562
|
that's a great idea! but wouldn't be the read/access/write time longer than to hdfs?
|
27 September 2006, 13:05 | #11 |
Retro Gamer
Join Date: Jan 2005
Location: Underworld
Age: 51
Posts: 4,058
|
We talking about one huge adf per game?
Will that work with amiga disk formats? (some games don't like even turbo read mode) |
27 September 2006, 13:09 | #12 | |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 6,985
|
Quote:
The HDF is always usuable. The Amiga is designed to be switched off at any point, so disk buffers cannot be an issue. Of cource, saving the state in the middle of a write operation is dangerous as is switching power off in the middle of an operation. But if the HDF is not touched between save and load of the state, there is no problem. |
|
27 September 2006, 13:33 | #13 | ||||
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,502
|
Quote:
Quote:
Quote:
Quote:
|
||||
27 September 2006, 13:47 | #14 |
Retro Gamer
Join Date: Jan 2005
Location: Underworld
Age: 51
Posts: 4,058
|
So this means that we will be able to add HDF file into flopy drive, start emulator and play the game. We don't need then internal save option of WHDLoad (drive can be read only).
Now, can you make dynamic HDF that will grow as more files we place into them or at least some HDZ - compressed HDF? See, it takes a small initiative for us to come up with some crazy ideas. |
02 May 2016, 12:35 | #15 |
Influence Device
Join Date: Nov 2005
Location: Germany
Age: 44
Posts: 75
|
Sorry for gravedigging, I just stumbled across this thread via search. I immediately remembered VMWares state saving capability. The VM keeps track of all changes to the virtual harddisk and stores that together with the state. States can be erased and then the changes get flushed to the real hardfile or discarded if a previous state is to be reconstructed.
|
03 May 2016, 13:56 | #16 |
Retro Gamer
Join Date: Jan 2005
Location: Underworld
Age: 51
Posts: 4,058
|
WinUAE does something similar to floppy disk images.
For HDF, just 7zip it before making big changes. |
29 May 2016, 10:31 | #17 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 6,985
|
I still don't see how a currupted state file can be dangerous for a HDF. Deleting a state file is like switching off the computer. It's the same as pressing Alt-F4 in the middle of a session. People do this all the time, it's the only way to shut down AmigaOS.
To prevent using a state file with a changed HDF, you could save a checksum of the HDF into the state file. Every change to the HDF will render the state file unusable. That's ok IMHO. You could offer an option for advanced users to override the change check, so that they can load the state file at their own risk. |
29 May 2016, 11:46 | #18 | |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,502
|
Quote:
For example: - Save state - Load state, after load, some file gets modified, it may cause recreation of some filesystem blocks (for example bitmap or hash tables if OFS/FFS). - Load state again. Now statefile loaded filesystem buffers contain recently saved/modified blocks with old contents. But actual HDF has new contents. - Bad things start happening. It is even worse with journal based filesystems that think some atomic operation has been completed when it actually does not exists. Which is 100% impossible condition in real world. I won't do anything until someone confirms that there is at least one filesystem that does not get too confused when time goes backwards. Or at least some way/hack to force full flush of all filesystem buffers and metadata. This would be the best solution. |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Regarding savestate | torbenb | support.WinUAE | 2 | 24 January 2012 19:33 |
Harddisks can have bootblock-viruses? | Leandro Jardim | support.Apps | 2 | 13 October 2011 06:11 |
WinUAE wont allow some HardDisks as Read/Write: Why? | Zetr0 | support.WinUAE | 4 | 03 August 2010 19:22 |
A1200 PCMCIA cd-rom controller to use with harddisks? | Jerry | support.Hardware | 1 | 04 June 2005 19:38 |
WIll Harddisks work with Kickstart 37.299 ? | Dr.Doom | support.Hardware | 8 | 30 November 2002 20:39 |
|
|