aboutsummaryrefslogtreecommitdiffstats
path: root/com32
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-12-07 16:18:09 -0800
committerH. Peter Anvin <hpa@zytor.com>2009-12-07 16:18:09 -0800
commite74de874126e4864dcbe88e4526180a6432d8811 (patch)
tree85a02441a47fc3f23851d01950d22bf527ef7ed5 /com32
parent469735a321138e519106e3d1dd16acd3be0cc024 (diff)
downloadsyslinux.git-e74de874126e4864dcbe88e4526180a6432d8811.tar.gz
syslinux.git-e74de874126e4864dcbe88e4526180a6432d8811.tar.xz
syslinux.git-e74de874126e4864dcbe88e4526180a6432d8811.zip
vesamenu: add MENU RESOLUTION to be able to set nonstandard res
Add a MENU RESOLUTION command to make it possible to set a nonstandard resolution. If the nonstandard resolution is unavailable, we revert to the text mode screen. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'com32')
-rw-r--r--com32/menu/menu.c9
-rw-r--r--com32/menu/menu.h6
-rw-r--r--com32/menu/menumain.c12
-rw-r--r--com32/menu/readconfig.c5
-rw-r--r--com32/menu/vesamenu.c9
5 files changed, 30 insertions, 11 deletions
diff --git a/com32/menu/menu.c b/com32/menu/menu.c
index 2c069fbe..797189b4 100644
--- a/com32/menu/menu.c
+++ b/com32/menu/menu.c
@@ -27,8 +27,13 @@ int draw_background(const char *arg)
return 0;
}
-int main(int argc, char *argv[])
+void set_resolution(int x, int y)
+{
+ (void)x;
+ (void)y;
+}
+
+void start_console(void)
{
console_ansi_raw();
- return menu_main(argc, argv);
}
diff --git a/com32/menu/menu.h b/com32/menu/menu.h
index 1d7dee80..0bfc47bc 100644
--- a/com32/menu/menu.h
+++ b/com32/menu/menu.h
@@ -181,6 +181,8 @@ extern long long totaltimeout;
void parse_configs(char **argv);
int draw_background(const char *filename);
+void set_resolution(int x, int y);
+void start_console(void);
static inline int my_isspace(char c)
{
@@ -192,10 +194,6 @@ unsigned int hexval(char c);
unsigned int hexval2(const char *p);
uint32_t parse_argb(char **p);
-int menu_main(int argc, char *argv[]);
-void console_prepare(void);
-void console_cleanup(void);
-
extern const int message_base_color, menu_color_table_size;
int mygetkey(clock_t timeout);
int show_message_file(const char *filename, const char *background);
diff --git a/com32/menu/menumain.c b/com32/menu/menumain.c
index 82f0018c..67deac32 100644
--- a/com32/menu/menumain.c
+++ b/com32/menu/menumain.c
@@ -1072,7 +1072,7 @@ static const char *run_menu(void)
return cmdline;
}
-int menu_main(int argc, char *argv[])
+int main(int argc, char *argv[])
{
const char *cmdline;
struct menu *m;
@@ -1081,14 +1081,20 @@ int menu_main(int argc, char *argv[])
(void)argc;
+ parse_configs(argv + 1);
+
+ /*
+ * We don't start the console until we have parsed the configuration
+ * file, since the configuration file might impact the console
+ * configuration, e.g. MENU RESOLUTION.
+ */
+ start_console();
if (getscreensize(1, &rows, &cols)) {
/* Unknown screen size? */
rows = 24;
cols = 80;
}
- parse_configs(argv + 1);
-
/* Some postprocessing for all menus */
for (m = menu_list; m; m = m->next) {
if (!m->mparm[P_WIDTH])
diff --git a/com32/menu/readconfig.c b/com32/menu/readconfig.c
index 1aad5958..f16e84f6 100644
--- a/com32/menu/readconfig.c
+++ b/com32/menu/readconfig.c
@@ -818,6 +818,11 @@ static void parse_config_file(FILE * f)
}
} else if (looking_at(p, "start")) {
start_menu = m;
+ } else if ((ep = looking_at(p, "resolution"))) {
+ int x, y;
+ x = strtoul(ep, &ep, 0);
+ y = strtoul(skipspace(ep), NULL, 0);
+ set_resolution(x, y);
} else {
/* Unknown, check for layout parameters */
enum parameter_number mp;
diff --git a/com32/menu/vesamenu.c b/com32/menu/vesamenu.c
index df5c94a6..22b46235 100644
--- a/com32/menu/vesamenu.c
+++ b/com32/menu/vesamenu.c
@@ -1,6 +1,7 @@
/* ----------------------------------------------------------------------- *
*
* Copyright 2004-2008 H. Peter Anvin - All Rights Reserved
+ * Copyright 2009 Intel Corporation; author: H. Peter Anvin
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -35,8 +36,12 @@ int draw_background(const char *what)
return vesacon_load_background(what);
}
-int main(int argc, char *argv[])
+void set_resolution(int x, int y)
+{
+ vesacon_set_resolution(x, y);
+}
+
+void start_console(void)
{
openconsole(&dev_rawcon_r, &dev_vesaserial_w);
- return menu_main(argc, argv);
}