Commit Graph
171 Commits
Author SHA1 Message Date
Filippos Karapetis bcb044fa5b SCI: Fix typo 2018-08-28 02:03:50 +03:00
Filippos Karapetis 7cbd3782f1 SCI: Load the correct sound effects in Hoyle 4
Fixes bug #10412
2018-08-27 23:45:34 +03:00
Filippos Karapetis 16fab2d480 SCI32: Ignore invalid kernel call when toggling the music in Hoyle 5 2018-08-21 03:36:07 +03:00
Colin Snover 42180527c4 SCI32: Fix music volume not being restored after speech in Torin
This was a regression introduced by
d556dcc57b.
2017-10-06 22:11:02 -05: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 7feccaaa98 SCI32: Implement SCI3-variant volume handling
Trying to find differences in Lighthouse's audio sample playback,
I discovered that SCI3 had its own variant of handling volumes and
sending this volume information back to game scripts. It is not
known if this fixes any sound bug.
2017-09-27 20:27:33 -05:00
Martin Kiewitz d9dfca2fcb SCI: SQ4: Now using additional and enhanced Win3.11 samples
Which were originally only played, when using the Windows interpreter.
Afaik the DOS interpreter was incapable of playing more than 1
sample at a time, which was probably the reason why Sierra only
added these for the Windows interpreter.

For example a sample is now played, when points are awarded.

Those samples are currently used all the time and will also
enhance the game, when platform DOS is chosen.
In case someone wishes to opt-out of this, we could add a game
specific option.

We do something like this for Space Quest 3 already,
that's why I don't see a reason to add a game option right now.
2017-09-25 00:44:04 +02:00
Colin Snover 200c8c442b SCI: Remove dead code 2017-09-10 22:17:17 -05:00
Colin Snover 87895b97f7 SCI: Fix looping of sounds that are not initialized yet
This fixes at least the character selection screen in QFG4CD,
where the sound for the torches is supposed to loop, but wasn't
because kDoSoundSetLoop would bail out before setting the loop
property on the soundObj.
2017-06-18 21:42:58 -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 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 53ab0b2805 SCI32: Fix broken background volume in Torin during speech 2016-07-11 16:23:46 -05:00
Colin Snover e8552cf96c SCI32: Fix audio fading 2016-07-01 12:42:39 -05: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 b51d60f85c SCI: Fix uninitialized read in SoundCommandParser 2016-06-12 20:28:34 -05:00
Ori Avtalion 3564032330 JANITORIAL: Reduce audio header dependencies 2016-04-14 16:10:21 +03:00
Filippos Karapetis 6958aa9890 SCI: Separate the demos of QFG4, PQ4 and GK1 from their full versions
The demo versions of these games were using a very different engine -
SCI1.1 vs SCI2/SCI2.1. Thus, we split them into different game IDs,
to avoid mixing specific game checks for them, as well as specific
game workarounds, which are different for the demos than the full
versions. Also, the demos should be working when SCI32 is disabled.
For these games, we don't use ADGF_DEMO, to avoid game IDs like
foodemo-demo
2016-03-08 20:36:02 +02:00
Willem Jan Palenstijn 4f6f0fb148 SCI: Fix digital audio
Regression from 5028487038, where I assumed all songs were MIDI.
2015-02-18 09:33:03 +01:00
Willem Jan Palenstijn 2b49b5f95e SCI: Fix sound object frame selector rate
Thanks waltervn. Verified against asm (QfG2, KQ6CD)
2015-02-15 14:14:46 +01:00
Willem Jan Palenstijn 5028487038 SCI: Use sound resource priority by default for songs
SCI1 sound resources can have an embedded priority. We now use that by
default, unless an explicit DoSound/SetPriority call overrides it.
Thanks waltervn.

This fixes relative priority of songs in at least PQ3 room 29.

