aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/kscripts.cpp
AgeCommit message (Collapse)Author
2017-09-19SCI32: Remove never-read default valuesColin Snover
2017-06-09SCI32: Implement kLock & kDoAudio(1) for SCI32Colin Snover
1. Unlocking all resources of a type using a resource ID of -1 is gone in SCI32; 2. Audio locks need to be serialized starting in GK2 for the game's modified kDoAudio(1) call; 3. Audio locks in SCI3 must work more like SSCI, since at least Lighthouse's `BackMusic::fade` method will attempt to unlock audio that was never locked by a script. In SSCI (and now in ScummVM too) this is a no-op; previously in ScummVM, it would remove Audio32's own lock on the audio resource, resulting in a use-after-free; 4. kDoAudio(1) starting in GK2 returns the number of active *not-in-memory* channels being played, not the total number of active channels. Fixes Trac#9675.
2017-06-09SCI: Do not lock Audio36/Sync36 in kLock for SCI1.1Colin Snover
This is not known to fix any problem, but was a noted difference in the implementation between ScummVM and SSCI.
2017-06-09SCI: Lock Audio resource types when digital SFX is enabledColin Snover
This seems to have been added in SCI1.1 and continued through SCI32; older games with digital SFX (like KQ5CD) did not convert the resource type in kLock. This is not known to fix any problem, but was a noted difference in the implementation between ScummVM and SSCI.
2017-06-09SCI: Remove unnecessary conditionColin Snover
Argument count validation for kernel calls is performed through the kernel table signature, so checking here is not necessary.
2017-06-09SCI: Fix typo in commentColin Snover
2017-05-20SCI: Refactor relocation codeColin Snover
This groundwork enables an object to look up its static name separately from the normal process that is used to populate Object::_variables when an object is first constructed. (The static name property needs to be able to be retrieved from objects inside of earlier save games whose name properties may have already been modified at runtime, so the code cannot simply pluck the value out of Object::_variables when they are first initialised and then persisted into the save game, as nice and easy as that would have been.) This commit also helps to clarify the situation with relocation tables in SCI1 games that start with a zero entry. Refs Trac#9780.
2017-05-20SCI: Add more support for >16-bit SCI3 offsetsColin Snover
Basically just grepped for getOffset calls being assigned to uint16s and expanded those to uint32 when they looked trivial. While some of these changes seem superfluous, at least for the US/English SCI3 games where potentially impacted game scripts are not large enough to have a problem with 16-bit offsets (e.g. when feature detecting the sound type), at least some of these changes are necessary for correct operation of the find_callk debugger command in SCI3 games. There should not be a reason why any of these variables need to be kept as uint16, in any case.
2017-04-23SCI: Fix SCI3 exportsColin Snover
Export functions may be relocated above 64k in SCI3, but exports that do not have an entry in the relocation table must be handled the same as SCI1.1-2.1.
2017-04-23SCI: Fix support for 32-bit SCI3 script offsetsColin Snover
2017-04-22SCI: Fix typo in debug messageColin Snover
2017-03-30SCI32: Implement known-used portions of kPlayDuckColin Snover
2017-01-02SCI32: Load VMDs from resource bundlesColin Snover
GK2 includes some VMDs in the RESSCI.00n volume bundles for the chase scene at the end of Chapter 6.
2016-09-29SCI: Add prefix to global variable constantsColin Snover
2016-09-29SCI: Replace magic numbers for globals with named constantsColin Snover
2016-08-01SCI32: Add bitmap segment and remove GC option from hunk segmentColin Snover
2016-08-01SCI32: Enable optional explicit memory management of hunk entriesColin Snover
Bitmaps in ScrollWindow and Robot code are managed by the kernel and not by game scripts, although they must be able to be referenced through a reg_t. To prevent incorrect GC of bitmaps that are in use but not referenced by any game script, explicit memory management of hunk entries can be enabled.
2016-05-28SCI: Remove warning in kDisposeScriptColin Snover
The two-argument implementation is correct and works properly.
2015-12-29SCI32: split up SCI2.1 into EARLY/MIDDLE/LATEMartin Kiewitz
- Detection works via signatures (couldn't find a better way) - new kString subcalls were introduced SCI2.1 LATE - kString now has signatures and is split via subcall table - kString fix, so that KQ7 doesn't crash, when starting a chapter - Sci2StringFunctionType removed, because no longer needed
2014-02-18SCI: Make GPL headers consistent in themselves.Johannes Schickel
2012-06-23SCI: Remove a duplicate sanity checkFilippos Karapetis
2012-06-18SCI: Add setter/getter methods to reg_t'sFilippos Karapetis
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-01-15SCI: Clean up some memory management and loopsWillem Jan Palenstijn
2011-06-20ALL: Remove trailing whitespacesMax Horn
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-05-25ALL: behaviour -> behaviorMatthew Hoops
2011-05-13SCI: Avoid incrementing lockers of deleted scriptWillem Jan Palenstijn
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-12GIT: Clean up: Suppress SVN tags, now uselessstrangerke
2011-03-12SCI: Moved a heap patch from kScriptID() into script_patches.cppmd5
2011-02-28SCI: Removed several workarounds which are no longer needed, after the ↵md5
changes regarding hunk pointers in r0d555c4
2011-01-15SCI: Added a hack to fix bug #3122075 - "LB1: Game play freezes when taking ↵Filippos Karapetis
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-01SCI: debugC calls no longer require a debug level of 2 to show outputFilippos Karapetis
svn-id: r55086
2010-11-18SCI: Removed SCI3 hacks in kClone/kDisposeCloneFilippos Karapetis
svn-id: r54350
2010-11-18SCI3: implement setInfoSelector() for SCI3, fixes infinite recursionLars Skovlund
svn-id: r54328
2010-11-18SCI3: Add proper support for the calle instructionLars Skovlund
svn-id: r54327
2010-11-17SCI: Added hacks in kClone/kDisposeClone for SCI3Filippos Karapetis
svn-id: r54307
2010-11-17SCI: Fixed the speed in the intro of PQ2, version 1.002.011 (bug #3102071)Filippos Karapetis
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-17SCI: Added some SCI3 selector related informationFilippos Karapetis
- 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-17SCI: Some restructuring. Added some SCI3 placeholders/stubsFilippos Karapetis
svn-id: r54280
2010-09-06SCI: fixing codeMartin Kiewitz
thx to tortoisegit and broken conflict managment svn-id: r52585
2010-09-06SCI: fix regression of r52565Martin Kiewitz
remove class bit when marking as clone svn-id: r52584
2010-09-06SCI: Clear class bit when cloning objects.Lars Skovlund
This fixes a regression affecting many SCI32 games and possibly other games, looping or recursing endlessly. svn-id: r52583
2010-09-05SCI: kClone cleanupMartin Kiewitz
and fixing possible crash & typo svn-id: r52565
2010-09-05SCI: adjusting comment on kClone changeMartin Kiewitz
svn-id: r52563
2010-09-05SCI: merging -info- stuff in Clone/DisposeCloneMartin Kiewitz
svn-id: r52562
2010-09-05SCI: Fix bugs #3035650 and #3039566, crash in PEPPER demo and LAURABOW2.Johannes Schickel
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-03SCI: kClone/kDisposeClone behaviour more accurateMartin Kiewitz
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-08-02SCI: Fix leaks in ResourceManager::listResources caller code.Johannes Schickel
svn-id: r51666
2010-07-28SCI: Changed a warning into debug outputFilippos Karapetis
svn-id: r51409
2010-07-18In SCI2.1, the type numbers inside resource maps/patches have changed ↵Matthew Hoops
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-11SCI: kUnLoad - removing unneeded warnings (signature mismatch will happen ↵Martin Kiewitz
now), added information about parameters svn-id: r50806