Commit Graph
181 Commits
Author SHA1 Message Date
Filippos Karapetis 680f7c897a Fixed a problem in kAnimate which occurred when a list was modified by a call (e.g. in KQ1 demo, PQ2)
svn-id: r50022
2010-06-18 15:40:18 +00:00
Filippos Karapetis 7a22e491e3 Marked the KQ1 demo workaround as a workaround
svn-id: r49985
2010-06-18 01:29:07 +00:00
Filippos Karapetis 30ea5f3ad2 Added a workaround for the KQ1 demo (looks like a script bug)
svn-id: r49984
2010-06-18 01:27:25 +00:00
Max Horn 06997c0da6 SCI: Update FIXME in SegmentManager
* Turn one FIXME into a simple comment
* Rewrap comment to 80 columns
* Turn several warnings into errors

svn-id: r49962
2010-06-17 23:11:56 +00:00
Filippos Karapetis 4e7b98db0c Removed a now obsolete FIXME (spotted by Fingolfin)
svn-id: r49932
2010-06-17 14:06:12 +00:00
Filippos Karapetis e93f8902a8 Cleanup of the savegame code:
- 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-15 07:20:53 +00:00
Filippos Karapetis cd77cb96fc Some cleanup of the script locals code
svn-id: r49649
2010-06-14 12:44:57 +00:00
Filippos Karapetis e083c20da1 The system strings segment is a fixed segment of the segment manager, which doesn't change during the game, thus move all the system strings code and variables inside the segment manager
svn-id: r49372
2010-06-01 14:41:48 +00:00
Filippos Karapetis c32e88fe0b Limit access to the _bufSize, _scriptSize and _heapSize members of the Script class
svn-id: r49327
2010-05-30 16:14:31 +00:00
Filippos Karapetis 5f2ff0b1e7 Limit access to the _classTable array (now it's directly accessible only inside saveLoadWithSerializer()
svn-id: r49318
2010-05-29 23:56:37 +00:00
Filippos Karapetis 2c2a1fa1ba Made _k_new_node() a method of the segment manager, and fixed a bug with the 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-26 22:05:51 +00:00
Max Horn 0197e9f6a1 SCI: Making various object and script related things const
svn-id: r49246
2010-05-26 16:30:10 +00:00
Filippos Karapetis 174a043aa7 Removed the exportsAreWide variable from the segment manager and save games, and moved validateExportFunc() in the Script class, thus resolving a TODO
svn-id: r49093
2010-05-19 08:50:24 +00:00
Filippos Karapetis f3892a506b - Removed the wrapper kalloc, kmem and kfree functions. Now, the associated 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-05-18 13:05:09 +00:00
Martin Kiewitz 2e7b049e41 SCI: check before writing 0 in SegManager::strncpy, fixes jones/cd crash
svn-id: r48519
2010-04-04 20:47:03 +00:00
Martin Kiewitz 6a840638ba SCI: put an ending NUL in strncpy, fixes castle of brain scrolling problem - should be verified by the vm gurus (waltervn and lskovlun)
svn-id: r48511
2010-04-04 12:25:52 +00:00
Max Horn bca7c6eef3 SCI: Move more stuff around
svn-id: r47836
2010-02-03 01:34:15 +00:00
Max Horn bb5e34a014 SCI: Get rid of EngineState::stack_segment
svn-id: r47833
2010-02-03 01:32:59 +00:00
Filippos Karapetis e110b02895 Added some more information on the errors thrown by lookupString() and freeString() - Torin full currently crashes in lookupString, called from kString (strcpy)
svn-id: r47659
2010-01-28 22:58:09 +00:00
Walter van Niftrik 473d8b7c2f SCI: Add string support for odd-offset pointers into reg_t-based segments.
svn-id: r47572
2010-01-26 19:51:08 +00:00
Johannes Schickel aed02365ec Strip trailing spaces/tabs.
svn-id: r47541
2010-01-25 01:39:44 +00:00
Walter van Niftrik 205f7437ea SCI: Fix segfault in dual-language KQ5.
svn-id: r46864
2010-01-01 23:48:22 +00:00
Matthew Hoops 7d131627fe Overload the = operator for SciArray which fixes the setType errors in GK1. 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-31 05:11:58 +00:00
Matthew Hoops 5382aa1ab0 SCI32:
- 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-30 16:00:56 +00:00
Matthew Hoops ef79d7f017 SCI32:
- 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-12-21 14:32:54 +00:00
Filippos Karapetis c8fbac1517 - Changed the segment manager to be a static part of the engine, and stopped deleting and recreating it when restoring games
- Merged game_exit(), script_free_vm_memory() and script_free_engine()
- Cleanup

svn-id: r45666
2009-11-04 14:22:17 +00:00
Filippos Karapetis a88aa2f45f - Fixed the pathfinding issue for LSL5 room 640, where Patti walks 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-20 10:08:28 +00:00
Max Horn 5ea978f63a SCI: Rename some vars (cleaning up what seems to have been caused by a blind global search & replace)
svn-id: r45060
2009-10-14 09:37:22 +00:00
Max Horn 296dd54344 SCI: Merge SegManager::alloc_Hunk into SegManager::allocateHunkEntry
svn-id: r45041
2009-10-13 18:53:50 +00:00
Max Horn ab1f2dac77 SCI: Fix warnings, cleanup
svn-id: r44978
2009-10-12 11:49:32 +00:00
Filippos Karapetis 6d030126d7 More work on the Object class
svn-id: r44921
2009-10-11 13:46:58 +00:00
Filippos Karapetis d6f5d93dbf Started rewriting the Object struct into a class
svn-id: r44878
2009-10-10 15:58:51 +00:00
Max Horn 76996301d1 SCI: Removed obsolete stringfrags code
svn-id: r44803
2009-10-08 21:29:45 +00:00
Max Horn d56d072fb2 SCI: Removed SegManager::getDescription
svn-id: r44795
2009-10-08 20:07:00 +00:00
Max Horn 0988e273ec SCI: Turn lookup_node & lookup_list into SegManager::lookupNode & SegManager::lookupList
svn-id: r44769
2009-10-07 23:34:24 +00:00
Max Horn 0da9ad5ff5 SCI: Add SegManager::findObjectByName() method, make parse_reg_t() local to console.cpp, and switch other code using it to use findObjectByName() instead.
svn-id: r44628
2009-10-04 18:36:58 +00:00
Willem Jan Palenstijn 75de46e9ab SCI: Fix sign issue in stringfrags
svn-id: r44572
2009-10-03 21:27:01 +00:00
Willem Jan Palenstijn 7971d77dd6 SCI: Adjust isValidOffset to match changes from r44396,
and make maxSize report the valid space starting at offset.

svn-id: r44421
2009-09-27 21:00:45 +00:00
Willem Jan Palenstijn 08e4d96a7d SCI: clear strcpy's dest string if src is invalid.
This fixes moving the plank at the start of KQ6 in Text mode.

svn-id: r44397
2009-09-27 13:05:50 +00:00
Willem Jan Palenstijn 77751a0455 SCI: change segment offsets in reg segments to be in half reg_t.
This makes offsets in raw and reg segments consistent, which
fixes string addressing in savegame dialogs.

svn-id: r44396
2009-09-27 12:23:14 +00:00
Willem Jan Palenstijn 5d2d8c580a SCI: Add utility functions for copying data between raw/non-raw segments
svn-id: r44387
2009-09-27 01:49:56 +00:00
Filippos Karapetis 13ad217cdd - Moved the SCI version in a global variable
- Changed all the SCI version checks to use getSciVersion()
- Also made getSciVersionDesc a global function (removes some ugly accessing of the SCI engine)

The fallback detector should work correctly now

svn-id: r44269
2009-09-23 10:55:35 +00:00
Filippos Karapetis 5184f86e15 - Merged scriptObjInit0() and scriptObjInit11()
- Replaced some cases where getSciVersion() is used with _resMan->sciVersion(), as getSciVersion() will fail with the fallback detector (as the engine is not initialized). Object property accessors still crash currently, when used with the fallback detector

svn-id: r44261
2009-09-22 14:33:46 +00:00
Max Horn 6424a1e9e2 SCI: Add some FIXMEs, and print warning if accessing a raw segment as non-raw or vice versa
svn-id: r44245
2009-09-22 00:51:55 +00:00
Max Horn 5f5ab54810 SCI: Add new type SegmentRef which ultimately will allow us to distinguish between raw and 'reg_t' memory blocks in client code
svn-id: r44244
2009-09-22 00:36:24 +00:00
Max Horn 5fc2428c99 SCI: SegmentObj's now set their type in constructor; replace central SegmentObj::createSegmentObj call in SegManager::allocSegment by several explicit 'new' statements; some extra cleanup
svn-id: r44242
2009-09-22 00:35:46 +00:00
Max Horn d2a6713a8e SCI: Replace IntMapper Script::_objIndices and Common::Array Script::_objects by a HashMap -- goodbye, class IntMapper
svn-id: r44240
2009-09-21 21:38:43 +00:00
Max Horn 57dfb9bafd SCI: Rename Object::flags and pos to _flags and _pos; tweak scriptObjInit0 and scriptObjInit11 to be more similar
svn-id: r44234
2009-09-21 21:35:43 +00:00
Max Horn eb77efda78 SCI: Add a global getSciVersion() function and make use of it
svn-id: r44170
2009-09-17 16:50:53 +00:00
Filippos Karapetis f890a69428 Changed the way object selectors are accessed, by removing the relevant defines and adding appropriate methods to the Object structure
svn-id: r44138
2009-09-17 08:51:38 +00:00