Commit graph

204 commits

Author SHA1 Message Date
Filippos Karapetis
3daf588e08 SCI: Janitorial - fixed spaces and typos
svn-id: r52527
2010-09-04 17:16:41 +00:00
Martin Kiewitz
83e51b0e92 SCI: removing pirated sq4 version from detection
"fixes" bug #3037800
fixing warning in seg_manager

svn-id: r51576
2010-08-01 12:38:07 +00:00
Filippos Karapetis
9699f8291d SCI: Ignoring non-critical script bug in QFG1VGA, when closing any conversation dialog with esc (doesn't affect gameplay in any manner)
svn-id: r51572
2010-08-01 11:10:14 +00:00
Filippos Karapetis
634d959897 SCI: Fixed the crash in LSL2, room 42 (when arriving at the island). kAnimate may refer to unfrozen objects which have been deleted, thus handle that case accordingly.
svn-id: r51152
2010-07-22 17:25:21 +00:00
Filippos Karapetis
dcb92c8352 Add checks for null reference to strncpy() and strlen() - happens for example when trying to talk to inanimate objects in KQ6
svn-id: r50596
2010-07-02 10:38:42 +00:00
Filippos Karapetis
b252d5f0b9 getString() on a NULL pointer is an empty string (verified in SCI2.1)
svn-id: r50591
2010-07-02 08:53:51 +00:00
Matthew Hoops
8b0f49b801 Only print the ambiguous object notice in findObjectByName if we didn't specify an index.
svn-id: r50584
2010-07-01 23:13:42 +00:00
Max Horn
b8904a48ed SCI: Make SegManager::_heap private
svn-id: r50552
2010-07-01 16:05:29 +00:00
Max Horn
36799dc83f SCI: Add SegManager::getSystemString() method
svn-id: r50550
2010-07-01 16:04:48 +00:00
Max Horn
3f429d64a2 SCI: Rename some variables to match our naming conventions
svn-id: r50549
2010-07-01 16:04:29 +00:00
Max Horn
e309f05162 SCI: Simplify SegManager::findObjectByName
svn-id: r50548
2010-07-01 16:04:04 +00:00
Max Horn
b3011faaef SCI: Make various SegManager const
svn-id: r50439
2010-06-28 12:28:12 +00:00
Max Horn
30218a2c32 SCI: Make Script member vars private; add const qualifiers
Only three Script members remain public (for now)

svn-id: r50428
2010-06-28 11:22:20 +00:00
Filippos Karapetis
4a60ff4090 Made the script initialization/uninitialization methods part of the segment manager
svn-id: r50402
2010-06-27 21:18:19 +00:00
Filippos Karapetis
bb992b0b93 SCI: Moved all the script-related code inside script.cpp/.h, and all script opcode-related code inside vm.cpp/.h
svn-id: r50396
2010-06-27 20:38:43 +00:00
Filippos Karapetis
4785e1fd3f Renamed some variables
svn-id: r50284
2010-06-25 19:09:19 +00:00
Filippos Karapetis
784f52a677 Removed the getHunkPointer error - it's valid SCI behavior (e.g. when 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-25 17:59:49 +00:00
Filippos Karapetis
aedc77f0bd When loading a game, stop all running VMs recursively, and also stop 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-25 17:25:00 +00:00
Martin Kiewitz
aa3bfe5489 SCI: doing the exact opposite of r50236 code-wise now, as it was meant to be
svn-id: r50237
2010-06-24 21:46:57 +00:00
Martin Kiewitz
f014c9ed7e SCI: ignore segment 0xFFFF in segmanager getchar, when offset > 1 - so we dont write a warning, if the scripts use some uninitialized temp variable as terminator
svn-id: r50236
2010-06-24 21:42:08 +00:00
Martin Kiewitz
35b5da7e0f SCI: reverting r50232, didnt make sense. thx @ wjp for noticing
svn-id: r50233
2010-06-24 20:52:35 +00:00
Martin Kiewitz
893429d092 SCI: correctly put NUL inside SegManager::strncpy() even when using n = 0xFFFFFFFFU
svn-id: r50232
2010-06-24 20:40:57 +00:00
Filippos Karapetis
0fb5429318 Initialize the stack with 'S' or 's' characters, like SSCI does (ultimately, 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-24 09:52:08 +00:00
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