Commit Graph
172 Commits
Author SHA1 Message Date
sluicebox 0eac3efe70 SCI32: Add LSL6HIRES kResCheck Wave/Audio handling
Adds missing fallback behavior that appeared in at least LSL6-Hires.
Removes a workaround that only addressed a symptom of this bug;
the buggy scripts only execute when a correct call to kResCheck fails.

- Clicking four times on lobby sign no longer crashes
- Sound effect now plays when quitting during end credits

Fixes bug #13549
2022-06-06 17:32:50 -04:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Orgad Shaneh 940c7bfc14 SCI: Use nullptr
Using clang-tidy modernize-use-nullptr
2021-11-14 15:51:59 +02:00
sluicebox 6853b5101f SCI: Convert PQ2 speed workaround to script patch
Cleans up kScriptID and speeds up startup
2021-03-11 08:50:46 -08:00
sluicebox 9982c761a2 SCI: Update all old bug tracker ticket numbers 2021-02-25 01:18:52 -08:00
Filippos Karapetis bd7e708fc3 SCI: Move resource related functionality into a separate folder 2020-11-29 14:34:55 +02:00
athrxx a6bf63bc1a SCI: revert accidental commits 2019-07-17 20:46:32 +02:00
athrxx 96dc86ca97 SCI CP
Conflicts:

	engines/sci/engine/script_patches.cpp
2019-07-17 17:38:25 +02:00
athrxx 80f163b0fc ALL: revert accidental commits 2019-06-21 14:19:42 +02:00
athrxx 6611a1c289 SCI CP
Conflicts:

	engines/sci/engine/script_patches.cpp
2019-06-21 13:35:34 +02:00
Filippos Karapetis 941869c466 SCI32: Remove reg32_t and use reg_t in all cases
reg32_t was a transitive solution, before reg_t's were
adapted to use 32-bit addresses internally, and before
support for SCI3 was added. It was introduced as another
way to handle large script offsets in SCI3, and was only
used for the program counter (PC). It's no longer
needed, as we now support SCI3 script offsets using
reg_t's, so we can use make_reg32 in all cases where
we need to access offsets over 64KB
2018-08-25 12:39:12 +03:00
Filippos Karapetis 2877c22097 SCI: Add workaround for buggy script in Hoyle 3 Amiga 2018-08-21 03:36:04 +03:00
Colin Snover eba9526fdd SCI32: Remove never-read default values 2017-09-19 19:54:30 -05:00
Colin Snover 85e35943fe SCI32: Implement kLock & kDoAudio(1) for SCI32
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-09 23:00:14 -05:00
Colin Snover 4311d1b182 SCI: Do not lock Audio36/Sync36 in kLock for SCI1.1
This is not known to fix any problem, but was a noted difference
in the implementation between ScummVM and SSCI.
2017-06-09 22:48:15 -05:00
Colin Snover 095226a614 SCI: Lock Audio resource types when digital SFX is enabled
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-09 22:48:15 -05:00
Colin Snover f0d00caf93 SCI: Remove unnecessary condition
Argument count validation for kernel calls is performed through the
kernel table signature, so checking here is not necessary.
2017-06-09 22:48:15 -05:00
Colin Snover f48fc02a9b SCI: Fix typo in comment 2017-06-09 22:48:15 -05:00
Colin Snover 1f29e6f241 SCI: Refactor relocation code
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-20 21:14:18 -05:00
Colin Snover 66efb750a0 SCI: Add more support for >16-bit SCI3 offsets
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-05-20 21:14:18 -05:00
Colin Snover a799cb3462 SCI: Fix SCI3 exports
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-23 13:07:25 -05:00
Colin Snover eadf5d818f SCI: Fix support for 32-bit SCI3 script offsets 2017-04-23 13:07:25 -05:00
Colin Snover 848bce47e1 SCI: Fix typo in debug message 2017-04-22 19:25:21 -05:00
Colin Snover 766d46153a SCI32: Implement known-used portions of kPlayDuck 2017-03-30 19:46:27 -05:00
Colin Snover a91b432cdb SCI32: Load VMDs from resource bundles
GK2 includes some VMDs in the RESSCI.00n volume bundles for the
chase scene at the end of Chapter 6.
2017-01-02 17:02:31 -06:00
Colin Snover 6290f1e5fc SCI: Add prefix to global variable constants 2016-09-29 19:39:16 -05:00
Colin Snover b5d0fffb8b SCI: Replace magic numbers for globals with named constants 2016-09-29 19:39:16 -05:00
Colin Snover 2071196f42 SCI32: Add bitmap segment and remove GC option from hunk segment 2016-08-01 10:37:14 -05:00
Colin Snover 4a637d65c3 SCI32: Enable optional explicit memory management of hunk entries
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-08-01 10:37:14 -05:00
Colin Snover fe7ae6087a SCI: Remove warning in kDisposeScript
The two-argument implementation is correct and works properly.
2016-05-28 11:42:17 -05:00
Martin Kiewitz 0dd760724e SCI32: split up SCI2.1 into EARLY/MIDDLE/LATE
- 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
2015-12-29 01:44:11 +01:00
Johannes Schickel 8fc7d60feb SCI: Make GPL headers consistent in themselves. 2014-02-18 02:39:37 +01:00
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