From 89c6f370f355a7822c99faa5ae078b580904d7a9 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sat, 9 Mar 2024 12:21:47 +0100 Subject: [PATCH] added support for PAL timing in BD engine to level editor --- src/editor.c | 12 +++++++++++- src/files.c | 8 ++++++++ src/main.h | 1 + 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/editor.c b/src/editor.c index c0f072d1..1cdf04d2 100644 --- a/src/editor.c +++ b/src/editor.c @@ -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) ---------------- diff --git a/src/files.c b/src/files.c index e0225dc2..b8ef4481 100644 --- a/src/files.c +++ b/src/files.c @@ -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; diff --git a/src/main.h b/src/main.h index c98b7d2f..06be311c 100644 --- a/src/main.h +++ b/src/main.h @@ -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 -- 2.34.1