From c7de829c796978e519984df2f1c8cfcf921a39a4 Mon Sep 17 00:00:00 2001 From: wdenk Date: Tue, 19 Nov 2002 11:04:11 +0000 Subject: * Patch by Thomas Frieden, 13 Nov 2002: Add code for AmigaOne board (preliminary merge to U-Boot, still WIP) * Patch by Jon Diekema, 12 Nov 2002: - Adding URL for IEEE OUI lookup - Making the autoboot #defines dependent on CONFIG_AUTOBOOT_KEYED being defined. - In the CONFIG_EXTRA_ENV_SETTINGS #define, the root-on-initrd and root-on-nfs macros are designed to switch how the default boot method gets defined. --- board/MAI/menu/menu.c | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 board/MAI/menu/menu.c (limited to 'board/MAI/menu/menu.c') diff --git a/board/MAI/menu/menu.c b/board/MAI/menu/menu.c new file mode 100644 index 0000000..3130142 --- /dev/null +++ b/board/MAI/menu/menu.c @@ -0,0 +1,66 @@ +#include "menu.h" + +#define SINGLE_BOX 0 +#define DOUBLE_BOX 1 + +void video_draw_box(int style, int attr, char *title, int separate, int x, int y, int w, int h); +void video_draw_text(int x, int y, int attr, char *text); +void video_save_rect(int x, int y, int w, int h, void *save_area, int clearchar, int clearattr); +void video_restore_rect(int x, int y, int w, int h, void *save_area); +int video_rows(void); +int video_cols(void); + +#define MAX_MENU_OPTIONS 200 + +typedef struct +{ + int used; /* flag if this entry is used */ + int entry_x; /* Character column of the menu entry */ + int entry_y; /* Character line of the entry */ + int option_x; /* Character colum of the option (entry is same) */ +} option_data_t; + +option_data_t odata[MAX_MENU_OPTIONS]; + +int normal_attr = 0x0F; +int select_attr = 0x2F; +int disabled_attr = 0x07; + +menu_t *root_menu; + +int menu_init (menu_t *root) +{ + char *s; + int i; + + s = getenv("menu_normal"); + if (s) normal_attr = atoi(s); + + s = getenv("menu_select"); + if (s) select_attr = atoi(s); + + s = getenv("menu_disabled"); + if (s) disabled_attr = atoi(s); + + for (i=0; iused = 0; +} + +void menu_layout (menu_t *menu) +{ -- cgit v1.1