added (optional) main menu button to switch between ECS and AGA chipset
authorHolger Schemel <info@artsoft.org>
Mon, 6 Apr 2020 08:55:11 +0000 (10:55 +0200)
committerHolger Schemel <info@artsoft.org>
Tue, 19 May 2020 16:20:02 +0000 (18:20 +0200)
src/conf_gfx.c
src/main.h
src/screens.c

index a607b377908db46b56316ed92ece1ee4b839870b..213f72b1204713db3d98bdcbbde55ba66be411b9 100644 (file)
@@ -6039,6 +6039,9 @@ struct ConfigInfo image_config[] =
   { "menu.button_play_solution",               UNDEFINED_FILENAME      },
   { "menu.button_play_solution.active",                UNDEFINED_FILENAME      },
 
+  { "menu.button_switch_ecs_aga",              UNDEFINED_FILENAME      },
+  { "menu.button_switch_ecs_aga.active",       UNDEFINED_FILENAME      },
+
   { "menu.button_touch_back",                  "RocksTouch.png"        },
   { "menu.button_touch_back.x",                        "210"                   },
   { "menu.button_touch_back.y",                        "180"                   },
@@ -7965,6 +7968,9 @@ struct ConfigInfo image_config[] =
   { "main.button.play_solution.x",             "-1"                    },
   { "main.button.play_solution.y",             "-1"                    },
 
+  { "main.button.switch_ecs_aga.x",            "-1"                    },
+  { "main.button.switch_ecs_aga.y",            "-1"                    },
+
   { "main.text.name.x",                                "-1"                    },
   { "main.text.name.y",                                "-1"                    },
   { "main.text.name.width",                    "-1"                    },
index f6c90269592f2b9fc5ab03182ed7301106db513f..bca6d626a04333621f401470048cd1088afe9603 100644 (file)
@@ -2681,6 +2681,8 @@ struct MenuMainButtonInfo
 
   struct MenuPosInfo insert_solution;
   struct MenuPosInfo play_solution;
+
+  struct MenuPosInfo switch_ecs_aga;
 };
 
 struct MenuMainTextInfo
index 521f68ced37b21c231d379f915e63ed287c0a013..17513d2c834a326dca593d8901b601484ec8b8ac 100644 (file)
 #define SCREEN_CTRL_ID_NEXT_PLAYER     6
 #define SCREEN_CTRL_ID_INSERT_SOLUTION 7
 #define SCREEN_CTRL_ID_PLAY_SOLUTION   8
-#define SCREEN_CTRL_ID_TOUCH_PREV_PAGE 9
-#define SCREEN_CTRL_ID_TOUCH_NEXT_PAGE 10
-#define SCREEN_CTRL_ID_TOUCH_PREV_PAGE2        11
-#define SCREEN_CTRL_ID_TOUCH_NEXT_PAGE2        12
-#define SCREEN_CTRL_ID_SCROLL_UP       13
-#define SCREEN_CTRL_ID_SCROLL_DOWN     14
-#define SCREEN_CTRL_ID_SCROLL_VERTICAL 15
-#define SCREEN_CTRL_ID_NETWORK_SERVER  16
-
-#define NUM_SCREEN_GADGETS             17
-
-#define NUM_SCREEN_MENUBUTTONS         13
+#define SCREEN_CTRL_ID_SWITCH_ECS_AGA  9
+#define SCREEN_CTRL_ID_TOUCH_PREV_PAGE 10
+#define SCREEN_CTRL_ID_TOUCH_NEXT_PAGE 11
+#define SCREEN_CTRL_ID_TOUCH_PREV_PAGE2        12
+#define SCREEN_CTRL_ID_TOUCH_NEXT_PAGE2        13
+#define SCREEN_CTRL_ID_SCROLL_UP       14
+#define SCREEN_CTRL_ID_SCROLL_DOWN     15
+#define SCREEN_CTRL_ID_SCROLL_VERTICAL 16
+#define SCREEN_CTRL_ID_NETWORK_SERVER  17
+
+#define NUM_SCREEN_GADGETS             18
+
+#define NUM_SCREEN_MENUBUTTONS         14
 #define NUM_SCREEN_SCROLLBUTTONS       2
 #define NUM_SCREEN_SCROLLBARS          1
 #define NUM_SCREEN_TEXTINPUT           1
@@ -8460,6 +8461,14 @@ static struct
     GD_EVENT_RELEASED,
     FALSE, "play solution tape"
   },
+  {
+    IMG_MENU_BUTTON_SWITCH_ECS_AGA, IMG_MENU_BUTTON_SWITCH_ECS_AGA_ACTIVE,
+    &menu.main.button.switch_ecs_aga, &setup.prefer_aga_graphics,
+    SCREEN_CTRL_ID_SWITCH_ECS_AGA,
+    SCREEN_MASK_MAIN,
+    GD_EVENT_RELEASED | GD_EVENT_OFF_BORDERS,
+    FALSE, "switch ECS/AGA chipset"
+  },
   {
     IMG_MENU_BUTTON_TOUCH_BACK, IMG_MENU_BUTTON_TOUCH_BACK,
     &menu.setup.button.touch_back, NULL,
@@ -8958,6 +8967,11 @@ static void HandleScreenGadgets(struct GadgetInfo *gi)
       PlaySolutionTape();
       break;
 
+    case SCREEN_CTRL_ID_SWITCH_ECS_AGA:
+      setup.prefer_aga_graphics = !setup.prefer_aga_graphics;
+      DrawMainMenu();
+      break;
+
     case SCREEN_CTRL_ID_TOUCH_PREV_PAGE:
     case SCREEN_CTRL_ID_TOUCH_NEXT_PAGE:
     case SCREEN_CTRL_ID_TOUCH_PREV_PAGE2: