Commit Graph
43 Commits
Author SHA1 Message Date
sluicebox 9be84837b3 SCI: Add speed_throttle debug command
Allows testing the speed throttler for possible improvements
and to demonstrate what it affects and what it doesn't.

`speed_throttle 0` disables kGameIsRestarting throttling.
(Except for game-specific workarounds.)

This command is possible due to several recent cleanups of other
throttling mechanisms that overlapped and were absorbed by this one.
2022-08-12 00:33:20 -04:00
sluicebox 55c719aea9 SCI: Handle alternate bit orders in game flag debug commands
Five games store flags in a different bit order than the rest
2022-07-30 16:39:24 -04:00
sluicebox 82a16d71a9 SCI: Add debugging commands for Game Flags 2022-05-22 11:20:41 +03:00
Filippos Karapetis d8336a31ff SCI: Allow saving from the GMM for games that can support it
This functionality should be working without issues in the following
games:
BRAIN1, BRAIN2, ECOQUEST1, ECOQUEST2, FAIRYTALES, PHARKAS, GK1, ICEMAN,
KQ1, KQ4, KQ5, KQ6, KQ7, LB1, LB2, LONGBOW, LSL1, LSL2, LSL3, LSL5, LSL6,
LSL6HIRES, PEPPER, PQ1, PQ2, PQ3, PQ4, PQSWAT, QFG1, QFG1VGA, QFG2, QFG3,
QFG4, SQ1, SQ3, SQ4, SQ5, SQ6
2022-01-16 18:36:27 +02:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
sluicebox 3ad5a82760 SCI: Apply workarounds to Mac games without object names
Restore object names in QFG1VGA workarounds that were removed to
accommodate the Mac version. Instead, don't match object names
on games that are known to not have them, since there are several.

Fixes workarounds not being applied to HOYLE4 Mac and LSL6 Mac.
2021-10-15 21:34:21 -05:00
Orgad Shaneh a05e54f00c JANITORIAL: Remove trailing whitespaces 2021-05-04 11:46:30 +03:00
sluicebox f6dd4fa234 SCI: Add option to use KQ5 CD Windows cursors
Ticket #7800
2021-04-29 09:27:13 -07:00
Filippos Karapetis bd7e708fc3 SCI: Move resource related functionality into a separate folder 2020-11-29 14:34:55 +02:00
sluicebox c4eda7ab4a SCI32: Set Mac gamma level 2020-09-06 21:56:58 -07:00
sluicebox 5f9111f9ed SCI: Fix LSL6 low-resolution volume synchronization
Applies the LSL6 volume sync to the SCI16 (lo-res) versions as well as
the SCI32 (hi-res) versions.
2020-07-10 14:29:32 -07:00
sluicebox d5d7d05d80 SCI32: Use correct kDoSound subops in Mac games 2020-02-07 13:15:43 -08:00
sluicebox ca66a776b0 SCI: Implement early GetLongest() behavior, bug #10000 2019-07-09 09:51:10 +03:00
Filippos Karapetis 2fd416b0ac SCI32: Extend scaler sanity checks to all SCI32 versions
Fixes QFG4 bug #10765. It's preferable to have sanity checks in the
code, rather than crashing due to invalid draw rectangles from buggy
game scripts. It's no use checking which specific interpreter versions
had sanity checks and trust the game scripts of the other interpreters.
Thus, it's easier and safer to always enable these sanity checks.
2019-06-30 14:46:37 +03:00
Lars Skovlund 4b6e0e0e7d SCI32: Add feature detection for plane id base
This provides a generic fix for AddScreenItem crashes in early SCI32
floppy games that have previously required individual script patches.
2018-12-28 11:55:32 +02:00
Colin Snover 31e1d0932c SCI32: Clean up Plane
* Rewrap comments to 80 columns
* Clarify comments where possible
2017-10-06 22:11:03 -05:00
Colin Snover 74738489ec SCI32: Fix SFX volume being misapplied to music & speech in some games
This was happening in games with game scripts that control the
master volume themselves by applying the master volume to each
channel sent to the kernel, instead of relying on the kernel to
manage the master volume for them.
2017-08-26 18:09:46 -05:00
Colin Snover 07d6ffd989 SCI32: Force General MIDI for games that support nothing else
* MGDX has only GM music;
* KQ7 1.x's AdLib data is incomplete, so is not usable even though
  it is partially there

Fixes Trac#9789.
2017-07-07 13:28:54 -05:00
Colin Snover d556dcc57b SCI: Switch SCI2 games to use Audio32
Upon investigation of Sound code across SCI32 games, it was
determined that there are actually (at least) 3 different
revisions, not just a single SCI2.1 version. This patch only
changes the parts of Sound code that are relevant to the correct
use of Audio32.

Fixes Trac#9736, Trac#9756, Trac#9767, Trac#9791.
2017-06-18 21:42:58 -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 e504efe4da SCI32: Add palette code for late SCI2.1mid+ games
Sometime during SCI2.1mid, the palette manager was changed to
save and restore the source palette, and to add in-game gamma
correction. Previously, only the vary start and target palettes
were saved, and gamma correction was only configurable in SSCI by
editing RESOURCE.CFG.
2017-04-22 13:01:37 -05:00
Colin Snover 3303a88139 SCI: Improve audio volume & settings sync code
This patch includes enhancements to the ScummVM integration with
SCI engine, with particular focus on SCI32 support.

