[Scummvm-cvs-logs] SF.net SVN: scummvm: [21265] scummvm/trunk/engines/kyra/sound_adlib.cpp
eriktorbjorn at users.sourceforge.net
eriktorbjorn at users.sourceforge.net
Mon Mar 13 15:27:02 CET 2006
Revision: 21265
Author: eriktorbjorn
Date: 2006-03-13 15:05:11 -0800 (Mon, 13 Mar 2006)
ViewCVS: http://svn.sourceforge.net/scummvm/?rev=21265&view=rev
Log Message:
-----------
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.
Modified Paths:
--------------
scummvm/trunk/engines/kyra/sound_adlib.cpp
Modified: scummvm/trunk/engines/kyra/sound_adlib.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sound_adlib.cpp 2006-03-13 21:38:20 UTC (rev 21264)
+++ scummvm/trunk/engines/kyra/sound_adlib.cpp 2006-03-13 23:05:11 UTC (rev 21265)
@@ -757,7 +757,7 @@
// 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 @@
// 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);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list