aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/detection_tables.h
diff options
context:
space:
mode:
authorColin Snover2017-01-26 13:18:41 -0600
committerColin Snover2017-04-21 19:00:27 -0500
commit3303a881397beff1753fba237a5da735de03edb5 (patch)
tree8c3a682ee12840bfeaa9cb8e80967440d2aad26e /engines/sci/detection_tables.h
parentc2e9fee93264468d89de66eccdc0cc712cdb76fe (diff)
downloadscummvm-rg350-3303a881397beff1753fba237a5da735de03edb5.tar.gz
scummvm-rg350-3303a881397beff1753fba237a5da735de03edb5.tar.bz2
scummvm-rg350-3303a881397beff1753fba237a5da735de03edb5.zip
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.
Diffstat (limited to 'engines/sci/detection_tables.h')
-rw-r--r--engines/sci/detection_tables.h65
1 files changed, 45 insertions, 20 deletions
diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h
index 02ec9aa55b..c37dd4fffb 100644
--- a/engines/sci/detection_tables.h
+++ b/engines/sci/detection_tables.h
@@ -724,7 +724,8 @@ static const struct ADGameDescription SciGameDescriptions[] = {
#ifdef ENABLE_SCI32
#define GUIO_GK1_FLOPPY GUIO2(GUIO_NOSPEECH, \
GAMEOPTION_ORIGINAL_SAVELOAD)
-#define GUIO_GK1_CD GUIO2(GAMEOPTION_ORIGINAL_SAVELOAD, \
+#define GUIO_GK1_CD GUIO3(GUIO_LINKSPEECHTOSFX, \
+ GAMEOPTION_ORIGINAL_SAVELOAD, \
GAMEOPTION_HIGH_RESOLUTION_GRAPHICS)
#define GUIO_GK1_MAC GUIO_GK1_FLOPPY
@@ -840,13 +841,16 @@ static const struct ADGameDescription SciGameDescriptions[] = {
#undef GUIO_GK1_CD
#undef GUIO_GK1_MAC
-#define GUIO_GK2_DEMO GUIO6(GUIO_NOSUBTITLES, \
+#define GUIO_GK2_DEMO GUIO7(GUIO_NOSUBTITLES, \
GUIO_NOMUSIC, \
+ GUIO_NOSFX, \
GUIO_NOSPEECH, \
GUIO_NOMIDI, \
GUIO_NOLAUNCHLOAD, \
GUIO_NOASPECT)
-#define GUIO_GK2 GUIO5(GUIO_NOSUBTITLES, \
+#define GUIO_GK2 GUIO7(GUIO_NOSUBTITLES, \
+ GUIO_NOSFX, \
+ GUIO_NOSPEECHVOLUME, \
GUIO_NOMIDI, \
GUIO_NOASPECT, \
GAMEOPTION_ORIGINAL_SAVELOAD, \
@@ -1134,8 +1138,10 @@ static const struct ADGameDescription SciGameDescriptions[] = {
Common::EN_ANY, Common::kPlatformMacintosh, ADGF_MACRESFORK, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
#ifdef ENABLE_SCI32
-#define GUIO_HOYLE5 GUIO3(GUIO_NOMIDI, \
+#define GUIO_HOYLE5 GUIO5(GUIO_NOMIDI, \
GUIO_NOLAUNCHLOAD, \
+ GUIO_LINKMUSICTOSFX, \
+ GUIO_LINKSPEECHTOSFX, \
GUIO_NOASPECT)
// Hoyle 5 (Hoyle Classic Games) - Windows demo
@@ -1803,11 +1809,14 @@ static const struct ADGameDescription SciGameDescriptions[] = {
#ifdef ENABLE_SCI32
-#define GUIO_KQ7_DEMO GUIO4(GUIO_NOSUBTITLES, \
- GUIO_NOSPEECH, \
+#define GUIO_KQ7_DEMO GUIO5(GUIO_NOSUBTITLES, \
GUIO_NOLAUNCHLOAD, \
+ GUIO_LINKMUSICTOSFX, \
+ GUIO_LINKSPEECHTOSFX, \
GUIO_NOASPECT)
-#define GUIO_KQ7 GUIO2(GUIO_NOASPECT, \
+#define GUIO_KQ7 GUIO4(GUIO_NOASPECT, \
+ GUIO_LINKMUSICTOSFX, \
+ GUIO_LINKSPEECHTOSFX, \
GAMEOPTION_ORIGINAL_SAVELOAD)
// King's Quest 7 - English Windows (from the King's Quest Collection)
@@ -2591,7 +2600,8 @@ static const struct ADGameDescription SciGameDescriptions[] = {
#ifdef ENABLE_SCI32
-#define GUIO_LSL6HIRES GUIO2(GUIO_NOASPECT, \
+#define GUIO_LSL6HIRES GUIO3(GUIO_NOASPECT, \
+ GUIO_LINKSPEECHTOSFX, \
GAMEOPTION_ORIGINAL_SAVELOAD)
// Larry 6 - English/German DOS CD - HIRES
@@ -2874,7 +2884,9 @@ static const struct ADGameDescription SciGameDescriptions[] = {
#ifdef ENABLE_SCI32
-#define GUIO_MOTHERGOOSEHIRES GUIO2(GUIO_NOASPECT, \
+#define GUIO_MOTHERGOOSEHIRES GUIO4(GUIO_NOSUBTITLES, \
+ GUIO_NOASPECT, \
+ GUIO_LINKSPEECHTOSFX, \
GAMEOPTION_ORIGINAL_SAVELOAD)
// Mixed-Up Mother Goose Deluxe - English Windows/DOS CD (supplied by markcoolio in bug report #2723810)
@@ -2907,9 +2919,10 @@ static const struct ADGameDescription SciGameDescriptions[] = {
#ifdef ENABLE_SCI32
-#define GUIO_PHANTASMAGORIA_DEMO GUIO4(GUIO_NOSUBTITLES, \
+#define GUIO_PHANTASMAGORIA_DEMO GUIO5(GUIO_NOSUBTITLES, \
GUIO_NOASPECT, \
GUIO_NOLAUNCHLOAD, \
+ GUIO_LINKSPEECHTOSFX, \
GAMEOPTION_ENABLE_BLACK_LINED_VIDEO)
#define GUIO_PHANTASMAGORIA GUIO_PHANTASMAGORIA_DEMO
#define GUIO_PHANTASMAGORIA_MAC GUIO_PHANTASMAGORIA_DEMO
@@ -3348,7 +3361,8 @@ static const struct ADGameDescription SciGameDescriptions[] = {
#define GUIO_PQ4_FLOPPY GUIO2(GUIO_NOSPEECH, \
GAMEOPTION_ORIGINAL_SAVELOAD)
-#define GUIO_PQ4_CD GUIO2(GAMEOPTION_HIGH_RESOLUTION_GRAPHICS, \
+#define GUIO_PQ4_CD GUIO3(GUIO_LINKSPEECHTOSFX, \
+ GAMEOPTION_HIGH_RESOLUTION_GRAPHICS, \
GAMEOPTION_ORIGINAL_SAVELOAD)
// Police Quest 4 - English DOS CD (from the Police Quest Collection)
@@ -3394,11 +3408,16 @@ static const struct ADGameDescription SciGameDescriptions[] = {
#undef GUIO_PQ4_FLOPPY
#undef GUIO_PQ4_CD
-#define GUIO_PQSWAT_DEMO GUIO4(GUIO_NOSUBTITLES, \
- GUIO_NOSPEECH, \
+#define GUIO_PQSWAT_DEMO GUIO6(GUIO_NOSUBTITLES, \
+ GUIO_NOMIDI, \
+ GUIO_LINKMUSICTOSFX, \
+ GUIO_LINKSPEECHTOSFX, \
GUIO_NOASPECT, \
GUIO_NOLAUNCHLOAD)
-#define GUIO_PQSWAT GUIO4(GUIO_NOMIDI, \
+#define GUIO_PQSWAT GUIO7(GUIO_NOSUBTITLES, \
+ GUIO_NOMIDI, \
+ GUIO_LINKMUSICTOSFX, \
+ GUIO_LINKSPEECHTOSFX, \
GUIO_NOASPECT, \
GAMEOPTION_ORIGINAL_SAVELOAD, \
GAMEOPTION_ENABLE_BLACK_LINED_VIDEO)
@@ -3797,7 +3816,8 @@ static const struct ADGameDescription SciGameDescriptions[] = {
#define GUIO_QFG4_FLOPPY GUIO2(GUIO_NOSPEECH, \
GAMEOPTION_ORIGINAL_SAVELOAD)
-#define GUIO_QFG4_CD GUIO1(GAMEOPTION_ORIGINAL_SAVELOAD)
+#define GUIO_QFG4_CD GUIO2(GUIO_LINKSPEECHTOSFX, \
+ GAMEOPTION_ORIGINAL_SAVELOAD)
// Quest for Glory 4 1.1 Floppy - English DOS (supplied by markcool in bug report #2723852)
// SCI interpreter version 2.000.000 (a guess?)
@@ -3920,12 +3940,15 @@ static const struct ADGameDescription SciGameDescriptions[] = {
#endif // ENABLE_SCI3_GAMES
-#define GUIO_SHIVERS_DEMO GUIO5(GUIO_NOSUBTITLES, \
- GUIO_NOSPEECH, \
+#define GUIO_SHIVERS_DEMO GUIO6(GUIO_NOSUBTITLES, \
GUIO_NOMIDI, \
GUIO_NOLAUNCHLOAD, \
+ GUIO_LINKSPEECHTOSFX, \
+ GUIO_LINKMUSICTOSFX, \
GUIO_NOASPECT)
-#define GUIO_SHIVERS GUIO4(GUIO_NOMIDI, \
+#define GUIO_SHIVERS GUIO6(GUIO_NOMIDI, \
+ GUIO_LINKSPEECHTOSFX, \
+ GUIO_LINKMUSICTOSFX, \
GUIO_NOASPECT, \
GAMEOPTION_ORIGINAL_SAVELOAD, \
GAMEOPTION_ENABLE_BLACK_LINED_VIDEO)
@@ -4528,9 +4551,11 @@ static const struct ADGameDescription SciGameDescriptions[] = {
#ifdef ENABLE_SCI32
-#define GUIO_SQ6_DEMO GUIO2(GUIO_NOLAUNCHLOAD, \
+#define GUIO_SQ6_DEMO GUIO3(GUIO_NOLAUNCHLOAD, \
+ GUIO_LINKSPEECHTOSFX, \
GUIO_NOASPECT)
-#define GUIO_SQ6 GUIO3(GUIO_NOASPECT, \
+#define GUIO_SQ6 GUIO4(GUIO_LINKSPEECHTOSFX, \
+ GUIO_NOASPECT, \
GAMEOPTION_ORIGINAL_SAVELOAD, \
GAMEOPTION_ENABLE_BLACK_LINED_VIDEO)