rnd-20100313-1-src
authorHolger Schemel <info@artsoft.org>
Sat, 13 Mar 2010 14:54:03 +0000 (15:54 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:58:45 +0000 (10:58 +0200)
* integrated playing sound effects into native Supaplex game engine

22 files changed:
ChangeLog
src/conf_gfx.c
src/conf_var.c
src/conftime.h
src/events.c
src/files.c
src/game.c
src/game.h
src/game_sp/BugsTerminals.c
src/game_sp/Explosions.c
src/game_sp/Infotrons.c
src/game_sp/Murphy.c
src/game_sp/Sound.c
src/game_sp/Sound.h
src/game_sp/Zonk.c
src/game_sp/export.h
src/game_sp/main.c
src/libgame/system.h
src/main.h
src/screens.c
src/tools.c
src/tools.h

index 60f21939eec49bced32f8b87e9e35bcffb3b18e2..777cbb8555a224bd86791fedf512c96c0da8d6ab 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2010-03-13
+       * integrated playing sound effects into native Supaplex game engine
+
 2010-03-10
        * added configurable key shortcuts for the tape recorder buttons
 
index fdb49e3013fefa74b77438c1210c0c7a469e0c0c..4c924e42e13d9bb96bb45d14cffd91392cd5dee9 100644 (file)
@@ -5415,6 +5415,8 @@ struct ConfigInfo image_config[] =
   { "menu.draw_yoffset.SETUP[SHORTCUTS_2]",    "0"                     },
   { "menu.draw_xoffset.SETUP[SHORTCUTS_3]",    "0"                     },
   { "menu.draw_yoffset.SETUP[SHORTCUTS_3]",    "0"                     },
+  { "menu.draw_xoffset.SETUP[SHORTCUTS_4]",    "0"                     },
+  { "menu.draw_yoffset.SETUP[SHORTCUTS_4]",    "0"                     },
   { "menu.draw_xoffset.SETUP[CHOOSE_ARTWORK]", "0"                     },
   { "menu.draw_yoffset.SETUP[CHOOSE_ARTWORK]", "0"                     },
   { "menu.draw_xoffset.SETUP[CHOOSE_OTHER]",   "0"                     },
index 90ed0b135c96075a1297a76bf1701d96cfe1054c..13fa8959a4335966b8088f9528924be734d605c8 100644 (file)
@@ -1320,6 +1320,14 @@ struct TokenIntPtrInfo image_config_vars[] =
     "menu.draw_yoffset.SETUP[SHORTCUTS_3]",
     &menu.draw_yoffset_setup[GFX_SPECIAL_ARG_SETUP_SHORTCUTS_3]
   },
+  {
+    "menu.draw_xoffset.SETUP[SHORTCUTS_4]",
+    &menu.draw_xoffset_setup[GFX_SPECIAL_ARG_SETUP_SHORTCUTS_4]
+  },
+  {
+    "menu.draw_yoffset.SETUP[SHORTCUTS_4]",
+    &menu.draw_yoffset_setup[GFX_SPECIAL_ARG_SETUP_SHORTCUTS_4]
+  },
   {
     "menu.draw_xoffset.SETUP[CHOOSE_ARTWORK]",
     &menu.draw_xoffset_setup[GFX_SPECIAL_ARG_SETUP_CHOOSE_ARTWORK]
index 6467aafc3e399717c9563a2e97377a88b714dd31..78990a157fa288cdc6037308b63a79c4d1a3f7b2 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "2010-03-10 14:11"
+#define COMPILE_DATE_STRING "2010-03-13 15:52"
index b9b5b8621ffde3e25c1d15a06c9f6543a1782bb2..3284723c75fbba3298cd7a3bb66e7e94eae104ad 100644 (file)
@@ -764,6 +764,7 @@ void HandleKey(Key key, int key_status)
       TapeTogglePause(TAPE_TOGGLE_MANUAL);
 
     HandleTapeButtonKeys(key);
+    HandleSoundButtonKeys(key);
   }
 
   if (game_status == GAME_MODE_PLAYING && !network_playing)
index 205c371ad71868f4ccca190d1900a0f5174ae25a..2e58ad30240e469571637a99b075a5267d87dd4d 100644 (file)
@@ -4282,25 +4282,8 @@ void CopyNativeLevel_RND_to_SP(struct LevelInfo *level)
   level_sp->height = level->fieldy;
 
   for (x = 0; x < level->fieldx; x++)
-  {
     for (y = 0; y < level->fieldy; y++)
-    {
-      int element_old = level->field[x][y];
-      int element_new;
-
-      if (element_old >= EL_SP_START &&
-         element_old <= EL_SP_END)
-       element_new = element_old - EL_SP_START;
-      else if (element_old == EL_EMPTY_SPACE)
-       element_new = 0x00;
-      else if (element_old == EL_INVISIBLE_WALL)
-       element_new = 0x28;
-      else
-       element_new = 0x20;     /* map unknown elements to yellow "hardware" */
-
-      level_sp->playfield[x][y] = element_new;
-    }
-  }
+      level_sp->playfield[x][y] = map_element_RND_to_SP(level->field[x][y]);
 
   header->InitialGravity = (level->initial_player_gravity[0] ? 1 : 0);
 
