From f47b25810a3e49adb0d95af5e3ec074e02606c54 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 14 Jun 2011 23:02:25 +1000 Subject: TSAGE: Fix channel field copy in _sfRethinkVoiceTypes --- engines/tsage/sound.cpp | 18 +++++++++--------- engines/tsage/sound.h | 1 - 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(_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; -- cgit v1.2.3