11-01-2013, 06:05 AM
(10-31-2013, 04:24 PM)jlperkins Wrote: So, Brackets, seeing as you are a regular contributor, how high would you rate the difficulty of adding open file handles to the savestate data?
I took a peek at the code in github, and it seems like the DoSave function in the DirectoryFileSystem.cpp is just a stub, like a benign version of a "not yet implemented" exception. Am I talking outta my arse?
That's about right. The job of each DoState function (there are a lot throughout the emulator) is to save OR load its individual chunk of state. This is actually the only one that I think is not implemented, iirc. (well and VFSFileSystem, but it's the same basically.)
The std::map "entries" is really the only thing that needs to be saved/restored. Unfortunately, this map consists of operating system file handles. It'll need to be changed to remember the relative file path, and other open parameters.
Then it'll need to save state, just ftell() maybe? Also when restoring, it'll probably need to treat truncate as read/write.
I don't think there's anything else but I'm not totally sure.
-[Unknown]

