[Scummvm-cvs-logs] scummvm master -> 401884fcc4e71c56627c7e756cd86fa0febfb084

eriktorbjorn eriktorbjorn at telia.com
Sun Nov 3 23:19:27 CET 2013


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
401884fcc4 TSAGE: Renamed and simplified AdLib register offset lookup


Commit: 401884fcc4e71c56627c7e756cd86fa0febfb084
    https://github.com/scummvm/scummvm/commit/401884fcc4e71c56627c7e756cd86fa0febfb084
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2013-11-03T14:18:46-08:00

Commit Message:
TSAGE: Renamed and simplified AdLib register offset lookup

Changed paths:
    engines/tsage/sound.cpp



diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp
index c7ac14a..0946b6c 100644
--- a/engines/tsage/sound.cpp
+++ b/engines/tsage/sound.cpp
@@ -2706,13 +2706,8 @@ SoundDriver::SoundDriver() {
 
 const byte adlib_group_data[] = { 1, 1, 9, 1, 0xff };
 
-const byte v440B0[9] = { 0, 1, 2, 6, 7, 8, 12, 13, 14 };
-
-const byte v440B9[9] = { 3, 4, 5, 9, 10, 11, 15, 16, 17 };
-
-const byte v440C2[18] = {
-	0, 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 16, 17, 18, 19, 20, 21
-};
+const byte adlib_operator1_offset[] = { 0, 1, 2, 8, 9, 10, 16, 17, 18 };
+const byte adlib_operator2_offset[] = { 3, 4, 5, 11, 12, 13, 19, 20, 21 };
 
 const byte v44134[64] = {
 	0, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
@@ -2843,10 +2838,10 @@ void AdlibSoundDriver::playSound(const byte *channelData, int dataOffset, int pr
 				_v4409E[channel] = dataP + offset - _patchData;
 
 				// Set sustain/release
-				int portNum = v440C2[v440B0[channel]] + 0x80;
+				int portNum = adlib_operator1_offset[channel] + 0x80;
 				write(portNum, (_portContents[portNum] & 0xF0) | 0xF);
 
-				portNum = v440C2[v440B9[channel]] + 0x80;
+				portNum = adlib_operator2_offset[channel] + 0x80;
 				write(portNum, (_portContents[portNum] & 0xF0) | 0xF);
 
 				if (_channelVoiced[channel])
@@ -2903,10 +2898,10 @@ void AdlibSoundDriver::updateChannelVolume(int channelNum) {
 	int level1 = !_v44082[channelNum] ? 63 - _v44070[channelNum] :
 		63 - v44134[volume * _v44070[channelNum] / 63];
 
-	int portNum = v440C2[v440B0[channelNum]] + 0x40;
+	int portNum = adlib_operator1_offset[channelNum] + 0x40;
 	write(portNum, (_portContents[portNum] & 0x80) | level1);
 
-	portNum = v440C2[v440B9[channelNum]] + 0x40;
+	portNum = adlib_operator2_offset[channelNum] + 0x40;
 	write(portNum, (_portContents[portNum] & 0x80) | level2);
 }
 
@@ -2923,7 +2918,7 @@ void AdlibSoundDriver::clearVoice(int channel) {
 
 void AdlibSoundDriver::updateChannel(int channel) {
 	const byte *dataP = _patchData + _v4409E[channel];
-	int portOffset = v440C2[v440B0[channel]];
+	int portOffset = adlib_operator1_offset[channel];
 
 	int portNum = portOffset + 0x20;
 	int portValue = 0;
@@ -2946,7 +2941,7 @@ void AdlibSoundDriver::updateChannel(int channel) {
 	write(0x80 + portOffset, *(dataP + 14) | (*(dataP + 13) << 4));
 	write(0xE0 + portOffset, (_portContents[0xE0 + portOffset] & 0xFC) | *(dataP + 15));
 
-	portOffset = v440C2[v440B9[channel]];
+	portOffset = adlib_operator2_offset[channel];
 	portNum = portOffset + 0x20;
 	portValue = 0;
 	if (*(dataP + 17))






More information about the Scummvm-git-logs mailing list