aboutsummaryrefslogtreecommitdiff
path: root/engines/tsage/sound.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2011-06-16 22:00:33 +1000
committerPaul Gilbert2011-06-16 22:00:33 +1000
commit15bc708610822d98133ff5fefb52ca55fa8ddd83 (patch)
tree357e60e937ca28eb21b668c05974983a30d9a983 /engines/tsage/sound.cpp
parenta7ee13a1ec6fab12374b784bd7b0c8335e184ea5 (diff)
downloadscummvm-rg350-15bc708610822d98133ff5fefb52ca55fa8ddd83.tar.gz
scummvm-rg350-15bc708610822d98133ff5fefb52ca55fa8ddd83.tar.bz2
scummvm-rg350-15bc708610822d98133ff5fefb52ca55fa8ddd83.zip
TSAGE: Bugfix for _sfRethinkVoiceTypes type 1 handling
Diffstat (limited to 'engines/tsage/sound.cpp')
-rw-r--r--engines/tsage/sound.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp
index f8f0cf6019..61254bb21f 100644
--- a/engines/tsage/sound.cpp
+++ b/engines/tsage/sound.cpp
@@ -778,6 +778,7 @@ void SoundManager::_sfRethinkVoiceTypes() {
int maxPriority = 0;
for (uint idx = 0; idx < vtStruct->_entries.size(); ++idx)
maxPriority = MAX(maxPriority, vtStruct->_entries[idx]._type1._priority2);
+
if (!maxPriority) {
_sfUpdateVoiceStructs2();
break;
@@ -793,11 +794,11 @@ void SoundManager::_sfRethinkVoiceTypes() {
}
} while (chNumVoices > numVoices);
- int voicesCtr = numVoices;
+ int voicesCtr = chNumVoices;
for (uint idx = 0; (idx < vtStruct->_entries.size()) && (voicesCtr > 0); ++idx) {
if (!vtStruct->_entries[idx]._type1._sound2) {
vtStruct->_entries[idx]._type1._sound2 = sound;
- vtStruct->_entries[idx]._type1._channelNum2 = idx;
+ vtStruct->_entries[idx]._type1._channelNum2 = foundIndex;
vtStruct->_entries[idx]._type1._priority2 = foundPriority;
--voicesCtr;
}
@@ -2509,7 +2510,17 @@ void AdlibSoundDriver::setPitch(int channel, int pitchBlend) {
void AdlibSoundDriver::write(byte reg, byte value) {
static int num = 1;
-debug("%d [%x]=%x", num++, reg, value);//***DEBUG****
+/*
+ if (((num - 1) % 8) == 0)
+ debugN("\n9800:%.4x ", (num - 1) * 2 + 2);
+
+ debugN("%.2x %.2x ", reg, value);
+ ++num;
+*/
+debugN("%d [%x]=%x ", num++, reg, value);//***DEBUG****
+ for (int idx = 0; idx < 16; ++idx) debugN("%d", _channelVoiced[idx] ? 1 : 0);
+ debugN("\n");
+
_portContents[reg] = value;
OPLWriteReg(_opl, reg, value);
}