[Scummvm-devel] SCI file handling revamp

Max Horn max at quendi.de
Thu Feb 26 17:50:07 CET 2009


Since there wasn't much feedback on the patch yet, except for some  
"seems to look OK", I guess we could move forward as follows: I'll  
commit the patch later today if nobody objects. Then, as we run into  
troubles due to files having to be mirrored / opened for read/write,  
this will cause to errors, which people then could report here,  
directly to me or as a tracker item. Then we can use that to complete  
the code.

Actually, I might change the current warning that is produced when  
trying to write to a file opened in read-mode, and vice versa, to an  
error, to ensure I get plenty of reports quickly *ggg*.


There are two ways to go about the write-to-data-file stuff:
1) If the (read-only in ScummVM) data files are only used as  
templates, and not simultaneously read&written, then we can get away  
by simply mirroring data files to savestates when they are written to  
for the first time.

2) If files have to be simultaneously read&written, but they are all  
"small", we could get away by loading the file into RAM upon opening,  
performing all read/write operations there, and writing it back to a  
savestate upon closing. That will be efficient and relatively  
straightforward to implement. Drawback: Memory consumption.

3) If big files have to be modified, well, then we have a problem with  
the simple copy&modify approaches above; savestates shouldn't get too  
big, I think; multi-MB savestates might cause problems on some ports,  
too. My hope is that this does not happen; if it does, one way to deal  
with it would be to only store the modifications in a special file  
format. Assuming only small parts of the big files are modified.  
Again, that's very speculative.



Bye,
Max




More information about the Scummvm-devel mailing list