added support for PAL timing in BD engine to level editor
authorHolger Schemel <info@artsoft.org>
Sat, 9 Mar 2024 11:21:47 +0000 (12:21 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 9 Mar 2024 11:21:47 +0000 (12:21 +0100)
src/editor.c
src/files.c
src/main.h

index c0f072d19a14958b7b7a902ce4cee65eebffe813..1cdf04d22af28da74faf22a3c72eb023091bdcbc 100644 (file)
@@ -650,6 +650,7 @@ enum
   GADGET_ID_RANDOM_QUANTITY,
   GADGET_ID_RANDOM_RESTRICTED,
   GADGET_ID_BD_INTERMISSION,
+  GADGET_ID_BD_PAL_TIMING,
   GADGET_ID_STICK_ELEMENT,
   GADGET_ID_EM_SLIPPERY_GEMS,
   GADGET_ID_EM_EXPLODES_BY_FIRE,
@@ -968,6 +969,7 @@ enum
   ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE_3,
   ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE_2,
   ED_CHECKBUTTON_ID_BD_INTERMISSION,
+  ED_CHECKBUTTON_ID_BD_PAL_TIMING,
   ED_CHECKBUTTON_ID_STICK_ELEMENT,
   ED_CHECKBUTTON_ID_EM_SLIPPERY_GEMS,
   ED_CHECKBUTTON_ID_EM_EXPLODES_BY_FIRE,
@@ -1049,7 +1051,7 @@ enum
 #define ED_CHECKBUTTON_ID_EDITOR_LAST  ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE_2
 
 #define ED_CHECKBUTTON_ID_ENGINE_FIRST ED_CHECKBUTTON_ID_BD_INTERMISSION
-#define ED_CHECKBUTTON_ID_ENGINE_LAST  ED_CHECKBUTTON_ID_BD_INTERMISSION
+#define ED_CHECKBUTTON_ID_ENGINE_LAST  ED_CHECKBUTTON_ID_BD_PAL_TIMING
 
 #define ED_CHECKBUTTON_ID_CUSTOM1_FIRST        ED_CHECKBUTTON_ID_CUSTOM_USE_GRAPHIC
 #define ED_CHECKBUTTON_ID_CUSTOM1_LAST ED_CHECKBUTTON_ID_CUSTOM_INDESTRUCTIBLE
@@ -3254,6 +3256,14 @@ static struct
     "Boulder Dash game engine settings:", NULL,
     "intermission",                    "level is an intermission level"
   },
+  {
+    ED_CHECKBUTTON_ID_BD_PAL_TIMING,
+    ED_LEVEL_SETTINGS_XPOS(0),         ED_LEVEL_SETTINGS_YPOS(1),
+    GADGET_ID_BD_PAL_TIMING,           GADGET_ID_NONE,
+    &level.bd_pal_timing,
+    NULL, NULL,
+    "PAL timing",                      "use slower timer (like PAL C64)"
+  },
 
   // ---------- element settings: configure (various elements) ----------------
 
index e0225dc2deded68ce3c9297a7ff41dbc61314deb..b8ef44816658da29e093e0b49b72ab26afe99eae 100644 (file)
@@ -279,6 +279,12 @@ static struct LevelFileConfigInfo chunk_config_INFO[] =
     &li.bd_intermission,               FALSE
   },
 
+  {
+    -1,                                        -1,
+    TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(15),
+    &li.bd_pal_timing,                 FALSE
+  },
+
   {
     -1,                                        -1,
     -1,                                        -1,
@@ -3723,6 +3729,7 @@ static void CopyNativeLevel_RND_to_BD(struct LevelInfo *level)
 
   cave->level_speed[0]                 = 160;  // set cave speed
 
+  cave->pal_timing                     = level->bd_pal_timing;
   cave->intermission                   = level->bd_intermission;
   cave->diagonal_movements             = level->bd_diagonal_movements;
 
@@ -3752,6 +3759,7 @@ static void CopyNativeLevel_BD_to_RND(struct LevelInfo *level)
   level->score[SC_EMERALD]             = cave->diamond_value;
   level->score[SC_DIAMOND_EXTRA]       = cave->extra_diamond_value;
 
+  level->bd_pal_timing                 = cave->pal_timing;
   level->bd_intermission               = cave->intermission;
   level->bd_diagonal_movements         = cave->diagonal_movements;
 
index c98b7d2f4d32259af56c0fe6a5e5df8aa2e94894..06be311c4782b4558b1870865b4a59652abe5e5d 100644 (file)
@@ -3480,6 +3480,7 @@ struct LevelInfo
   int initial_inventory_size[MAX_PLAYERS];
   int initial_inventory_content[MAX_PLAYERS][MAX_INITIAL_INVENTORY_SIZE];
 
+  boolean bd_pal_timing;               // BD engine special timing
   boolean bd_intermission;             // BD level is intermission
   boolean bd_diagonal_movements;       // BD style diagonal movements
   boolean em_slippery_gems;            // EM style "gems slip from wall" behaviour