aboutsummaryrefslogtreecommitdiffstats
path: root/com32/lib/sys/vesa/initvesa.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2006-09-12 17:39:33 -0700
committerH. Peter Anvin <hpa@zytor.com>2006-09-12 17:39:33 -0700
commit247ccfe8b2c0b021c13ad600548282cddaabea62 (patch)
tree6f1ca3ece9a515976b123002e860f79cf0e1ca22 /com32/lib/sys/vesa/initvesa.c
parentb90182528d6d9a64d0eae7e3876d629fd3a596d2 (diff)
downloadsyslinux-247ccfe8b2c0b021c13ad600548282cddaabea62.tar.gz
syslinux-247ccfe8b2c0b021c13ad600548282cddaabea62.tar.xz
syslinux-247ccfe8b2c0b021c13ad600548282cddaabea62.zip
vesacon: if a custom font is loaded, use it instead of the BIOS font
Diffstat (limited to 'com32/lib/sys/vesa/initvesa.c')
-rw-r--r--com32/lib/sys/vesa/initvesa.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/com32/lib/sys/vesa/initvesa.c b/com32/lib/sys/vesa/initvesa.c
index 2becc9be..b396b53f 100644
--- a/com32/lib/sys/vesa/initvesa.c
+++ b/com32/lib/sys/vesa/initvesa.c
@@ -153,13 +153,21 @@ static int vesacon_set_mode(void)
break;
}
- /* Download the BIOS-provided font */
- rm.eax.w[0] = 0x1130; /* Get Font Information */
- rm.ebx.w[0] = 0x0600; /* Get 8x16 ROM font */
- __intcall(0x10, &rm, &rm);
- rom_font = MK_PTR(rm.es, rm.ebp.w[0]);
- __vesacon_font_height = 16;
- unpack_font((uint8_t *)__vesacon_graphics_font, rom_font, 16);
+ /* Download the SYSLINUX- or BIOS-provided font */
+ rm.eax.w[0] = 0x0018; /* Query custom font */
+ __intcall(0x22, &rm, &rm);
+ if (!(rm.eflags.l & EFLAGS_CF) && rm.eax.b[0]) {
+ __vesacon_font_height = rm.eax.b[0];
+ rom_font = MK_PTR(rm.es, rm.ebx.w[0]);
+ } else {
+ rm.eax.w[0] = 0x1130; /* Get Font Information */
+ rm.ebx.w[0] = 0x0600; /* Get 8x16 ROM font */
+ __intcall(0x10, &rm, &rm);
+ rom_font = MK_PTR(rm.es, rm.ebp.w[0]);
+ __vesacon_font_height = 16;
+ }
+ unpack_font((uint8_t *)__vesacon_graphics_font, rom_font,
+ __vesacon_font_height);
__vesacon_text_rows = (VIDEO_Y_SIZE-2*VIDEO_BORDER)/__vesacon_font_height;
__vesacon_init_cursor(__vesacon_font_height);
@@ -173,6 +181,13 @@ static int vesacon_set_mode(void)
return 9; /* Failed to set mode */
}
+ /* Tell syslinux we changed video mode */
+ rm.eax.w[0] = 0x0017; /* Report video mode change */
+ rm.ebx.w[0] = (mi->mode_attr & 4) ? 0x0007 : 0x000F;
+ rm.ecx.w[0] = VIDEO_X_SIZE;
+ rm.edx.w[0] = VIDEO_Y_SIZE;
+ __intcall(0x22, &rm, NULL);
+
/* Copy established state out of the bounce buffer */
memcpy(&__vesa_info, __com32.cs_bounce, sizeof __vesa_info);