#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 */
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);
};
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 = {
__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];
{
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;
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)];
#ifndef LIB_SYS_VESA_VIDEO_H
#define LIB_SYS_VESA_VIDEO_H
+#include <stdbool.h>
#include <colortbl.h>
#include "vesa.h"
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);
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;
.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,
};
}
/* 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)
(void)y;
}
+void local_cursor_enable(bool enabled)
+{
+ (void)enabled;
+}
+
void start_console(void)
{
console_ansi_raw();
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)
{
}
for (;;) {
+ local_cursor_enable(true);
cmdline = run_menu();
+ local_cursor_enable(false);
printf("\033[?25h\033[%d;1H\033[0m", END_ROW);
if (cmdline) {
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);