1. Fixes audio volumes syncing erroneously to ScummVM in games
   that modify the audio volume without user action (e.g. SCI1.1
   talkies that reduce music volume during speech playback). Now,
   volumes will only be synchronised when the user interacts with
   the game's audio settings. This mechanism works by looking for
   a known volume control object in the stack, and only syncing
   when the control object is present. (Ports and planes were
   researched and found unreliable.)

2. Fixes audio syncing in SCI32 games that do not set game
   volumes through kDoSoundMasterVolume/kDoAudioVolume, like GK1,
   GK2, Phant1, and Torin.

3. Fixes speech/subtitles syncing in SCI32 games that do not use
   global 90, like LSL6hires.

4. Fixes in-game volume controls in SCI32 games reflecting
   outdated audio volumes when a change is made during the game
   from the ScummVM launcher.

5. Fixes SCI32 games that would restore volumes from save games
   or reset volumes on startup, which caused game volumes to be
   out-of-sync with ScummVM when started.

6. ScummVM integration code for audio sync has been abstracted
   into a new GuestAdditions class. This keeps the ScummVM-
   specific code all in one place, with only small hooks into the
   engine code. ScummVM integrated save/load code should probably
   also go here in the future.

Fixes Trac#9700.
2017-04-21 19:00:27 -05:00
Colin Snover dd13fdfe17 SCI32: "Fix" renderer for PQ4CD
PQ4CD and several other games contain a hack in two renderer
methods to avoid rendering invalid screen items with zero or
negative-dimension target rects. This prevents PQ4CD from
crashing during the fifth phase of target practice.
2017-01-12 13:14:10 -06:00
Colin Snover 4cff1e400f SCI32: Add support for alternate graphics selectors
Used by at least Phantasmagoria 2.
2016-12-19 14:46:59 -06:00
Colin Snover 4bfd005c78 SCI32: Stop digital audio when VMDs open in some SCI2.1 games 2016-11-04 20:10:21 -05:00
Colin Snover 34bd1bcaa9 SCI32: Split out detection of features that cross SSCI versions 2016-10-20 11:33:29 -05:00
Martin Kiewitz c270b30a79 SCI: Fix pseudo mouse in various SCI1 games like e.g. Larry5
Pseudo mouse was functionality in SCI1+ games, that allowed the
user to control the mouse via keyboard cursor keys.

This new class only worked, when a tiny difference inside
the keyboard driver happened on kMapKeyToDir calls. We previously
tried to enable this behavior depending on cursor type, but
this didn't work correctly (Larry 5 for example was not detected
as such, but had PseudoMouse support).
2016-08-13 14:58:07 +02: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 e41e412c9e SCI: Fix for bug #3522046 "Detection of SQ4CD as Windows breaks Music"
Fall back to the DOS soundtracks in Windows CD versions if the user picks
a non-General MIDI music device, as the Windows tracks only contain MIDI
music
2012-04-29 20:45:16 +03: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
strangerke 69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
Filippos Karapetis 2c2f3a97e6 SCI: Added support for the alternate Windows MIDI soundtracks of the CD versions of EcoQuest, Jones, KQ5 and SQ4
svn-id: r54476
2010-11-25 14:22:09 +00:00
Filippos Karapetis d275461958 SCI: Added a heuristic to detect the modified late SCI2.1/SCI3 kString/kArray kernel functions
svn-id: r54398
2010-11-21 00:44:04 +00:00
Filippos Karapetis 47e137fd8e SCI: lofsa/lofss functionality for SCI3
- Updated detectLofsType() for SCI3
- Cleaned up op_lofsa and op_lofss and updated them for SCI3

svn-id: r54293
2010-11-17 14:28:32 +00:00
Martin Kiewitz d5e4efa025 SCI: fix lofs autodetection
makes polish lsl1 work (its game superclass name got translated, so no "Game" object available) - bug #3037194 thx to dam-soft for his patient help

svn-id: r51557
2010-07-31 22:45:38 +00:00
Matthew Hoops 828434456f SCI: Better fix for bug #3035058 - ECOQUEST demo: Missing subtitles
The demo really uses kGetMessage and not kMessage. We now detect which version of the message function is used. Thanks to Walter for pointing this out.

svn-id: r51384
2010-07-27 19:07:39 +00:00
Filippos Karapetis 50c1f4e545 Moved the MoveCountType enum above the GameFeatures class, as it's the only class using it
svn-id: r49561
2010-06-10 07:48:32 +00:00
Max Horn ae0c9b48cd Split GameFeatures::autoDetectFeature into several methods, one for each feature
svn-id: r47962
2010-02-07 12:16:23 +00:00
Max Horn 0a0875efb8 SCI: Add GameFeatures::getDetectionAddr auxillary method
svn-id: r47961
2010-02-07 12:15:59 +00:00
Filippos Karapetis 3c8ab42eea With the new detection for setCursor, the game object and game ID are no longer required, which makes some ugly code obsolete. Yay! :)
svn-id: r47951
2010-02-07 09:33:53 +00:00
Matthew Hoops ecd8e6f7d1 Rewrite detectSetCursorType() so that it works for KQ5 Mac in addition to KQ5 DOS CD.
svn-id: r47948
2010-02-07 02:53:07 +00:00
Filippos Karapetis 2fb37063a4 Placed all the game feature detection code in a separate class
svn-id: r47850
2010-02-03 11:02:43 +00:00