diff options
author | Ludvig Strigeus | 2002-04-12 21:26:59 +0000 |
---|---|---|
committer | Ludvig Strigeus | 2002-04-12 21:26:59 +0000 |
commit | d2b0070c5f39661561484f8e2dfd6be271ed21cf (patch) | |
tree | 0e751495a08c9514e82879d78a977ad6f27469a7 /sound | |
parent | b195bb597c32384bf4ce6f9c22ffc281c0828ca4 (diff) | |
download | scummvm-rg350-d2b0070c5f39661561484f8e2dfd6be271ed21cf.tar.gz scummvm-rg350-d2b0070c5f39661561484f8e2dfd6be271ed21cf.tar.bz2 scummvm-rg350-d2b0070c5f39661561484f8e2dfd6be271ed21cf.zip |
new video engine (expect broken non-sdl builds),
simon the sorcerer 1 & 2 support (non SCUMM games)
svn-id: r3912
Diffstat (limited to 'sound')
-rw-r--r-- | sound/adlib.cpp | 2 | ||||
-rw-r--r-- | sound/gmidi.cpp | 23 | ||||
-rw-r--r-- | sound/imuse.cpp | 2 |
3 files changed, 24 insertions, 3 deletions
diff --git a/sound/adlib.cpp b/sound/adlib.cpp index 8fe6f7536e..de550d3361 100644 --- a/sound/adlib.cpp +++ b/sound/adlib.cpp @@ -113,7 +113,7 @@ MidiChannelAdl *AdlibSoundDriver::allocate_midichan(byte pri) return best; } -void AdlibSoundDriver::init(SoundEngine *eng) +void AdlibSoundDriver::init(SoundEngine *eng, OSystem *syst) { int i; MidiChannelAdl *mc; diff --git a/sound/gmidi.cpp b/sound/gmidi.cpp index 7d90614171..9fea3c0472 100644 --- a/sound/gmidi.cpp +++ b/sound/gmidi.cpp @@ -523,11 +523,32 @@ void MidiSoundDriver::part_key_off(Part *part, byte note) } } -void MidiSoundDriver::init(SoundEngine *eng) +int MidiSoundDriver::midi_driver_thread(void *param) { + MidiSoundDriver *mid = (MidiSoundDriver*) param; + int old_time, cur_time; + + old_time = mid->_system->get_msecs(); + + for(;;) { + mid->_system->delay_msecs(10); + + cur_time = mid->_system->get_msecs(); + while (old_time < cur_time) { + old_time += 10; + mid->_se->on_timer(); + } + } +} + +void MidiSoundDriver::init(SoundEngine *eng, OSystem *syst) { int i; MidiChannelGM *mc; + _system = syst; + + /* Install the on_timer thread */ + syst->create_thread(midi_driver_thread, this); _se = eng; for (i = 0, mc = _midi_channels; i != ARRAYSIZE(_midi_channels); i++, mc++) diff --git a/sound/imuse.cpp b/sound/imuse.cpp index e3068fd367..92e3333aae 100644 --- a/sound/imuse.cpp +++ b/sound/imuse.cpp @@ -999,7 +999,7 @@ int SoundEngine::initialize(Scumm *scumm, SoundDriver * driver) init_queue(); init_parts(); - _driver->init(this); + _driver->init(this, scumm->_system); _initialized = true; |