From 510811554b97c29077cc0a07fff09ec005f380fb Mon Sep 17 00:00:00 2001 From: Pierre-Alexandre Meyer Date: Sun, 30 Aug 2009 17:14:02 -0700 Subject: [PATCH] Revert "ansicon: allow to pass page # to write functions" We shouldn't be using any pages, as there is no support on the serial line. This reverts commit e9b317fd0dc87dc93a49bc40520f4bdd0264d746. --- com32/lib/sys/ansi.c | 4 ++-- com32/lib/sys/ansi.h | 9 ++------- com32/lib/sys/ansicon_write.c | 18 ++++++++++++------ 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/com32/lib/sys/ansi.c b/com32/lib/sys/ansi.c index 43b3b65..7d58085 100644 --- a/com32/lib/sys/ansi.c +++ b/com32/lib/sys/ansi.c @@ -123,7 +123,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; @@ -430,6 +430,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 1e03424..0d1f102 100644 --- a/com32/lib/sys/ansi.h +++ b/com32/lib/sys/ansi.h @@ -9,11 +9,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, @@ -48,10 +43,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 8ec16b0..7c2754e 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); -- 2.7.4