From 8555759550e214eafcb5c60bbf3f95b4baa92ef3 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Tue, 3 Dec 2024 19:59:34 +0100 Subject: [PATCH] added setup option for suicide key for BD game engine --- src/conf_gfx.c | 2 + src/files.c | 8 ++++ src/libgame/system.h | 1 + src/main.h | 1 + src/screens.c | 91 ++++++++++++++++++++++++++++---------------- 5 files changed, 70 insertions(+), 33 deletions(-) diff --git a/src/conf_gfx.c b/src/conf_gfx.c index 03aa6321..ff462771 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -9312,6 +9312,8 @@ struct ConfigInfo image_config[] = { "menu.draw_yoffset.SETUP[SHORTCUTS_5]", "0" }, { "menu.draw_xoffset.SETUP[SHORTCUTS_6]", "0" }, { "menu.draw_yoffset.SETUP[SHORTCUTS_6]", "0" }, + { "menu.draw_xoffset.SETUP[SHORTCUTS_7]", "0" }, + { "menu.draw_yoffset.SETUP[SHORTCUTS_7]", "0" }, { "menu.draw_xoffset.SETUP[CHOOSE_ARTWORK]", "0" }, { "menu.draw_yoffset.SETUP[CHOOSE_ARTWORK]", "0" }, { "menu.draw_xoffset.SETUP[CHOOSE_OTHER]", "0" }, diff --git a/src/files.c b/src/files.c index f9eabd78..f922d6e5 100644 --- a/src/files.c +++ b/src/files.c @@ -11422,6 +11422,10 @@ static struct TokenInfo shortcut_setup_tokens[] = TYPE_KEY_X11, &setup.shortcut.speed_slow, "shortcut.speed_slow" }, + { + TYPE_KEY_X11, + &setup.shortcut.suicide, "shortcut.suicide" + }, }; static struct SetupInputInfo setup_input; @@ -11667,6 +11671,10 @@ static struct TokenInfo internal_setup_tokens[] = TYPE_BOOLEAN, &setup.internal.menu_shortcuts_speed, "menu_shortcuts_speed" }, + { + TYPE_BOOLEAN, + &setup.internal.menu_shortcuts_engine, "menu_shortcuts_engine" + }, { TYPE_BOOLEAN, &setup.internal.info_title, "info_title" diff --git a/src/libgame/system.h b/src/libgame/system.h index a74ed155..36c41d6f 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -1498,6 +1498,7 @@ struct SetupInternalInfo boolean menu_shortcuts_sound; boolean menu_shortcuts_snap; boolean menu_shortcuts_speed; + boolean menu_shortcuts_engine; boolean info_title; boolean info_elements; diff --git a/src/main.h b/src/main.h index 46ae8788..83e88398 100644 --- a/src/main.h +++ b/src/main.h @@ -2884,6 +2884,7 @@ enum GFX_SPECIAL_ARG_SETUP_SHORTCUTS_4, GFX_SPECIAL_ARG_SETUP_SHORTCUTS_5, GFX_SPECIAL_ARG_SETUP_SHORTCUTS_6, + GFX_SPECIAL_ARG_SETUP_SHORTCUTS_7, GFX_SPECIAL_ARG_SETUP_CHOOSE_ARTWORK, GFX_SPECIAL_ARG_SETUP_CHOOSE_OTHER, diff --git a/src/screens.c b/src/screens.c index e8be8d71..651b6830 100644 --- a/src/screens.c +++ b/src/screens.c @@ -61,42 +61,43 @@ #define SETUP_MODE_SHORTCUTS_4 13 #define SETUP_MODE_SHORTCUTS_5 14 #define SETUP_MODE_SHORTCUTS_6 15 +#define SETUP_MODE_SHORTCUTS_7 16 // sub-screens on the setup screen (generic) -#define SETUP_MODE_CHOOSE_ARTWORK 16 -#define SETUP_MODE_CHOOSE_OTHER 17 +#define SETUP_MODE_CHOOSE_ARTWORK 17 +#define SETUP_MODE_CHOOSE_OTHER 18 // sub-screens on the setup screen (specific) -#define SETUP_MODE_CHOOSE_SCORES_TYPE 18 -#define SETUP_MODE_CHOOSE_GAME_SPEED 19 -#define SETUP_MODE_CHOOSE_SCROLL_DELAY 20 -#define SETUP_MODE_CHOOSE_SNAPSHOT_MODE 21 -#define SETUP_MODE_CHOOSE_GAME_ENGINE_TYPE 22 -#define SETUP_MODE_CHOOSE_BD_PALETTE_C64 23 -#define SETUP_MODE_CHOOSE_BD_PALETTE_C64DTV 24 -#define SETUP_MODE_CHOOSE_BD_PALETTE_ATARI 25 -#define SETUP_MODE_CHOOSE_BD_COLOR_TYPE 26 -#define SETUP_MODE_CHOOSE_WINDOW_SIZE 27 -#define SETUP_MODE_CHOOSE_SCALING_TYPE 28 -#define SETUP_MODE_CHOOSE_RENDERING 29 -#define SETUP_MODE_CHOOSE_VSYNC 30 -#define SETUP_MODE_CHOOSE_GRAPHICS 31 -#define SETUP_MODE_CHOOSE_SOUNDS 32 -#define SETUP_MODE_CHOOSE_MUSIC 33 -#define SETUP_MODE_CHOOSE_VOLUME_SIMPLE 34 -#define SETUP_MODE_CHOOSE_VOLUME_LOOPS 35 -#define SETUP_MODE_CHOOSE_VOLUME_MUSIC 36 -#define SETUP_MODE_CHOOSE_TOUCH_CONTROL 37 -#define SETUP_MODE_CHOOSE_MOVE_DISTANCE 38 -#define SETUP_MODE_CHOOSE_DROP_DISTANCE 39 -#define SETUP_MODE_CHOOSE_TRANSPARENCY 40 -#define SETUP_MODE_CHOOSE_GRID_XSIZE_0 41 -#define SETUP_MODE_CHOOSE_GRID_YSIZE_0 42 -#define SETUP_MODE_CHOOSE_GRID_XSIZE_1 43 -#define SETUP_MODE_CHOOSE_GRID_YSIZE_1 44 -#define SETUP_MODE_CONFIG_VIRT_BUTTONS 45 - -#define MAX_SETUP_MODES 46 +#define SETUP_MODE_CHOOSE_SCORES_TYPE 19 +#define SETUP_MODE_CHOOSE_GAME_SPEED 20 +#define SETUP_MODE_CHOOSE_SCROLL_DELAY 21 +#define SETUP_MODE_CHOOSE_SNAPSHOT_MODE 22 +#define SETUP_MODE_CHOOSE_GAME_ENGINE_TYPE 23 +#define SETUP_MODE_CHOOSE_BD_PALETTE_C64 24 +#define SETUP_MODE_CHOOSE_BD_PALETTE_C64DTV 25 +#define SETUP_MODE_CHOOSE_BD_PALETTE_ATARI 26 +#define SETUP_MODE_CHOOSE_BD_COLOR_TYPE 27 +#define SETUP_MODE_CHOOSE_WINDOW_SIZE 28 +#define SETUP_MODE_CHOOSE_SCALING_TYPE 29 +#define SETUP_MODE_CHOOSE_RENDERING 30 +#define SETUP_MODE_CHOOSE_VSYNC 31 +#define SETUP_MODE_CHOOSE_GRAPHICS 32 +#define SETUP_MODE_CHOOSE_SOUNDS 33 +#define SETUP_MODE_CHOOSE_MUSIC 34 +#define SETUP_MODE_CHOOSE_VOLUME_SIMPLE 35 +#define SETUP_MODE_CHOOSE_VOLUME_LOOPS 36 +#define SETUP_MODE_CHOOSE_VOLUME_MUSIC 37 +#define SETUP_MODE_CHOOSE_TOUCH_CONTROL 38 +#define SETUP_MODE_CHOOSE_MOVE_DISTANCE 39 +#define SETUP_MODE_CHOOSE_DROP_DISTANCE 40 +#define SETUP_MODE_CHOOSE_TRANSPARENCY 41 +#define SETUP_MODE_CHOOSE_GRID_XSIZE_0 42 +#define SETUP_MODE_CHOOSE_GRID_YSIZE_0 43 +#define SETUP_MODE_CHOOSE_GRID_XSIZE_1 44 +#define SETUP_MODE_CHOOSE_GRID_YSIZE_1 45 +#define SETUP_MODE_CONFIG_VIRT_BUTTONS 46 + +#define MAX_SETUP_MODES 47 #define MAX_MENU_MODES MAX(MAX_INFO_MODES, MAX_SETUP_MODES) @@ -745,7 +746,7 @@ static int align_yoffset = 0; INFO_MODE_MAIN) #define DRAW_MODE_SETUP(i) ((i) >= SETUP_MODE_MAIN && \ - (i) <= SETUP_MODE_SHORTCUTS_6 ? (i) : \ + (i) <= SETUP_MODE_SHORTCUTS_7 ? (i) : \ (i) >= SETUP_MODE_CHOOSE_GRAPHICS && \ (i) <= SETUP_MODE_CHOOSE_MUSIC ? \ SETUP_MODE_CHOOSE_ARTWORK : \ @@ -8209,6 +8210,13 @@ static void execSetupShortcuts6(void) DrawSetupScreen(); } +static void execSetupShortcuts7(void) +{ + setup_mode = SETUP_MODE_SHORTCUTS_7; + + DrawSetupScreen(); +} + static void execExitSetup(void) { SetGameStatus(GAME_MODE_MAIN); @@ -8474,6 +8482,7 @@ static struct { &setup.internal.menu_shortcuts_sound, execSetupShortcuts4 }, { &setup.internal.menu_shortcuts_snap, execSetupShortcuts5 }, { &setup.internal.menu_shortcuts_speed, execSetupShortcuts6 }, + { &setup.internal.menu_shortcuts_engine, execSetupShortcuts7 }, { &setup.internal.info_title, execInfoTitleScreen }, { &setup.internal.info_elements, execInfoElements }, @@ -8808,6 +8817,7 @@ static struct TokenInfo setup_info_shortcuts[] = { TYPE_ENTER_MENU, execSetupShortcuts4, "Sound & Music" }, { TYPE_ENTER_MENU, execSetupShortcuts5, "TAS Snap Keys" }, { TYPE_ENTER_MENU, execSetupShortcuts6, "Speed Keys" }, + { TYPE_ENTER_MENU, execSetupShortcuts7, "Engine Keys" }, { TYPE_EMPTY, NULL, "" }, { TYPE_LEAVE_MENU, execSetupMain, "Back" }, @@ -8915,6 +8925,16 @@ static struct TokenInfo setup_info_shortcuts_6[] = { 0, NULL, NULL } }; +static struct TokenInfo setup_info_shortcuts_7[] = +{ + { TYPE_KEYTEXT, NULL, "Boulder Dash Suicide Key:" }, + { TYPE_KEY, &setup.shortcut.suicide, "" }, + { TYPE_EMPTY, NULL, "" }, + { TYPE_LEAVE_MENU, execSetupShortcuts, "Back" }, + + { 0, NULL, NULL } +}; + static Key getSetupKey(void) { Key key = KSYM_UNDEFINED; @@ -9352,6 +9372,11 @@ static void DrawSetupScreen_Generic(void) setup_info = setup_info_shortcuts_6; title_string = STR_SETUP_SHORTCUTS; } + else if (setup_mode == SETUP_MODE_SHORTCUTS_7) + { + setup_info = setup_info_shortcuts_7; + title_string = STR_SETUP_SHORTCUTS; + } // use modified setup info without setup entries marked as hidden setup_info = getSetupInfoFinal(setup_info); -- 2.34.1