aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/klists.cpp
AgeCommit message (Collapse)Author
2018-10-26SCI32: Correct fix for the TRAP machine in QFG4Filippos Karapetis
Properly fixes bug #10766.
2018-10-24SCI32: Fix an array initialization in the floppy version of QFG4Filippos Karapetis
The array used for the trap machine's messages outside Dr. Cranium's lab is set correctly now. Fixes bug #10766.
2017-09-30SCI32: Fix support for RAMA demoColin Snover
Fixes Trac#10251.
2017-09-23SCI32: Fix handling of array copiesColin Snover
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-03-30SCI32: Check for game aborts in all kList iteration methodsColin Snover
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-01-05SCI32: Add validity checks to kList iteration methodsColin Snover
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.
2016-12-11SCI32: Implement List sortColin Snover
Used by Hoyle5. Also includes a tiny amount of cleanup in kAddAfter for consistency with kAddBefore.
2016-11-20SCI32: Add recursion code to kListFirstTrue and kListAllTrueColin Snover
This change ensures that these kernel calls operate in the same manner that they did in SSCI.
2016-09-29SCI32: Rewrite kArray & kStringColin Snover
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-29SCI32: Fix off-by-one errorColin Snover
CID 1361599.
2016-08-23SCI32: Allow kListAt to reference an empty listFilippos Karapetis
Happens in Torin when examining Di's locket in chapter 3
2016-08-23SCI32: Explicitly abord kEachElementDo when a game is being loadedFilippos Karapetis
This is a better check than the one in commit 3d1f1a3a21
2016-08-23SCI32: Fix restoring games from Torin's game restore dialogFilippos Karapetis
The list in kListEachElementDo may be invalidated after a selector invocation
2016-08-12SCI32: Fix crash when multiple nodes are deleted during kListEachElementDoColin Snover
This happens in e.g. Phant1, when walking from dining, to reception, to up the stairs.
2016-01-04SCI32: fix kString calling from within kArrayMartin Kiewitz
(didn't work since the introduction of kString signatures and the kString split-up)
2014-02-18SCI: Make GPL headers consistent in themselves.Johannes Schickel
2013-04-20SCI: Add extra sanity checkWillem Jan Palenstijn
2012-07-08SCI: Update the virtual file selected in the QFG4 character import screenFilippos Karapetis
This makes the character import screen in QFG4 functional, as the virtual file index was never updated
2012-06-18SCI: Add setter/getter methods to reg_t'sFilippos Karapetis
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-11SCI: Add support for variable selectors in kListFirstTrue / kListAllTrueFilippos Karapetis
This is used by Torin's Passage (e.g. when trying to open the menu). Based on a slightly modified patch by LePhilousophe
2012-01-15SCI: Remove wrong script-to-array copying code in kArrayFilippos Karapetis
2011-11-03SCI: Fix copy/paste errorEugene Sandulenko
2011-10-18SCI: Added some hacks related to new functionality in Phantasmagoria 2Filippos Karapetis
The game will now start (but won't do anything exciting - it'll display its main menu, which doesn't work yet)
2011-05-12GIT: Clean up: Suppress SVN tags, now uselessstrangerke
2011-01-01SCI: debugC calls no longer require a debug level of 2 to show outputFilippos Karapetis
svn-id: r55086
2011-01-01SCI: Disable continuous list checking by defaultFilippos Karapetis
svn-id: r55085
2010-12-22SCI: Changed the check for NULL values inside kArray(Cpy) to only ignore ↵Filippos Karapetis
such values in SCI3 svn-id: r55002
2010-12-21Added back the null check in kArray(cpy): it happens in SCI3Filippos Karapetis
svn-id: r54990
2010-12-07SCI: Removed the system strings code and replaced it with a much more ↵Filippos Karapetis
simplified version, thus greatly simplifying handling of system strings svn-id: r54805
2010-11-21SCI: kArray wasn't changed in late SCI2.1/SCI3 games (thanks to waltervn)Filippos Karapetis
svn-id: r54402
2010-11-21SCI: Adapted kArray/kString to use the new heuristic for late SCI2.1/SCI3 ↵Filippos Karapetis
games, and updated their subops accordingly svn-id: r54399
2010-11-19SCI: Also send system strings to kString(). This makes LSL7 continue into ↵Filippos Karapetis
the actual game! :D svn-id: r54377
2010-11-19Implement a couple of NULL checks in kArrayLars Skovlund
svn-id: r54373
2010-11-19SCI: Added support for script -> string copying (used by late SCI2.1 and ↵Filippos Karapetis
SCI3 games) svn-id: r54364
2010-11-18SCI2: Treat SCI2 raw arrays (type 3) as strings in kArrayFilippos Karapetis
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-17SCI: Call lookupArray() after allocateArray() when duplicating arraysFilippos Karapetis
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-08-18SCI: Fixed bug #3038433 - "HOYLE1: Crashes"Filippos Karapetis
svn-id: r52182
2010-07-22SCI: Also allow checkListPointer() to check the result of lookupNode() itselfFilippos Karapetis
svn-id: r51156
2010-07-22SCI: allow isSaneNodePointer to handle invalid node references itselfFilippos Karapetis
svn-id: r51153
2010-07-21SCI: Moved the SCI32 kernel functions out of kernel32.cpp and into their ↵Filippos Karapetis
respective files svn-id: r51108
2010-07-17SCI: added special case for iceman when plotting course inside isSaneNodePointerMartin Kiewitz
svn-id: r50960
2010-07-14SCI:Filippos Karapetis
- 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-01SCI: Rename some variables to match our naming conventionsMax Horn
svn-id: r50549
2010-06-30Added support for kAddAfter with 4 parameters (used in Torin's Passage, for ↵Filippos Karapetis
example) svn-id: r50537
2010-06-30Changed an error back to a warning - Torin's Passage calls kAddAfter with 4 ↵Filippos Karapetis
parameters, and we don't know what the 4th parameter is yet svn-id: r50528
2010-06-30SCI: Reverting r50516, SSCI didn't reset the node value when deleting the ↵Filippos Karapetis
node. Also, a slight fix in VM debug code. svn-id: r50521
2010-06-30Updated incorrect commentFilippos Karapetis
svn-id: r50517
2010-06-30Also erase the value of the list node itself when deleting it inside ↵Filippos Karapetis
kDeleteKey, as it might be referenced again before the GC is invoked svn-id: r50516
2010-06-30When deleting a list node, erase its references to predecessor and successor ↵Filippos Karapetis
nodes. Fixes cases where game scripts could reference a list node after it was deleted (e.g. QFG1 intro, Longbow when exiting the cave). Some slight cleanup svn-id: r50515
2010-06-28SCI: Turn more warnings into errors.Max Horn
If one of these is triggered for you, you can add an exception to the error, together with a comment explaining why this exception is necessary. Ideally after verifying that the cause is a script bug and not a bug in our code... svn-id: r50442