aboutsummaryrefslogtreecommitdiffstats
path: root/com32
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-12-07 16:49:15 -0800
committerH. Peter Anvin <hpa@zytor.com>2009-12-07 16:49:15 -0800
commit040441da7d90285e63bd920f4f416a0659e095be (patch)
treef75e930b6b2183f05f2f87a2bd4426e56ddeffd7 /com32
parentc64383a22c3d8ae511153b50baa065d79c7ff855 (diff)
downloadsyslinux.git-040441da7d90285e63bd920f4f416a0659e095be.tar.gz
syslinux.git-040441da7d90285e63bd920f4f416a0659e095be.tar.xz
syslinux.git-040441da7d90285e63bd920f4f416a0659e095be.zip
vesacon: don't display the cursor when doing a quiet boot
Don't display the cursor on the graphical screen while doing a quiet boot. When doing a quiet boot we will probably show the graphical screen for a fair bit of time; as a result, we really don't want a completely bogus cursor blob on the bottom of the screen. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'com32')
-rw-r--r--com32/include/syslinux/vesacon.h3
-rw-r--r--com32/lib/sys/ansi.h2
-rw-r--r--com32/lib/sys/ansicon_write.c6
-rw-r--r--com32/lib/sys/vesa/drawtxt.c2
-rw-r--r--com32/lib/sys/vesa/video.h3
-rw-r--r--com32/lib/sys/vesacon_write.c14
-rw-r--r--com32/menu/menu.c5
-rw-r--r--com32/menu/menu.h1
-rw-r--r--com32/menu/menumain.c2
-rw-r--r--com32/menu/vesamenu.c5
10 files changed, 35 insertions, 8 deletions
diff --git a/com32/include/syslinux/vesacon.h b/com32/include/syslinux/vesacon.h
index 11d72f3a..b99e649c 100644
--- a/com32/include/syslinux/vesacon.h
+++ b/com32/include/syslinux/vesacon.h
@@ -28,9 +28,12 @@
#ifndef _SYSLINUX_VESACON_H
#define _SYSLINUX_VESACON_H
+#include <stdbool.h>
+
int vesacon_default_background(void);
void vesacon_set_resolution(int, int);
int vesacon_load_background(const char *);
int vesacon_set_background(unsigned int);
+void vesacon_cursor_enable(bool);
#endif /* _SYSLINUX_VESACON_H */
diff --git a/com32/lib/sys/ansi.h b/com32/lib/sys/ansi.h
index 40a531cc..7ccafc8b 100644
--- a/com32/lib/sys/ansi.h
+++ b/com32/lib/sys/ansi.h
@@ -48,7 +48,7 @@ struct ansi_ops {
void (*write_char) (int x, int y, uint8_t ch, const struct term_state * st);
void (*showcursor) (const struct term_state * st);
void (*scroll_up) (const struct term_state * st);
- void (*set_cursor) (int x, int y, int visible);
+ void (*set_cursor) (int x, int y, bool visible);
void (*beep) (void);
};
diff --git a/com32/lib/sys/ansicon_write.c b/com32/lib/sys/ansicon_write.c
index 7c2754e7..b25f2d2e 100644
--- a/com32/lib/sys/ansicon_write.c
+++ b/com32/lib/sys/ansicon_write.c
@@ -47,7 +47,7 @@ static void ansicon_erase(const struct term_state *, int, int, int, int);
static void ansicon_write_char(int, int, uint8_t, const struct term_state *);
static void ansicon_showcursor(const struct term_state *);
static void ansicon_scroll_up(const struct term_state *);
-static void ansicon_set_cursor(int, int, int);
+static void ansicon_set_cursor(int, int, bool);
static struct term_state ts;
struct ansi_ops __ansicon_ops = {
@@ -176,7 +176,7 @@ static void ansicon_showcursor(const struct term_state *st)
__intcall(0x10, &ireg, NULL);
}
-static void ansicon_set_cursor(int x, int y, int visible)
+static void ansicon_set_cursor(int x, int y, bool visible)
{
const int page = BIOS_PAGE;
struct curxy xy = BIOS_CURXY[page];
@@ -198,7 +198,7 @@ static void ansicon_write_char(int x, int y, uint8_t ch,
{
static com32sys_t ireg;
- ansicon_set_cursor(x, y, 0);
+ ansicon_set_cursor(x, y, false);
ireg.eax.b[1] = 0x09;
ireg.eax.b[0] = ch;
diff --git a/com32/lib/sys/vesa/drawtxt.c b/com32/lib/sys/vesa/drawtxt.c
index 92d89018..85a9e974 100644
--- a/com32/lib/sys/vesa/drawtxt.c
+++ b/com32/lib/sys/vesa/drawtxt.c
@@ -279,7 +279,7 @@ void __vesacon_write_char(int x, int y, uint8_t ch, attr_t attr)
vesacon_touch(y, x, 1, 1);
}
-void __vesacon_set_cursor(int x, int y, int visible)
+void __vesacon_set_cursor(int x, int y, bool visible)
{
struct vesa_char *ptr = &__vesacon_text_display
[(y + 1) * (__vesacon_text_cols + 2) + (x + 1)];
diff --git a/com32/lib/sys/vesa/video.h b/com32/lib/sys/vesa/video.h
index 0bd1abff..764228a0 100644
--- a/com32/lib/sys/vesa/video.h
+++ b/com32/lib/sys/vesa/video.h
@@ -28,6 +28,7 @@
#ifndef LIB_SYS_VESA_VIDEO_H
#define LIB_SYS_VESA_VIDEO_H
+#include <stdbool.h>
#include <colortbl.h>
#include "vesa.h"
@@ -87,7 +88,7 @@ void __vesacon_scroll_up(int, attr_t);
void __vesacon_write_char(int, int, uint8_t, attr_t);
void __vesacon_redraw_text(void);
void __vesacon_doit(void);
-void __vesacon_set_cursor(int, int, int);
+void __vesacon_set_cursor(int, int, bool);
void __vesacon_copy_to_screen(size_t, const uint32_t *, size_t);
void __vesacon_init_copy_to_screen(void);
diff --git a/com32/lib/sys/vesacon_write.c b/com32/lib/sys/vesacon_write.c
index e85aba88..37693177 100644
--- a/com32/lib/sys/vesacon_write.c
+++ b/com32/lib/sys/vesacon_write.c
@@ -48,6 +48,7 @@
static void vesacon_erase(const struct term_state *, int, int, int, int);
static void vesacon_write_char(int, int, uint8_t, const struct term_state *);
static void vesacon_showcursor(const struct term_state *);
+static void vesacon_setcursor(int x, int y, bool visible);
static void vesacon_scroll_up(const struct term_state *);
static struct term_state ts;
@@ -55,7 +56,7 @@ static struct ansi_ops op = {
.erase = vesacon_erase,
.write_char = vesacon_write_char,
.showcursor = vesacon_showcursor,
- .set_cursor = __vesacon_set_cursor, /* in drawtxt.c */
+ .set_cursor = vesacon_setcursor,
.scroll_up = vesacon_scroll_up,
.beep = __ansicon_beep,
};
@@ -141,9 +142,18 @@ static void vesacon_write_char(int x, int y, uint8_t ch,
}
/* Show or hide the cursor */
+static bool cursor_enabled = true;
+void vesacon_cursor_enable(bool enabled)
+{
+ cursor_enabled = enabled;
+}
static void vesacon_showcursor(const struct term_state *st)
{
- __vesacon_set_cursor(st->xy.x, st->xy.y, st->cursor);
+ vesacon_setcursor(st->xy.x, st->xy.y, st->cursor);
+}
+static void vesacon_setcursor(int x, int y, bool visible)
+{
+ __vesacon_set_cursor(x, y, visible && cursor_enabled);
}
static void vesacon_scroll_up(const struct term_state *st)
diff --git a/com32/menu/menu.c b/com32/menu/menu.c
index 797189b4..8f7af4d0 100644
--- a/com32/menu/menu.c
+++ b/com32/menu/menu.c
@@ -33,6 +33,11 @@ void set_resolution(int x, int y)
(void)y;
}
+void local_cursor_enable(bool enabled)
+{
+ (void)enabled;
+}
+
void start_console(void)
{
console_ansi_raw();
diff --git a/com32/menu/menu.h b/com32/menu/menu.h
index 72f5c99e..52b4e4dc 100644
--- a/com32/menu/menu.h
+++ b/com32/menu/menu.h
@@ -186,6 +186,7 @@ void parse_configs(char **argv);
int draw_background(const char *filename);
void set_resolution(int x, int y);
void start_console(void);
+void local_cursor_enable(bool);
static inline int my_isspace(char c)
{
diff --git a/com32/menu/menumain.c b/com32/menu/menumain.c
index 32ed1b08..cbeb9a18 100644
--- a/com32/menu/menumain.c
+++ b/com32/menu/menumain.c
@@ -1115,8 +1115,10 @@ int main(int argc, char *argv[])
}
for (;;) {
+ local_cursor_enable(true);
cmdline = run_menu();
+ local_cursor_enable(false);
printf("\033[?25h\033[%d;1H\033[0m", END_ROW);
if (cmdline) {
diff --git a/com32/menu/vesamenu.c b/com32/menu/vesamenu.c
index 22b46235..62e29bd0 100644
--- a/com32/menu/vesamenu.c
+++ b/com32/menu/vesamenu.c
@@ -41,6 +41,11 @@ void set_resolution(int x, int y)
vesacon_set_resolution(x, y);
}
+void local_cursor_enable(bool enabled)
+{
+ vesacon_cursor_enable(enabled);
+}
+
void start_console(void)
{
openconsole(&dev_rawcon_r, &dev_vesaserial_w);