[SeaBIOS] [PATCH] vgabios: implement AX=1120H..1124H functions

Paolo Bonzini pbonzini at redhat.com
Thu Jan 10 13:41:36 CET 2013


These function only have to set INT 1Fh and INT 43h, and set
the BDA height + number of rows.

I could not find out whether AX=1120h should also set the character
height to 8.  I think not, because INT 43h might still point to
14- or 16-pixel high characters and in this case INT 1Fh will not
be used at all.
Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
---
 vgasrc/vgabios.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)

diff --git a/vgasrc/vgabios.c b/vgasrc/vgabios.c
index b13d274..afaf018 100644
--- a/vgasrc/vgabios.c
+++ b/vgasrc/vgabios.c
@@ -797,6 +797,61 @@ handle_101114(struct bregs *regs)
 }
 
 static void
+handle_101120(struct bregs *regs)
+{
+    SET_IVT(0x1f, SEGOFF(regs->es, regs->bp));
+}
+
+void
+load_gfx_font(u16 seg, u16 off, u8 height, u8 bl, u8 dl)
+{
+    u8 rows;
+
+    SET_IVT(0x43, SEGOFF(seg, off));
+    switch(bl) {
+    case 0:
+        rows = dl;
+        break;
+    case 1:
+        rows = 14;
+        break;
+    case 3:
+        rows = 43;
+        break;
+    case 2:
+    default:
+        rows = 25;
+        break;
+    }
+    SET_BDA(video_rows, rows - 1);
+    SET_BDA(char_height, height);
+}
+
+static void
+handle_101121(struct bregs *regs)
+{
+    load_gfx_font(regs->es, regs->bp, regs->cx, regs->bl, regs->dl);
+}
+
+static void
+handle_101122(struct bregs *regs)
+{
+    load_gfx_font(get_global_seg(), (u32)vgafont14, 14, regs->bl, regs->dl);
+}
+
+static void
+handle_101123(struct bregs *regs)
+{
+    load_gfx_font(get_global_seg(), (u32)vgafont8, 8, regs->bl, regs->dl);
+}
+
+static void
+handle_101124(struct bregs *regs)
+{
+    load_gfx_font(get_global_seg(), (u32)vgafont16, 16, regs->bl, regs->dl);
+}
+
+static void
 handle_101130(struct bregs *regs)
 {
     switch (regs->bh) {
@@ -867,6 +922,11 @@ handle_1011(struct bregs *regs)
     case 0x12: handle_101112(regs); break;
     case 0x14: handle_101114(regs); break;
     case 0x30: handle_101130(regs); break;
+    case 0x20: handle_101120(regs); break;
+    case 0x21: handle_101121(regs); break;
+    case 0x22: handle_101122(regs); break;
+    case 0x23: handle_101123(regs); break;
+    case 0x24: handle_101124(regs); break;
     default:   handle_1011XX(regs); break;
     }
 }
-- 
1.8.1




More information about the SeaBIOS mailing list