Commit Graph
190 Commits
Author SHA1 Message Date
sluicebox f3f90556d4 SCI: Remove SCI32 code from SCI16 kDoAudio 2022-12-09 23:31:16 -08:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Orgad Shaneh a05e54f00c JANITORIAL: Remove trailing whitespaces 2021-05-04 11:46:30 +03:00
sluicebox 77b93c77ab SCI: Add support for MOTHERGOOSE256 CD-Audio version
This multi-lingual version handles audio in a unique manner.
English audio is only on the CD audio track while the other
four languages are only in resource files. This is transparent
to the scripts that play audio; they're the same in all versions.
This required a custom interpreter that detects the language and
handles English differently. It even has a custom error message:
"You will not be able to play the 'ENGLISH' version."

Fixes bug #12431
2021-04-24 00:35:03 -07:00
sluicebox 364542e9e1 SCI: Fully implement kDoAudio(13) for PHARKAS CD
Now that we match SSCI behavior when it comes to interrupting samples
when new samples play, we need to implement kDoAudio(13) so that the CD
version of Freddy Pharkas can detect these interruptions. Otherwise,
the game will softlock if the points sound effect or narration is
interrupted.
2021-02-23 18:22:25 -08:00
sluicebox de9443407f SCI: kDoAudio stops samples played with kDoSound 2021-02-22 14:57:02 -08:00
sluicebox c71db70d25 SCI: Remove redundant version check from kSciAudioCD
This version check is enforced by kernel tables
2020-11-27 10:58:35 -08:00
sluicebox d592a67125 SCI32: Add kDoAudio support for Mac AIFF patch files
Fixes LSL6 hires Mac aerobics room and end credits
2020-09-01 10:31:32 -07:00
sluicebox 85e27b0caf SCI32: Implement Mac kSetLanguage 2020-05-05 12:14:18 -07:00
Filippos Karapetis 41dbcb6e64 SCI: Remove dead code 2020-03-21 18:35:27 +02:00
sluicebox d5d7d05d80 SCI32: Use correct kDoSound subops in Mac games 2020-02-07 13:15:43 -08:00
D G Turner d11c61db14 SCI: Fix Missing Default Switch Cases
These are flagged by GCC if -Wswitch-default is enabled.
2019-12-01 05:06:31 +00:00
sluicebox 511e5441e3 SCI32: Enable Mac code (remove ENABLE_SCI32_MAC) 2019-10-11 14:18:26 -07:00
D G Turner 09abcc5c2c SCI: Fix Fall Through Compiler Warnings. 2018-11-13 12:10:30 +00:00
Colin Snover 93c8044f69 SCI32: Clean up Audio32
* Rewrap comments to 80 columns
* Remove resolved TODOs
* Use containers and smart pointers where appropriate
2017-10-06 22:10:52 -05:00
Colin Snover 743082ac8c SCI32: Disable all SCI32 Mac code
This code is currently untestable and is almost certainly at least
partly based on guesswork & not actual reverse-engineering (as was
the case for all other pre-2015 SCI32 code), so future developers
interested in adding SCI32 Mac support should use it only as an
intermediate reference rather than as known good code.
2017-09-24 22:56:59 -05:00
Colin Snover 21337e4cf6 SCI32: Implement per-channel audio panning
Used by RAMA, in various places, starting with the refrigerator
at base camp after the cable car at the beginning of the game.
2017-09-24 22:56:57 -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 eb9965274d SCI32: Fix race conditions in Audio32 2017-04-23 13:07:25 -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 f1ca9ccc64 SCI32: Fix kSetLanguage 2017-01-09 19:38:59 -06:00
Colin Snover f02107f682 SCI: Minor cleanup of kDoSound
Replaces unused kernel calls to use kEmpty, and set correct
signatures for SCI32 kernel calls.
2016-06-20 21:02:21 -05:00
Colin Snover 46551fd4b5 SCI32: Rewrite digital audio engine
This provides a complete implementation of kDoAudio through
SCI2.1mid, plus partial implementation of SCI3 features.

Digital audio calls shunted through kDoSound have also been
updated to go through the SCI32 audio mixer, though these shunts
are a bit hacky because the ScummVM implementation of kDoSound
does not currently match how SSCI kDoSound is designed.

