]> xenbits.xensource.com Git - seabios.git/commitdiff
vgabios: implement AX=1120H..1124H functions rel-1.7.2
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 10 Jan 2013 12:41:36 +0000 (13:41 +0100)
committerKevin O'Connor <kevin@koconnor.net>
Sat, 12 Jan 2013 22:00:50 +0000 (17:00 -0500)
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@redhat.com>
vgasrc/vgabios.c

index b13d274591da9a18a5f25e37eea7572be0568099..afaf018b1559eb9f86901e3bfbc379a7d0ba5319 100644 (file)
@@ -796,6 +796,61 @@ handle_101114(struct bregs *regs)
     set_scan_lines(16);
 }
 
+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)
 {
@@ -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;
     }
 }