aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/kfile.cpp
AgeCommit message (Collapse)Author
2019-10-11SCI: Fix more kFileIO return valuessluicebox
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.
2019-10-02SCI: Return correct value from kFileIOWriteStringsluicebox
Fixes corrupt save games in Hoyle5, bug #11174
2019-09-12SCI32: Fix loading autosaves (slot 0)sluicebox
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
2017-10-03SCI32: Restore gameplay time in RAMAColin Snover
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.
2017-09-30SCI32: Fix crash when dying in RAMAColin Snover
As it turns out, autorama.sg *is* actually used sometimes. Fixes Trac#10253.
2017-09-28SCI32: Allow save games to be deleted from original save/restore in RAMAColin Snover
2017-09-28SCI32: Block RAMA from creating PREF.DAT fileColin Snover
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.
2017-09-24SCI32: Fix RAMA auto-save gameColin Snover
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.
2017-09-23SCI32: Replace magic number with kAutoSaveId in QFG4 save codeColin Snover
2017-09-23SCI32: Support RAMA's custom save games through kFileIOColin Snover
2017-09-23SCI: Clean-ups to file handling codeColin Snover
Preparations for adding support for RAMA's custom save game format.
2017-09-14SCI32: Fix Phant2 "auto-save"Colin Snover
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.
2017-09-08SCI32: Toggle Phant2 content censoring from game optionsColin Snover
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.
2017-07-26SCI32: Fix truncated save game names in Phant2Colin Snover
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).
2017-07-24SCI32: Match 4-language MGDX extra save game dataColin Snover
2017-05-27SCI32: Update some old comments related to virtual filesFilippos Karapetis
2017-05-13SCI32: Make sure all save game validity checks are in kCheckSaveGame32Colin Snover
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).
2017-04-23SCI32: Fix missing main menu in LSL7Colin Snover
2017-04-23SCI32: Fix crash when writing word to VIRTUALFILE_HANDLE_SCI32SAVEColin Snover
This happens in Phant2 when trying to delete a save game from the in-game save dialogue.
2017-04-23SCI32: Put Lighthouse restart game in restart save slotColin Snover
2017-04-23SCI32: Fix call to kFileIOIsValidDirectory in RAMAColin Snover
2017-04-22SCI32: Implement support for QFG4 autosaveColin Snover
2017-04-22SCI32: Provide more detail in console when a save game fails checksColin Snover
2017-04-22SCI32: Make version 41 the first supported save game versionColin Snover
Save games created by earlier versions of ScummVM are prone to having subtle graphics problems or other corruption caused by incomplete save/load code.
2017-04-22SCI: Move ScummVM save/restore to GuestAdditions and reimplement for SCI32Colin Snover
2017-02-27SCI: Fix up readString writing into too small bufferWillem Jan Palenstijn
This fixes QfG4 character import, which specifies a size of 52 for a buffer of size 40.
2017-02-05SCI: Use strnlen instead of strlen to avoid buffer overflowsColin Snover
2017-01-16SCI32: Fix loading save games in KQ7 1.51Colin Snover
2017-01-11SCI32: Remove backslashes from PQ:SWAT extra save game filesColin Snover
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.
2017-01-10SCI: Fix Unused Variable Compiler Warning when SCI32 is not enabled.D G Turner
The bytesWritten variable is not used if SCI32 is not enabled. Fixed by adding this and success flag to the debug console print.
2016-12-18SCI32: Fix handling of rewritable files opened with mode 1Colin Snover
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.
2016-12-18SCI: Fail gracefully when attempting to write to a read-only fdColin Snover
2016-12-18SCI: Remove restriction on backwards seekingColin Snover
SaveFileRewriteStream enables backwards seeking, which is necessary for the chase.dat in Phant1 to be parsed correctly by the game.
2016-10-09SCI32: Change storage type of int16 arrays to hold reg_ts insteadColin Snover
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.
2016-10-05SCI32: Fix deleting save games in native save/load dialogueColin Snover
2016-10-05SCI32: Fix version file read failure in LSL6hiresColin Snover
2016-09-30SCI32: Fix some buildbot compiler warningsColin Snover
2016-09-29SCI32: Fix warnings and incompatible save games when built without SCI32Colin Snover
2016-09-29SCI32: Emulate MGDX ego view metadataColin Snover
2016-09-29SCI32: Fix deleting save games in KQ7Colin Snover
2016-09-29SCI32: Fix multiple bugs in kSaveColin Snover
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.
2016-09-29SCI32: Emulate Shivers 1 game score metadataColin Snover
2016-09-29SCI32: Fix read overflow when there are no save gamesColin Snover
SCI system scripts will always try to read once from the game IDs array even if the number of games is zero.
2016-09-29SCI32: Add handling for save cataloguesColin Snover
2016-09-29SCI32: Implement ScummVM save/loadColin Snover
2016-09-29SCI32: Correct return values for kFileIO operationsColin Snover
2016-09-29SCI32: Implement kSave for standard-save SCI32 gamesColin Snover
Games with custom save code (KQ7, MGDX, PQ:SWAT, Shivers) are not fully supported yet.
2016-09-29SCI32: Fix "new game" and auto-save functionalityColin Snover
2016-09-29SCI32: Start implementing kSave for SCI32Colin Snover
2016-09-29SCI32: Clean up and fix some SCI32-only kFileIO operationsColin Snover