]> xenbits.xensource.com Git - seabios.git/commitdiff
vgainit: Move video param setup to stdvga_build_video_param()
authorKevin O'Connor <kevin@koconnor.net>
Fri, 5 Aug 2016 14:58:24 +0000 (10:58 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Fri, 5 Aug 2016 15:27:25 +0000 (11:27 -0400)
Move the full video_param_table[] setup (including the updating of the
BDA) to stdvga_build_video_param().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
vgasrc/stdvgamodes.c
vgasrc/vgabios.c
vgasrc/vgabios.h
vgasrc/vgainit.c

index c553514fad6e313d9052c0403d557d277a9ab5fe..f61d52fe1a85e5e8a7a360f76c21d3865e6439f1 100644 (file)
@@ -7,6 +7,7 @@
 
 #include "biosvar.h" // GET_GLOBAL
 #include "output.h" // warn_internalerror
+#include "std/vga.h" // struct video_param_s
 #include "stdvga.h" // stdvga_find_mode
 #include "string.h" // memcpy_far
 #include "vgabios.h" // video_param_table
@@ -348,9 +349,18 @@ stdvga_list_modes(u16 seg, u16 *dest, u16 *last)
     SET_FARVAR(seg, *dest, 0xffff);
 }
 
+static struct video_save_pointer_s video_save_pointer_table VAR16;
+
+static struct video_param_s video_param_table[29] VAR16;
+
 void
 stdvga_build_video_param(void)
 {
+    SET_BDA(video_savetable
+            , SEGOFF(get_global_seg(), (u32)&video_save_pointer_table));
+    SET_VGA(video_save_pointer_table.videoparam
+            , SEGOFF(get_global_seg(), (u32)video_param_table));
+
     static u8 parammodes[] VAR16 = {
         0, 0, 0, 0, 0x04, 0x05, 0x06, 0x07,
         0, 0, 0, 0, 0, 0x0d, 0x0e, 0,
index 44ce312d81a949717fc92a937d9f8e62f01112d3..b980da5d426bb1c1bfac1cbf5f424d01fe3abb48 100644 (file)
@@ -11,6 +11,7 @@
 #include "config.h" // CONFIG_*
 #include "output.h" // dprintf
 #include "std/vbe.h" // VBE_RETURN_STATUS_FAILED
+#include "std/vga.h" // struct video_func_static
 #include "stdvga.h" // stdvga_set_cursor_shape
 #include "string.h" // memset_far
 #include "vgabios.h" // calc_page_size
index 0e988bdbbf329dee1884108e963631c47e0a2991..2176ec61b1225e56dbcd976ac1b27b53576b2be9 100644 (file)
@@ -2,9 +2,8 @@
 #define __VGABIOS_H
 
 #include "config.h" // CONFIG_VGA_EMULATE_TEXT
+#include "farptr.h" // GET_FARVAR
 #include "types.h" // u8
-#include "farptr.h" // struct segoff_s
-#include "std/vga.h" // struct video_param_s
 
 // Save/Restore flags
 #define SR_HARDWARE   0x0001
@@ -81,12 +80,10 @@ extern u8 vgafont14alt[];
 extern u8 vgafont16alt[];
 
 // vgainit.c
-extern struct video_save_pointer_s video_save_pointer_table;
-extern struct video_param_s video_param_table[29];
-
-// vgabios.c
 extern int VgaBDF;
 extern int HaveRunInit;
+
+// vgabios.c
 #define SET_VGA(var, val) SET_FARVAR(get_global_seg(), (var), (val))
 int vga_bpp(struct vgamode_s *vmode_g);
 u16 calc_page_size(u8 memmodel, u16 width, u16 height);
index 6249e665c65ddc5736a74b1dc0200d3c9996e320..f003026c93895f0b5a66114c77a8b3c6895f772d 100644 (file)
 #include "vgabios.h" // video_save_pointer_table
 #include "vgahw.h" // vgahw_setup
 
-struct video_save_pointer_s video_save_pointer_table VAR16;
-
-struct video_param_s video_param_table[29] VAR16;
-
 // Type of emulator platform - for dprintf with certain compile options.
 int PlatformRunningOn VAR16;
 
@@ -132,8 +128,6 @@ init_bios_area(void)
     SET_BDA(modeset_ctl, 0x51);
 
     SET_BDA(dcc_index, CONFIG_VGA_STDVGA_PORTS ? 0x08 : 0xff);
-    SET_BDA(video_savetable
-            , SEGOFF(get_global_seg(), (u32)&video_save_pointer_table));
 
     // FIXME
     SET_BDA(video_msr, 0x00); // Unavailable on vanilla vga, but...
@@ -171,8 +165,6 @@ vga_post(struct bregs *regs)
 
     init_bios_area();
 
-    SET_VGA(video_save_pointer_table.videoparam
-            , SEGOFF(get_global_seg(), (u32)video_param_table));
     if (CONFIG_VGA_STDVGA_PORTS)
         stdvga_build_video_param();