aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorJohannes Schickel2014-06-04 01:49:31 +0200
committerJohannes Schickel2014-06-04 01:49:31 +0200
commit46a95fa157b70a06a6b2c67fe5070629d322a9f5 (patch)
tree44aca47fc9527b810526182902b9d7813a81c6f0 /engines
parentd18c31e2eb9d62d9b551c520bf95847a858ce090 (diff)
downloadscummvm-rg350-46a95fa157b70a06a6b2c67fe5070629d322a9f5.tar.gz
scummvm-rg350-46a95fa157b70a06a6b2c67fe5070629d322a9f5.tar.bz2
scummvm-rg350-46a95fa157b70a06a6b2c67fe5070629d322a9f5.zip
SCUMM: Make sound completely silent for volume level 0 in AD code.
Diffstat (limited to 'engines')
-rw-r--r--engines/scumm/players/player_ad.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/engines/scumm/players/player_ad.cpp b/engines/scumm/players/player_ad.cpp
index 6225efeaeb..e864fe4f2b 100644
--- a/engines/scumm/players/player_ad.cpp
+++ b/engines/scumm/players/player_ad.cpp
@@ -239,6 +239,12 @@ void Player_AD::setupVolume() {
const uint reg = 0x40 + _operatorOffsetTable[i];
writeReg(reg, readReg(reg));
}
+
+ // Reset note on status
+ for (int i = 0; i < ARRAYSIZE(_hwChannels); ++i) {
+ const uint reg = 0xB0 + i;
+ writeReg(reg, readReg(reg));
+ }
}
int Player_AD::allocateHWChannel(int priority, SfxSlot *owner) {
@@ -323,6 +329,26 @@ void Player_AD::writeReg(int r, int v) {
}
}
+ // Since AdLib's lowest volume level does not imply that the sound is
+ // completely silent we ignore key on in such a case.
+ if (r >= 0xB0 && r <= 0xB8) {
+ const int channel = r - 0xB0;
+ bool mute = false;
+ if (_hwChannels[channel].sfxOwner) {
+ if (!_sfxVolume) {
+ mute = true;
+ }
+ } else {
+ if (!_musicVolume) {
+ mute = true;
+ }
+ }
+
+ if (mute) {
+ v &= ~0x20;
+ }
+ }
+
_opl2->writeReg(r, v);
}