@@ -4387,20 +4370,12 @@ void CopyNativeLevel_SP_to_RND(struct LevelInfo *level)
     for (y = 0; y < level->fieldy; y++)
     {
       int element_old = level_sp->playfield[x][y];
-      int element_new;
+      int element_new = getMappedElement(map_element_SP_to_RND(element_old));
 
-      if (element_old <= 0x27)
-       element_new = getMappedElement(EL_SP_START + element_old);
-      else if (element_old == 0x28)
-       element_new = EL_INVISIBLE_WALL;
-      else
-      {
+      if (element_new == EL_UNKNOWN)
        Error(ERR_WARN, "invalid element %d at position %d, %d",
              element_old, x, y);
 
-       element_new = EL_UNKNOWN;
-      }
-
       level->field[x][y] = element_new;
     }
   }
@@ -9008,8 +8983,11 @@ void SaveScore(int nr)
 #define SETUP_TOKEN_SHORTCUT_TAPE_PAUSE                10
 #define SETUP_TOKEN_SHORTCUT_TAPE_RECORD       11
 #define SETUP_TOKEN_SHORTCUT_TAPE_PLAY         12
+#define SETUP_TOKEN_SHORTCUT_SOUND_SIMPLE      13
+#define SETUP_TOKEN_SHORTCUT_SOUND_LOOPS       14
+#define SETUP_TOKEN_SHORTCUT_SOUND_MUSIC       15
 
-#define NUM_SHORTCUT_SETUP_TOKENS              13
+#define NUM_SHORTCUT_SETUP_TOKENS              16
 
 /* player setup */
 #define SETUP_TOKEN_PLAYER_USE_JOYSTICK                0
@@ -9159,6 +9137,9 @@ static struct TokenInfo shortcut_setup_tokens[] =
   { TYPE_KEY_X11, &ssi.tape_pause,     "shortcut.tape_pause"           },
   { TYPE_KEY_X11, &ssi.tape_record,    "shortcut.tape_record"          },
   { TYPE_KEY_X11, &ssi.tape_play,      "shortcut.tape_play"            },
+  { TYPE_KEY_X11, &ssi.sound_simple,   "shortcut.sound_simple"         },
+  { TYPE_KEY_X11, &ssi.sound_loops,    "shortcut.sound_loops"          },
+  { TYPE_KEY_X11, &ssi.sound_music,    "shortcut.sound_music"          },
 };
 
 static struct TokenInfo player_setup_tokens[] =
@@ -9281,6 +9262,10 @@ static void setSetupInfoToDefaults(struct SetupInfo *si)
   si->shortcut.tape_record     = DEFAULT_KEY_TAPE_RECORD;
   si->shortcut.tape_play       = DEFAULT_KEY_TAPE_PLAY;
 
+  si->shortcut.sound_simple    = DEFAULT_KEY_SOUND_SIMPLE;
+  si->shortcut.sound_loops     = DEFAULT_KEY_SOUND_LOOPS;
+  si->shortcut.sound_music     = DEFAULT_KEY_SOUND_MUSIC;
+
   for (i = 0; i < MAX_PLAYERS; i++)
   {
     si->input[i].use_joystick = FALSE;
index d19831759e264f2419d09ad36316986eefa617ae..4874b346fa25eb6e6d93202114740d033fe86e8b 100644 (file)
@@ -16208,6 +16208,21 @@ void PlayLevelSound_EM(int xx, int yy, int element_em, int sample)
   }
 }
 
+void PlayLevelSound_SP(int xx, int yy, int element_sp, int action_sp)
+{
+  int element = map_element_SP_to_RND(element_sp);
+  int action = map_action_SP_to_RND(action_sp);
+  int offset = (setup.sp_show_border_elements ? 0 : 1);
+  int x = xx - offset;
+  int y = yy - offset;
+
+#if 0
+  printf("::: %d -> %d\n", element_sp, action_sp);
+#endif
+
+  PlayLevelSoundElementAction(x, y, element, action);
+}
+
 #if 0
 void ChangeTime(int value)
 {
@@ -16863,10 +16878,8 @@ void RedrawGameButtons()
     RedrawGadget(game_gadget[i]);
 }
 
-static void HandleGameButtons(struct GadgetInfo *gi)
+static void HandleGameButtonsExt(int id)
 {
-  int id = gi->custom_id;
-
   if (game_status != GAME_MODE_PLAYING)
     return;
 
@@ -16912,6 +16925,7 @@ static void HandleGameButtons(struct GadgetInfo *gi)
       if (setup.sound_music)
       { 
        setup.sound_music = FALSE;
+
        FadeMusic();
       }
       else if (audio.music_available)
@@ -16930,6 +16944,7 @@ static void HandleGameButtons(struct GadgetInfo *gi)
       else if (audio.loops_available)
       {
        setup.sound = setup.sound_loops = TRUE;
+
        SetAudioMode(setup.sound);
       }
       break;
@@ -16940,6 +16955,7 @@ static void HandleGameButtons(struct GadgetInfo *gi)
       else if (audio.sound_available)
       {
        setup.sound = setup.sound_simple = TRUE;
+
        SetAudioMode(setup.sound);
       }
       break;
@@ -16948,3 +16964,27 @@ static void HandleGameButtons(struct GadgetInfo *gi)
       break;
   }
 }
