140 Commits

Author SHA1 Message Date
Filippos Karapetis
d78ed6f6ad SCI: Remove a duplicate sanity check 2012-06-23 21:45:20 +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
Willem Jan Palenstijn
56fb56936e SCI: Clean up some memory management and loops 2012-01-15 18:25:00 +01:00
Max Horn
88913c0139 ALL: Remove trailing whitespaces
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-06-20 00:59:48 +02:00
Matthew Hoops
eea482fa43 ALL: behaviour -> behavior 2011-05-25 10:50:46 -04:00
Willem Jan Palenstijn
c01fed7159 SCI: Avoid incrementing lockers of deleted script
Having a deleted script with non-zero lockers had the side effect of
making the deleted script re-appear in the GC's work list, including
any (deleted) objects in the script.

This should be the root cause of bugs #3299458 and #3295849, so
also delete the workaround added for that in 35086fe1.
2011-05-13 23:09:04 +02:00
strangerke
69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
md5
0b8c57be84 SCI: Moved a heap patch from kScriptID() into script_patches.cpp 2011-03-12 00:57:45 +02:00
md5
194081e7ae SCI: Removed several workarounds which are no longer needed, after the changes regarding hunk pointers in r0d555c4 2011-02-28 22:32:41 +02:00
Filippos Karapetis
f680e24146 SCI: Added a hack to fix bug #3122075 - "LB1: Game play freezes when taking shower"
This is a regression from the new kInitBresen/kDoBresen functions, enabled in r52467.
Many thanks to waltervn for his work in bisecting this. The actual bug should be
found, but since only this death scene has an issue, it's not really worth the
effort. The old functions are based on observations, so there are many differences in
the way that they behave. If another test case is found, then this shall be examined
further. Until then, this simple and unobtrusive hack will do.

