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

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Sun Mar 12 09:59:02 CET 2006


Revision: 21240
Author:   lordhoto
Date:     2006-03-12 09:58:04 -0800 (Sun, 12 Mar 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21240&view=rev

Log Message:
-----------
- Changes usage of regBx to regAx in primaryEffect2 (seems to be a bug introduced when renaming).
- Changes unk41 and unk32 to signed.
- Fixes wrong sound when dropping items (that was also a little bug in primaryEffect2)

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-12 17:50:36 UTC (rev 21239)
+++ scummvm/trunk/engines/kyra/sound_adlib.cpp	2006-03-12 17:58:04 UTC (rev 21240)
@@ -152,8 +152,8 @@
 		uint8 unk34;
 		uint8 unk35;
 		uint8 unk36;
-		uint8 unk32;
-		uint8 unk41;
+		int8 unk32;
+		int8 unk41;
 		uint8 unk38;
 		uint8 opExtraLevel1;
 		uint8 unk7;
@@ -1094,23 +1094,23 @@
 	}
 
 	state.unk41 += state.unk32;
-	if ((int8)state.unk41 < 0) {
-		uint16 temp2 = state.unk37;
+	if (state.unk41 < 0) {
+		uint16 unk1 = state.unk37;
 		if (!(--state.unk34)) {
-			temp2 ^= 0xFFFF;
-			++temp2;
-			state.unk37 = temp2;
+			unk1 ^= 0xFFFF;
+			++unk1;
+			state.unk37 = unk1;
 			state.unk34 = state.unk35;
 		}
 
-		uint16 temp3 = state.regAx | (state.regBx << 8);
-		temp2 += temp3 & 0x3FF;
-		state.regAx = temp2 & 0xFF;
+		uint16 unk2 = (state.regAx | (state.regBx << 8)) & 0x3FF;
+		unk2 += unk1;
+		
+		state.regAx = unk2 & 0xFF;
+		state.regBx = (state.regBx & 0xFC) | (unk2 >> 8);
 
-		state.regBx = (state.regBx & 0xFC) | (temp3 >> 8);
-
 		// Octave / F-Number / Key-On
-		writeOPL(0xA0 + _curTable, state.regBx);
+		writeOPL(0xA0 + _curTable, state.regAx);
 		writeOPL(0xB0 + _curTable, state.regBx);
 	}
 }
@@ -1352,7 +1352,7 @@
 }
 
 int AdlibDriver::update_setupPrimaryEffect2(uint8 *&dataptr, OutputState &state, uint8 value) {
-	state.unk32 = value;
+	state.unk32 = (int8)value;
 	state.unk33 = *dataptr++;
 	uint8 temp = *dataptr++;
 	state.unk34 = temp + 1;


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