aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/seg_manager.cpp
AgeCommit message (Collapse)Author
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-25Renamed some variablesFilippos Karapetis
svn-id: r50284
2010-06-25Removed the getHunkPointer error - it's valid SCI behavior (e.g. when ↵Filippos Karapetis
loading/quitting sometimes, since hunks are not saved). We check for valid hunk pointers anyway, so there's no reason for the warning/error svn-id: r50279
2010-06-25When loading a game, stop all running VMs recursively, and also stop ↵Filippos Karapetis
kAnimate's current recursion. This fixes the invalid execution stack frame in SQ1, when loading from the death screen after dying from the acid drops in Kerona. This should also fix the invalid hunk pointers, thus the warning about invalid hunk pointers has been turned into an error, as it shouldn't occur anymore svn-id: r50277
2010-06-24SCI: doing the exact opposite of r50236 code-wise now, as it was meant to beMartin Kiewitz
svn-id: r50237
2010-06-24SCI: ignore segment 0xFFFF in segmanager getchar, when offset > 1 - so we ↵Martin Kiewitz
dont write a warning, if the scripts use some uninitialized temp variable as terminator svn-id: r50236
2010-06-24SCI: reverting r50232, didnt make sense. thx @ wjp for noticingMartin Kiewitz
svn-id: r50233
2010-06-24SCI: correctly put NUL inside SegManager::strncpy() even when using n = ↵Martin Kiewitz
0xFFFFFFFFU svn-id: r50232
2010-06-24Initialize the stack with 'S' or 's' characters, like SSCI does (ultimately, ↵Filippos Karapetis
we should not change the stack again like we do in op_link - this is what Sierra is doing). Some cleanup svn-id: r50207
2010-06-18Fixed a problem in kAnimate which occurred when a list was modified by a ↵Filippos Karapetis
call (e.g. in KQ1 demo, PQ2) svn-id: r50022
2010-06-18Marked the KQ1 demo workaround as a workaroundFilippos Karapetis
svn-id: r49985
2010-06-18Added a workaround for the KQ1 demo (looks like a script bug)Filippos Karapetis
svn-id: r49984
2010-06-17SCI: Update FIXME in SegmentManagerMax Horn
* Turn one FIXME into a simple comment * Rewrap comment to 80 columns * Turn several warnings into errors svn-id: r49962
2010-06-17Removed a now obsolete FIXME (spotted by Fingolfin)Filippos Karapetis
svn-id: r49932
2010-06-15Cleanup of the savegame code:Filippos Karapetis
- Added a saveLoadWithSerializer() method to the reg_t class - Moved SegManager::reconstructClones() inside savegame.cpp - Moved SoundCommandParser::syncPlayList() and SoundCommandParser::reconstructPlayList() inside savegame.cpp svn-id: r49683
2010-06-14Some cleanup of the script locals codeFilippos Karapetis
svn-id: r49649
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-30Limit access to the _bufSize, _scriptSize and _heapSize members of the ↵Filippos Karapetis
Script class svn-id: r49327
2010-05-29Limit access to the _classTable array (now it's directly accessible only ↵Filippos Karapetis
inside saveLoadWithSerializer() svn-id: r49318
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-26SCI: Making various object and script related things constMax Horn
svn-id: r49246
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-04-04SCI: check before writing 0 in SegManager::strncpy, fixes jones/cd crashMartin Kiewitz
svn-id: r48519
2010-04-04SCI: put an ending NUL in strncpy, fixes castle of brain scrolling problem - ↵Martin Kiewitz
should be verified by the vm gurus (waltervn and lskovlun) svn-id: r48511
2010-02-03SCI: Move more stuff aroundMax Horn
svn-id: r47836
2010-02-03SCI: Get rid of EngineState::stack_segmentMax Horn
svn-id: r47833
2010-01-28Added some more information on the errors thrown by lookupString() and ↵Filippos Karapetis
freeString() - Torin full currently crashes in lookupString, called from kString (strcpy) svn-id: r47659
2010-01-26SCI: Add string support for odd-offset pointers into reg_t-based segments.Walter van Niftrik
svn-id: r47572
2010-01-25Strip trailing spaces/tabs.Johannes Schickel
svn-id: r47541
2010-01-01SCI: Fix segfault in dual-language KQ5.Walter van Niftrik
svn-id: r46864
2009-12-31Overload the = operator for SciArray which fixes the setType errors in GK1. ↵Matthew Hoops
Some other cleanup too. GK1 can now access the restore menu and get a bit further in the game (until a segfault in the Decompressor code). svn-id: r46789
2009-12-30SCI32:Matthew Hoops
- Set signature for Array/String - Add the kernel table differences for the GK2 demo - Implement kMessage changes in SCI32 - Use an empty string as the default path for all games now (and modify kValidPath to accept that only as valid) - Add dereferencing for Arrays svn-id: r46756
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
2009-11-04- Changed the segment manager to be a static part of the engine, and stopped ↵Filippos Karapetis
deleting and recreating it when restoring games - Merged game_exit(), script_free_vm_memory() and script_free_engine() - Cleanup svn-id: r45666
2009-10-20- Fixed the pathfinding issue for LSL5 room 640, where Patti walks ↵Filippos Karapetis
off-screen (we still need a proper way of detecting this, though...) - Made warnings where invalid pointers are dereferenced more precise svn-id: r45257
2009-10-14SCI: Rename some vars (cleaning up what seems to have been caused by a blind ↵Max Horn
global search & replace) svn-id: r45060
2009-10-13SCI: Merge SegManager::alloc_Hunk into SegManager::allocateHunkEntryMax Horn
svn-id: r45041
2009-10-12SCI: Fix warnings, cleanupMax Horn
svn-id: r44978
2009-10-11More work on the Object classFilippos Karapetis
svn-id: r44921
2009-10-10Started rewriting the Object struct into a classFilippos Karapetis
svn-id: r44878
2009-10-08SCI: Removed obsolete stringfrags codeMax Horn
svn-id: r44803
2009-10-08SCI: Removed SegManager::getDescriptionMax Horn
svn-id: r44795
2009-10-07SCI: Turn lookup_node & lookup_list into SegManager::lookupNode & ↵Max Horn
SegManager::lookupList svn-id: r44769
2009-10-04SCI: Add SegManager::findObjectByName() method, make parse_reg_t() local to ↵Max Horn
console.cpp, and switch other code using it to use findObjectByName() instead. svn-id: r44628
2009-10-03SCI: Fix sign issue in stringfragsWillem Jan Palenstijn
svn-id: r44572
2009-09-27SCI: Adjust isValidOffset to match changes from r44396,Willem Jan Palenstijn
and make maxSize report the valid space starting at offset. svn-id: r44421
2009-09-27SCI: clear strcpy's dest string if src is invalid.Willem Jan Palenstijn
This fixes moving the plank at the start of KQ6 in Text mode. svn-id: r44397
2009-09-27SCI: change segment offsets in reg segments to be in half reg_t.Willem Jan Palenstijn
This makes offsets in raw and reg segments consistent, which fixes string addressing in savegame dialogs. svn-id: r44396
2009-09-27SCI: Add utility functions for copying data between raw/non-raw segmentsWillem Jan Palenstijn
svn-id: r44387