aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/segment.cpp
AgeCommit message (Collapse)Author
2017-04-23SCI: Fix support for 32-bit SCI3 script offsetsColin Snover
2016-10-11SCI32: Fix garbage collection of objects stored in IntArraysColin Snover
2016-10-09SCI32: Change storage type of int16 arrays to hold reg_ts insteadColin Snover
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-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-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-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.
2014-02-18SCI: Make GPL headers consistent in themselves.Johannes Schickel
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-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)
2012-01-15SCI: Zero-terminate strings in SciString::fromString()Filippos Karapetis
2011-11-03SCI: Fixed a workaroundFilippos Karapetis
2011-11-03SCI: Add fixme comment to a weird comparisonEugene Sandulenko
2011-06-20ALL: Remove trailing whitespacesMax Horn
This tries to make our code a bit more compliant with our code formatting conventions. For future use, this is the command I used: git ls-files "*.cpp" "*.h" | xargs sed -i -e 's/[ \t]*$//'
2011-05-12GIT: Clean up: Suppress SVN tags, now uselessstrangerke
2011-03-08SCI: Cleanupmd5
2011-03-08SCI: Cleanupmd5
2011-02-28SCI: Moved hunk pointer handling to the GC, and removed some related workaroundsmd5
SCI scripts can contain stale pointers, which are used later on. We now delete the contents of hunk entries without invalidating the relevant pointers and let the GC clear the references. Many thanks to waltervn and wjp for all their work and help on this.
2011-01-01SCI: debugC calls no longer require a debug level of 2 to show outputFilippos Karapetis
svn-id: r55086
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-19SCI: Moved the Object class in a separate fileFilippos Karapetis
svn-id: r54361
2010-11-18SCI: Added species selector functionality for SCI3Filippos Karapetis
svn-id: r54351
2010-11-18Get rid of a const_cast.Lars Skovlund
svn-id: r54333
2010-11-17SCI: Fixed the return values of Object::relocateSci3()Filippos Karapetis
svn-id: r54289
2010-11-17SCI: More work on SCI3, based on a patch by lskovlunFilippos Karapetis
- Added SCI3 equivalents for access to object selectors - Added SCI3 implementation of object relocation - Added SCI3 implementation of Script::initialiseClasses() svn-id: r54283
2010-11-17SCI: Some restructuring. Added some SCI3 placeholders/stubsFilippos Karapetis
svn-id: r54280
2010-11-01ENGINES: Get rid of some (f)printfsMax Horn
svn-id: r54011
2010-08-06SCI: fixing another warningMartin Kiewitz
svn-id: r51789
2010-06-28SCI: Move a few remaining Script methods to engine/script.cppMax Horn
svn-id: r50441
2010-06-28SCI: Fix DEBUG_GC mode and permanently enable itMax Horn
svn-id: r50430
2010-06-28SCI: Revise GC interface: use Common::Array<reg_t> instead of callbacksMax Horn
This means a little bit more overhead but makes the code much more readable and understandable. svn-id: r50429
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-27CleanupFilippos Karapetis
svn-id: r50359
2010-06-26Removed the misleading getHeap() function (only valid for SCI0-SCI1), plus ↵Filippos Karapetis
removed some unused defines svn-id: r50358
2010-06-25SCI: Introduce SciGameId enumMax Horn
svn-id: r50273
2010-06-25SCI: Restrict some 'error' exceptions to the places they occur; cleanupMax Horn
svn-id: r50271
2010-06-24Changed an error in LocalVariables::dereference() back to a warning, as it ↵Filippos Karapetis
occurs in 2 places during the intro of LB2 (called from kMemory(peek)) svn-id: r50202
2010-06-22Reverted the code which handles objects without a base object when loading, ↵Filippos Karapetis
for now. This possibly indicates an issue related to the garbage collector svn-id: r50142
2010-06-17Strict mode: Changed several warnings due to logic bugs into errors. If an ↵Filippos Karapetis
error pops up from these ones, please add the game where it occurred and the steps to reproduce the error before turning it into a warning svn-id: r49973
2010-06-15Add support for SCI32 segment types to seg_table and vr debug commandsLars Skovlund
svn-id: r49686
2010-06-14Removed the code used for tracking script code block relocations in ↵Filippos Karapetis
SCI0-SCI1 games, as we don't actually relocate these blocks, and it was used solely for verification of the exports table. The issue that this warning was created for should no longer occur svn-id: r49669
2010-06-14Really silence the warning with _bufSizeFilippos Karapetis
svn-id: r49652
2010-06-14Silenced warningFilippos Karapetis
svn-id: r49651
2010-06-14Fixed a bug with commit #49640Filippos Karapetis
svn-id: r49650
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-03Moved several object-related defines inside vm.h into segment.h, where the ↵Filippos Karapetis
Object class resides. Also, removed several unused defines svn-id: r49406
2010-06-02Fixed regression from commit #49332 (merging of the SCI0 and SCI11 relocate ↵Filippos Karapetis
functions, where the SCI0 equivalent had a +1 count): it seems that we should skip over zero exports, however the total number of valid exports remains the same. Fixes KQ5 and QFG2. This also fixes the relocation calculation of script 71 in SQ3, so remove the comment that the script has broken relocation entries svn-id: r49394
2010-05-31Wrote the initialization code for the exports and synonyms table to make ↵Filippos Karapetis
more sense and fixed a bug with the initialization of the synonyms pointer, introduced with rev #49336 svn-id: r49360
2010-05-31The save/load object init code is now unified with the regular object init codeFilippos Karapetis
svn-id: r49346