added setup option for suicide key for BD game engine
authorHolger Schemel <holger.schemel@virtion.de>
Tue, 3 Dec 2024 18:59:34 +0000 (19:59 +0100)
committerHolger Schemel <holger.schemel@virtion.de>
Tue, 3 Dec 2024 14:00:10 +0000 (15:00 +0100)
src/conf_gfx.c
src/files.c
src/libgame/system.h
src/main.h
src/screens.c

index 03aa6321857a880f766669589f4656c028c55b5f..ff462771718dc38cb55735eaaf8944b89a9a8382 100644 (file)
@@ -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"                             },
index f9eabd786cd95e66e8a184a2970a10cd3cb258aa..f922d6e5dcdb88c3d7f0449ddf62e305e35d761e 100644 (file)
@@ -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"
index a74ed1550d434acacb80210a3f87e3c4bdaf8652..36c41d6f597bc8ed1ba6f94820a7b4b681942fcc 100644 (file)
@@ -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;
index 46ae87882657935bf78d3c26034d309cde525684..83e883983768c40f80359dc1698d2991ea49cfb9 100644 (file)
@@ -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,
 
index e8be8d71bd32731fcf0338c37854e14bd97b811d..651b6830113ae4047c6668dd1ebc52ab4691777e 100644 (file)
 #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);