Commit Graph
317 Commits
Author SHA1 Message Date
Colin Snover a2fb53790b SCI32: Make version 41 the first supported save game version
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-22 13:01:38 -05:00
Colin Snover ec12c5a342 SCI: Move ScummVM save/restore to GuestAdditions and reimplement for SCI32 2017-04-22 13:01:16 -05:00
Willem Jan Palenstijn 8bac8836b1 SCI: Fix up readString writing into too small buffer
This fixes QfG4 character import, which specifies a size of 52 for a
buffer of size 40.
2017-02-27 16:02:20 +01:00
Colin Snover b1c3332fdd SCI: Use strnlen instead of strlen to avoid buffer overflows 2017-02-05 10:24:02 -06:00
Colin Snover d495267829 SCI32: Fix loading save games in KQ7 1.51 2017-01-16 12:16:12 -06:00
Colin Snover e00c773d95 SCI32: Remove backslashes from PQ:SWAT extra save game files
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-11 11:13:44 -06:00
D G Turner 26452df855 SCI: Fix Unused Variable Compiler Warning when SCI32 is not enabled.
The bytesWritten variable is not used if SCI32 is not enabled. Fixed by
adding this and success flag to the debug console print.
2017-01-10 06:14:03 +00:00
Colin Snover df38f24c77 SCI32: Fix handling of rewritable files opened with mode 1
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-18 19:03:30 -06:00
Colin Snover 274ce59699 SCI: Fail gracefully when attempting to write to a read-only fd 2016-12-18 19:03:30 -06:00
Colin Snover 1a3d47bcb5 SCI: Remove restriction on backwards seeking
SaveFileRewriteStream enables backwards seeking, which is necessary
for the chase.dat in Phant1 to be parsed correctly by the game.
2016-12-18 19:02:41 -06:00
Colin Snover 8c555200d9 SCI32: Change storage type of int16 arrays to hold reg_ts instead
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-09 11:21:13 -05:00
Colin Snover ac95f2595b SCI32: Fix deleting save games in native save/load dialogue 2016-10-05 15:19:11 -05:00
Colin Snover 5cca33702d SCI32: Fix version file read failure in LSL6hires 2016-10-05 15:19:11 -05:00
Colin Snover 5baff4a1e5 SCI32: Fix some buildbot compiler warnings 2016-09-30 13:54:06 -05:00
Colin Snover 1847b0f705 SCI32: Fix warnings and incompatible save games when built without SCI32 2016-09-29 19:39:16 -05:00
Colin Snover 0c9d423497 SCI32: Emulate MGDX ego view metadata 2016-09-29 19:39:16 -05:00
Colin Snover aa720ca9cd SCI32: Fix deleting save games in KQ7 2016-09-29 19:39:16 -05:00
Colin Snover fba8568484 SCI32: Fix multiple bugs in kSave
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-29 19:39:16 -05:00
Colin Snover 2629269212 SCI32: Emulate Shivers 1 game score metadata 2016-09-29 19:39:16 -05:00
Colin Snover b3cfe699f6 SCI32: Fix read overflow when there are no save games
SCI system scripts will always try to read once from the game IDs
array even if the number of games is zero.
2016-09-29 19:39:16 -05:00
Colin Snover c8516ff9eb SCI32: Add handling for save catalogues 2016-09-29 19:39:16 -05:00
Colin Snover 1eb6d90eec SCI32: Implement ScummVM save/load 2016-09-29 19:39:16 -05:00
Colin Snover a96dc1a7b8 SCI32: Correct return values for kFileIO operations 2016-09-29 19:39:16 -05:00
Colin Snover 10f450917c SCI32: Implement kSave for standard-save SCI32 games
Games with custom save code (KQ7, MGDX, PQ:SWAT, Shivers) are not
fully supported yet.
2016-09-29 19:39:16 -05:00
Colin Snover a22bfb0db2 SCI32: Fix "new game" and auto-save functionality 2016-09-29 19:39:16 -05:00
Colin Snover 64dc37cfe2 SCI32: Start implementing kSave for SCI32 2016-09-29 19:39:16 -05:00
Colin Snover c7dacf273e SCI32: Clean up and fix some SCI32-only kFileIO operations 2016-09-29 19:39:16 -05:00
Colin Snover 2be2629a3b SCI32: Fix kFileIOOpen signature
The mode argument is required in SCI32 too; Torin just had a script
bug.
2016-09-29 19:39:16 -05:00
Colin Snover 3f91726765 SCI32: Rewrite kArray & kString
This change invalidates earlier SCI32 save games, which separated
arrays and strings in an incompatible manner. Old save games
contain invalid references to a string segment which no longer
exists, and contain incompatible array structures that lack
critical type information.
2016-09-29 19:39:16 -05:00
Willem Jan Palenstijn 5734400a37 SCI: Make kFileIORename use wrapped filenames
This fixes deleting savegames in Phantasmagoria 1.
2016-08-25 22:05:24 +02:00
Filippos Karapetis cd00132d23 SCI32: Also handle game checks for "torinsg.cat" in Torin
This shows the "Open..." button when continuing a game
2016-08-23 11:36:37 +03:00
Colin Snover 0a4a2567a3 SCI32: Partially implement kCD 2016-08-19 15:23:10 -05:00
Willem Jan Palenstijn 6d9ed09897 SCI32: Don't use autosave.cat in Torin 2016-08-11 19:29:34 +02:00
Willem Jan Palenstijn 401b34bf45 SCI32: Support Torin's autosave system
Torin has two sets of saves: autosave.### and torinsg.###, both with
their own slots and .cat file. The autosave system uses autosave.000
and autosave.001. It also checks the presence of autosave.cat to
determine if it should show the chapter selection menu on startup.
2016-07-29 21:09:32 +02:00
Willem Jan Palenstijn d832a23241 SCI32: Add SaveFileRewriteStream for read/write access to files
At least Phantasmagoria and PQ:SWAT require this.

