Add preliminary support for the x86emu backend.
[v86d.git] / libs / lrmi-0.10 / vbe.h
blob83efa4c2c7e73d027017cb99bad9e2315a6d7418
1 /*
2 This file is in the public domain.
3 */
5 #ifndef _VBE_H
6 #define _VBE_H
8 /* structures for vbe 2.0 */
10 struct vbe_info_block {
11 char vbe_signature[4];
12 short vbe_version;
13 unsigned short oem_string_off;
14 unsigned short oem_string_seg;
15 int capabilities;
16 unsigned short video_mode_list_off;
17 unsigned short video_mode_list_seg;
18 short total_memory;
19 short oem_software_rev;
20 unsigned short oem_vendor_name_off;
21 unsigned short oem_vendor_name_seg;
22 unsigned short oem_product_name_off;
23 unsigned short oem_product_name_seg;
24 unsigned short oem_product_rev_off;
25 unsigned short oem_product_rev_seg;
26 char reserved[222];
27 char oem_data[256];
28 } __attribute__ ((packed));
30 #define VBE_ATTR_MODE_SUPPORTED (1 << 0)
31 #define VBE_ATTR_TTY (1 << 2)
32 #define VBE_ATTR_COLOR (1 << 3)
33 #define VBE_ATTR_GRAPHICS (1 << 4)
34 #define VBE_ATTR_NOT_VGA (1 << 5)
35 #define VBE_ATTR_NOT_WINDOWED (1 << 6)
36 #define VBE_ATTR_LINEAR (1 << 7)
38 #define VBE_WIN_RELOCATABLE (1 << 0)
39 #define VBE_WIN_READABLE (1 << 1)
40 #define VBE_WIN_WRITEABLE (1 << 2)
42 #define VBE_MODEL_TEXT 0
43 #define VBE_MODEL_CGA 1
44 #define VBE_MODEL_HERCULES 2
45 #define VBE_MODEL_PLANAR 3
46 #define VBE_MODEL_PACKED 4
47 #define VBE_MODEL_256 5
48 #define VBE_MODEL_RGB 6
49 #define VBE_MODEL_YUV 7
51 struct vbe_mode_info_block {
52 unsigned short mode_attributes;
53 unsigned char win_a_attributes;
54 unsigned char win_b_attributes;
55 unsigned short win_granularity;
56 unsigned short win_size;
57 unsigned short win_a_segment;
58 unsigned short win_b_segment;
59 unsigned short win_func_ptr_off;
60 unsigned short win_func_ptr_seg;
61 unsigned short bytes_per_scanline;
62 unsigned short x_resolution;
63 unsigned short y_resolution;
64 unsigned char x_char_size;
65 unsigned char y_char_size;
66 unsigned char number_of_planes;
67 unsigned char bits_per_pixel;
68 unsigned char number_of_banks;
69 unsigned char memory_model;
70 unsigned char bank_size;
71 unsigned char number_of_image_pages;
72 unsigned char res1;
73 unsigned char red_mask_size;
74 unsigned char red_field_position;
75 unsigned char green_mask_size;
76 unsigned char green_field_position;
77 unsigned char blue_mask_size;
78 unsigned char blue_field_position;
79 unsigned char rsvd_mask_size;
80 unsigned char rsvd_field_position;
81 unsigned char direct_color_mode_info;
82 unsigned int phys_base_ptr;
83 unsigned int offscreen_mem_offset;
84 unsigned short offscreen_mem_size;
85 unsigned char res2[206];
86 } __attribute__ ((packed));
88 struct vbe_palette_entry {
89 unsigned char blue;
90 unsigned char green;
91 unsigned char red;
92 unsigned char align;
93 } __attribute__ ((packed));
95 #endif