Also increase savegame version to 33.
2015-02-15 14:05:36 +01:00
Willem Jan Palenstijn 58ef44eb8d SCI: Register and save playBed option to PlaySound
The playBed option is not handled yet, only stored. This increases
the savegame format version.
2015-02-14 16:06:55 +01:00
Matthew Hoops a83ce70467 SCI: Silence a gcc conversion warning 2014-06-01 17:28:34 -04:00
Johannes Schickel 8fc7d60feb SCI: Make GPL headers consistent in themselves. 2014-02-18 02:39:37 +01:00
Willem Jan Palenstijn 8cc82d0a0b SCI: Make fade signal version check more precise 2013-11-23 16:11:07 +01:00
Willem Jan Palenstijn 35617bf601 SCI: Fix SCI1late fade complete signal
This fixes duplicate music playing in LauraBow2CD (#6462)
2013-11-23 15:27:16 +01:00
m-kiewitz 158d12e555 SCI: abbrev. ffs to FE and priority check fix 2013-09-21 14:34:42 +02:00
m-kiewitz 4443793b97 SCI: sfx/music priority int16 fixes bug #3615038
it seems that sound system up till SCI0_LATE uses int16, afterwards it seems they changed to byte
main music object (conMusic) in Laura Bow 1 uses -1 as priority. This was truncated to 255 till now, which resulted in many sound effects not getting played, because those used priority 0
2013-09-21 14:27:16 +02:00
Filippos Karapetis 125b146b06 SCI: Implement the 4-param version of kDoSoundSendMidi - bug #3614447
Many thanks to wjp for his help with disassembly
2013-06-19 02:08:06 +03:00
Willem Jan Palenstijn 6e3510ac61 SCI: Add note about LSL1vga DoSoundSendMidi 2013-06-18 18:46:54 +02:00
Filippos Karapetis d0697addab SCI: Change wording for a function reference 2013-04-28 23:31:11 +03:00
Filippos Karapetis 46ebf37ec9 SCI: Change wording for bug/further info references 2013-04-27 14:04:27 +03:00
Willem Jan Palenstijn e273a387a7 SCI: Replace workaround for bug #3605269 by script patch 2013-04-19 23:50:04 +02:00
Willem Jan Palenstijn cdf1900ce0 SCI: Add signal/fade related CHECKME 2013-04-07 18:22:41 +02:00
Willem Jan Palenstijn 6f3c83bd51 SCI: Minor cleanup
(Thanks waltervn)
2013-04-06 22:28:42 +02:00
Willem Jan Palenstijn 1e1cc7309f SCI: Further clarify comment 2013-04-06 22:11:15 +02:00
Willem Jan Palenstijn 173a022f91 SCI: Clarify comment 2013-04-06 20:48:52 +02:00
Willem Jan Palenstijn d0d9894b22 SCI: Revert "Fixed fading-related bugs #3267956 and #3041738"
This reverts commit bfef0f5a6f.
2013-04-06 20:46:15 +02:00
Willem Jan Palenstijn 6f3716ae74 SCI: Re-initialize more of MusicEntry on play
This fixes bug #3267956.
2013-04-06 20:31:34 +02:00
Willem Jan Palenstijn eb48325248 SCI: Revert "Added a more specific workaround for bug #3267956.[...]"
This reverts commit 5654e12575.

Conflicts:
	engines/sci/sound/soundcmd.cpp
2013-04-06 20:31:34 +02:00
Willem Jan Palenstijn da3583f569 SCI: Revert "Clarify comment from rev 5654e12 further"
This reverts commit 9f74a6eda2.
2013-04-06 20:31:34 +02:00
Willem Jan Palenstijn 5a2ef39335 SCI: Revert "Fix script bug #3555404 - "SCI: KQ6 Spider Scene Game Freeze""
This reverts commit 8524ebd699.
2013-04-06 20:31:34 +02:00
Willem Jan Palenstijn 9155e8e1a1 SCI: Revert "Properly fix bugs #3267956 and #3605377"
This reverts commit 17ca8d14b1,
except for a minor unrelated change to the workaround for bug #3605269

Conflicts:
	engines/sci/sound/soundcmd.cpp
2013-04-06 20:31:34 +02:00
Willem Jan Palenstijn 0f2fae14cc SCI: Revert "Add a hack to fix bug #3596335"
This reverts commit f019d5a488.
2013-04-06 20:31:34 +02:00
Willem Jan Palenstijn 841b6ca540 SCI: Revert "Add a more generic solution for the problem found in bug #3605269"
This reverts commit c6320a28e4.
SSCI does not interpret signals on other channels than 15.

Conflicts:
	engines/sci/sound/soundcmd.cpp
2013-04-05 21:14:55 +02:00
Filippos Karapetis f019d5a488 SCI: Add a hack to fix bug #3596335
Game scripts are waiting indefinitely for a song, thus we change its dataInc
selector to prevent that from happening
2013-04-04 00:37:43 +03:00
Filippos Karapetis 17ca8d14b1 Properly fix bugs #3267956 and #3605377
SCI: Only stop after fading, if the song to be faded is faded down. Also,
reset the song signal when fading starts. It was set to -1 when fading
started in bug #3267956, thus it stopped immediately.
2013-04-04 00:37:43 +03:00
Filippos Karapetis c6320a28e4 SCI: Add a more generic solution for the problem found in bug #3605269
We now accept signals from all channels if channel 15 is missing. This
is a very rare edge case, but our behavior is now somewhat closer to what
the original interpreter seems to be doing. Mordack's appearance animation
is now synced properly. The more generic workaround works for songs 1840
and 1843, but not for 1849, which is still problematic and we still resort
to manually changing its dataInc selector
2013-04-02 10:03:48 +03:00
Filippos Karapetis dc2d8793b9 SCI: Set the song's sound queue signal to -1 when stopping a sound, like SSCI does
Previously, we set the signal of the sound objects themselves to -1, but set the
sound queue's signal to 0. This now matches the original behavior.
2013-04-01 21:31:50 +03:00