+
+static void HandleGameButtons(struct GadgetInfo *gi)
+{
+  HandleGameButtonsExt(gi->custom_id);
+}
+
+void HandleSoundButtonKeys(Key key)
+{
+#if 1
+  if (key == setup.shortcut.sound_simple)
+    ClickOnGadget(game_gadget[SOUND_CTRL_ID_SIMPLE], MB_LEFTBUTTON);
+  else if (key == setup.shortcut.sound_loops)
+    ClickOnGadget(game_gadget[SOUND_CTRL_ID_LOOPS], MB_LEFTBUTTON);
+  else if (key == setup.shortcut.sound_music)
+    ClickOnGadget(game_gadget[SOUND_CTRL_ID_MUSIC], MB_LEFTBUTTON);
+#else
+  if (key == setup.shortcut.sound_simple)
+    HandleGameButtonsExt(SOUND_CTRL_ID_SIMPLE);
+  else if (key == setup.shortcut.sound_loops)
+    HandleGameButtonsExt(SOUND_CTRL_ID_LOOPS);
+  else if (key == setup.shortcut.sound_music)
+    HandleGameButtonsExt(SOUND_CTRL_ID_MUSIC);
+#endif
+}
index f6c93315ceefb04b9b371d8527cfd4f325f19774..f5bf7bbf37fdb9ca2d0ab635fdc54c3d3c47736e 100644 (file)
@@ -340,6 +340,7 @@ void ScrollLevel(int, int);
 
 void InitPlayLevelSound();
 void PlayLevelSound_EM(int, int, int, int);
+void PlayLevelSound_SP(int, int, int, int);
 
 void RaiseScore(int);
 void RaiseScoreElement(int);
@@ -360,4 +361,6 @@ void FreeGameButtons();
 void UnmapGameButtons();
 void RedrawGameButtons();
 
+void HandleSoundButtonKeys(Key);
+
 #endif
index 17fc9a0fe459b5f726459ff14aba79f5d8c5a68a..b7f7862d95da86049bb6256b68516ea81170d836 100644 (file)
@@ -75,34 +75,38 @@ int subAnimateBugs(int si)
 #endif
 
   // now the bug is active! Beware Murphy!
-  if ((ByteMask && PlayField16[si - FieldWidth - 1]) == fiMurphy)
+  if ((ByteMask & PlayField16[si - FieldWidth - 1]) == fiMurphy)
     goto markPlaySound;
 
-  if ((ByteMask && PlayField16[si - FieldWidth]) == fiMurphy)
+  if ((ByteMask & PlayField16[si - FieldWidth]) == fiMurphy)
     goto markPlaySound;
 
-  if ((ByteMask && PlayField16[si - FieldWidth + 1]) == fiMurphy)
+  if ((ByteMask & PlayField16[si - FieldWidth + 1]) == fiMurphy)
     goto markPlaySound;
 
-  if ((ByteMask && PlayField16[si - 1]) == fiMurphy)
+  if ((ByteMask & PlayField16[si - 1]) == fiMurphy)
     goto markPlaySound;
 
-  if ((ByteMask && PlayField16[si + 1]) == fiMurphy)
+  if ((ByteMask & PlayField16[si + 1]) == fiMurphy)
     goto markPlaySound;
 
-  if ((ByteMask && PlayField16[si + FieldWidth - 1]) == fiMurphy)
+  if ((ByteMask & PlayField16[si + FieldWidth - 1]) == fiMurphy)
     goto markPlaySound;
 
-  if ((ByteMask && PlayField16[si + FieldWidth]) == fiMurphy)
+  if ((ByteMask & PlayField16[si + FieldWidth]) == fiMurphy)
     goto markPlaySound;
 
-  if ((ByteMask && PlayField16[si + FieldWidth + 1]) == fiMurphy)
+  if ((ByteMask & PlayField16[si + FieldWidth + 1]) == fiMurphy)
     goto markPlaySound;
 
   goto markDisplay;
 
 markPlaySound:
+#if 1
+  subSoundFX(si, fiBug, actActive);    // play dangerous sound
+#else
   subSoundFXBug(); // play dangerous sound
+#endif
 
 markDisplay:
   // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
index 8983a3781b131c0889435dba76e7eafe57babb27..0d2ec1a0bf1996b163f54cd94ff0946bae1ef8ae 100644 (file)
@@ -154,7 +154,11 @@ void ExplodeFieldSP(int si)
   GfxGraphic[GetX(si)][GetY(si)] = -1;         // restart for chain-explosions
 
   // loc_g_2C3B:
