aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2018-12-06 20:36:09 -0800
committerPaul Gilbert2018-12-08 19:05:59 -0800
commit2ae0edd58ba0258b4f3278e334468b12a0b73573 (patch)
treef6798dcd5cc3750e01477fd91d7e3767cac54368
parent88b47cdd8bd20e54fcfdf5e98c24c8e7d0c97415 (diff)
downloadscummvm-rg350-2ae0edd58ba0258b4f3278e334468b12a0b73573.tar.gz
scummvm-rg350-2ae0edd58ba0258b4f3278e334468b12a0b73573.tar.bz2
scummvm-rg350-2ae0edd58ba0258b4f3278e334468b12a0b73573.zip
GLK: FROTZ: Add sound playing code
-rw-r--r--engines/glk/frotz/glk_interface.cpp20
-rw-r--r--engines/glk/frotz/processor.cpp5
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);