It is probably possible in the future to just replace the SCI1.1
audio code (audio.cpp) with the new SCI32 code, since the major
differences seem to be that (1) SCI1.1 only supported one digital
audio playback channel (this is configurable already), (2) it
had extra commands for CD audio playback and queued sample
playback.
2016-06-20 21:02:21 -05:00
Colin Snover 5d3385750d SCI: Split audio sync to its own class
SCI32 has its own audio handling code, but audio sync code is the
same as SCI16.
2016-06-19 14:48:33 -05:00
Martin Kiewitz f3c2d7629d SCI: Fix FM-Towns audio language selection
This first of all combines both detection entries and makes it
possible so that the user can directly choose English or Japanese
without having to add the game twice.
But it also fixes the in-game option to switch between English
and Japanese. Prior to this commit it was only possible to for
example switch from Japanese to English once, but it was not
possible to switch back without quitting the game and starting it
again.
2016-02-24 00:51:50 +01:00
Lars Skovlund f7025c4cab SCI: Make Pharkas CD opcodes return explicit values. Document. 2016-02-22 01:04:56 +01: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
Matthew Hoops ee86e671f1 SCI: Fix Phantasmagoria Mac's kDoSound 2013-04-28 13:43:17 -04:00
Willem Jan Palenstijn 8d184cddf7 SCI: Add missing break 2013-04-15 21:35:18 +02:00
Filippos Karapetis e7836beabb SCI: Silence some very chatty warnings
Also, add an example room where kRemapToGray is called
2012-07-25 12:13:35 +03:00
Filippos Karapetis 0ccfd614aa SCI: Add more verbose debug output for DoAudio in SCI2.1 2012-06-11 11:54:09 +03:00
athrxx 731382ad51 SCI: add Japanese detection entry for KQ5 FM-Towns and fix audio language handling 2011-11-01 20:29:53 +01:00
strangerke 69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
Ori Avtalion 9414d7a6e2 JANITORIAL: Reduce header dependencies in shared code
Some backends may break as I only compiled SDL
2011-04-28 15:08:58 +03:00
Filippos Karapetis e4b46bd159 SCI: Added resource manager support for changing the audio directory dynamically. Also,
moved some audio-specific resource code inside resource_audio.cpp

This functionality is used by kSetLanguage(), called when switching the language in
MUMG Deluxe from the game's main menu.

svn-id: r55872
2011-02-10 16:48:29 +00:00
Max Horn 42ab839dd6 AUDIO: Rename sound/ dir to audio/
svn-id: r55850
2011-02-09 01:09:01 +00:00
Filippos Karapetis c2acabd710 SCI2.1: Some functionality for Phantasmagoria 1 and MUMG Deluxe
- Added a stub for kSetLanguage, used in MUMG Deluxe - this needs support at the resource
manager level
- Made kGetSierraProfileInt a stub function (it's used in the Windows version of
Phantasmagoria 1 to override the video speed setting obtained from kGetConfig)

svn-id: r55161
2011-01-08 11:19:20 +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 364d37b302 SCI: some changes to the way reverb is handled
- "Invalid" SCI reverb values (127) are properly handled now
- SCI kDoSound(reverb) sets the global reverb (renamed it accordingly)
- kDoSound(reverb) can also return the current reverb if no parameter is sent

svn-id: r54457
2010-11-24 14:21:31 +00:00
Filippos Karapetis 5ca6b33ba7 SCI: Silenced some sound related warnings. Added an empty function for kDoSound(Restore), called when restoring games
svn-id: r51661
2010-08-02 21:20:43 +00:00
Filippos Karapetis a9a0451b15 SCI: Updated some comments related to Freddy Pharkas and silenced warning for kDoAudio subop 13
svn-id: r51499
2010-07-30 07:11:57 +00:00
Martin Kiewitz a24de29358 SCI: renaming kDoSound(resume) to resumeAfterRestore
kDoSound(resumeAfterRestore) is called right after restoring a saved game for sound-sci0 games, we already resume playing music inside restore, so we don't need to implement this at all

svn-id: r51058
2010-07-20 11:17:33 +00:00
Martin Kiewitz ba776fb293 SCI: implemented subsignatures for kDoSound
svn-id: r50755
2010-07-09 12:06:41 +00:00
Martin Kiewitz 7e05d6e62b SCI: part of subfunction signature&mapping implemented, little cleanup
svn-id: r50750
2010-07-08 21:22:59 +00:00
Martin Kiewitz 07fef4c6e6 SCI: hopefully fix build :P
svn-id: r50747
2010-07-08 18:38:15 +00:00
Martin Kiewitz b877f3c711 SCI: sorted kernel map alphabetically
svn-id: r50746
2010-07-08 18:26:05 +00:00
Filippos Karapetis 9f1320d5cc SCI: Made the SoundCommandParser a member of the SciEngine class and removed it from the EngineState, since it's static throughout the course of a game
svn-id: r50484
2010-06-29 09:00:08 +00:00
Filippos Karapetis 5855cd7127 The volume subop of kDoAudio returns the previous volume in SCI2.1, but not in earlier versions
svn-id: r50141
2010-06-22 15:01:45 +00:00
Matthew Hoops 727841ef91 In SCI32, kDoAudio subop 10 is no longer CD audio. Just stub it off for now.
svn-id: r50134
2010-06-21 22:58:33 +00:00