aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjörn Andersson2006-03-13 23:05:11 +0000
committerTorbjörn Andersson2006-03-13 23:05:11 +0000
commit221263e275af003da7ff8bdfd89f433ef99f775b (patch)
tree97b1ecbc9bdafaded70a051727b1e5183d06f8ea
parentd66d7ff76bad94a61de85897187c6aff4837e39d (diff)
downloadscummvm-rg350-221263e275af003da7ff8bdfd89f433ef99f775b.tar.gz
scummvm-rg350-221263e275af003da7ff8bdfd89f433ef99f775b.tar.bz2
scummvm-rg350-221263e275af003da7ff8bdfd89f433ef99f775b.zip
Cleaned up the comments in unkOutput2(), and added a big note about the bug
where low-frequent noises are playing at the beginning of some new sounds. svn-id: r21265
-rw-r--r--engines/kyra/sound_adlib.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/engines/kyra/sound_adlib.cpp b/engines/kyra/sound_adlib.cpp
index bdf6ec76e2..ce8ab0623b 100644
--- a/engines/kyra/sound_adlib.cpp
+++ b/engines/kyra/sound_adlib.cpp
@@ -757,7 +757,7 @@ void AdlibDriver::initChannel(Channel &channel) {
// normally here are nullfuncs but we set 0 for now
channel.primaryEffect = 0;
channel.secondaryEffect = 0;
- channel.spacing1 = 0x01;
+ channel.spacing1 = 1;
}
void AdlibDriver::noteOff(Channel &channel) {
@@ -784,26 +784,34 @@ void AdlibDriver::unkOutput2(uint8 chan) {
// I believe this has to do with channels 6, 7, and 8 being special
// when Adlib's rhythm section is enabled.
+
if (_unk4 && chan >= 6)
return;
uint8 offset = _regOffset[chan];
- // Clear the Attack Rate / Decay Rate for the channel
+ // The channel is cleared: First the attack/delay rate, then the
+ // sustain/release rate, and finally the note is turned off.
+
writeOPL(0x60 + offset, 0xFF);
writeOPL(0x63 + offset, 0xFF);
- // Clear the Sustain Level / Release Rate for the channel
writeOPL(0x80 + offset, 0xFF);
writeOPL(0x83 + offset, 0xFF);
- // Octave / F-Number / Key-On
+ writeOPL(0xB0 + chan, 0x00);
- // Turn the note off, then turn it on again. This could be a "note on"
- // function, but it also clears the octave and the part of the
- // frequency (F-Number) stored in this register. Weird.
+ // FIXME!
+ //
+ // ...and then the note is turned on again, with whatever value is
+ // still lurking in the A0 + chan register, but everything else -
+ // including the two most significant frequency bit, and the octave -
+ // set to zero.
+ //
+ // This is very strange behaviour, and appears to be the cause of the
+ // bug where low-frequent notes are played at the beginning of a new
+ // sound. However, this is what the original does here...
- writeOPL(0xB0 + chan, 0x00);
writeOPL(0xB0 + chan, 0x20);
}