vgabios: Don't pass vmode_g to vgafb_move_chars() / vgafb_clear_chars()

Now that a pointer to the current video mode info struct is cached in
memory, it's not necessary to pass the struct into the vgafb code.
The vgafb code can lookup the struct itself.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
diff --git a/vgasrc/vgabios.c b/vgasrc/vgabios.c
index fcc5b34..8ec6aa6 100644
--- a/vgasrc/vgabios.c
+++ b/vgasrc/vgabios.c
@@ -212,19 +212,15 @@
     if (pcp->y > nbrows) {
         pcp->y--;
 
-        struct vgamode_s *vmode_g = get_current_mode();
-        if (!vmode_g)
-            return;
-
         struct cursorpos dest = {0, 0, pcp->page};
         struct cursorpos src = {0, 1, pcp->page};
         struct cursorpos size = {GET_BDA(video_cols), nbrows};
-        vgafb_move_chars(vmode_g, dest, src, size);
+        vgafb_move_chars(dest, src, size);
 
         struct cursorpos clr = {0, nbrows, pcp->page};
         struct carattr attr = {' ', 0, 0};
         struct cursorpos clrsize = {GET_BDA(video_cols), 1};
-        vgafb_clear_chars(vmode_g, clr, attr, clrsize);
+        vgafb_clear_chars(clr, attr, clrsize);
     }
 }
 
@@ -430,10 +426,6 @@
     if (wincols <= 0 || winrows <= 0)
         return;
 
-    struct vgamode_s *vmode_g = get_current_mode();
-    if (!vmode_g)
-        return;
-
     u8 page = GET_BDA(video_page);
     int clearlines = regs->al, movelines = winrows - clearlines;
     if (!clearlines || movelines <= 0) {
@@ -441,7 +433,7 @@
         struct cursorpos clr = {ulx, uly, page};
         struct carattr attr = {' ', regs->bh, 1};
         struct cursorpos clrsize = {wincols, winrows};
-        vgafb_clear_chars(vmode_g, clr, attr, clrsize);
+        vgafb_clear_chars(clr, attr, clrsize);
         return;
     }
 
@@ -450,23 +442,23 @@
         struct cursorpos dest = {ulx, uly, page};
         struct cursorpos src = {ulx, uly + clearlines, page};
         struct cursorpos size = {wincols, movelines};
-        vgafb_move_chars(vmode_g, dest, src, size);
+        vgafb_move_chars(dest, src, size);
 
         struct cursorpos clr = {ulx, uly + movelines, page};
         struct carattr attr = {' ', regs->bh, 1};
         struct cursorpos clrsize = {wincols, clearlines};
-        vgafb_clear_chars(vmode_g, clr, attr, clrsize);
+        vgafb_clear_chars(clr, attr, clrsize);
     } else {
         // Scroll down
         struct cursorpos dest = {ulx, uly + clearlines, page};
         struct cursorpos src = {ulx, uly, page};
         struct cursorpos size = {wincols, movelines};
-        vgafb_move_chars(vmode_g, dest, src, size);
+        vgafb_move_chars(dest, src, size);
 
         struct cursorpos clr = {ulx, uly, page};
         struct carattr attr = {' ', regs->bh, 1};
         struct cursorpos clrsize = {wincols, clearlines};
-        vgafb_clear_chars(vmode_g, clr, attr, clrsize);
+        vgafb_clear_chars(clr, attr, clrsize);
     }
 }
 
diff --git a/vgasrc/vgabios.h b/vgasrc/vgabios.h
index d17b48f..fc8d45a 100644
--- a/vgasrc/vgabios.h
+++ b/vgasrc/vgabios.h
@@ -123,9 +123,9 @@
 void init_gfx_op(struct gfx_op *op, struct vgamode_s *vmode_g);
 void handle_gfx_op(struct gfx_op *op);
 void *text_address(struct cursorpos cp);
-void vgafb_move_chars(struct vgamode_s *vmode_g, struct cursorpos dest
+void vgafb_move_chars(struct cursorpos dest
                       , struct cursorpos src, struct cursorpos movesize);
-void vgafb_clear_chars(struct vgamode_s *vmode_g, struct cursorpos dest
+void vgafb_clear_chars(struct cursorpos dest
                        , struct carattr ca, struct cursorpos movesize);
 void vgafb_write_char(struct cursorpos cp, struct carattr ca);
 struct carattr vgafb_read_char(struct cursorpos cp);
diff --git a/vgasrc/vgafb.c b/vgasrc/vgafb.c
index fdc525d..0100080 100644
--- a/vgasrc/vgafb.c
+++ b/vgasrc/vgafb.c
@@ -465,9 +465,13 @@
 
 // Move characters on screen.
 void
-vgafb_move_chars(struct vgamode_s *vmode_g, struct cursorpos dest
+vgafb_move_chars(struct cursorpos dest
                  , struct cursorpos src, struct cursorpos movesize)
 {
+    struct vgamode_s *vmode_g = get_current_mode();
+    if (!vmode_g)
+        return;
+
     if (GET_GLOBAL(vmode_g->memmodel) != MM_TEXT) {
         gfx_move_chars(vmode_g, dest, src, movesize);
         return;
@@ -481,9 +485,13 @@
 
 // Clear are of screen.
 void
-vgafb_clear_chars(struct vgamode_s *vmode_g, struct cursorpos dest
+vgafb_clear_chars(struct cursorpos dest
                   , struct carattr ca, struct cursorpos clearsize)
 {
+    struct vgamode_s *vmode_g = get_current_mode();
+    if (!vmode_g)
+        return;
+
     if (GET_GLOBAL(vmode_g->memmodel) != MM_TEXT) {
         gfx_clear_chars(vmode_g, dest, ca, clearsize);
         return;