annotate linux/vbelib.h @ 9355:19b0ee14fc0b

removed obsolete unused cyuv.c noticed by Mike Melanson <melanson@pcisys.net>
author arpi
date Sun, 09 Feb 2003 00:08:08 +0000
parents 21e1ab99cb21
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2243
f4b588dba08a vbelib import
nick
parents:
diff changeset
1 /*
f4b588dba08a vbelib import
nick
parents:
diff changeset
2 VESA VBE 2.0 compatible structures and definitions.
f4b588dba08a vbelib import
nick
parents:
diff changeset
3 You can redistribute this file under terms and conditions
2632
6e3cee9e07ef Double buffering interface
nick
parents: 2610
diff changeset
4 of GNU General Public licence v2.
2243
f4b588dba08a vbelib import
nick
parents:
diff changeset
5 Written by Nick Kurshev <nickols_k@mail.ru>
f4b588dba08a vbelib import
nick
parents:
diff changeset
6 */
f4b588dba08a vbelib import
nick
parents:
diff changeset
7 #ifndef __VESA_VBELIB_INCLUDED__
f4b588dba08a vbelib import
nick
parents:
diff changeset
8 #define __VESA_VBELIB_INCLUDED__ 1
f4b588dba08a vbelib import
nick
parents:
diff changeset
9
f4b588dba08a vbelib import
nick
parents:
diff changeset
10 /* Note: every pointer within structures is 32-bit protected mode pointer.
f4b588dba08a vbelib import
nick
parents:
diff changeset
11 So you don't need to convert it from real mode. */
f4b588dba08a vbelib import
nick
parents:
diff changeset
12
f4b588dba08a vbelib import
nick
parents:
diff changeset
13 typedef struct tagFarPtr
f4b588dba08a vbelib import
nick
parents:
diff changeset
14 {
f4b588dba08a vbelib import
nick
parents:
diff changeset
15 unsigned short off;
f4b588dba08a vbelib import
nick
parents:
diff changeset
16 unsigned short seg;
f4b588dba08a vbelib import
nick
parents:
diff changeset
17 }FarPtr;
f4b588dba08a vbelib import
nick
parents:
diff changeset
18
2254
6e5b548790c9 Fixed bug of 32-bit mode interface detection and save-restore mechanism
nick
parents: 2243
diff changeset
19 #define VBE_DAC_8BIT (1 << 0)
6e5b548790c9 Fixed bug of 32-bit mode interface detection and save-restore mechanism
nick
parents: 2243
diff changeset
20 #define VBE_NONVGA_CRTC (1 << 1)
6e5b548790c9 Fixed bug of 32-bit mode interface detection and save-restore mechanism
nick
parents: 2243
diff changeset
21 #define VBE_SNOWED_RAMDAC (1 << 2)
6e5b548790c9 Fixed bug of 32-bit mode interface detection and save-restore mechanism
nick
parents: 2243
diff changeset
22 #define VBE_STEREOSCOPIC (1 << 3)
6e5b548790c9 Fixed bug of 32-bit mode interface detection and save-restore mechanism
nick
parents: 2243
diff changeset
23 #define VBE_STEREO_EVC (1 << 4)
6e5b548790c9 Fixed bug of 32-bit mode interface detection and save-restore mechanism
nick
parents: 2243
diff changeset
24
2243
f4b588dba08a vbelib import
nick
parents:
diff changeset
25 struct VbeInfoBlock {
f4b588dba08a vbelib import
nick
parents:
diff changeset
26 char VESASignature[4]; /* 'VESA' 4 byte signature */
f4b588dba08a vbelib import
nick
parents:
diff changeset
27 short VESAVersion; /* VBE version number */
f4b588dba08a vbelib import
nick
parents:
diff changeset
28 char * OemStringPtr; /* Pointer to OEM string */
f4b588dba08a vbelib import
nick
parents:
diff changeset
29 long Capabilities; /* Capabilities of video card */
f4b588dba08a vbelib import
nick
parents:
diff changeset
30 unsigned short* VideoModePtr; /* Pointer to supported modes */
f4b588dba08a vbelib import
nick
parents:
diff changeset
31 short TotalMemory; /* Number of 64kb memory blocks */
2254
6e5b548790c9 Fixed bug of 32-bit mode interface detection and save-restore mechanism
nick
parents: 2243
diff changeset
32 /* VBE 2.0 and above */
2243
f4b588dba08a vbelib import
nick
parents:
diff changeset
33 short OemSoftwareRev;
f4b588dba08a vbelib import
nick
parents:
diff changeset
34 char * OemVendorNamePtr;
f4b588dba08a vbelib import
nick
parents:
diff changeset
35 char * OemProductNamePtr;
f4b588dba08a vbelib import
nick
parents:
diff changeset
36 char * OemProductRevPtr;
f4b588dba08a vbelib import
nick
parents:
diff changeset
37 char reserved[222];
f4b588dba08a vbelib import
nick
parents:
diff changeset
38 char OemData[256]; /* Pad to 512 byte block size */
f4b588dba08a vbelib import
nick
parents:
diff changeset
39 }__attribute__ ((packed));
f4b588dba08a vbelib import
nick
parents:
diff changeset
40
f4b588dba08a vbelib import
nick
parents:
diff changeset
41 static inline FarPtr VirtToPhys(void *ptr)
f4b588dba08a vbelib import
nick
parents:
diff changeset
42 {
f4b588dba08a vbelib import
nick
parents:
diff changeset
43 FarPtr retval;
f4b588dba08a vbelib import
nick
parents:
diff changeset
44 retval.seg = ((unsigned long)ptr) >> 4;
f4b588dba08a vbelib import
nick
parents:
diff changeset
45 retval.off = ((unsigned long)ptr) & 0x0f;
f4b588dba08a vbelib import
nick
parents:
diff changeset
46 return retval;
f4b588dba08a vbelib import
nick
parents:
diff changeset
47 }
f4b588dba08a vbelib import
nick
parents:
diff changeset
48
f4b588dba08a vbelib import
nick
parents:
diff changeset
49 static inline unsigned short VirtToPhysSeg(void *ptr)
f4b588dba08a vbelib import
nick
parents:
diff changeset
50 {
f4b588dba08a vbelib import
nick
parents:
diff changeset
51 return ((unsigned long)ptr) >> 4;
f4b588dba08a vbelib import
nick
parents:
diff changeset
52 }
f4b588dba08a vbelib import
nick
parents:
diff changeset
53
f4b588dba08a vbelib import
nick
parents:
diff changeset
54 static inline unsigned short VirtToPhysOff(void *ptr)
f4b588dba08a vbelib import
nick
parents:
diff changeset
55 {
f4b588dba08a vbelib import
nick
parents:
diff changeset
56 return ((unsigned long)ptr) & 0x0f;
f4b588dba08a vbelib import
nick
parents:
diff changeset
57 }
f4b588dba08a vbelib import
nick
parents:
diff changeset
58
f4b588dba08a vbelib import
nick
parents:
diff changeset
59 static inline void * PhysToVirt(FarPtr ptr)
f4b588dba08a vbelib import
nick
parents:
diff changeset
60 {
f4b588dba08a vbelib import
nick
parents:
diff changeset
61 return (void *)((ptr.seg << 4) | ptr.off);
f4b588dba08a vbelib import
nick
parents:
diff changeset
62 }
f4b588dba08a vbelib import
nick
parents:
diff changeset
63
f4b588dba08a vbelib import
nick
parents:
diff changeset
64 static inline void * PhysToVirtSO(unsigned short seg,unsigned short off)
f4b588dba08a vbelib import
nick
parents:
diff changeset
65 {
f4b588dba08a vbelib import
nick
parents:
diff changeset
66 return (void *)((seg << 4) | off);
f4b588dba08a vbelib import
nick
parents:
diff changeset
67 }
f4b588dba08a vbelib import
nick
parents:
diff changeset
68
f4b588dba08a vbelib import
nick
parents:
diff changeset
69 #define MODE_ATTR_MODE_SUPPORTED (1 << 0)
f4b588dba08a vbelib import
nick
parents:
diff changeset
70 #define MODE_ATTR_TTY (1 << 2)
f4b588dba08a vbelib import
nick
parents:
diff changeset
71 #define MODE_ATTR_COLOR (1 << 3)
f4b588dba08a vbelib import
nick
parents:
diff changeset
72 #define MODE_ATTR_GRAPHICS (1 << 4)
f4b588dba08a vbelib import
nick
parents:
diff changeset
73 #define MODE_ATTR_NOT_VGA (1 << 5)
f4b588dba08a vbelib import
nick
parents:
diff changeset
74 #define MODE_ATTR_NOT_WINDOWED (1 << 6)
f4b588dba08a vbelib import
nick
parents:
diff changeset
75 #define MODE_ATTR_LINEAR (1 << 7)
f4b588dba08a vbelib import
nick
parents:
diff changeset
76 #define MODE_ATTR_DOUBLESCAN (1 << 8)
f4b588dba08a vbelib import
nick
parents:
diff changeset
77 #define MODE_ATTR_INTERLACE (1 << 9)
f4b588dba08a vbelib import
nick
parents:
diff changeset
78 #define MODE_ATTR_TRIPLEBUFFER (1 << 10)
f4b588dba08a vbelib import
nick
parents:
diff changeset
79 #define MODE_ATTR_STEREOSCOPIC (1 << 11)
f4b588dba08a vbelib import
nick
parents:
diff changeset
80 #define MODE_ATTR_DUALDISPLAY (1 << 12)
f4b588dba08a vbelib import
nick
parents:
diff changeset
81
f4b588dba08a vbelib import
nick
parents:
diff changeset
82 #define MODE_WIN_RELOCATABLE (1 << 0)
f4b588dba08a vbelib import
nick
parents:
diff changeset
83 #define MODE_WIN_READABLE (1 << 1)
f4b588dba08a vbelib import
nick
parents:
diff changeset
84 #define MODE_WIN_WRITEABLE (1 << 2)
f4b588dba08a vbelib import
nick
parents:
diff changeset
85
f4b588dba08a vbelib import
nick
parents:
diff changeset
86 /* SuperVGA mode information block */
f4b588dba08a vbelib import
nick
parents:
diff changeset
87 struct VesaModeInfoBlock {
2608
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
88 unsigned short ModeAttributes; /* 00: Mode attributes */
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
89 unsigned char WinAAttributes; /* 02: Window A attributes */
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
90 unsigned char WinBAttributes; /* 03: Window B attributes */
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
91 unsigned short WinGranularity; /* 04: Window granularity in k */
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
92 unsigned short WinSize; /* 06: Window size in k */
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
93 unsigned short WinASegment; /* 08: Window A segment */
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
94 unsigned short WinBSegment; /* 0A: Window B segment */
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
95 FarPtr WinFuncPtr; /* 0C: 16-bit far pointer to window function */
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
96 unsigned short BytesPerScanLine; /* 10: Bytes per scanline */
2243
f4b588dba08a vbelib import
nick
parents:
diff changeset
97 /* VBE 1.2 and above */
2608
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
98 unsigned short XResolution; /* 12: Horizontal resolution */
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
99 unsigned short YResolution; /* 14: Vertical resolution */
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
100 unsigned char XCharSize; /* 16: Character cell width */
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
101 unsigned char YCharSize; /* 17: Character cell height */
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
102 unsigned char NumberOfPlanes; /* 18: Number of memory planes */
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
103 unsigned char BitsPerPixel; /* 19: Bits per pixel */
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
104 unsigned char NumberOfBanks; /* 1A: Number of CGA style banks */
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
105 unsigned char MemoryModel; /* 1B: Memory model type */
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
106 unsigned char BankSize; /* 1C: Size of CGA style banks */
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
107 unsigned char NumberOfImagePages; /* 1D: Number of images pages */
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
108 unsigned char res1; /* 1E: Reserved */
2243
f4b588dba08a vbelib import
nick
parents:
diff changeset
109 /* Direct Color fields (required for direct/6 and YUV/7 memory models) */
2608
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
110 unsigned char RedMaskSize; /* 1F: Size of direct color red mask */
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
111 unsigned char RedFieldPosition; /* 20: Bit posn of lsb of red mask */
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
112 unsigned char GreenMaskSize; /* 21: Size of direct color green mask */
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
113 unsigned char GreenFieldPosition; /* 22: Bit posn of lsb of green mask */
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
114 unsigned char BlueMaskSize; /* 23: Size of direct color blue mask */
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
115 unsigned char BlueFieldPosition; /* 24: Bit posn of lsb of blue mask */
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
116 unsigned char RsvdMaskSize; /* 25: Size of direct color res mask */
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
117 unsigned char RsvdFieldPosition; /* 26: Bit posn of lsb of res mask */
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
118 unsigned char DirectColorModeInfo; /* 27: Direct color mode attributes */
2243
f4b588dba08a vbelib import
nick
parents:
diff changeset
119 /* VBE 2.0 and above */
2608
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
120 unsigned long PhysBasePtr; /* 28: physical address for flat memory frame buffer. (Should be converted to linear before using) */
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
121 unsigned short res3[3]; /* 2C: Reserved - always set to 0 */
2243
f4b588dba08a vbelib import
nick
parents:
diff changeset
122 /* VBE 3.0 and above */
2608
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
123 unsigned short LinBytesPerScanLine; /* 32: bytes per scan line for linear modes */
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
124 unsigned char BnkNumberOfImagePages;/* 34: number of images for banked modes */
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
125 unsigned char LinNumberOfImagePages;/* 35: number of images for linear modes */
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
126 unsigned char LinRedMaskSize; /* 36: size of direct color red mask (linear modes) */
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
127 unsigned char LinRedFieldPosition; /* 37: bit position of lsb of red mask (linear modes) */
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
128 unsigned char LinGreenMaskSize; /* 38: size of direct color green mask (linear modes) */
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
129 unsigned char LinGreenFieldPosition;/* 39: bit position of lsb of green mask (linear modes) */
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
130 unsigned char LinBlueMaskSize; /* 40: size of direct color blue mask (linear modes) */
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
131 unsigned char LinBlueFieldPosition; /* 41: bit position of lsb of blue mask (linear modes) */
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
132 unsigned char LinRsvdMaskSize; /* 42: size of direct color reserved mask (linear modes) */
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
133 unsigned char LinRsvdFieldPosition; /* 43: bit position of lsb of reserved mask (linear modes) */
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
134 unsigned long MaxPixelClock; /* 44: maximum pixel clock (in Hz) for graphics mode */
88c089c3ea45 Fixed bug of DGA address detection!!!
nick
parents: 2460
diff changeset
135 char res4[189]; /* 48: remainder of ModeInfoBlock */
2243
f4b588dba08a vbelib import
nick
parents:
diff changeset
136 }__attribute__ ((packed));
f4b588dba08a vbelib import
nick
parents:
diff changeset
137
f4b588dba08a vbelib import
nick
parents:
diff changeset
138 typedef enum {
f4b588dba08a vbelib import
nick
parents:
diff changeset
139 memText= 0,
f4b588dba08a vbelib import
nick
parents:
diff changeset
140 memCGA = 1,
f4b588dba08a vbelib import
nick
parents:
diff changeset
141 memHercules = 2,
f4b588dba08a vbelib import
nick
parents:
diff changeset
142 memPL = 3, /* Planar memory model */
f4b588dba08a vbelib import
nick
parents:
diff changeset
143 memPK = 4, /* Packed pixel memory model */
f4b588dba08a vbelib import
nick
parents:
diff changeset
144 mem256 = 5,
f4b588dba08a vbelib import
nick
parents:
diff changeset
145 memRGB = 6, /* Direct color RGB memory model */
f4b588dba08a vbelib import
nick
parents:
diff changeset
146 memYUV = 7, /* Direct color YUV memory model */
f4b588dba08a vbelib import
nick
parents:
diff changeset
147 } memModels;
f4b588dba08a vbelib import
nick
parents:
diff changeset
148
f4b588dba08a vbelib import
nick
parents:
diff changeset
149 struct VesaCRTCInfoBlock {
f4b588dba08a vbelib import
nick
parents:
diff changeset
150 unsigned short hTotal; /* Horizontal total in pixels */
f4b588dba08a vbelib import
nick
parents:
diff changeset
151 unsigned short hSyncStart; /* Horizontal sync start in pixels */
f4b588dba08a vbelib import
nick
parents:
diff changeset
152 unsigned short hSyncEnd; /* Horizontal sync end in pixels */
f4b588dba08a vbelib import
nick
parents:
diff changeset
153 unsigned short vTotal; /* Vertical total in lines */
f4b588dba08a vbelib import
nick
parents:
diff changeset
154 unsigned short vSyncStart; /* Vertical sync start in lines */
f4b588dba08a vbelib import
nick
parents:
diff changeset
155 unsigned short vSyncEnd; /* Vertical sync end in lines */
f4b588dba08a vbelib import
nick
parents:
diff changeset
156 unsigned char Flags; /* Flags (Interlaced, Double Scan etc) */
f4b588dba08a vbelib import
nick
parents:
diff changeset
157 unsigned long PixelClock; /* Pixel clock in units of Hz */
f4b588dba08a vbelib import
nick
parents:
diff changeset
158 unsigned short RefreshRate;/* Refresh rate in units of 0.01 Hz*/
f4b588dba08a vbelib import
nick
parents:
diff changeset
159 unsigned char Reserved[40];/* remainder of CRTCInfoBlock*/
f4b588dba08a vbelib import
nick
parents:
diff changeset
160 }__attribute__ ((packed));
f4b588dba08a vbelib import
nick
parents:
diff changeset
161
f4b588dba08a vbelib import
nick
parents:
diff changeset
162 #define VESA_CRTC_DOUBLESCAN 0x01
f4b588dba08a vbelib import
nick
parents:
diff changeset
163 #define VESA_CRTC_INTERLACED 0x02
f4b588dba08a vbelib import
nick
parents:
diff changeset
164 #define VESA_CRTC_HSYNC_NEG 0x04
f4b588dba08a vbelib import
nick
parents:
diff changeset
165 #define VESA_CRTC_VSYNC_NEG 0x08
f4b588dba08a vbelib import
nick
parents:
diff changeset
166
f4b588dba08a vbelib import
nick
parents:
diff changeset
167 #define VESA_MODE_CRTC_REFRESH (1 << 11)
f4b588dba08a vbelib import
nick
parents:
diff changeset
168 #define VESA_MODE_USE_LINEAR (1 << 14)
f4b588dba08a vbelib import
nick
parents:
diff changeset
169 #define VESA_MODE_NOT_CLEAR (1 << 15)
f4b588dba08a vbelib import
nick
parents:
diff changeset
170
f4b588dba08a vbelib import
nick
parents:
diff changeset
171 /* This will contain accesible 32-bit protmode pointers */
f4b588dba08a vbelib import
nick
parents:
diff changeset
172 struct VesaProtModeInterface
f4b588dba08a vbelib import
nick
parents:
diff changeset
173 {
f4b588dba08a vbelib import
nick
parents:
diff changeset
174 void (*SetWindowCall)(void);
f4b588dba08a vbelib import
nick
parents:
diff changeset
175 void (*SetDisplayStart)(void);
f4b588dba08a vbelib import
nick
parents:
diff changeset
176 void (*SetPaletteData)(void);
f4b588dba08a vbelib import
nick
parents:
diff changeset
177 unsigned short * iopl_ports;
2254
6e5b548790c9 Fixed bug of 32-bit mode interface detection and save-restore mechanism
nick
parents: 2243
diff changeset
178 };
2243
f4b588dba08a vbelib import
nick
parents:
diff changeset
179
f4b588dba08a vbelib import
nick
parents:
diff changeset
180 /*
f4b588dba08a vbelib import
nick
parents:
diff changeset
181 All functions below return:
f4b588dba08a vbelib import
nick
parents:
diff changeset
182 0 if succesful
f4b588dba08a vbelib import
nick
parents:
diff changeset
183 0xffff if vm86 syscall error occurs
f4b588dba08a vbelib import
nick
parents:
diff changeset
184 0x4fxx if VESA error occurs
f4b588dba08a vbelib import
nick
parents:
diff changeset
185 */
f4b588dba08a vbelib import
nick
parents:
diff changeset
186
f4b588dba08a vbelib import
nick
parents:
diff changeset
187 #define VBE_OK 0
f4b588dba08a vbelib import
nick
parents:
diff changeset
188 #define VBE_VM86_FAIL -1
f4b588dba08a vbelib import
nick
parents:
diff changeset
189 #define VBE_OUT_OF_DOS_MEM -2
f4b588dba08a vbelib import
nick
parents:
diff changeset
190 #define VBE_OUT_OF_MEM -3
2359
ee6ef0b10655 More iopl'ed ports and test for brken BIOS
nick
parents: 2254
diff changeset
191 #define VBE_BROKEN_BIOS -4
2254
6e5b548790c9 Fixed bug of 32-bit mode interface detection and save-restore mechanism
nick
parents: 2243
diff changeset
192 #define VBE_VESA_ERROR_MASK 0x004f
6e5b548790c9 Fixed bug of 32-bit mode interface detection and save-restore mechanism
nick
parents: 2243
diff changeset
193 #define VBE_VESA_ERRCODE_MASK 0xff00
2243
f4b588dba08a vbelib import
nick
parents:
diff changeset
194
f4b588dba08a vbelib import
nick
parents:
diff changeset
195 extern int vbeInit( void );
2446
6fb598bd7ede Suppressing warnings
nick
parents: 2410
diff changeset
196 extern int vbeDestroy( void );
2243
f4b588dba08a vbelib import
nick
parents:
diff changeset
197
f4b588dba08a vbelib import
nick
parents:
diff changeset
198 extern int vbeGetControllerInfo(struct VbeInfoBlock *);
f4b588dba08a vbelib import
nick
parents:
diff changeset
199 extern int vbeGetModeInfo(unsigned mode,struct VesaModeInfoBlock *);
f4b588dba08a vbelib import
nick
parents:
diff changeset
200 extern int vbeSetMode(unsigned mode,struct VesaCRTCInfoBlock *);
f4b588dba08a vbelib import
nick
parents:
diff changeset
201 extern int vbeGetMode(unsigned *mode);
7069
21e1ab99cb21 General Timing Formula algorithm from a scratch.
arpi
parents: 2693
diff changeset
202 extern int vbeGetPixelClock(unsigned *mode,unsigned *pixel_clock);
2243
f4b588dba08a vbelib import
nick
parents:
diff changeset
203 extern int vbeSaveState(void **data); /* note never copy this data */
f4b588dba08a vbelib import
nick
parents:
diff changeset
204 extern int vbeRestoreState(void *data);
f4b588dba08a vbelib import
nick
parents:
diff changeset
205 extern int vbeGetWindow(unsigned *win_num); /* win_A=0 or win_B=1 */
f4b588dba08a vbelib import
nick
parents:
diff changeset
206 extern int vbeSetWindow(unsigned win_num,unsigned win_gran);
2632
6e3cee9e07ef Double buffering interface
nick
parents: 2610
diff changeset
207 extern int vbeGetScanLineLength(unsigned *num_pixels,unsigned *num_bytes);
6e3cee9e07ef Double buffering interface
nick
parents: 2610
diff changeset
208 extern int vbeGetMaxScanLines(unsigned *num_pixels,unsigned *num_bytes, unsigned *num_lines);
6e3cee9e07ef Double buffering interface
nick
parents: 2610
diff changeset
209 extern int vbeSetScanLineLength(unsigned num_pixels);
6e3cee9e07ef Double buffering interface
nick
parents: 2610
diff changeset
210 extern int vbeSetScanLineLengthB(unsigned num_bytes);
6e3cee9e07ef Double buffering interface
nick
parents: 2610
diff changeset
211 extern int vbeGetDisplayStart(unsigned *pixel_num,unsigned *scan_line);
6e3cee9e07ef Double buffering interface
nick
parents: 2610
diff changeset
212 extern int vbeSetDisplayStart(unsigned long offset, int vsync);
2693
1a8e5e017b1d triple buffering interface
nick
parents: 2632
diff changeset
213 extern int vbeSetScheduledDisplayStart(unsigned long offset, int vsync);
2243
f4b588dba08a vbelib import
nick
parents:
diff changeset
214 /*
f4b588dba08a vbelib import
nick
parents:
diff changeset
215 Func 0x08-0x09:
f4b588dba08a vbelib import
nick
parents:
diff changeset
216 Support of palette currently is not implemented.
f4b588dba08a vbelib import
nick
parents:
diff changeset
217 */
f4b588dba08a vbelib import
nick
parents:
diff changeset
218 extern int vbeGetProtModeInfo(struct VesaProtModeInterface *);
2410
27ca5ad3c7e9 Title support
nick
parents: 2359
diff changeset
219
27ca5ad3c7e9 Title support
nick
parents: 2359
diff changeset
220 /* Standard VGA stuff */
27ca5ad3c7e9 Title support
nick
parents: 2359
diff changeset
221 int vbeWriteString(int x, int y, int attr, char *str);
27ca5ad3c7e9 Title support
nick
parents: 2359
diff changeset
222
2610
65cb69a90a9f vo_vesa: DGA support
nick
parents: 2608
diff changeset
223 /* Misc stuff (For portability only) */
65cb69a90a9f vo_vesa: DGA support
nick
parents: 2608
diff changeset
224 void * vbeMapVideoBuffer(unsigned long phys_addr,unsigned long size);
65cb69a90a9f vo_vesa: DGA support
nick
parents: 2608
diff changeset
225 void vbeUnmapVideoBuffer(unsigned long linear_addr,unsigned long size);
65cb69a90a9f vo_vesa: DGA support
nick
parents: 2608
diff changeset
226
2460
7925f241765b Suppress trivial warnings
nick
parents: 2446
diff changeset
227 #endif