Kevin O'Connor | e1e000b | 2011-12-31 03:30:40 -0500 | [diff] [blame] | 1 | #ifndef __VGABIOS_H |
| 2 | #define __VGABIOS_H |
Kevin O'Connor | 1f2c307 | 2009-05-06 23:35:59 -0400 | [diff] [blame] | 3 | |
| 4 | #include "types.h" // u8 |
Kevin O'Connor | 9f98542 | 2009-09-09 11:34:39 -0400 | [diff] [blame] | 5 | #include "farptr.h" // struct segoff_s |
Kevin O'Connor | 1f2c307 | 2009-05-06 23:35:59 -0400 | [diff] [blame] | 6 | |
Kevin O'Connor | 2c34f41 | 2009-05-31 15:25:14 -0400 | [diff] [blame] | 7 | #define SCREEN_IO_START(x,y,p) (((((x)*(y)) | 0x00ff) + 1) * (p)) |
| 8 | #define SCREEN_MEM_START(x,y,p) SCREEN_IO_START(((x)*2),(y),(p)) |
Kevin O'Connor | 1f2c307 | 2009-05-06 23:35:59 -0400 | [diff] [blame] | 9 | |
Kevin O'Connor | ca66864 | 2009-05-21 23:06:08 -0400 | [diff] [blame] | 10 | struct saveBDAstate { |
| 11 | u8 video_mode; |
| 12 | u16 video_cols; |
| 13 | u16 video_pagesize; |
| 14 | u16 crtc_address; |
| 15 | u8 video_rows; |
| 16 | u16 char_height; |
| 17 | u8 video_ctl; |
| 18 | u8 video_switches; |
| 19 | u8 modeset_ctl; |
| 20 | u16 cursor_type; |
| 21 | u16 cursor_pos[8]; |
| 22 | u16 video_pagestart; |
| 23 | u8 video_page; |
| 24 | /* current font */ |
Kevin O'Connor | 9f98542 | 2009-09-09 11:34:39 -0400 | [diff] [blame] | 25 | struct segoff_s font0; |
| 26 | struct segoff_s font1; |
Kevin O'Connor | ca66864 | 2009-05-21 23:06:08 -0400 | [diff] [blame] | 27 | }; |
| 28 | |
Kevin O'Connor | 821d6b4 | 2011-12-31 18:19:22 -0500 | [diff] [blame] | 29 | // Mode flags |
| 30 | #define MF_GRAYSUM 0x0002 |
| 31 | #define MF_NOPALETTE 0x0008 |
| 32 | #define MF_CUSTOMCRTC 0x0800 |
| 33 | #define MF_LINEARFB 0x4000 |
| 34 | #define MF_NOCLEARMEM 0x8000 |
| 35 | |
Kevin O'Connor | 5727c29 | 2009-05-16 17:29:32 -0400 | [diff] [blame] | 36 | // vgatables.c |
Kevin O'Connor | ed68e5b | 2011-12-31 04:15:12 -0500 | [diff] [blame] | 37 | struct vgamode_s; |
Kevin O'Connor | 5727c29 | 2009-05-16 17:29:32 -0400 | [diff] [blame] | 38 | struct vgamode_s *find_vga_entry(u8 mode); |
Kevin O'Connor | f376037 | 2011-12-23 22:41:08 -0500 | [diff] [blame] | 39 | void build_video_param(void); |
Kevin O'Connor | 815e447 | 2011-12-21 09:05:32 -0500 | [diff] [blame] | 40 | extern struct VideoSavePointer_s video_save_pointer_table; |
Kevin O'Connor | 1f2c307 | 2009-05-06 23:35:59 -0400 | [diff] [blame] | 41 | extern u8 static_functionality[]; |
| 42 | |
| 43 | // vgafonts.c |
| 44 | extern u8 vgafont8[]; |
| 45 | extern u8 vgafont14[]; |
| 46 | extern u8 vgafont16[]; |
| 47 | extern u8 vgafont14alt[]; |
| 48 | extern u8 vgafont16alt[]; |
| 49 | |
Kevin O'Connor | e1e000b | 2011-12-31 03:30:40 -0500 | [diff] [blame] | 50 | // vgabios.c |
Kevin O'Connor | 161d201 | 2011-12-31 19:42:21 -0500 | [diff] [blame^] | 51 | extern u16 VgaBDF; |
Kevin O'Connor | f376037 | 2011-12-23 22:41:08 -0500 | [diff] [blame] | 52 | #define SET_VGA(var, val) SET_FARVAR(get_global_seg(), (var), (val)) |
Kevin O'Connor | 0926241 | 2009-05-25 11:44:11 -0400 | [diff] [blame] | 53 | struct carattr { |
Kevin O'Connor | 0ad77f0 | 2009-05-31 20:46:43 -0400 | [diff] [blame] | 54 | u8 car, attr, use_attr; |
Kevin O'Connor | 0926241 | 2009-05-25 11:44:11 -0400 | [diff] [blame] | 55 | }; |
Kevin O'Connor | 918b156 | 2009-05-25 11:05:18 -0400 | [diff] [blame] | 56 | struct cursorpos { |
| 57 | u8 x, y, page; |
| 58 | }; |
Kevin O'Connor | 821d6b4 | 2011-12-31 18:19:22 -0500 | [diff] [blame] | 59 | void modeswitch_set_bda(int mode, int flags, struct vgamode_s *vmode_g); |
Kevin O'Connor | c0c7df6 | 2009-05-17 18:11:33 -0400 | [diff] [blame] | 60 | |
| 61 | // vgafb.c |
Kevin O'Connor | 217f2bc | 2009-05-31 00:46:47 -0400 | [diff] [blame] | 62 | void vgafb_scroll(int nblines, int attr |
| 63 | , struct cursorpos ul, struct cursorpos lr); |
Kevin O'Connor | d3b3815 | 2009-05-26 00:05:37 -0400 | [diff] [blame] | 64 | void vgafb_write_char(struct cursorpos cp, struct carattr ca); |
| 65 | struct carattr vgafb_read_char(struct cursorpos cp); |
Kevin O'Connor | 227a2bb | 2009-05-31 22:00:20 -0400 | [diff] [blame] | 66 | void vgafb_write_pixel(u8 color, u16 x, u16 y); |
| 67 | u8 vgafb_read_pixel(u16 x, u16 y); |
Kevin O'Connor | c0c7df6 | 2009-05-17 18:11:33 -0400 | [diff] [blame] | 68 | |
Julian Pidancet | 87879e2 | 2011-12-19 05:08:00 +0000 | [diff] [blame] | 69 | // vbe.c |
| 70 | #define VBE_OEM_STRING "SeaBIOS VBE(C) 2011" |
| 71 | #define VBE_VENDOR_STRING "SeaBIOS Developers" |
| 72 | #define VBE_PRODUCT_STRING "SeaBIOS VBE Adapter" |
| 73 | #define VBE_REVISION_STRING "Rev. 1" |
| 74 | |
| 75 | struct vbe_modeinfo |
| 76 | { |
| 77 | u16 width; |
| 78 | u16 height; |
| 79 | u8 depth; |
| 80 | u16 linesize; |
| 81 | u32 phys_base; |
| 82 | u32 vram_size; |
| 83 | }; |
Kevin O'Connor | 21079f4 | 2009-05-16 21:30:10 -0400 | [diff] [blame] | 84 | |
Kevin O'Connor | 4040195 | 2011-12-31 03:43:12 -0500 | [diff] [blame] | 85 | struct bregs; |
| 86 | void handle_104f(struct bregs *regs); |
| 87 | |
Kevin O'Connor | e1e000b | 2011-12-31 03:30:40 -0500 | [diff] [blame] | 88 | #endif // vgabios.h |