Changes between Initial Version and Version 1 of Ticket #12060, comment 5
- Timestamp:
- 02/02/21 20:54:01 (2 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #12060, comment 5
initial v1 1 1 SCI games depend on many game-specific and version-specific files and if they're run without them they'll fail in different ways. GK1 has dozens of files that are indirectly relied upon. The SCI instructions are to copy all of the files: https://wiki.scummvm.org/index.php/Datafiles#All_SCI32_.28SCI2.2F3.29_games 2 2 3 The gibberish bytes are because ScummVM returns uninitialized memory when reading a string from an invalid file handle. The GK1 game scripts don't do any error checking when reading VERSION (which Sierra fixed in later SCI32 games) so when there's no VERSION you're getting random bytes. Those random bytes got saved in save-files and then andcompared to new random bytes upon Restore with unpredictable results. You can see this because ScummVM always logs "WARNING: Attempt to use invalid/unused file handle 65535!" when you start GK1 without VERSION.3 The gibberish bytes are because ScummVM returns uninitialized memory when reading a string from an invalid file handle. The GK1 game scripts don't do any error checking when reading VERSION (which Sierra fixed in later SCI32 games) so when there's no VERSION you're getting random bytes. Those random bytes got saved in save-files and then compared to new random bytes upon Restore with unpredictable results. You can see this because ScummVM always logs "WARNING: Attempt to use invalid/unused file handle 65535!" when you start GK1 without VERSION. 4 4 5 5 I've improved this slightly by changing ScummVM to always initialize kFileIOReadString's output so that the results will be consistent. Now if you save a GK1 game without a VERSION file it will still load if you don't have the VERSION file. But that just keeps a bad situation from getting worse.