aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/vm.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/engine/vm.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/engine/vm.h')
-rw-r--r--engines/sci/engine/vm.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/engines/sci/engine/vm.h b/engines/sci/engine/vm.h
index 0444cf5ffc..1ac6fed0b6 100644
--- a/engines/sci/engine/vm.h
+++ b/engines/sci/engine/vm.h
@@ -142,16 +142,32 @@ enum GlobalVar {
kGlobalVarCurrentRoom = 2,
kGlobalVarSpeed = 3, // SCI16
kGlobalVarQuit = 4,
+ kGlobalVarSounds = 8,
kGlobalVarPlanes = 10, // SCI32
kGlobalVarCurrentRoomNo = 11,
kGlobalVarPreviousRoomNo = 12,
kGlobalVarNewRoomNo = 13,
kGlobalVarScore = 15,
+ kGlobalVarGK2MusicVolume = 76, // 0 to 127
kGlobalVarFastCast = 84, // SCI16
kGlobalVarMessageType = 90,
kGlobalVarTextSpeed = 94, // SCI32; 0 is fastest, 8 is slowest
- kGlobalVarLSL6HiresTextSpeed = 167, // 1 is fastest, 14 is slowest
- kGlobalVarShivers1Score = 349
+ kGlobalVarGK1Music1 = 102, // 0 to 127
+ kGlobalVarGK1Music2 = 103, // 0 to 127
+ kGlobalVarLSL6HiresGameFlags = 137,
+ kGlobalVarGK1NarratorMode = 166, // 0 for text, 1 for speech
+ kGlobalVarPhant1MusicVolume = 187, // 0 to 15
+ kGlobalVarPhant1DACVolume = 188, // 0 to 127
+ kGlobalVarLSL6HiresMusicVolume = 194, // 0 to 13
+ kGlobalVarGK1DAC1 = 207, // 0 to 127
+ kGlobalVarGK1DAC2 = 208, // 0 to 127
+ kGlobalVarLSL6HiresRestoreTextWindow = 210,
+ kGlobalVarGK1DAC3 = 211, // 0 to 127
+ kGlobalVarShiversFlags = 211,
+ kGlobalVarTorinMusicVolume = 227, // 0 to 100
+ kGlobalVarTorinSFXVolume = 228, // 0 to 100
+ kGlobalVarTorinSpeechVolume = 229, // 0 to 100
+ kGlobalVarShivers1Score = 349
};
/** Number of kernel calls in between gcs; should be < 50000 */