aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra
diff options
context:
space:
mode:
authorJohannes Schickel2006-02-27 23:41:27 +0000
committerJohannes Schickel2006-02-27 23:41:27 +0000
commit2bcd6bb95e26d1f15b560133fff49e2255bfd94d (patch)
treefb76fe8fde718f63e2146a924307ee6d9ffc1b8e /engines/kyra
parentd0bba4cb56e3589ad91f2c48c6f6c1262e7443bb (diff)
downloadscummvm-rg350-2bcd6bb95e26d1f15b560133fff49e2255bfd94d.tar.gz
scummvm-rg350-2bcd6bb95e26d1f15b560133fff49e2255bfd94d.tar.bz2
scummvm-rg350-2bcd6bb95e26d1f15b560133fff49e2255bfd94d.zip
Fixes hangs in the "Pool of Sorrow" scene (at least I don't get them anymore).
svn-id: r20964
Diffstat (limited to 'engines/kyra')
-rw-r--r--engines/kyra/sound_adlib.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/engines/kyra/sound_adlib.cpp b/engines/kyra/sound_adlib.cpp
index f1171ef16f..295e722e42 100644
--- a/engines/kyra/sound_adlib.cpp
+++ b/engines/kyra/sound_adlib.cpp
@@ -50,9 +50,7 @@ public:
// AudioStream API
int readBuffer(int16 *buffer, const int numSamples) {
memset(buffer, 0, sizeof(int16)*numSamples);
- lock();
YM3812UpdateOne(_adlib, buffer, numSamples);
- unlock();
return numSamples;
}
@@ -335,7 +333,7 @@ AdlibDriver::AdlibDriver(Audio::Mixer *mixer) {
_mixer->setupPremix(this);
// the interval should be around 13000 to 20000
- Common::g_timer->installTimerProc(&AdlibTimerCall, 15000, this);
+ Common::g_timer->installTimerProc(&AdlibTimerCall, 17000, this);
}
AdlibDriver::~AdlibDriver() {
@@ -400,6 +398,7 @@ int AdlibDriver::snd_unkOpcode1(va_list &list) {
int AdlibDriver::snd_startSong(va_list &list) {
int songId = va_arg(list, int);
_flags |= 8;
+ _flagTrigger = 1;
uint16 offset = READ_LE_UINT16(&_soundData[songId << 1]);
uint8 firstByte = *(_soundData + offset);
@@ -501,8 +500,8 @@ int AdlibDriver::snd_clearFlag(va_list &list) {
void AdlibDriver::callback() {
lock();
- //--_flagTrigger;
- //if ((int8)_flagTrigger < 0)
+ --_flagTrigger;
+ if ((int8)_flagTrigger < 0)
_flags &= 0xFFF7;
callbackOutput();
callbackProcess();
@@ -558,6 +557,7 @@ void AdlibDriver::callbackProcess() {
table.unk1 = _unkTableByte1;
}
+ // TODO: check that
table.unk4 += table.unk1;
if (table.unk4 < 0) {
if (--table.unk5) {