Changes between Initial Version and Version 1 of Ticket #12060, comment 5


Ignore:
Timestamp:
02/02/21 20:54:01 (3 years ago)
Author:
sluicebox

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #12060, comment 5

    initial v1  
    11SCI 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
    22
    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 and 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.
     3The 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.
    44
    55I'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.