aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-11-06 16:44:53 -0800
committerH. Peter Anvin <hpa@zytor.com>2009-11-06 16:45:58 -0800
commit70e386288cd0e97211d3431db4948394ee235c86 (patch)
treed895fe122aeb6b173516b070ea13ed68fc864eb8
parent259c0dca1bc6ead6003fc504e136be67a1311abb (diff)
downloadsyslinux-devel-70e386288cd0e97211d3431db4948394ee235c86.tar.gz
syslinux-devel-70e386288cd0e97211d3431db4948394ee235c86.tar.xz
syslinux-devel-70e386288cd0e97211d3431db4948394ee235c86.zip
Revert "ansicon: allow to pass page # to write functions"
This reverts commit e9b317fd0dc87dc93a49bc40520f4bdd0264d746. (This commit breaks vesamenu, and $DEITY knows what else.) Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--com32/lib/sys/ansi.c4
-rw-r--r--com32/lib/sys/ansi.h9
-rw-r--r--com32/lib/sys/ansicon_write.c18
3 files changed, 16 insertions, 15 deletions
diff --git a/com32/lib/sys/ansi.c b/com32/lib/sys/ansi.c
index 17ace1d4..f73c03e2 100644
--- a/com32/lib/sys/ansi.c
+++ b/com32/lib/sys/ansi.c
@@ -124,7 +124,7 @@ void __ansi_putchar(const struct term_info *ti, uint8_t ch)
if (st->vtgraphics && (ch & 0xe0) == 0x60)
ch = decvt_to_cp437[ch - 0x60];
- op->write_char(xy.x, xy.y, BIOS_PAGE, ch, st);
+ op->write_char(xy.x, xy.y, ch, st);
xy.x++;
}
break;
@@ -439,6 +439,6 @@ void __ansi_putchar(const struct term_info *ti, uint8_t ch)
}
/* Update cursor position */
- op->set_cursor(xy.x, xy.y, BIOS_PAGE, st->cursor);
+ op->set_cursor(xy.x, xy.y, st->cursor);
st->xy = xy;
}
diff --git a/com32/lib/sys/ansi.h b/com32/lib/sys/ansi.h
index ed4b01cb..40a531cc 100644
--- a/com32/lib/sys/ansi.h
+++ b/com32/lib/sys/ansi.h
@@ -10,11 +10,6 @@
#define ANSI_MAX_PARMS 16
-#define BIOS_CURXY ((struct curxy *)0x450) /* Array for each page */
-#define BIOS_ROWS (*(uint8_t *)0x484) /* Minus one; if zero use 24 (= 25 lines) */
-#define BIOS_COLS (*(uint16_t *)0x44A) /* Number of columns on screen */
-#define BIOS_PAGE (*(uint8_t *)0x462) /* Current page number */
-
enum ansi_state {
st_init,
st_esc,
@@ -50,10 +45,10 @@ struct term_state {
struct ansi_ops {
void (*erase) (const struct term_state * st, int x0, int y0, int x1,
int y1);
- void (*write_char) (int x, int y, int page, uint8_t ch, const struct term_state * st);
+ 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 page, int visible);
+ void (*set_cursor) (int x, int y, int visible);
void (*beep) (void);
};
diff --git a/com32/lib/sys/ansicon_write.c b/com32/lib/sys/ansicon_write.c
index 8ec16b0a..7c2754e7 100644
--- a/com32/lib/sys/ansicon_write.c
+++ b/com32/lib/sys/ansicon_write.c
@@ -44,10 +44,10 @@
#include "ansi.h"
static void ansicon_erase(const struct term_state *, int, int, int, int);
-static void ansicon_write_char(int, int, int, uint8_t, const struct term_state *);
+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, int);
+static void ansicon_set_cursor(int, int, int);
static struct term_state ts;
struct ansi_ops __ansicon_ops = {
@@ -65,6 +65,11 @@ static struct term_info ti = {
.op = &__ansicon_ops
};
+#define BIOS_CURXY ((struct curxy *)0x450) /* Array for each page */
+#define BIOS_ROWS (*(uint8_t *)0x484) /* Minus one; if zero use 24 (= 25 lines) */
+#define BIOS_COLS (*(uint16_t *)0x44A)
+#define BIOS_PAGE (*(uint8_t *)0x462)
+
/* Reference counter to the screen, to keep track of if we need
reinitialization. */
static int ansicon_counter = 0;
@@ -171,8 +176,9 @@ static void ansicon_showcursor(const struct term_state *st)
__intcall(0x10, &ireg, NULL);
}
-static void ansicon_set_cursor(int x, int y, int page, int visible)
+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;
@@ -187,16 +193,16 @@ static void ansicon_set_cursor(int x, int y, int page, int visible)
}
}
-static void ansicon_write_char(int x, int y, int page, uint8_t ch,
+static void ansicon_write_char(int x, int y, uint8_t ch,
const struct term_state *st)
{
static com32sys_t ireg;
- ansicon_set_cursor(x, y, 0, page);
+ ansicon_set_cursor(x, y, 0);
ireg.eax.b[1] = 0x09;
ireg.eax.b[0] = ch;
- ireg.ebx.b[1] = page;
+ ireg.ebx.b[1] = BIOS_PAGE;
ireg.ebx.b[0] = ansicon_attribute(st);
ireg.ecx.w[0] = 1;
__intcall(0x10, &ireg, NULL);