243 Commits

Author SHA1 Message Date
Johannes Schickel
8fc7d60feb SCI: Make GPL headers consistent in themselves. 2014-02-18 02:39:37 +01:00
Martin Kiewitz
8bdffcb2fb SCI: script patcher is now a separate class 2013-12-04 20:42:16 +01:00
Filippos Karapetis
cc34755986 SCI: Fix script bug #3615119 - "SCI: Crazy Nick Laura Bow - Uninitialized read error 2" 2013-10-30 09:42:56 +02:00
Filippos Karapetis
66fce6d156 SCI: Fix some non-initialized variables in SegManager - CID 1003116 2013-05-01 01:51:11 +03:00
Johannes Schickel
89abab97e3 JANITORIAL: Remove trailing whitespaces.
Powered by:
git ls-files "*.cpp" "*.h" "*.m" "*.mm" | xargs sed -i -e 's/[ \t]*$//'
2012-09-26 04:17:55 +02:00
Filippos Karapetis
c80429008f SCI: Remove an unnecessary warning and related FIXME comments
It's perfectly normal behavior to have locals with a smaller segment ID
than the ID of their respective script, e.g. when scripts are
uninstantiated and then instantiated again
2012-07-03 03:34:30 +03:00
Filippos Karapetis
f6e4312665 SCI: Add a hack for a bug in the script handling code
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-07-02 12:49:10 +03:00
Filippos Karapetis
2b50824133 SCI: Add setter/getter methods to reg_t's
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-06-18 05:24:06 +03:00
Filippos Karapetis
a0add53c60 SCI: Change getClassAddress() to only require the caller segment
The caller offset is never actually used inside the function
2012-06-15 22:32:17 +03:00
Filippos Karapetis
041b1447c0 SCI: Replace RAW_IS_OBJECT with a method 2012-06-15 22:32:15 +03:00
Filippos Karapetis
160732b2f7 Revert "SCI: Change Script::getObject() to accept a reg_t"
This reverts commit 577d7e41c9ca2c498dc85e41c373fbdca8d2ed41.
2012-06-15 22:32:14 +03:00
Filippos Karapetis
562a8a980c SCI: Further cleanup of the script code
Merge the init() and load() Script methods and reset the script when
necessary
2012-06-15 12:53:17 +03:00
Filippos Karapetis
577d7e41c9 SCI: Change Script::getObject() to accept a reg_t
This is needed for upcoming changes to the Script class
2012-06-15 12:24:14 +03:00
Tarek Soliman
a4798602d7 JANITORIAL: Fix missing whitespace in pointer cast
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-02-15 10:07:10 -06:00
Willem Jan Palenstijn
71566a4307 SCI: Fix style 2011-11-11 00:16:57 +01:00
Willem Jan Palenstijn
8c57e4bf43 SCI: Fix const cast 2011-11-11 00:07:27 +01:00
Filippos Karapetis
5969c6bd2e SCI: Updated Script::getObjectMap()
It now returns a reference to the object list instead of copying it
2011-11-05 13:08:42 +02:00
Filippos Karapetis
58190c36b4 SCI: Made the object map hashmap of the Script class private 2011-11-05 10:07:03 +02:00
Filippos Karapetis
267c6f1756 SCI: Made more fields of the Script class private. Some cleanup. 2011-11-05 03:00:42 +02:00
Max Horn
529919e20b SCI: Remove dead code 2011-08-08 20:33:42 +02:00
Matthew Hoops
9539017ee3 ALL: initialise -> initialize 2011-05-25 11:17:11 -04:00
Matthew Hoops
eea482fa43 ALL: behaviour -> behavior 2011-05-25 10:50:46 -04:00
strangerke
69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
md5
ca1f9a075f SCI: Got rid of VERIFY() and removed some newlines in error messages 2011-03-14 20:00:26 +02:00
md5
0929d1e12d SCI: Don't try to uninstantiate scripts marked as deleted
Trying to delete a script marked as deleted should do nothing. Hoyle 3
tried to uninstantiate scripts more than once, and we incorrectly
decreased the reference count of associated scripts more than once,
thereby killing them. This properly fixes bug #3038837 (removed the
hack for it). Many many thanks to wjp for his help on this :)
2011-03-10 19:18:37 +02:00
md5
5c504739bd SCI: Removed unnecessary parameter from deallocate() 2011-03-09 23:33:26 +02:00
Walter van Niftrik
f96e93047a SCI: Use BE string handling for Mac games. 2011-03-04 21:12:00 +01:00
md5
4314a61ab4 SCI: Fixed a issue with signed characters in setChar()
This was visible in the password of LSL5 Amiga. Thanks to waltervn for
finding this
2011-03-04 14:26:23 +02:00
md5
0d555c497d SCI: Moved hunk pointer handling to the GC, and removed some related workarounds
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-02-28 15:56:03 +02:00
Walter van Niftrik
386203a3d6 SCI: Do not try to dereference object name when it's not a pointer.
Stops flood of warnings in some Mac titles.

svn-id: r55849
2011-02-09 00:27:50 +00:00
Matthew Hoops
4088e735a9 SCI: Properly reset the array/string segment ids
svn-id: r55749
2011-02-03 04:06:22 +00:00
Filippos Karapetis
aa15235858 SCI: Slight cleanup
svn-id: r54925
2010-12-15 23:35:21 +00:00
Filippos Karapetis
de2ef2edc0 SCI: Removed the system strings code and replaced it with a much more simplified version, thus greatly simplifying handling of system strings
svn-id: r54805
2010-12-07 00:47:05 +00:00
Filippos Karapetis
0b5f6d4c97 SCI: Fixed bug #3034471 - "SCI, Castlebrain/Amiga: Invisible text in word search"
Fixed some endianness issues in Amiga versions, thanks to wjp. Amiga
versions expect a BE VM, thus we adjust accordingly in the places
where memory is accessed directly (i.e. kStrAt, kMemory and all places
that set/get characters from memory)

svn-id: r54521
2010-11-28 14:57:56 +00:00
Filippos Karapetis
e8e23a83e9 SCI: Removed the Shivers 2 hack from the segment manager (it isn't SCI)
svn-id: r54174
2010-11-09 22:20:36 +00:00
Filippos Karapetis
1a85ce8e03 SCI: Some slight work on SCI3
- Enabled the SCI3 game entries for testing purposes
- The resource manager is initialized fully now (with a slight hack)
- Added a hack for the demo of Shivers 2 (which seemingly has no
scripts or vocabularies)
- The engine will stop before parsing any game scripts in SCI3 games,
and opens the console for resource manager-related functionality

svn-id: r54167
2010-11-09 19:37:42 +00:00
Max Horn
ba3e826872 SCI: Remove any use of printf
svn-id: r54037
2010-11-02 09:49:47 +00:00
Filippos Karapetis
ce657cc0dc SCI: Changed the script protection code to be a hack for Hoyle 3 only
This shouldn't be happening normally, but apparently it does, which would indicate
a potential issue with the object locking code

svn-id: r52703
2010-09-13 13:47:56 +00:00
Filippos Karapetis
e242814990 SCI: Proper fix for bug #3038837 - "HOYLE3: EGA/VGA Crashes" and some cleanup
System scripts (i.e. 0 and 900-999) are now protected and never destroyed during a
game

svn-id: r52702
2010-09-13 13:17:55 +00:00
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