+#if 1
+  subSoundFX(si, ax, actExploding);
+#else
   subSoundFXExplosion();
+#endif
 } // ExplodeFieldSP
 
 static void LetExplodeFieldSP(int tsi, int cx, int dh)
index aae2d00e24857695cd757f6ccad18c140d5a1993..49d23c5cd19d1999d2375062e88d40eaa5b8bf44 100644 (file)
@@ -173,7 +173,19 @@ loc_g_1242: // infotron comes falling from above
   if (ax == fiOrangeDisk) // orange disk hit
     goto loc_g_1386;
 
+#if 1
+
+#if 1
+  // play the infotron sound, 'cause infotron hits something "hard"
+  subSoundFX(si, fiInfotron, actImpact);
+#else
+ // play the zonk sound, 'cause zonk hits something "hard"
+  subSoundFX(si, fiZonk, actImpact);
+#endif
+
+#else
   subSoundFXZonk(); // play the zonk sound,'cause zonk hits something "hard"
+#endif
 
   if (! (ax == fiZonk || ax == fiInfotron || ax == fiRAM))
     return subAnimateInfotrons;
index 849e685cef5cc7df62d96a63a42ed6948f50258b..ae4fd7641cdabf3b0995e54db3cec0cfd44c7482 100644 (file)
@@ -755,7 +755,12 @@ loc_g_63C2:
   // ==========================================================================
 
 loc_g_63D3:
+#if 1
+  subSoundFX(*si, fiBase, actDigging);
+#else
   subSoundFXBase();
+#endif
+
   dx = (MurphyVarFaceLeft == 0 ? aniFramesMurphyEatUpRight : aniFramesMurphyEatUpLeft);
   dx1 = (MurphyVarFaceLeft == 0 ? aniMurphyDigUpRight : aniMurphyDigUpLeft);
   PlayField16[*si - FieldWidth] = 0x503;
@@ -781,7 +786,12 @@ loc_g_640B:
   // ==========================================================================
 
 loc_g_641C:
+#if 1
+  subSoundFX(*si, fiBase, actDigging);
+#else
   subSoundFXBase();
+#endif
+
   dx = aniFramesMurphyEatLeft;
   dx1 = aniMurphyDigLeft;
   PlayField16[*si - 1] = 0x203;
@@ -807,7 +817,12 @@ loc_g_6448:
   // ==========================================================================
 
 loc_g_6459:
+#if 1
+  subSoundFX(*si, fiBase, actDigging);
+#else
   subSoundFXBase();
+#endif
+
   dx = (MurphyVarFaceLeft == 0 ? aniFramesMurphyEatUpRight : aniFramesMurphyEatUpLeft);
   dx1 = (MurphyVarFaceLeft == 0 ? aniMurphyDigUpRight : aniMurphyDigUpLeft);
   PlayField16[*si + FieldWidth] = 0x703;
@@ -833,7 +848,12 @@ loc_g_6491:
   // ==========================================================================
 
 loc_g_64A2:
+#if 1
+  subSoundFX(*si, fiBase, actDigging);
+#else
   subSoundFXBase();
+#endif
+
   dx = aniFramesMurphyEatRight;
   dx1 = aniMurphyDigRight;
   PlayField16[*si + 1] = 0x803;
@@ -860,7 +880,12 @@ loc_g_64CE:
 
 loc_g_64DF:
   subCopyImageToScreen(*si, aniMurphyTouchUp);
+#if 1
+  subSoundFX(*si, fiBase, actDigging);
+#else
   subSoundFXBase();
+#endif
+
   dx = aniFramesTouchBase;
   dx1 = aniTouchBase;
   dxPos = *si - FieldWidth;
@@ -886,7 +911,12 @@ loc_g_650C:
 
 loc_g_651D:
   subCopyImageToScreen(*si, aniMurphyTouchLeft);
+#if 1
+  subSoundFX(*si, fiBase, actDigging);
+#else
   subSoundFXBase();
+#endif
+
   dx = aniFramesTouchBase;
   dx1 = aniTouchBase;
   dxPos = *si - 1;
@@ -912,7 +942,12 @@ loc_g_654A:
 
 loc_g_655B:
   subCopyImageToScreen(*si, aniMurphyTouchDown);
+#if 1
+  subSoundFX(*si, fiBase, actDigging);
+#else
   subSoundFXBase();
+#endif
+
   dx = aniFramesTouchBase;
   dx1 = aniTouchBase;
   dxPos = *si + FieldWidth;
@@ -938,7 +973,12 @@ loc_g_6588:
 
 loc_g_6599:
   subCopyImageToScreen(*si, aniMurphyTouchRight);
+#if 1
+  subSoundFX(*si, fiBase, actDigging);
+#else
   subSoundFXBase();
+#endif
+
   dx = aniFramesTouchBase;
   dx1 = aniTouchBase;
   dxPos = *si + 1;
@@ -950,7 +990,12 @@ loc_g_6599:
   // ==========================================================================
 
 loc_g_65C6:
