aboutsummaryrefslogtreecommitdiffstats
path: root/com32/lib/sys/vesa
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-12-18 15:08:02 -0800
committerH. Peter Anvin <hpa@zytor.com>2009-12-18 15:08:02 -0800
commita7615704a4a4c76ef794c4758a60f6a539d603ce (patch)
tree3e12455629593524d44923a6139a297690e4d317 /com32/lib/sys/vesa
parent13b9de9031014e3b3fed2cd0fa5c48efc180cd80 (diff)
downloadsyslinux-a7615704a4a4c76ef794c4758a60f6a539d603ce.tar.gz
syslinux-a7615704a4a4c76ef794c4758a60f6a539d603ce.tar.xz
syslinux-a7615704a4a4c76ef794c4758a60f6a539d603ce.zip
video: implement long-promised video functions; use them
Implement long-since-promised video functions defined in <syslinux/video.h>. Use these functions in initvesa.c instead of open-coding the same functionality. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'com32/lib/sys/vesa')
-rw-r--r--com32/lib/sys/vesa/initvesa.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/com32/lib/sys/vesa/initvesa.c b/com32/lib/sys/vesa/initvesa.c
index 0221fcf7..f1224a17 100644
--- a/com32/lib/sys/vesa/initvesa.c
+++ b/com32/lib/sys/vesa/initvesa.c
@@ -37,6 +37,7 @@
#include <stdlib.h>
#include <string.h>
#include <sys/fpu.h>
+#include <syslinux/video.h>
#include "vesa.h"
#include "video.h"
#include "fill.h"
@@ -240,12 +241,10 @@ static int vesacon_set_mode(int x, int y)
__vesacon_format_pixels = __vesacon_format_pixels_list[bestpxf];
/* 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 {
+ __vesacon_font_height = syslinux_font_query(&rom_font);
+ if (!__vesacon_font_height) {
+ /* Get BIOS 8x16 font */
+
rm.eax.w[0] = 0x1130; /* Get Font Information */
rm.ebx.w[0] = 0x0600; /* Get 8x16 ROM font */
__intcall(0x10, &rm, &rm);
@@ -270,17 +269,13 @@ static int vesacon_set_mode(int x, int y)
__vesacon_init_copy_to_screen();
/* Tell syslinux we changed video mode */
- rm.eax.w[0] = 0x0017; /* Report video mode change */
/* In theory this should be:
- rm.ebx.w[0] = (mi->mode_attr & 4) ? 0x0007 : 0x000f;
+ flags = (mi->mode_attr & 4) ? 0x0007 : 0x000f;
However, that would assume all systems that claim to handle text
output in VESA modes actually do that... */
- rm.ebx.w[0] = 0x000f;
- rm.ecx.w[0] = mi->h_res;
- rm.edx.w[0] = mi->v_res;
- __intcall(0x22, &rm, NULL);
+ syslinux_report_video_mode(0x000f, mi->h_res, mi->v_res);
__vesacon_pixel_format = bestpxf;