aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/seg_manager.h
AgeCommit message (Collapse)Author
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-18SCI: Remove unused second parameter to SegManager::getStringColin 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-19SCI32: Address TODO in seg_manager.hColin Snover
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-01-15SCI: Indent comment properly.Johannes Schickel
2016-01-15SCI3: Add comment re new functionLars Skovlund
2016-01-15SCI: Use the actual segment in the segment manager for SCI3 gamesFilippos Karapetis
2014-02-18SCI: Make GPL headers consistent in themselves.Johannes Schickel
2013-12-04Merge branch 'master' of github.com:scummvm/scummvmMartin Kiewitz
2013-12-04SCI: script patcher is now a separate classMartin Kiewitz
2013-11-23SCI: Janitorial - Fix spacing errorsStrangerke
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-15SCI: Change getClassAddress() to only require the caller segmentFilippos Karapetis
The caller offset is never actually used inside the function
2011-11-05SCI: Made more fields of the Script class private. Some cleanup.Filippos Karapetis
2011-05-25ALL: initialise -> initializeMatthew 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-09SCI: Removed unnecessary parameter from deallocate()md5
2010-12-15SCI: Slight cleanupFilippos Karapetis
svn-id: r54925
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-08SCI: Some changes regarding the string heap in saved gamesFilippos Karapetis
- Maintain the state of the string heap space in saved games - Merged SegManager::reconstructScripts() inside SegManager::saveLoadWithSerializer() - Disabled a now unnecessary script patch for the cipher puzzle in Castle of Dr. Brain, and performed some cleanup for another disabled patch - Removed direct access to the _baseObj variable of objects svn-id: r54133
2010-08-01SCI: Ignoring non-critical script bug in QFG1VGA, when closing any ↵Filippos Karapetis
conversation dialog with esc (doesn't affect gameplay in any manner) svn-id: r51572
2010-07-22SCI: Fixed the crash in LSL2, room 42 (when arriving at the island). ↵Filippos Karapetis
kAnimate may refer to unfrozen objects which have been deleted, thus handle that case accordingly. svn-id: r51152
2010-07-01SCI: Make SegManager::_heap privateMax Horn
svn-id: r50552
2010-07-01SCI: Make SegManager::_classTable private.Max Horn
This require a small tweak to the save/load code: I moved the syncing logic for _classtable from EngineState::saveLoadWithSerializer to SegManager::saveLoadWithSerializer, which in theory should have no effect (luckily, _classtable was being synced right after the segment manager). svn-id: r50551
2010-07-01SCI: Add SegManager::getSystemString() methodMax Horn
svn-id: r50550
2010-07-01SCI: Rename some variables to match our naming conventionsMax Horn
svn-id: r50549
2010-06-28SCI: Make various SegManager constMax Horn
svn-id: r50439
2010-06-27Made the script initialization/uninitialization methods part of the segment ↵Filippos Karapetis
manager svn-id: r50402
2010-06-27SCI: Made the code for initializing script classes, objects and locals part ↵Filippos Karapetis
of the Script class svn-id: r50398
2010-06-27SCI: Moved all the script-related code inside script.cpp/.h, and all script ↵Filippos Karapetis
opcode-related code inside vm.cpp/.h svn-id: r50396
2010-06-27SCI: Separated the code for initializing script classes from the code for ↵Filippos Karapetis
initializing script objects svn-id: r50390
2010-06-26Moved script_instantiate_sci0() inside the segment manager, and renamed it ↵Filippos Karapetis
to scriptInitialiseObjectsSci0() svn-id: r50357
2010-06-15Fix spelling, cleanupMax Horn
svn-id: r49843
2010-06-14Some cleanup of the script locals codeFilippos Karapetis
svn-id: r49649
2010-06-13The offset of script local variables is now calculated when the script is ↵Filippos Karapetis
loaded, thus we no longer need to save it. Merged scriptInitialiseLocals() with scriptInitialiseLocalsZero() svn-id: r49640
2010-06-08Made reconstruct_stack() a member of SegManagerFilippos Karapetis
svn-id: r49503
2010-06-01The system strings segment is a fixed segment of the segment manager, which ↵Filippos Karapetis
doesn't change during the game, thus move all the system strings code and variables inside the segment manager svn-id: r49372
2010-05-29Limit access to the _classTable array (now it's directly accessible only ↵Filippos Karapetis
inside saveLoadWithSerializer() svn-id: r49318
2010-05-29CleanupFilippos Karapetis
svn-id: r49312
2010-05-29Added a method to the resource manager, to limit the places where script ↵Filippos Karapetis
exports are accessed, since for SCI11 and newer exports can be functions and objects (first step in removing scriptRelocateExportsSci11(), which is a gross hack and it fails in QFG1VGA) svn-id: r49308
2010-05-26Made _k_new_node() a method of the segment manager, and fixed a bug with the ↵Filippos Karapetis
rarely used SCI0 kernel function kSort in the process (_k_new_node was called with key, value instead of value, key inside kSort) svn-id: r49251
2010-05-19Removed the exportsAreWide variable from the segment manager and save games, ↵Filippos Karapetis
and moved validateExportFunc() in the Script class, thus resolving a TODO svn-id: r49093
2010-05-18- Removed the wrapper kalloc, kmem and kfree functions. Now, the associated ↵Filippos Karapetis
Segment manager functions allocateHunkEntry, getHunkPointer and freeHunkEntry are used directly (which are more descriptive, anyway) - Replaced the GET_SEGMENT macro by a method of the segment manager - Removed the unused reference to the created hunk in allocateHunkEntry(), only the reg_t reference to it is returned now svn-id: r49078
2010-02-03SCI: Move more stuff aroundMax Horn
svn-id: r47836
2010-01-25Strip trailing spaces/tabs.Johannes Schickel
svn-id: r47541
2009-12-21SCI32:Matthew Hoops
- Fully implement kArray and kIsHiRes and mostly implement kString (printf and atoi subfunctions still missing). - Add a dummy SciGui class for SCI32 to bypass the views. Gabriel Knight 1 will now play the Sierra logo music and the main menu music. - Some other minor SCI32 changes. svn-id: r46462