diff options
-rw-r--r-- | engines/glk/frotz/glk_interface.cpp | 20 | ||||
-rw-r--r-- | engines/glk/frotz/processor.cpp | 5 |
2 files changed, 20 insertions, 5 deletions
diff --git a/engines/glk/frotz/glk_interface.cpp b/engines/glk/frotz/glk_interface.cpp index 7367375f05..f800f73a88 100644 --- a/engines/glk/frotz/glk_interface.cpp +++ b/engines/glk/frotz/glk_interface.cpp @@ -279,11 +279,27 @@ bool GlkInterface::os_picture_data(int picture, glui32 *height, glui32 *width) { } void GlkInterface::start_sample(int number, int volume, int repeats, zword eos) { - // TODO + static zbyte LURKING_REPEATS[] = { + 0x00, 0x00, 0x00, 0x01, 0xff, + 0x00, 0x01, 0x01, 0x01, 0x01, + 0xff, 0x01, 0x01, 0xff, 0x00, + 0xff, 0xff, 0xff, 0xff, 0xff + }; + + if (_storyId == LURKING_HORROR) + repeats = LURKING_REPEATS[number]; + + os_start_sample(number, volume, repeats, eos); + + _soundPlaying = true; } void GlkInterface::start_next_sample() { - // TODO + if (next_sample != 0) + start_sample(next_sample, next_volume, 0, 0); + + next_sample = 0; + next_volume = 0; } void GlkInterface::gos_update_width() { diff --git a/engines/glk/frotz/processor.cpp b/engines/glk/frotz/processor.cpp index e9f0d87e3e..8cfff9cd1b 100644 --- a/engines/glk/frotz/processor.cpp +++ b/engines/glk/frotz/processor.cpp @@ -628,12 +628,11 @@ void Processor::z_sound_effect() { _soundPlaying = false; switch (effect) { - case EFFECT_PREPARE: - os_prepare_sample (number); + os_prepare_sample(number); break; case EFFECT_PLAY: - start_sample(number, lo (volume), hi (volume), (zargc == 4) ? zargs[3] : 0); + start_sample(number, lo(volume), hi(volume), (zargc == 4) ? zargs[3] : 0); break; case EFFECT_STOP: os_stop_sample (number); |