Commit Graph
133 Commits
Author SHA1 Message Date
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
sluicebox 9982c761a2 SCI: Update all old bug tracker ticket numbers 2021-02-25 01:18:52 -08:00
Filippos Karapetis aceb528068 SCI32: Correct fix for the TRAP machine in QFG4
Properly fixes bug #10766.
2018-10-26 03:42:48 +03:00
Filippos Karapetis f4ae043d70 SCI32: Fix an array initialization in the floppy version of QFG4
The array used for the trap machine's messages outside Dr. Cranium's
lab is set correctly now. Fixes bug #10766.
2018-10-24 18:46:56 +03:00
Colin Snover b2966f3fc8 SCI32: Fix support for RAMA demo
Fixes Trac#10251.
2017-09-30 01:08:12 -05:00
Colin Snover dced2fb9f5 SCI32: Fix handling of array copies
kArrayCopy would perform an unnecessary memory copy of the source
array, the treatment of the count value as unsigned was clearly
not correct since it was being sign-extended and checked against
-1.
2017-09-23 20:57:03 -05:00
Colin Snover ee644ec01b SCI32: Check for game aborts in all kList iteration methods
This fixes a use-after-free in GK2 when restoring a second save
game, when the List reg_t is still considered valid but the List
has moved due to a partial game restore.
2017-03-30 20:49:37 -05:00
Colin Snover 70d1edf615 SCI32: Add validity checks to kList iteration methods
In GK2, restoring a save game causes the segment manager to reset
in the middle of a kListFirstTrue call, which invalidates all
pointers and reg_ts to stored data. This means that when
kListFirstTrue tries to decrement the list recursion counter at
the end of iteration, it is writing to freed memory, potentially
resulting in heap corruption.

SCI3 added checks to prevent this from happening, but these checks
seem like they should have also been applied to some SCI2.1 games
as well (like GK2).

Since there should be no negative side-effect to this check, it
is applied universally to all SCI32 games.
2017-01-05 16:00:59 -06:00
Colin Snover 5b5aaee57b SCI32: Implement List sort
Used by Hoyle5.