svn-id: r55251
2011-01-15 18:25:10 +00:00
Filippos Karapetis
32d7e687ee SCI: debugC calls no longer require a debug level of 2 to show output
svn-id: r55086
2011-01-01 12:48:12 +00:00
Filippos Karapetis
9e418e6eaf SCI: Removed SCI3 hacks in kClone/kDisposeClone
svn-id: r54350
2010-11-18 22:26:58 +00:00
Lars Skovlund
0001a6b74d SCI3: implement setInfoSelector() for SCI3, fixes infinite recursion
svn-id: r54328
2010-11-18 17:13:01 +00:00
Lars Skovlund
c5252071db SCI3: Add proper support for the calle instruction
svn-id: r54327
2010-11-18 17:04:00 +00:00
Filippos Karapetis
34c18f20d8 SCI: Added hacks in kClone/kDisposeClone for SCI3
svn-id: r54307
2010-11-17 21:49:19 +00:00
Filippos Karapetis
61e02f0570 SCI: Fixed the speed in the intro of PQ2, version 1.002.011 (bug #3102071)
In version 1.002.011, global 3, used for timing, is incorrectly initialized
to 0, whereas it should be 6 (like in other versions). Initializing it to
the correct value fixes the speed in the intro. This has been based on the
patch for that version by NewRisingSun(NRS) / Belzorash

svn-id: r54298
2010-11-17 18:46:29 +00:00
Filippos Karapetis
bb9b7c24f9 SCI: Added some SCI3 selector related information
- Added a TODO for the usage of the -info- selector in kClone and kDisposeClone in
SCI3 scripts, as it's no longer used in SCI3
- Added information about which of the selectors are missing in SCI3. There are
some more which are missing, but aren't used in SCI2-SCI3 anyway
- Some styling

svn-id: r54291
2010-11-17 14:03:14 +00:00
Filippos Karapetis
f44b084deb SCI: Some restructuring. Added some SCI3 placeholders/stubs
svn-id: r54280
2010-11-17 08:53:02 +00:00
Martin Kiewitz
bab5050531 SCI: fixing code
thx to tortoisegit and broken conflict managment

svn-id: r52585
2010-09-06 10:41:14 +00:00
Martin Kiewitz
c342c0e3d8 SCI: fix regression of r52565
remove class bit when marking as clone

svn-id: r52584
2010-09-06 10:39:42 +00:00
Lars Skovlund
e3e9bac6f6 SCI: Clear class bit when cloning objects.
This fixes a regression affecting many SCI32 games and possibly other games,
looping or recursing endlessly.

svn-id: r52583
2010-09-06 10:11:07 +00:00
Martin Kiewitz
49c8d1a549 SCI: kClone cleanup
and fixing possible crash & typo

svn-id: r52565
2010-09-05 15:34:25 +00:00
Martin Kiewitz
13e24af0ca SCI: adjusting comment on kClone change
svn-id: r52563
2010-09-05 15:11:22 +00:00
Martin Kiewitz
d817bec4fd SCI: merging -info- stuff in Clone/DisposeClone
svn-id: r52562
2010-09-05 15:09:50 +00:00
Johannes Schickel
2a08124f0f SCI: Fix bugs #3035650 and #3039566, crash in PEPPER demo and LAURABOW2.
The actual names for the bug reports are:
 #3035650 "PEPPER non-interactive demo: Crash"
 #3039566 "LAURABOW2: Crash during introduction"

Those crashes were caused by an invalid memory dereference in kClone. This
in turn was happening, because the parent object pointer might have been
invalidated in cases where the parent object is also a clone.

svn-id: r52561
2010-09-05 14:59:09 +00:00
Martin Kiewitz
87b78b1673 SCI: kClone/kDisposeClone behaviour more accurate
now also checking -info- selector, if object is supposed to get freed. Fixes kq4 early hanging (in intro, when opening door, etc.)

svn-id: r52508
2010-09-03 18:14:59 +00:00
Johannes Schickel
dd38e424e7 SCI: Fix leaks in ResourceManager::listResources caller code.
svn-id: r51666
2010-08-02 22:27:26 +00:00
Filippos Karapetis
bae197c489 SCI: Changed a warning into debug output
svn-id: r51409
2010-07-28 09:21:58 +00:00
Matthew Hoops
c128b87c77 In SCI2.1, the type numbers inside resource maps/patches have changed slightly. We no longer use the number Sierra gives us directly, but use a function to convert to our ResourceType enum based on version. This allows us to read the chunk type from SCI2.1 (a form of script). Also, allow debugging of Mac-specific resources from the console.
svn-id: r50973
2010-07-18 00:16:19 +00:00
Martin Kiewitz
a94b25f99c SCI: kUnLoad - removing unneeded warnings (signature mismatch will happen now), added information about parameters
svn-id: r50806
2010-07-11 19:16:16 +00:00
Filippos Karapetis
79768098b1 Added handling for kLock called with resource id -1 (unlock all resources of the requested type). Happens e.g. in KQ6 and LSL6
svn-id: r50595
2010-07-02 10:18:11 +00:00
Martin Kiewitz
7595e7c1be SCI: implementing workarounds for kernel calls, removing original code workaround for kDisposeScript / qfg1 room 64 and adding it to workaround table
svn-id: r50520
2010-06-30 09:47:04 +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
3dcebcb1bc Shuffled some functions around. Also, the filename in kResCheck can never be bigger than 9 characters, when dealing with VMD videos
svn-id: r50355
2010-06-26 23:01:22 +00:00
Filippos Karapetis
b2f2c48c7e Added a workaround for broken script 377 in Castle of Dr. Brain, room 320. It constantly tries to free the saved area rectangle (underbits) underneath the popup window
svn-id: r50352
2010-06-26 22:50:39 +00:00
Max Horn
bb528d894c SCI: Rewrap some overlong comments
svn-id: r50012
2010-06-18 09:37:06 +00:00
Filippos Karapetis
773f3bf145 Changed another warning into an error. Cleanup
svn-id: r49995
2010-06-18 02:23:30 +00:00
Filippos Karapetis
36d92b4566 Fixed kLoad and kUnload (the resource type was incorrect)
svn-id: r49931
2010-06-17 14:05:05 +00:00
Filippos Karapetis
a7b76c04d9 Added handling of VMD video files in kResCheck, fixes video playing in GK2
svn-id: r49913
2010-06-17 00:07:03 +00:00
Max Horn
2b24a1a2ad SCI: OOpify class ResourceId
svn-id: r49841
2010-06-15 12:31:16 +00:00
Filippos Karapetis
60eced7a81 Cleanup
svn-id: r49662
2010-06-14 16:57:43 +00:00
Filippos Karapetis
86b452d36c Moved several object-related defines inside vm.h into segment.h, where the Object class resides. Also, removed several unused defines
svn-id: r49406
2010-06-03 10:16:21 +00:00
Filippos Karapetis
50cd1d1da4 Limited access to the script export table and synonyms block
svn-id: r49338
2010-05-30 23:31:33 +00:00
Filippos Karapetis
9c2da78ba9 kScriptID can be used to load scripts with no exports. Don't throw warnings in this case if no export is requested, as it's perfectly normal behavior
svn-id: r49331
2010-05-30 20:01:25 +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
67de5b1bd3 Mass renaming of selector-related functions, and removed some defines which were just cloaking functions with a different name
- GET_SEL32 -> readSelector
- GET_SEL32V -> readSelectorValue
- PUT_SEL32 -> writeSelector
- PUT_SEL32V -> writeSelectorValue
Also, changed some selector-related function names and variables to CamelCase

svn-id: r49317
2010-05-29 23:37:15 +00:00
Filippos Karapetis
a6156a6805 Removed the scriptRelocateExportsSci11() hack. The open spell in QFG1VGA works now (thanks to waltervn for all his help on this)
svn-id: r49311
2010-05-29 15:29:27 +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