This adds a ReadStream/WriteStream to support this. It replaces
the previous VirtualIndexFile which required reimplementation of
most read/write functions.
2016-07-06 21:06:12 +02:00
Martin Kiewitz 80462b3f87 SCI: Fix auto-saving in the fan-made Cascade Quest
Script patch to change the fixed slot 999 to fixed slot 99 in the
game scripts and additional code for kSaveGame, that checks for
Cascade Quest + slot 99 and will then use ScummVM slot 0, which
is our auto-save slot.

Fixes bug #7007

Also added the game name to the other fan-made script patch.
2016-06-25 23:59:01 +02:00
Martin Kiewitz 2c247a03e9 SCI: Add hack for Pepper's Adventure in Time CDAUDIO issue
Game checks for file CDAUDIO. Currently the kFileIO(Exists)
code is working pretty slowly on at least Windows. Needs to get
fixed properly by enhancing SaveFileManager().
This is primarily for branch 1.8.0.
2016-02-22 14:24:37 +01:00
Martin Kiewitz ce595cb92d SCI: Script patch for Mixed Up Mother Goose SCI1
+ Mother Goose SCI1.1
Fixes graphic issues when restoring from GMM
Also make the fix ups for Mixed Up Mother Goose, Jones + PQ2
get applied all the time (debugger command not included)
2016-02-09 01:28:34 +01:00
Martin Kiewitz 04de7279a1 SCI: Blocking ScummVM auto-save slot 0 for saving
Auto-saving is not used by SCI, but slot 0 is ScummVM "standard"
for auto-saving, that's why it's not available for saving anymore.
Jones still uses slot 0 for saving/restoring (because it's
hardcoded and changing it would break it somewhat)
Deleting + restoring is still possible of couse.
2016-02-05 19:43:48 +01:00
Martin Kiewitz 9d5ee9cba0 SCI: fix sciAudio support on some platforms
The old code expected sciAudio FOpen calls to fail, because they
contained a directory name. On AmigaOS those calls succeeded.
Because of that at least on AmigaOS, sciAudio support didn't
work at all.

We now detect sciAudio FOpen calls and return a proper virtual file
handle. This should fix it on all platforms.

Also moved the SCI32 virtual save file handle from 200 to 32100.
2016-01-02 21:50:35 +01:00
Filippos Karapetis 138ec332d2 SCI: Fix wording for commit fc14641 2015-07-10 14:25:35 +03:00
Filippos Karapetis fc1464155a SCI: Enable the save game menu option when dying in PQ2 - bug #6875
This uses the same hack as the one used to reset the menus in Jones.
I've tested some more SCI games, and they don't disable menu entries
when loading a game. Hopefully, Jones and PQ2 are the only ones
2015-07-10 14:13:18 +03:00
Willem Jan Palenstijn 1860c2107a SCI: Add notes 2014-10-19 23:44:45 +02:00
Filippos Karapetis 1d5536da02 SCI: Enable some menus in Jones after restoring (bugs #6537 and #6723)
The code path that is supposed to enable these never gets called when
restoring from the main menu, or from the ScummVM launcher. Since the
logic on when and what to enable is quite complex, the easiest thing
to do is enable these entries manually after a game is loaded.
2014-10-19 16:52:00 +03:00
Martin Kiewitz 23bfc2f035 SCI: comment typo fix 2014-06-02 20:59:27 +02:00
Martin Kiewitz d4de84bf8b SCI: fix saving in mother goose sci0 (bug #6486) 2014-06-02 20:51:39 +02:00
Filippos Karapetis 6a519f7f40 SCI: Initial implementation of the fanmade sciAudio library
This is used in the fanmade games "LockerGnome Quest Redux" and
"Betrayed Alliance"
2014-03-28 02:16:54 +02:00
Johannes Schickel 8fc7d60feb SCI: Make GPL headers consistent in themselves. 2014-02-18 02:39:37 +01:00
Filippos Karapetis 9addca7287 SCI: Allow saving without a VERSION file in Jones
Apparently, the original does the same. Fixes bug #6535
2014-02-17 11:52:49 +02:00
Strangerke 6795fdf639 SCI: Janitorial - Fix spacing errors 2013-11-23 11:02:24 +01:00