+#if 1
+  subSoundFX(*si, fiInfotron, actCollecting);
+#else
   subSoundFXInfotron();
+#endif
+
   dx = (MurphyVarFaceLeft == 0 ? aniFramesMurphyEatUpRight : aniFramesMurphyEatUpLeft);
   dx1 = (MurphyVarFaceLeft == 0 ? aniMurphyEatUpRight : aniMurphyEatUpLeft);
   PlayField16[*si - FieldWidth] = 0x903;
@@ -963,7 +1008,12 @@ loc_g_65C6:
   // ==========================================================================
 
 loc_g_65FE:
+#if 1
+  subSoundFX(*si, fiInfotron, actCollecting);
+#else
   subSoundFXInfotron();
+#endif
+
   dx = aniFramesEatInfotronLeft;
   dx1 = aniEatInfotronLeft;
 #if 0
@@ -981,7 +1031,12 @@ loc_g_65FE:
   // ==========================================================================
 
 loc_g_662A:
+#if 1
+  subSoundFX(*si, fiInfotron, actCollecting);
+#else
   subSoundFXInfotron();
+#endif
+
   dx = (MurphyVarFaceLeft == 0 ? aniFramesMurphyEatUpRight : aniFramesMurphyEatUpLeft);
   dx1 = (MurphyVarFaceLeft == 0 ? aniMurphyEatUpRight : aniMurphyEatUpLeft);
   PlayField16[*si + FieldWidth] = 0xB03;
@@ -994,7 +1049,12 @@ loc_g_662A:
   // ==========================================================================
 
 loc_g_6662:
+#if 1
+  subSoundFX(*si, fiInfotron, actCollecting);
+#else
   subSoundFXInfotron();
+#endif
+
   dx = aniFramesEatInfotronRight;
   dx1 = aniEatInfotronRight;
 #if 0
@@ -1013,7 +1073,12 @@ loc_g_6662:
 
 loc_g_668E:
   subCopyImageToScreen(*si, aniMurphyTouchUp);
+#if 1
+  subSoundFX(*si, fiInfotron, actCollecting);
+#else
   subSoundFXInfotron();
+#endif
+
   dx = aniFramesTouchInfotron;
   dx1 = aniTouchInfotron;
   MovHighByte(&PlayField16[*si], 0x14);
@@ -1026,7 +1091,12 @@ loc_g_668E:
 
 loc_g_66C0:
   subCopyImageToScreen(*si, aniMurphyTouchLeft);
+#if 1
+  subSoundFX(*si, fiInfotron, actCollecting);
+#else
   subSoundFXInfotron();
+#endif
+
   dx = aniFramesTouchInfotron;
   dx1 = aniTouchInfotron;
   MovHighByte(&PlayField16[*si], 0x15);
@@ -1039,7 +1109,12 @@ loc_g_66C0:
 
 loc_g_66F2:
   subCopyImageToScreen(*si, aniMurphyTouchDown);
+#if 1
+  subSoundFX(*si, fiInfotron, actCollecting);
+#else
   subSoundFXInfotron();
+#endif
+
   dx = aniFramesTouchInfotron;
   dx1 = aniTouchInfotron;
   MovHighByte(&PlayField16[*si], 0x16);
@@ -1052,7 +1127,12 @@ loc_g_66F2:
 
 loc_g_6724:
   subCopyImageToScreen(*si, aniMurphyTouchRight);
+#if 1
+  subSoundFX(*si, fiInfotron, actCollecting);
+#else
   subSoundFXInfotron();
+#endif
+
   dx = aniFramesTouchInfotron;
   dx1 = aniTouchInfotron;
   MovHighByte(&PlayField16[*si], 0x17);
@@ -1081,7 +1161,12 @@ loc_g_6756:
   game_sp.LevelSolved = TRUE;
 #endif
 
+#if 1
+  subSoundFX(*si, fiExit, actPassing);
+#else
   subSoundFXExit();
+#endif
+
   data_h_DemoDone = 1; // EP set level success bytes
   LevelStatus = 1; // set Level Status DONE
   EP_GameDemoVar0DAA = 0; // force demo for lead-out
@@ -1597,8 +1682,36 @@ locProceedMovingMurphy: // proceed moving murphy
 
   ax = ax - 1;   // next picture of sequence
   MovingPictureSequencePhase = ax;            // store for later
+
   if (ax == 0) // Sound effects
+#if 1
+  {
+    switch (HighByte(PlayField16[*si]))
+    {
+      case 0xE:
+      case 0xF:
+       subSoundFX(*si, fiZonk, actPushing);
+       break;
+
+      case 0x28:
+      case 0x29:
+       subSoundFX(*si, fiOrangeDisk, actPushing);
+       break;
+
+      case 0x24:
+      case 0x25:
+      case 0x26:
+      case 0x27:
+       subSoundFX(*si, fiYellowDisk, actPushing);
+       break;
+
+      default:
+       break;
+    }
+  }
+#else
     subSoundFXPush();
