Add code to check for Infocom games that use bleeps, but don't set SOUND_FLAG.
authorDavid Griffith <dave@661.org>
Wed, 19 Jun 2019 08:27:55 +0000 (01:27 -0700)
committerDavid Griffith <dave@661.org>
Wed, 19 Jun 2019 08:27:55 +0000 (01:27 -0700)
This may be useful later on when os_beep() is rewritten to make high and low
noises.  Right now this code does nothing.

src/common/fastmem.c
src/common/frotz.h
src/common/setup.h
src/common/sound.c
src/curses/ux_init.c

index 52378d14d4dfe5390de7cb2ff8d199f937e87b9f..22369d825a51a133da89e0cbaadfc8640413a25f 100644 (file)
@@ -314,6 +314,15 @@ void init_memory (void)
        { LURKING_HORROR, 203, "870506" },
        { LURKING_HORROR, 219, "870912" },
        { LURKING_HORROR, 221, "870918" },
+       {    BUREAUCRACY,  86, "870212" },
+       {    BUREAUCRACY, 116, "870602" },
+       {    BUREAUCRACY, 160, "880521" },
+       {        TRINITY,   1, "851202" },
+       {        TRINITY,  14, "860313" },
+       {        TRINITY,   1, "860221" },
+       {        TRINITY,  11, "860509" },
+       {        TRINITY,  12, "860926" },
+       {        TRINITY,  15, "870628" },
        {        UNKNOWN,   0, "------" }
     };
 
index d78d62dc61bcf3fb5ff50cfef64743a69dc2309a..e09480ac9a31e5be8fe4dc131f253a8012a477f8 100644 (file)
@@ -105,6 +105,8 @@ enum story {
     ARTHUR,
     JOURNEY,
     LURKING_HORROR,
+    BUREAUCRACY,
+    TRINITY,
     UNKNOWN
 };
 
index e81e5e827b3a082939a0147fecc69d7ee589a983..0c1ab35df7e8bee023389984190741934e9d1c62 100644 (file)
@@ -19,6 +19,7 @@ typedef struct frotz_setup_struct {
        int script_cols;
        int sound;
        int sound_flag;
+       int bleep;
        int err_report_mode;
 
        char *story_file;
index 9c0bc7d5514ee7fdb7929d10a7f4c213e1c93d2e..4656a3ae0fe854da992383ead801a7c38dbf8113 100644 (file)
@@ -48,6 +48,23 @@ static bool playing = FALSE;
  */
 void init_sound (void)
 {
+
+    /* These games use sound effects numbers 1 and 2, which are defined
+     * as high and low "bleeps" respectively, yet they do not set SOUND_FLAG
+     * or OLD_SOUND_FLAG.  Note that OLD_SOUND_FLAG uses the same bit as does
+     * UNDO_FLAG, but the former is only for V3 games and the latter for V5+.
+     *
+     * Currently os_beep() just rings the terminal, so f_setup.bleep isn't
+     * yet being used.
+     */
+    switch (story_id) {
+       case TRINITY:
+       case BUREAUCRACY:
+       case AMFV:      f_setup.bleep = TRUE;
+                       break;
+       default:        break;
+    }
+
     if ((h_flags & SOUND_FLAG) || (h_version == V3 && (h_flags & OLD_SOUND_FLAG))) {
        f_setup.sound_flag = TRUE;
        locked = FALSE;
index aa4fbb86ed236a4b8580486e5a70677c161b7b52..a511a897a3a3aea7a6c9d18a792e223bb7666da3 100644 (file)
@@ -1096,6 +1096,8 @@ void os_init_setup(void)
        f_setup.expand_abbreviations = 0;
        f_setup.script_cols = 80;
        f_setup.sound = 1;
+       f_setup.sound_flag = 0;
+       f_setup.bleep = 0;
        f_setup.err_report_mode = ERR_DEFAULT_REPORT_MODE;
        f_setup.restore_mode = 0;