aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2011-06-14 23:02:25 +1000
committerPaul Gilbert2011-06-14 23:02:25 +1000
commitf47b25810a3e49adb0d95af5e3ec074e02606c54 (patch)
treeaa80bbf9409eb75459b35d9d2492c4d93fc0b864
parent8ed74c61f640c368fa9ef59addbb78a8b1f97fac (diff)
downloadscummvm-rg350-f47b25810a3e49adb0d95af5e3ec074e02606c54.tar.gz
scummvm-rg350-f47b25810a3e49adb0d95af5e3ec074e02606c54.tar.bz2
scummvm-rg350-f47b25810a3e49adb0d95af5e3ec074e02606c54.zip
TSAGE: Fix channel field copy in _sfRethinkVoiceTypes
-rw-r--r--engines/tsage/sound.cpp18
-rw-r--r--engines/tsage/sound.h1
2 files changed, 9 insertions, 10 deletions
diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp
index 878d27edba..97c7f7133f 100644
--- a/engines/tsage/sound.cpp
+++ b/engines/tsage/sound.cpp
@@ -1156,8 +1156,8 @@ void SoundManager::_sfRethinkVoiceTypes() {
++idx2;
VoiceStructEntryType1 &vse2 = vs->_entries[idx2]._type1;
- vse2._sound = sound;
- vse2._channelNum = vse._channelNum;
+ vse2._sound = vse._sound2;
+ vse2._channelNum = vse._channelNum2;
vse2._priority = vse._priority2;
vse._field4 = -1;
vse2._field5 = 0;
@@ -1941,7 +1941,7 @@ void Sound::_soServiceTrackType0(int trackIndex, const byte *channelData) {
b = static_cast<byte>(_volume * (int)b / 127);
if (voiceType != VOICETYPE_0) {
- _soProc38(vtStruct, channelNum, chVoiceType, cmdVal, v);
+ _soProc38(vtStruct, channelNum, chVoiceType, cmdVal, b);
} else if (voiceNum != -1) {
assert(driver);
driver->proc24(voiceNum, chVoiceType, this, cmdVal, b);
@@ -2117,13 +2117,13 @@ void Sound::_soProc38(VoiceTypeStruct *vtStruct, int channelNum, VoiceType voice
_soundManager->_needToRethink = true;
} else {
for (uint entryIndex = 0; entryIndex < vtStruct->_entries.size(); ++entryIndex) {
- VoiceStructEntryType1 &vte = vtStruct->_entries[entryIndex]._type1;
+ VoiceStructEntry &vte = vtStruct->_entries[entryIndex];
- if ((vte._sound == this) && (vte._channelNum == channelNum)) {
- SoundDriver *driver = vtStruct->_entries[entryIndex]._driver;
+ if ((vte._type1._sound == this) && (vte._type1._channelNum == channelNum)) {
+ SoundDriver *driver = vte._driver;
assert(driver);
- driver->proc38(vtStruct->_entries[entryIndex]._voiceNum, cmd, value);
+ driver->proc38(vte._voiceNum, cmd, value);
}
}
}
@@ -2502,8 +2502,8 @@ void AdlibSoundDriver::setPitch(int channel, int pitchBlend) {
}
void AdlibSoundDriver::write(byte reg, byte value) {
-static int num = 0;
-debug("%d [%x]=%x", ++num, reg, value);//***DEBUG****
+static int num = 1;
+debug("%d [%x]=%x", num++, reg, value);//***DEBUG****
_portContents[reg] = value;
OPLWriteReg(_opl, reg, value);
}
diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h
index 77208c16e4..de67044cd1 100644
--- a/engines/tsage/sound.h
+++ b/engines/tsage/sound.h
@@ -250,7 +250,6 @@ private:
void _unPrime();
void orientAfterRestore();
public:
- int _field0;
bool _stoppedAsynchronously;
int _soundResID;
int _group;