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

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Thu Mar 2 08:16:44 CET 2006


Revision: 21012
Author:   lordhoto
Date:     2006-03-02 08:14:46 -0800 (Thu, 02 Mar 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm?rev=21012&view=rev

Log Message:
-----------
Changed timeing related variables to unsigned.
Also changed the callback interval.

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-02 12:14:06 UTC (rev 21011)
+++ scummvm/trunk/engines/kyra/sound_adlib.cpp	2006-03-02 16:14:46 UTC (rev 21012)
@@ -116,8 +116,8 @@
 		uint8 unk26;
 		uint8 unk7;
 		uint8 unk15;
-		int8 unk1;
-		int8 unk4;
+		uint8 unk1;
+		uint8 unk4;
 		uint8 unk17;
 		uint8 unkOutputValue1;
 		typedef void (AdlibDriver::*Callback)(OutputState&);
@@ -336,8 +336,7 @@
 
 	_mixer->setupPremix(this);
 
-	// the interval should be around 13000 to 20000
-	Common::g_timer->installTimerProc(&AdlibTimerCall, 18000, this);
+	Common::g_timer->installTimerProc(&AdlibTimerCall, 13888, this);
 }
 
 AdlibDriver::~AdlibDriver() {
@@ -538,8 +537,8 @@
 			initTable(table);
 			table.unk2 = unk2;
 			table.dataptr = ptr;
-			table.unk1 = -1;
-			table.unk4 = -1;
+			table.unk1 = 0xFF;
+			table.unk4 = 0xFF;
 			table.unk5 = 1;
 			if (index != 9) {
 				unkOutput2(index);
@@ -564,8 +563,9 @@
 			table.unk1 = _unkTableByte1;
 		}
 
+		uint16 temp = table.unk4 + table.unk1;
 		table.unk4 += table.unk1;
-		if (table.unk4 < 0) {
+		if (temp > 0xFF) {
 			if (--table.unk5) {
 				if (table.unk5 == table.unk7)
 					unkOutput1(table);
@@ -652,7 +652,7 @@
 	debugC(9, kDebugLevelSound, "initTable(%d)", &table - _outputTables);
 	memset(&table.dataptr, 0, sizeof(OutputState) - ((char*)&table.dataptr - (char*)&table));
 
-	table.unk1 = -1;
+	table.unk1 = 0xFF;
 	table.unk2 = 0;
 	// normally here are nullfuncs but we set 0 for now
 	table.callback1 = 0;
@@ -976,8 +976,8 @@
 		initTable(state2);
 		state2.unk2 = temp;
 		state2.dataptr = ptr;
-		state2.unk1 = -1;
-		state2.unk4 = -1;
+		state2.unk1 = 0xFF;
+		state2.unk4 = 0xFF;
 		state2.unk5 = 1;
 		unkOutput2(table);
 	}







More information about the Scummvm-git-logs mailing list