From bbea8429d449be9badea09afeb8ab7b4e4a42877 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Mon, 6 Apr 2020 10:55:11 +0200 Subject: [PATCH] added (optional) main menu button to switch between ECS and AGA chipset --- src/conf_gfx.c | 6 ++++++ src/main.h | 2 ++ src/screens.c | 38 ++++++++++++++++++++++++++------------ 3 files changed, 34 insertions(+), 12 deletions(-) diff --git a/src/conf_gfx.c b/src/conf_gfx.c index a607b377..213f72b1 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -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" }, diff --git a/src/main.h b/src/main.h index f6c90269..bca6d626 100644 --- a/src/main.h +++ b/src/main.h @@ -2681,6 +2681,8 @@ struct MenuMainButtonInfo struct MenuPosInfo insert_solution; struct MenuPosInfo play_solution; + + struct MenuPosInfo switch_ecs_aga; }; struct MenuMainTextInfo diff --git a/src/screens.c b/src/screens.c index 521f68ce..17513d2c 100644 --- a/src/screens.c +++ b/src/screens.c @@ -181,18 +181,19 @@ #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: -- 2.34.1