+#endif
 
   bl = HighByte(PlayField16[*si]);
   if (bl == 0xE)        // Push Zonk to left
@@ -2531,7 +2644,12 @@ loc_g_747F:
   RedDiskReleasePhase = 2;
   RedDiskCount = RedDiskCount - 1;
   subDisplayRedDiskCount();
+
+#if 1
+  subSoundFX(*si, fiRedDisk, actDropping);
+#else
   subSoundFXPush();                 // Sound effects
+#endif
 } // subAnimateMurphy
 
 // ==========================================================================
index b17c41936a5ce69cdec7cc7254a22f3a7c9c5a15..1284e58c30988017e6e0a98e72ee4867d5bd301b 100644 (file)
@@ -208,6 +208,14 @@ void subSoundFXExit()
 #endif
 }
 
+void subSoundFX(int si, int element, int action)
+{
+  int x = GetX(si);
+  int y = GetY(si);
+
+  PlayLevelSound_SP(x, y, element, action);
+}
+
 void subMusicInit()
 {
 }
index 30baa6c45e818ab5ea231e245c195276f73eb272..445a4348cd6fb803bccedfd5206bafa706a927ee 100644 (file)
@@ -22,6 +22,8 @@ extern void subSoundFXInfotron();
 extern void subSoundFXPush();
 extern void subSoundFXZonk();
 
+extern void subSoundFX(int, int, int);
+
 extern int FXOnFlag;
 extern int MusicOnFlag;
 
index b19c003346c0b898e09bf6f28924279e7b8e1326..f047a6102581bef34173366e364f4e415d1b5e0e 100644 (file)
@@ -183,7 +183,12 @@ loc_g_0DE8: // zonk comes falling from above
   if (ax == fiOrangeDisk) // OrangeDisk explodes 'loc_g_0E95:
     goto loc_g_0F75;
 
+#if 1
+  // play the zonk sound, 'cause zonk hits something "hard"
+  subSoundFX(si, fiZonk, actImpact);
+#else
   subSoundFXZonk(); // play the zonk sound,'cause zonk hits something "hard"
+#endif
 
   if (! (ax == fiZonk || ax == fiInfotron || ax == fiRAM))
     return subAnimateZonks;
index 9e374dc52e752118fc3068b545105bea0ff75524..ca5912b60d58aada1abb3511adda8b241a0f6cd6 100644 (file)
 #define SP_MAX_TAPE_LEN                        64010   /* (see "spfix63.doc") */
 
 
+/* sound actions */
+
+#define actActive                      0
+#define actImpact                      1
+#define actExploding                   2
+#define actDigging                     3
+#define actSnapping                    4
+#define actCollecting                  5
+#define actPassing                     6
+#define actPushing                     7
+#define actDropping                    8
+
+
 /* ------------------------------------------------------------------------- */
 /* data structure definitions                                                */
 /* ------------------------------------------------------------------------- */
index b73da64f9d4ffc6de9a9919e6963b96f3bc3dc5a..299a63b509b71ba835b250ee2071cb1d00dfc143 100644 (file)
@@ -109,6 +109,8 @@ void GameActions_SP(byte action[MAX_PLAYERS], boolean warp_mode)
   byte single_player_action = action[0];
   int x, y;
 
+  UpdateEngineValues(mScrollX / TILEX, mScrollY / TILEY);
+
   subMainGameLoop_Main(single_player_action, warp_mode);
 
   RedrawPlayfield_SP(FALSE);
index aeab9c23cd3b737240c53fd2a4bc88f8a65961e5..3d01171833a95b0d83c60648ef02ed434225b719 100644 (file)
@@ -77,6 +77,9 @@
 #define DEFAULT_KEY_TAPE_PAUSE         KSYM_UNDEFINED
 #define DEFAULT_KEY_TAPE_RECORD                KSYM_UNDEFINED
 #define DEFAULT_KEY_TAPE_PLAY          KSYM_UNDEFINED
+#define DEFAULT_KEY_SOUND_SIMPLE       KSYM_UNDEFINED
+#define DEFAULT_KEY_SOUND_LOOPS                KSYM_UNDEFINED
+#define DEFAULT_KEY_SOUND_MUSIC                KSYM_UNDEFINED
 
 /* values for key_status */
 #define KEY_NOT_PRESSED                        FALSE
@@ -845,6 +848,10 @@ struct SetupShortcutInfo
   Key tape_pause;
   Key tape_record;
   Key tape_play;
+
+  Key sound_simple;
+  Key sound_loops;
+  Key sound_music;
 };
 
 struct SetupSystemInfo
index 56ecbd16a67dbeabac69dadc4ffd331e1411cd83..739d5be21c0185df8f84a03d4468a0346cb35044 100644 (file)
 #define GFX_SPECIAL_ARG_SETUP_SHORTCUTS_1      8
 #define GFX_SPECIAL_ARG_SETUP_SHORTCUTS_2      9
 #define GFX_SPECIAL_ARG_SETUP_SHORTCUTS_3      10
