Age | Commit message (Collapse) | Author |
|
Fix a number of incorrect return values from file IO functions, continuing
the kFileIOWriteString fix from 7c1fb8bee1890f831adde61a98d94a563f9d14fa
One of the misconceptions was that these functions return DOS error
error codes on failure. Instead, SCI16 immediately zeros those out.
|
|
Fixes corrupt save games in Hoyle5, bug #11174
|
|
Fixes bugs in trac #11029:
- Slot 1 loading when user selects slot 0 in ScummVM UI
- Slot 1 loading when slot 0 specified on command line
- QFG4 slot 0 not appearing in game's original Restore UI
|
|
This will cause non-linear time shifts in the system timer that
the game's custom save logic may not expect, but in initial testing
the game doesn't seem to care about this.
Fixes Trac#10259.
|
|
As it turns out, autorama.sg *is* actually used sometimes.
Fixes Trac#10253.
|
|
|
|
This file normally stores brightness, music volume, and most
recently used save game directory. Since we store the music volume
ourselves and don't use the save game directory, the only
potentially useful information is the brightness level, and that
is fine to just restore from the save games.
|
|
Despite what game script disassembly lead me to believe, the game
seems to create only one auto-save, which ends up being saved as
911.sg (not autorama.sg). This save file is created just before
entering the underground Avian Lair in New York, and seems to be
designed as some emergency backup since entering the Avian Lair is
a one-way trip.
|
|
|
|
|
|
Preparations for adding support for RAMA's custom save game format.
|
|
The game has a feature where it will automatically create a save
game when you quit the game through the in-game control panel (or
when you die, for some reason).
Unfortunately, due to bad programming, this automatic save would
just overwrite whatever was in save slot 1 (slot 0 in the original
interpreter). Find this attempt to auto-save the game and redirect
it to the auto-save slot. This might not be totally correct, but
it is at least better than destroying a save game.
Fixes Trac#10201.
|
|
To enable the optional content censoring mode, Phant2 looks
for a RESDUK.PAT file, which is normally placed by the game's
installer if the user chose to enable censorship. If the file
exists, the game reads an unlock password out of the file and
asks the user to enter the password when starting a new game to
create an uncensored game, or to click a "less intense" button
to start the game with censoring. The censorship state of the
game is then persisted in the save game file, and installations
with the RESDUK.PAT file need to enter the password again in
order to restore any of the uncensored saves.
Since we do not have an installer that can enable this feature,
add a game option toggle to enable/disable censoring (for the
releases that have the optional censorship mode) instead so the
censored content feature is available for anyone that wants to use
it. This flag is restored from ScummVM whenever a save game is
loaded, so it can be toggled on or off at any point without
needing a separate save game, unlike in the original interpreter.
|
|
Phant2 creates save game names that append "<PROTECTED>" at the
end of the game name, with an assumption that the game name is
always exactly 36 characters long. This seems to be OK with other
games too (tested GK1, SQ6, and Torin).
|
|
|
|
|
|
Save game metadata validity checks in SCI32 should all exist within
kCheckSaveGame32 since this allows most games to recover
successfully from an attempt to load an invalid save game. If
gamestate_restore fails, the game will usually crash because the
engine is left in an inconsistent state (game scripts have cleaned
up objects in preparation for a game load that is no longer
happening).
|
|
|
|
This happens in Phant2 when trying to delete a save game from the
in-game save dialogue.
|
|
|
|
|
|
|
|
|
|
Save games created by earlier versions of ScummVM are prone to
having subtle graphics problems or other corruption caused by
incomplete save/load code.
|
|
|
|
This fixes QfG4 character import, which specifies a size of 52 for a
buffer of size 40.
|
|
|
|
|
|
The original interpreter created subdirectories for each in-game
profile, but copying this behaviour would add a lot of
superfluous complexity to the save game system in ScummVM, and
may not be portable to all supported platforms. Instead, when the
game tries to save its files to a subdirectory, the backslash in
the file name is replaced with an underscore so it can be created
successfully on filesystems where backslash is an illegal file
name character.
This has a side-effect of causing all save games to be displayed
under all profiles, instead of just the ones "belonging" to a
particular profile, but this seems like a reasonable trade-off
given that there is no reason to play this game with more than one
profile.
|
|
The bytesWritten variable is not used if SCI32 is not enabled. Fixed by
adding this and success flag to the debug console print.
|
|
In SSCI, all files opened through kFileIO are writable. Most of
the time this does not matter and the engine can get away with
using read-only streams, but when chase.dat is opened by Phant1
from the retry dialogue during the chase, it needs to be writable
because game code puts a '98' marker in the chase data. If this
write does not occur, the game gets stuck in a loop looking for
the marker.
|
|
|
|
SaveFileRewriteStream enables backwards seeking, which is necessary
for the chase.dat in Phant1 to be parsed correctly by the game.
|
|
Memory references and integers in SSCI are both 16-bit numbers,
so game scripts frequently (incorrectly) use an IntArray instead
of an IDArray for holding references. Since references in ScummVM
are 32-bit reg_ts, IntArray entries must be large enough to hold
reg_ts in order to be compatible with game scripts that store
references in integer arrays.
The alternative solution is to find and patch all incorrect use of
IntArray across all games. This is possible, but a bit risky from
a save game stability perspective, since incorrect IntArray usage
is sometimes not apparent until well after the array is
instantiated (like GK1's global interview array).
This change invalidates existing SCI32 save games.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1. Shift save numbers up/down for game scripts that rely on save
game numbers starting from 0 to work correctly
2. Add fake file operations to support KQ7 save games
3. Hide autosave games from native save/load list to match SSCI.
|
|
|
|
SCI system scripts will always try to read once from the game IDs
array even if the number of games is zero.
|
|
|
|
|
|
|
|
Games with custom save code (KQ7, MGDX, PQ:SWAT, Shivers) are not
fully supported yet.
|
|
|
|
|
|
|