Replace common segment/offset pairs with struct segoff_s.
[seabios.git] / vgasrc / vgatables.h
index aa21108e7e26777b6830786214e0740b2b4664e7..e5f3309cc5e74d541c5937961de89bfd56a0259e 100644 (file)
@@ -2,6 +2,7 @@
 #define __VGATABLES_H
 
 #include "types.h" // u8
+#include "farptr.h" // struct segoff_s
 
 /*
  *
 #define LINEAR24   0x12
 #define LINEAR32   0x13
 
-#define SCROLL_DOWN 0
-#define SCROLL_UP   1
-
-#define SCREEN_SIZE(x,y) (((x*y*2)|0x00ff)+1)
-#define SCREEN_MEM_START(x,y,p) ((((x*y*2)|0x00ff)+1)*p)
-#define SCREEN_IO_START(x,y,p) ((((x*y)|0x00ff)+1)*p)
+#define SCREEN_IO_START(x,y,p) (((((x)*(y)) | 0x00ff) + 1) * (p))
+#define SCREEN_MEM_START(x,y,p) SCREEN_IO_START(((x)*2),(y),(p))
 
 /* standard BIOS Video Parameter Table */
 struct VideoParam_s {
@@ -127,10 +124,8 @@ struct saveBDAstate {
     u16 video_pagestart;
     u8 video_page;
     /* current font */
-    u16 font0_off;
-    u16 font0_seg;
-    u16 font1_off;
-    u16 font1_seg;
+    struct segoff_s font0;
+    struct segoff_s font1;
 };
 
 struct saveDACcolors {
@@ -156,8 +151,7 @@ extern u8 vgafont16alt[];
 
 // vga.c
 struct carattr {
-    u8 car, attr;
-    u16 use_attr;
+    u8 car, attr, use_attr;
 };
 struct cursorpos {
     u8 x, y, page;
@@ -169,8 +163,8 @@ void vgafb_scroll(int nblines, int attr
                   , struct cursorpos ul, struct cursorpos lr);
 void vgafb_write_char(struct cursorpos cp, struct carattr ca);
 struct carattr vgafb_read_char(struct cursorpos cp);
-void biosfn_write_pixel(u8 BH, u8 AL, u16 CX, u16 DX);
-void biosfn_read_pixel(u8 BH, u16 CX, u16 DX, u16 *AX);
+void vgafb_write_pixel(u8 color, u16 x, u16 y);
+u8 vgafb_read_pixel(u16 x, u16 y);
 void vgafb_load_font(u16 seg, void *src_far, u16 count
                      , u16 start, u8 destflags, u8 fontsize);
 
@@ -194,6 +188,8 @@ void vgahw_set_pel_mask(u8 val);
 u8 vgahw_get_pel_mask();
 void vgahw_save_dac_state(u16 seg, struct saveDACcolors *info);
 void vgahw_restore_dac_state(u16 seg, struct saveDACcolors *info);
+void vgahw_sequ_write(u8 index, u8 value);
+void vgahw_grdc_write(u8 index, u8 value);
 void vgahw_set_text_block_specifier(u8 spec);
 void get_font_access();
 void release_font_access();