aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjörn Andersson2006-03-10 11:18:40 +0000
committerTorbjörn Andersson2006-03-10 11:18:40 +0000
commita4ba0066bc48cfbd8f2a3365fb5d0f9b0d38206a (patch)
tree17e2c09655dc774809c82438d011e9a2c6a89360
parentac997a249364315ee45768a1e1ef0dc3f9dcba85 (diff)
downloadscummvm-rg350-a4ba0066bc48cfbd8f2a3365fb5d0f9b0d38206a.tar.gz
scummvm-rg350-a4ba0066bc48cfbd8f2a3365fb5d0f9b0d38206a.tar.bz2
scummvm-rg350-a4ba0066bc48cfbd8f2a3365fb5d0f9b0d38206a.zip
Added guesswork comments for stateCallback2_1() and its related functions and
variables, and cleaned it up slightly. (Some of its variables are now signed.) svn-id: r21203
-rw-r--r--engines/kyra/sound_adlib.cpp29
1 files changed, 24 insertions, 5 deletions
diff --git a/engines/kyra/sound_adlib.cpp b/engines/kyra/sound_adlib.cpp
index 4d442a7d7a..38e64f120b 100644
--- a/engines/kyra/sound_adlib.cpp
+++ b/engines/kyra/sound_adlib.cpp
@@ -133,9 +133,9 @@ private:
uint8 unk3;
uint8 unk11;
uint8 unk19;
- uint8 unk18;
- uint8 unk20;
- uint8 unk21;
+ int8 unk18;
+ int8 unk20;
+ int8 unk21;
uint8 unk22;
uint16 offset;
uint8 unk6;
@@ -965,11 +965,30 @@ void AdlibDriver::stateCallback1_2(OutputState &state) {
}
}
+// I don't know where this is used. The same operation is performed several
+// times on the current channel, using a chunk of the _soundData[] buffer for
+// parameters. The parameters are used starting at the end of the chunk.
+// Related functions and variables:
+//
+// updateCallback14()
+// - Initialies unk18, unk19, unk20, unk21, unk22 and offset
+// - unk19 is not further modified
+// - unk20 is not further modified
+// - unk22 is not further modified
+// - offset is not further modified
+//
+// unk18 - determines how often the operation is performed
+// unk19 - determines how often the operation is performed
+// unk20 - the start index into the data chunk
+// unk21 - the current index into the data chunk
+// unk22 - the operation to perform
+// offset - the offset to the data chunk
+
void AdlibDriver::stateCallback2_1(OutputState &state) {
debugC(9, kDebugLevelSound, "Calling stateCallback2_1 (channel: %d)", _curTable);
state.unk18 += state.unk19;
- if ((int8)state.unk18 < 0) {
- if ((--state.unk21) & 0x80) {
+ if (state.unk18 < 0) {
+ if (--state.unk21 < 0) {
state.unk21 = state.unk20;
}
writeOPL(state.unk22 + _unkOutputByte1, _soundData[state.offset + state.unk21]);