summaryrefslogtreecommitdiff
path: root/com32/lib/sys/ansicon_write.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2006-09-11 22:10:21 -0700
committerH. Peter Anvin <hpa@zytor.com>2006-09-11 22:10:21 -0700
commit9ac07bc4aad3c52a63c2c1063cc7fde9d103fcf4 (patch)
treebdf8f40e7f2d37598b65b12c775478ce64055d75 /com32/lib/sys/ansicon_write.c
parent146c0ce9b8f15b77c9a215cc65bad0edebb789a6 (diff)
downloadsyslinux-9ac07bc4aad3c52a63c2c1063cc7fde9d103fcf4.tar.gz
Cursor support for vesacon
Diffstat (limited to 'com32/lib/sys/ansicon_write.c')
-rw-r--r--com32/lib/sys/ansicon_write.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/com32/lib/sys/ansicon_write.c b/com32/lib/sys/ansicon_write.c
index e3fb0ec7..43b7c18b 100644
--- a/com32/lib/sys/ansicon_write.c
+++ b/com32/lib/sys/ansicon_write.c
@@ -43,9 +43,9 @@
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 *, int);
+static void ansicon_showcursor(const struct term_state *);
static void ansicon_scroll_up(const struct term_state *);
-static void ansicon_set_cursor(int, int);
+static void ansicon_set_cursor(int, int, int);
static struct term_state ts;
struct ansi_ops __ansicon_ops = {
@@ -72,6 +72,8 @@ static struct term_info ti =
reinitialization. */
static int ansicon_counter = 0;
+static uint16_t cursor_type; /* Saved cursor pattern */
+
/* Common setup */
int __ansicon_open(struct file_info *fp)
{
@@ -101,7 +103,7 @@ int __ansicon_open(struct file_info *fp)
ireg.eax.b[1] = 0x03;
ireg.ebx.b[1] = BIOS_PAGE;
__intcall(0x10, &ireg, &oreg);
- ti.ts->cursor_type = oreg.ecx.w[0];
+ cursor_type = oreg.ecx.w[0];
}
}
@@ -161,21 +163,23 @@ static void ansicon_erase(const struct term_state *st,
}
/* Show or hide the cursor */
-static void ansicon_showcursor(const struct term_state *st, int yes)
+static void ansicon_showcursor(const struct term_state *st)
{
static com32sys_t ireg;
ireg.eax.b[1] = 0x01;
- ireg.ecx.w[0] = yes ? st->cursor_type : 0x2020;
+ ireg.ecx.w[0] = st->cursor ? cursor_type : 0x2020;
__intcall(0x10, &ireg, NULL);
}
-static void ansicon_set_cursor(int x, int y)
+static void ansicon_set_cursor(int x, int y, int visible)
{
const int page = BIOS_PAGE;
struct curxy xy = BIOS_CURXY[page];
static com32sys_t ireg;
+ (void)visible;
+
if (xy.x != x || xy.y != y) {
ireg.eax.b[1] = 0x02;
ireg.ebx.b[1] = page;
@@ -190,7 +194,7 @@ static void ansicon_write_char(int x, int y, uint8_t ch,
{
static com32sys_t ireg;
- ansicon_set_cursor(x, y);
+ ansicon_set_cursor(x, y, 0);
ireg.eax.b[1] = 0x09;
ireg.eax.b[0] = ch;