-#define GFX_SPECIAL_ARG_SETUP_CHOOSE_ARTWORK   11
-#define GFX_SPECIAL_ARG_SETUP_CHOOSE_OTHER     12
+#define GFX_SPECIAL_ARG_SETUP_SHORTCUTS_4      11
+#define GFX_SPECIAL_ARG_SETUP_CHOOSE_ARTWORK   12
+#define GFX_SPECIAL_ARG_SETUP_CHOOSE_OTHER     13
 
-#define NUM_SPECIAL_GFX_SETUP_ARGS             13
+#define NUM_SPECIAL_GFX_SETUP_ARGS             14
 
 
 /* values for image configuration suffixes */
index 74690d7fd3ce52c2a6cc59228950b3a3ac41cde4..87f4a3e0ee124af6f93583f740b77695dc80ba26 100644 (file)
 #define SETUP_MODE_SHORTCUTS_1         8
 #define SETUP_MODE_SHORTCUTS_2         9
 #define SETUP_MODE_SHORTCUTS_3         10
+#define SETUP_MODE_SHORTCUTS_4         11
 
 /* sub-screens on the setup screen (generic) */
-#define SETUP_MODE_CHOOSE_ARTWORK      11
-#define SETUP_MODE_CHOOSE_OTHER                12
+#define SETUP_MODE_CHOOSE_ARTWORK      12
+#define SETUP_MODE_CHOOSE_OTHER                13
 
 /* sub-screens on the setup screen (specific) */
-#define SETUP_MODE_CHOOSE_GAME_SPEED   13
-#define SETUP_MODE_CHOOSE_SCREEN_MODE  14
-#define SETUP_MODE_CHOOSE_SCROLL_DELAY 15
-#define SETUP_MODE_CHOOSE_GRAPHICS     16
-#define SETUP_MODE_CHOOSE_SOUNDS       17
-#define SETUP_MODE_CHOOSE_MUSIC                18
+#define SETUP_MODE_CHOOSE_GAME_SPEED   14
+#define SETUP_MODE_CHOOSE_SCREEN_MODE  15
+#define SETUP_MODE_CHOOSE_SCROLL_DELAY 16
+#define SETUP_MODE_CHOOSE_GRAPHICS     17
+#define SETUP_MODE_CHOOSE_SOUNDS       18
+#define SETUP_MODE_CHOOSE_MUSIC                19
 
-#define MAX_SETUP_MODES                        19
+#define MAX_SETUP_MODES                        20
 
 /* for input setup functions */
 #define SETUPINPUT_SCREEN_POS_START    0
@@ -234,7 +235,7 @@ static struct
                                 INFO_MODE_MAIN)
 
 #define DRAW_MODE_SETUP(i)     ((i) >= SETUP_MODE_MAIN &&              \
-                                (i) <= SETUP_MODE_SHORTCUTS_3 ? (i) :  \
+                                (i) <= SETUP_MODE_SHORTCUTS_4 ? (i) :  \
                                 (i) >= SETUP_MODE_CHOOSE_GRAPHICS &&   \
                                 (i) <= SETUP_MODE_CHOOSE_MUSIC ?       \
                                 SETUP_MODE_CHOOSE_ARTWORK :            \
@@ -4111,6 +4112,13 @@ static void execSetupShortcuts3()
   DrawSetupScreen();
 }
 
