[Scummvm-cvs-logs] SF.net SVN: scummvm: [21203] scummvm/trunk/engines/kyra/sound_adlib.cpp

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Fri Mar 10 03:19:05 CET 2006


Revision: 21203
Author:   eriktorbjorn
Date:     2006-03-10 03:18:40 -0800 (Fri, 10 Mar 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21203&view=rev

Log Message:
-----------
Added guesswork comments for stateCallback2_1() and its related functions and
variables, and cleaned it up slightly. (Some of its variables are now signed.)

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-10 10:55:36 UTC (rev 21202)
+++ scummvm/trunk/engines/kyra/sound_adlib.cpp	2006-03-10 11:18:40 UTC (rev 21203)
@@ -133,9 +133,9 @@
 		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 @@
 	}
 }
 
+// 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]);


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