Also includes a tiny amount of cleanup in kAddAfter for
consistency with kAddBefore.
2016-12-11 20:09:48 -06:00
Colin Snover 22c2f39c00 SCI32: Add recursion code to kListFirstTrue and kListAllTrue
This change ensures that these kernel calls operate in the same
manner that they did in SSCI.
2016-11-20 12:31:44 -06: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
Colin Snover 78849053ca SCI32: Fix off-by-one error
CID 1361599.
2016-09-29 19:39:16 -05:00
Filippos Karapetis 14f163bad1 SCI32: Allow kListAt to reference an empty list
Happens in Torin when examining Di's locket in chapter 3
2016-08-23 14:26:59 +03:00
Filippos Karapetis 6929cc65f8 SCI32: Explicitly abord kEachElementDo when a game is being loaded
This is a better check than the one in commit 3d1f1a3a21
2016-08-23 13:08:37 +03:00
Filippos Karapetis 3d1f1a3a21 SCI32: Fix restoring games from Torin's game restore dialog
The list in kListEachElementDo may be invalidated after a
selector invocation
2016-08-23 11:36:38 +03:00
Colin Snover efaf7f20d6 SCI32: Fix crash when multiple nodes are deleted during kListEachElementDo
This happens in e.g. Phant1, when walking from dining, to
reception, to up the stairs.
2016-08-12 10:26:06 -05:00
Martin Kiewitz 0b5a09f836 SCI32: fix kString calling from within kArray
(didn't work since the introduction of kString signatures and the
kString split-up)
2016-01-04 14:58:02 +01:00
Johannes Schickel 8fc7d60feb SCI: Make GPL headers consistent in themselves. 2014-02-18 02:39:37 +01:00
Willem Jan Palenstijn f279cc0e51 SCI: Add extra sanity check 2013-04-20 23:53:06 +02:00
Filippos Karapetis 2ef3f5e695 SCI: Update the virtual file selected in the QFG4 character import screen
This makes the character import screen in QFG4 functional, as the virtual
file index was never updated
2012-07-08 16:15:45 +03:00
Filippos Karapetis 2b50824133 SCI: Add setter/getter methods to reg_t's
No functionality change has been made with this commit. This avoids
setting and getting the reg_t members directly, and is the basis of any
future work on large SCI3 scripts (larger than 64KB)
2012-06-18 05:24:06 +03:00
Filippos Karapetis ea06210b92 SCI: Add support for variable selectors in kListFirstTrue / kListAllTrue
This is used by Torin's Passage (e.g. when trying to open the menu).
Based on a slightly modified patch by LePhilousophe
2012-06-11 21:17:21 +03:00
Filippos Karapetis 96aa86a60b SCI: Remove wrong script-to-array copying code in kArray 2012-01-15 20:58:14 +02:00
Eugene Sandulenko 7e298f13a1 SCI: Fix copy/paste error 2011-11-03 01:06:56 +00:00
Filippos Karapetis 7708a4ddbb SCI: Added some hacks related to new functionality in Phantasmagoria 2
The game will now start (but won't do anything exciting - it'll display
its main menu, which doesn't work yet)
2011-10-18 03:10:19 +03:00
strangerke 69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
Filippos Karapetis 32d7e687ee SCI: debugC calls no longer require a debug level of 2 to show output
svn-id: r55086
2011-01-01 12:48:12 +00:00
Filippos Karapetis d44a105e7f SCI: Disable continuous list checking by default
svn-id: r55085
2011-01-01 12:43:09 +00:00
Filippos Karapetis 5a3ed29a4b SCI: Changed the check for NULL values inside kArray(Cpy) to only ignore such values in SCI3
svn-id: r55002
2010-12-22 13:17:19 +00:00
Filippos Karapetis 7680ed0be7 Added back the null check in kArray(cpy): it happens in SCI3
svn-id: r54990
2010-12-21 20:54:33 +00:00
Filippos Karapetis de2ef2edc0 SCI: Removed the system strings code and replaced it with a much more simplified version, thus greatly simplifying handling of system strings
svn-id: r54805
2010-12-07 00:47:05 +00:00
Filippos Karapetis ac7c488c7c SCI: kArray wasn't changed in late SCI2.1/SCI3 games (thanks to waltervn)
svn-id: r54402
2010-11-21 02:06:20 +00:00
Filippos Karapetis cd69472be9 SCI: Adapted kArray/kString to use the new heuristic for late SCI2.1/SCI3 games, and updated their subops accordingly
svn-id: r54399
2010-11-21 00:47:56 +00:00
Filippos Karapetis 5d53673e93 SCI: Also send system strings to kString(). This makes LSL7 continue into the actual game! :D
svn-id: r54377
2010-11-19 13:23:20 +00:00
Lars Skovlund 84d4a4a89f Implement a couple of NULL checks in kArray
svn-id: r54373
2010-11-19 12:49:46 +00:00
Filippos Karapetis 6ec8ec416b SCI: Added support for script -> string copying (used by late SCI2.1 and SCI3 games)
svn-id: r54364
2010-11-19 10:27:22 +00:00
Filippos Karapetis c2bdba2ea6 SCI2: Treat SCI2 raw arrays (type 3) as strings in kArray
SCI2 strings inherit from arrays, plus kArray and kString are almost the
same, so this is all possible. This is needed, as SCI scripts copy 
strings on arrays and then process them as such (e.g. in RAMA and LSL7)
However, we really need to merge SCI2 array types with the SCI2 string
types, and ultimately merge the code with the SCI1 array and string types.

svn-id: r54340
2010-11-18 19:18:11 +00:00
Filippos Karapetis bd844a8c92 SCI: Call lookupArray() after allocateArray() when duplicating arrays
This ensures that the pointer to the element that lookupArray() returned
won't be invalidated in case the array is reallocated because of
allocateArray() - same issue as in kClone()

svn-id: r54306
2010-11-17 21:47:05 +00:00
Filippos Karapetis 98a8c01dbb SCI: Fixed bug #3038433 - "HOYLE1: Crashes"
svn-id: r52182
2010-08-18 07:14:17 +00:00
Filippos Karapetis 50c2fbbb48 SCI: Also allow checkListPointer() to check the result of lookupNode() itself
svn-id: r51156
2010-07-22 18:13:05 +00:00
Filippos Karapetis b4a704c342 SCI: allow isSaneNodePointer to handle invalid node references itself
svn-id: r51153
2010-07-22 17:41:42 +00:00
Filippos Karapetis 9862f3fe24 SCI: Moved the SCI32 kernel functions out of kernel32.cpp and into their respective files
svn-id: r51108
2010-07-21 21:18:21 +00:00
Martin Kiewitz cb4072f978 SCI: added special case for iceman when plotting course inside isSaneNodePointer
svn-id: r50960
2010-07-17 13:27:07 +00:00
Filippos Karapetis 2bfee401d2 SCI:
- Split SCI2 from SCI2.1 signature checks
- Added signature checking for the subops of the SCI2.1 kernel call kList
- Added support for calls to kAddToFront and kAddToEnd with 3 parameters (unimplemented code uncovered by the signature checks)
- Added a FIXME for a potential incorrect subop (uncovered by the signature checks), which might be related to the crashes in the demo of Torin's Passage

svn-id: r50861
2010-07-14 00:57:48 +00:00
Max Horn 3f429d64a2 SCI: Rename some variables to match our naming conventions
svn-id: r50549
2010-07-01 16:04:29 +00:00
Filippos Karapetis b85fd471a6 Added support for kAddAfter with 4 parameters (used in Torin's Passage, for example)
svn-id: r50537
2010-06-30 17:36:52 +00:00
Filippos Karapetis cb897a1a15 Changed an error back to a warning - Torin's Passage calls kAddAfter with 4 parameters, and we don't know what the 4th parameter is yet
svn-id: r50528
2010-06-30 11:08:23 +00:00
Filippos Karapetis 8752eed8f2 SCI: Reverting r50516, SSCI didn't reset the node value when deleting the node. Also, a slight fix in VM debug code.
svn-id: r50521
2010-06-30 09:51:21 +00:00
Filippos Karapetis 1e8b74f9de Updated incorrect comment
svn-id: r50517
2010-06-30 07:34:37 +00:00
Filippos Karapetis 7c5b31eb6d Also erase the value of the list node itself when deleting it inside kDeleteKey, as it might be referenced again before the GC is invoked
svn-id: r50516
2010-06-30 07:28:30 +00:00