+static void execSetupShortcuts4()
+{
+  setup_mode = SETUP_MODE_SHORTCUTS_4;
+
+  DrawSetupScreen();
+}
+
 static void execExitSetup()
 {
   game_status = GAME_MODE_MAIN;
@@ -4283,6 +4291,7 @@ static struct TokenInfo setup_info_shortcuts[] =
   { TYPE_ENTER_MENU,   execSetupShortcuts1,    "Various Keys"  },
   { TYPE_ENTER_MENU,   execSetupShortcuts2,    "Player Focus"  },
   { TYPE_ENTER_MENU,   execSetupShortcuts3,    "Tape Buttons"  },
+  { TYPE_ENTER_MENU,   execSetupShortcuts4,    "Sound & Music" },
   { TYPE_EMPTY,                NULL,                   ""                      },
   { TYPE_LEAVE_MENU,   execSetupMain,          "Back"                  },
 
@@ -4326,15 +4335,15 @@ static struct TokenInfo setup_info_shortcuts_2[] =
 
 static struct TokenInfo setup_info_shortcuts_3[] =
 {
-  { TYPE_KEYTEXT,      NULL,           "Tape Eject:",                  },
+  { TYPE_KEYTEXT,      NULL,                   "Tape Eject:",          },
   { TYPE_KEY,          &setup.shortcut.tape_eject, ""                  },
-  { TYPE_KEYTEXT,      NULL,           "Tape Stop:",                   },
+  { TYPE_KEYTEXT,      NULL,                   "Tape Stop:",           },
   { TYPE_KEY,          &setup.shortcut.tape_stop, ""                   },
-  { TYPE_KEYTEXT,      NULL,           "Tape Pause:",                  },
+  { TYPE_KEYTEXT,      NULL,                   "Tape Pause:",          },
   { TYPE_KEY,          &setup.shortcut.tape_pause, ""                  },
-  { TYPE_KEYTEXT,      NULL,           "Tape Record:",                 },
+  { TYPE_KEYTEXT,      NULL,                   "Tape Record:",         },
   { TYPE_KEY,          &setup.shortcut.tape_record, ""                 },
-  { TYPE_KEYTEXT,      NULL,           "Tape Play:",                   },
+  { TYPE_KEYTEXT,      NULL,                   "Tape Play:",           },
   { TYPE_KEY,          &setup.shortcut.tape_play, ""                   },
   { TYPE_EMPTY,                NULL,                   ""                      },
   { TYPE_LEAVE_MENU,   execSetupShortcuts,     "Back"                  },
@@ -4342,6 +4351,20 @@ static struct TokenInfo setup_info_shortcuts_3[] =
   { 0,                 NULL,                   NULL                    }
 };
 
+static struct TokenInfo setup_info_shortcuts_4[] =
+{
+  { TYPE_KEYTEXT,      NULL,           "Sound Effects (Normal):",      },
+  { TYPE_KEY,          &setup.shortcut.sound_simple, ""                },
+  { TYPE_KEYTEXT,      NULL,           "Sound Effects (Looping):",     },
+  { TYPE_KEY,          &setup.shortcut.sound_loops, ""                 },
+  { TYPE_KEYTEXT,      NULL,           "Music:",                       },
+  { TYPE_KEY,          &setup.shortcut.sound_music, ""                 },
+  { TYPE_EMPTY,                NULL,                   ""                      },
+  { TYPE_LEAVE_MENU,   execSetupShortcuts,     "Back"                  },
+
+  { 0,                 NULL,                   NULL                    }
+};
+
 static Key getSetupKey()
 {
   Key key = KSYM_UNDEFINED;
@@ -4640,6 +4663,11 @@ static void DrawSetupScreen_Generic()
     setup_info = setup_info_shortcuts_3;
     title_string = "Setup Shortcuts";
   }
+  else if (setup_mode == SETUP_MODE_SHORTCUTS_4)
+  {
+    setup_info = setup_info_shortcuts_4;
+    title_string = "Setup Shortcuts";
+  }
 
   DrawTextSCentered(mSY - SY + 16, FONT_TITLE_1, title_string);
 
index 773a59db1efd0efbe2a2ab69b5d6cf566ff7c37a..c6cd967aaf11dff43d2dfe7e6d038119a34606ce 100644 (file)
@@ -5900,6 +5900,52 @@ int map_direction_EM_to_RND(int direction)
          MV_NONE);
 }
 
+int map_element_RND_to_SP(int element_rnd)
+{
+  int element_sp = 0x20;       /* map unknown elements to yellow "hardware" */
+
+  if (element_rnd >= EL_SP_START &&
+      element_rnd <= EL_SP_END)
+    element_sp = element_rnd - EL_SP_START;
+  else if (element_rnd == EL_EMPTY_SPACE)
+    element_sp = 0x00;
+  else if (element_rnd == EL_INVISIBLE_WALL)
+    element_sp = 0x28;
+
+  return element_sp;
+}
+
+int map_element_SP_to_RND(int element_sp)
+{
+  int element_rnd = EL_UNKNOWN;
+
+  if (element_sp >= 0x00 &&
+      element_sp <= 0x27)
+    element_rnd = EL_SP_START + element_sp;
+  else if (element_sp == 0x28)
+    element_rnd = EL_INVISIBLE_WALL;
+
+  return element_rnd;
+}
+
+int map_action_SP_to_RND(int action_sp)
+{
+  switch (action_sp)
+  {
+    case actActive:            return ACTION_ACTIVE;
+    case actImpact:            return ACTION_IMPACT;
+    case actExploding:         return ACTION_EXPLODING;
+    case actDigging:           return ACTION_DIGGING;
+    case actSnapping:          return ACTION_SNAPPING;
+    case actCollecting:                return ACTION_COLLECTING;
+    case actPassing:           return ACTION_PASSING;
+    case actPushing:           return ACTION_PUSHING;
+    case actDropping:          return ACTION_DROPPING;
+
+    default:                   return ACTION_DEFAULT;
+  }
+}
+
 int get_next_element(int element)
 {
   switch (element)
index 136a305cf948777f8c1fc0277e51175eb3176092..e16b4eae3d705ca90e4ac847adfd8cf374bfad9c 100644 (file)
@@ -174,6 +174,10 @@ int map_direction_EM_to_RND(int);
 void map_android_clone_elements_RND_to_EM(struct LevelInfo *);
 void map_android_clone_elements_EM_to_RND(struct LevelInfo *);
 
+int map_element_RND_to_SP(int);
+int map_element_SP_to_RND(int);
+int map_action_SP_to_RND(int);
+
 int get_next_element(int);
 int el_act_dir2img(int, int, int);
 int el_act2img(int, int);