[SeaBIOS] [PATCH 2/3] vgabios: Don't check for special case of page==0xff on external calls

Kevin O'Connor kevin at koconnor.net
Mon Jul 4 18:41:15 CEST 2016


The original "lgpl vgabios" internally used page=0xff as a mechanism
for specifying the current page.  It also would allow int1013 calls to
externally specify bh==0xff for the current page.  However, there is
no documentation supporting this as an externally available feature.
SeaVGABIOS does not need the internal shortcut; this patch removes the
code.

Signed-off-by: Kevin O'Connor <kevin at koconnor.net>
---
 vgasrc/vgabios.c | 14 ++++----------
 vgasrc/vgafb.c   |  2 +-
 2 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/vgasrc/vgabios.c b/vgasrc/vgabios.c
index 8b50192..2593e03 100644
--- a/vgasrc/vgabios.c
+++ b/vgasrc/vgabios.c
@@ -109,16 +109,10 @@ set_cursor_pos(struct cursorpos cp)
 struct cursorpos
 get_cursor_pos(u8 page)
 {
-    if (page == 0xff)
-        // special case - use current page
-        page = GET_BDA(video_page);
-    if (page > 7) {
-        struct cursorpos cp = { 0, 0, 0xfe };
-        return cp;
-    }
+    if (page > 7)
+        return (struct cursorpos) { 0, 0, 0 };
     u16 xy = GET_BDA(cursor_pos[page]);
-    struct cursorpos cp = {xy, xy>>8, page};
-    return cp;
+    return (struct cursorpos) { xy, xy>>8, page };
 }
 
 static void
@@ -555,7 +549,7 @@ handle_100e(struct bregs *regs)
     // Ralf Brown Interrupt list is WRONG on bh(page)
     // We do output only on the current page !
     struct carattr ca = {regs->al, regs->bl, 0};
-    struct cursorpos cp = get_cursor_pos(0xff);
+    struct cursorpos cp = get_cursor_pos(GET_BDA(video_page));
     write_teletype(&cp, ca);
     set_cursor_pos(cp);
 }
diff --git a/vgasrc/vgafb.c b/vgasrc/vgafb.c
index 5d1ecc9..58c60ad 100644
--- a/vgasrc/vgafb.c
+++ b/vgasrc/vgafb.c
@@ -674,7 +674,7 @@ vgafb_set_swcursor(int enable)
     struct vgamode_s *vmode_g = get_current_mode();
     if (!vmode_g)
         return;
-    struct cursorpos cp = get_cursor_pos(0xff);
+    struct cursorpos cp = get_cursor_pos(GET_BDA(video_page));
     if (cp.x >= GET_BDA(video_cols) || cp.y > GET_BDA(video_rows)
         || GET_BDA(cursor_type) >= 0x2000)
         // Cursor not visible
-- 
2.5.5




More information about the SeaBIOS mailing list