aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/seg_manager.cpp
AgeCommit message (Collapse)Author
2017-07-30SCI: Expose API for retrieving multiple objects with the same nameColin Snover
This is needed by Phant2 guest additions to find the correct slider for the music volume, since the sliders have no unique name.
2017-05-20SCI: Stop leaking locals segments during script reuseColin Snover
When a game deletes a script and then loads the same script again before it has been fully deallocated, SegManager::instantiateScript tries to reuse the same script & locals segments, but it was failing to reuse the old locals segment because Script::freeScript would unconditionally clear the old locals SegmentId, which meant the old locals segment would just leak. This patch does not fix old save games which may contain orphaned locals segments, but should prevent the problem from occurring going forward. (It is possible to clean up these old save games, but this is not a big leak so it doesn't seem worth the extra effort to do so.)
2017-05-20SCI: Find and store the original static names of objectsColin Snover
See code comment in Object::init for more details. Fixes Trac#9780.
2017-05-16SCI: Let getClassAddress fail gracefully with SCRIPT_GET_DONT_LOADWillem Jan Palenstijn
This fixes a crash in the debugger when disassembling the class opcode with a class from a script that hasn't yet been loaded.
2017-04-22SCI: Move ScummVM save/restore to GuestAdditions and reimplement for SCI32Colin Snover
2017-03-30SCI: Ensure object name reg_ts are valid before dereferencing themColin Snover
2017-03-27SCI: Implement bounds-checked reads of game resourcesColin Snover
2017-02-05SCI: Fix more unsafe C-string usageColin Snover
2017-02-05SCI: Use strnlen instead of strlen to avoid buffer overflowsColin Snover
2017-01-09SCI32: Ignore attempts to free null array reg_tsColin Snover
2016-12-18SCI: Remove unused second parameter to SegManager::getStringColin Snover
2016-12-03SCI: Remove unnecessary lock in SegManagerColin Snover
2016-10-09SCI32: Clarify some identifiersColin Snover
transparentColor -> skipColor displace -> origin scaledWidth -> xResolution scaledHeight -> yResolution
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-08-13SCI: Fix pointer invalidation caused by array storage movesColin Snover
When objects are added to a SegmentObjTable, it may cause the internal storage for the table to expand and move to a new region of memory. When this happens, all pointers to objects held by a SegmentObjTable of the same type would be invalidated, due to an implementation detail that should not be exposed. To prevent this, objects are now allocated separately on the heap, so even if the table's storage moves due to insertions, the objects owned by the table will not, so references remain valid for the lifetime of the object.
2016-08-01SCI32: Fix invalid memory access after BitmapTable is extendedColin Snover
When new bitmaps are added and the underlying Common::Array needs to move to expand, this invalidates all pointers to bitmaps, which makes it basically impossible to use the bitmap segment since you never know if a reference is going to be invalidated due to an array move. To solve this, BitmapTable is changed to hold pointers to SciBitmaps that are allocated separately on the heap instead, so when those bitmaps are looked up, the resulting pointers are valid for the lifetime of the bitmap, instead of the lifetime of the Common::Array used internally by BitmapTable.
2016-08-01SCI32: Add bitmap segment and remove GC option from hunk segmentColin Snover
2016-08-01SCI32: Enable optional explicit memory management of hunk entriesColin Snover
Bitmaps in ScrollWindow and Robot code are managed by the kernel and not by game scripts, although they must be able to be referenced through a reg_t. To prevent incorrect GC of bitmaps that are in use but not referenced by any game script, explicit memory management of hunk entries can be enabled.
2016-03-25SCI: Introduce accessors for SegmentObjTable entries.Johannes Schickel
This makes code not use _table directly whenever possible. An exception is the save game code which is not easy to adapt due to design deficiencies.
2016-02-08SCI: Zero out dynamically allocated memoryMartin Kiewitz
Fixes Mixed Up Mother Goose SCI1.1 crash when saving And could potentially fix all sorts of other issues Original SCI only zeroed out heap on init.
2016-01-15SCI: Use the actual segment in the segment manager for SCI3 gamesFilippos Karapetis
2014-08-08SCI: Show the address segment when trying to free hunks from an invalidFilippos Karapetis
address
2014-02-18SCI: Make GPL headers consistent in themselves.Johannes Schickel
2013-12-04SCI: script patcher is now a separate classMartin Kiewitz
2013-10-30SCI: Fix script bug #3615119 - "SCI: Crazy Nick Laura Bow - Uninitialized ↵Filippos Karapetis
read error 2"
2013-05-01SCI: Fix some non-initialized variables in SegManager - CID 1003116Filippos Karapetis
2012-09-26JANITORIAL: Remove trailing whitespaces.Johannes Schickel
Powered by: git ls-files "*.cpp" "*.h" "*.m" "*.mm" | xargs sed -i -e 's/[ \t]*$//'
2012-07-03SCI: Remove an unnecessary warning and related FIXME commentsFilippos Karapetis
It's perfectly normal behavior to have locals with a smaller segment ID than the ID of their respective script, e.g. when scripts are uninstantiated and then instantiated again
2012-07-02SCI: Add a hack for a bug in the script handling codeFilippos Karapetis
When resetting the segment manager, sometimes the locals block for a script is placed in a segment smaller than the script itself. This shouldn't be happening, but it isn't fatal, however it should be resolved in a proper manner
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-15SCI: Change getClassAddress() to only require the caller segmentFilippos Karapetis
The caller offset is never actually used inside the function
2012-06-15SCI: Replace RAW_IS_OBJECT with a methodFilippos Karapetis
2012-06-15Revert "SCI: Change Script::getObject() to accept a reg_t"Filippos Karapetis
This reverts commit 577d7e41c9ca2c498dc85e41c373fbdca8d2ed41.
2012-06-15SCI: Further cleanup of the script codeFilippos Karapetis
Merge the init() and load() Script methods and reset the script when necessary
2012-06-15SCI: Change Script::getObject() to accept a reg_tFilippos Karapetis
This is needed for upcoming changes to the Script class
2012-02-15JANITORIAL: Fix missing whitespace in pointer castTarek Soliman
find -name '*.h' -or -name '*.cpp' | xargs sed -r -i 's@\(([A-Za-z0-9]+)\*\)@(\1 *)@g' This seems to have caught some params as well which is not undesirable IMO. It also caught some strings containing this which is undesirable so I excluded them manually. (engines/sci/engine/kernel_tables.h)
2011-11-11SCI: Fix styleWillem Jan Palenstijn
2011-11-11SCI: Fix const castWillem Jan Palenstijn
2011-11-05SCI: Updated Script::getObjectMap()Filippos Karapetis
It now returns a reference to the object list instead of copying it
2011-11-05SCI: Made the object map hashmap of the Script class privateFilippos Karapetis
2011-11-05SCI: Made more fields of the Script class private. Some cleanup.Filippos Karapetis
2011-08-08SCI: Remove dead codeMax Horn
2011-05-25ALL: initialise -> initializeMatthew Hoops
2011-05-25ALL: behaviour -> behaviorMatthew Hoops
2011-05-12GIT: Clean up: Suppress SVN tags, now uselessstrangerke
2011-03-14SCI: Got rid of VERIFY() and removed some newlines in error messagesmd5
2011-03-10SCI: Don't try to uninstantiate scripts marked as deletedmd5
Trying to delete a script marked as deleted should do nothing. Hoyle 3 tried to uninstantiate scripts more than once, and we incorrectly decreased the reference count of associated scripts more than once, thereby killing them. This properly fixes bug #3038837 (removed the hack for it). Many many thanks to wjp for his help on this :)
2011-03-09SCI: Removed unnecessary parameter from deallocate()md5
2011-03-04SCI: Use BE string handling for Mac games.Walter van Niftrik
2011-03-04SCI: Fixed a issue with signed characters in setChar()md5
This was visible in the password of LSL5 Amiga. Thanks to waltervn for finding this