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);
}
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)
{
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);
return cmdline;
}
-int menu_main(int argc, char *argv[])
+int main(int argc, char *argv[])
{
const char *cmdline;
struct menu *m;
(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])
}
} 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;
/* ----------------------------------------------------------------------- *
*
* 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
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);
}