aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorTobias Gunkel2011-12-19 17:03:10 +0100
committerTobias Gunkel2011-12-22 12:08:24 +0100
commite56d5df295de63ed991bf9682f1c78e3ab92f351 (patch)
tree158d7ca4f29a32e6250e25d061bf8e7f5ea49b06 /engines/scumm
parent109ba212c6cc62ec4a2f2a664a957e66b383f44d (diff)
downloadscummvm-rg350-e56d5df295de63ed991bf9682f1c78e3ab92f351.tar.gz
scummvm-rg350-e56d5df295de63ed991bf9682f1c78e3ab92f351.tar.bz2
scummvm-rg350-e56d5df295de63ed991bf9682f1c78e3ab92f351.zip
SCUMM: Fix error in player_appleII when both voices are triggered at the same time
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/player_appleII.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/engines/scumm/player_appleII.cpp b/engines/scumm/player_appleII.cpp
index c5f60cd700..b83bb22871 100644
--- a/engines/scumm/player_appleII.cpp
+++ b/engines/scumm/player_appleII.cpp
@@ -272,19 +272,21 @@ void Player_AppleII::_soundFunc4(byte param0, byte param1, byte param2) { // D1A
while (true) {
--updateRemain1;
- if (updateRemain1 == 0) {
- updateRemain1 = updateInterval1;
- speakerShiftReg ^= bitmask1;
- }
-
--updateRemain2;
+
if (updateRemain2 == 0) {
updateRemain2 = updateInterval2;
+ // use only first voice's data (bitmask1) if both voices are triggered
if (updateRemain1 != 0) {
speakerShiftReg ^= bitmask2;
}
}
+ if (updateRemain1 == 0) {
+ updateRemain1 = updateInterval1;
+ speakerShiftReg ^= bitmask1;
+ }
+
if (speakerShiftReg & 0x1)
speakerToggle();
speakerShiftReg >>= 1;