aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorTorbjörn Andersson2006-03-16 17:39:23 +0000
committerTorbjörn Andersson2006-03-16 17:39:23 +0000
commit8fcb38648d69137d5e2ab2111e4dd8f2ba682f2b (patch)
tree4113691fbf7f5965eadb54cfadcfa37806aa8220 /engines
parentfa38b770afbe5b9bb7af732d2adadb8f37a203f4 (diff)
downloadscummvm-rg350-8fcb38648d69137d5e2ab2111e4dd8f2ba682f2b.tar.gz
scummvm-rg350-8fcb38648d69137d5e2ab2111e4dd8f2ba682f2b.tar.bz2
scummvm-rg350-8fcb38648d69137d5e2ab2111e4dd8f2ba682f2b.zip
I don't know if it's our bug, or a bug in the original Kyra music driver, but
updateCallback3() would call unkOutput2(9) in at least one case. This is obviously wrong because it a) reads outside _regOffsets[], and b) writes to invalid Adlib registers. Now unkOutput2() has the same safeguards as noteOff() already had, making callbackOutput() and updateCallback3() even more similar. svn-id: r21335
Diffstat (limited to 'engines')
-rw-r--r--engines/kyra/sound_adlib.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/engines/kyra/sound_adlib.cpp b/engines/kyra/sound_adlib.cpp
index 68c481f235..52113bdcd0 100644
--- a/engines/kyra/sound_adlib.cpp
+++ b/engines/kyra/sound_adlib.cpp
@@ -612,9 +612,7 @@ void AdlibDriver::callbackOutput() {
channel.tempo = 0xFF;
channel.position = 0xFF;
channel.duration = 1;
- if (chan != 9) {
- unkOutput2(chan);
- }
+ unkOutput2(chan);
}
++_lastProcessed;
@@ -786,6 +784,11 @@ void AdlibDriver::noteOff(Channel &channel) {
void AdlibDriver::unkOutput2(uint8 chan) {
debugC(9, kDebugLevelSound, "unkOutput2(%d)", chan);
+ // The control channel has no corresponding Adlib channel
+
+ if (chan >= 9)
+ return;
+
// I believe this has to do with channels 6, 7, and 8 being special
// when Adlib's rhythm section is enabled.