diff options
author | Marcus Brinkmann <marcus@gnu.org> | 2002-09-30 17:13:14 +0000 |
---|---|---|
committer | Marcus Brinkmann <marcus@gnu.org> | 2002-09-30 17:13:14 +0000 |
commit | e8800e674058ea33a8d43e5976277a18b8102233 (patch) | |
tree | 0cfe3e6f2b1ed9bb6282aa20d6bbfcf76dc92ea2 | |
parent | 3f9ff75beda3a3084b4f846ba9616401055948b6 (diff) |
2002-09-30 Marcus Brinkmann <marcus@gnu.org>
* vga-support.c (vga_get_font_width): New function.
* vga-support.h: Add prototype for vga_get_font_width.
* vga-dynafont.c (create_system_font): Call vga_get_font_width to
determine real font width.
-rw-r--r-- | console-client/ChangeLog | 7 | ||||
-rw-r--r-- | console-client/vga-dynafont.c | 2 | ||||
-rw-r--r-- | console-client/vga-support.c | 8 | ||||
-rw-r--r-- | console-client/vga-support.h | 3 |
4 files changed, 19 insertions, 1 deletions
diff --git a/console-client/ChangeLog b/console-client/ChangeLog index cf13d98d..3283fb0c 100644 --- a/console-client/ChangeLog +++ b/console-client/ChangeLog @@ -1,3 +1,10 @@ +2002-09-30 Marcus Brinkmann <marcus@gnu.org> + + * vga-support.c (vga_get_font_width): New function. + * vga-support.h: Add prototype for vga_get_font_width. + * vga-dynafont.c (create_system_font): Call vga_get_font_width to + determine real font width. + 2002-09-22 Marcus Brinkmann <marcus@gnu.org> * pc-kbd.c (sc_to_kc): Implement Meta-Backspace combinations. diff --git a/console-client/vga-dynafont.c b/console-client/vga-dynafont.c index 0df28df1..97ca2d83 100644 --- a/console-client/vga-dynafont.c +++ b/console-client/vga-dynafont.c @@ -309,7 +309,7 @@ create_system_font (void) bdf_error_t bdferr; bdf_font_t font; unsigned char bitmap[VGA_FONT_SIZE][VGA_FONT_HEIGHT]; /* 8kB on stack. */ - int width = 9; /* XXX Find out if we are in 8 or 9 pixel mode. */ + int width = vga_get_font_width (); int i; /* Add the glyph at position POS to the font for character diff --git a/console-client/vga-support.c b/console-client/vga-support.c index 30ed6533..717663ce 100644 --- a/console-client/vga-support.c +++ b/console-client/vga-support.c @@ -322,6 +322,14 @@ vga_set_font_height (int height) } +/* Get the font height in pixel. Can be 8 or 9. */ +int +vga_get_font_width (void) +{ + outb (VGA_SEQ_CLOCK_MODE_ADDR, VGA_SEQ_ADDR_REG); + return (inb (VGA_SEQ_DATA_REG) & VGA_SEQ_CLOCK_MODE_8) ? 8 : 9; +} + /* Set the font height in pixel. WIDTH can be 8 or 9. */ void vga_set_font_width (int width) diff --git a/console-client/vga-support.h b/console-client/vga-support.h index 51dec782..38c6248f 100644 --- a/console-client/vga-support.h +++ b/console-client/vga-support.h @@ -57,6 +57,9 @@ void vga_select_font_buffer (int font_buffer, int font_buffer_supp); /* Set the font height in pixel. */ void vga_set_font_height (int height); +/* Get the font height in pixel. Can be 8 or 9. */ +int vga_get_font_width (void); + /* Set the font height in pixel. WIDTH can be 8 or 9. */ void vga_set_font_width (int width); |