1
/****************************************************************************
3
* VBE 2.0 Linear Framebuffer Profiler
4
* By Kendall Bennett and Brian Hook
8
* Environment: Watcom C/C++ 10.0a with DOS4GW
10
* Description: Header file for the LFBPROF.C progam.
12
****************************************************************************/
17
/*---------------------- Macros and type definitions ----------------------*/
21
/* SuperVGA information block */
24
char VESASignature[4]; /* 'VESA' 4 byte signature */
25
short VESAVersion; /* VBE version number */
26
long OemStringPtr; /* Pointer to OEM string */
27
long Capabilities; /* Capabilities of video card */
28
long VideoModePtr; /* Pointer to supported modes */
29
short TotalMemory; /* Number of 64kb memory blocks */
31
/* VBE 2.0 extensions */
33
short OemSoftwareRev; /* OEM Software revision number */
34
long OemVendorNamePtr; /* Pointer to Vendor Name string */
35
long OemProductNamePtr; /* Pointer to Product Name string */
36
long OemProductRevPtr; /* Pointer to Product Revision str */
37
char reserved[222]; /* Pad to 256 byte block size */
38
char OemDATA[256]; /* Scratch pad for OEM data */
41
/* SuperVGA mode information block */
44
short ModeAttributes; /* Mode attributes */
45
char WinAAttributes; /* Window A attributes */
46
char WinBAttributes; /* Window B attributes */
47
short WinGranularity; /* Window granularity in k */
48
short WinSize; /* Window size in k */
49
short WinASegment; /* Window A segment */
50
short WinBSegment; /* Window B segment */
51
long WinFuncPtr; /* Pointer to window function */
52
short BytesPerScanLine; /* Bytes per scanline */
53
short XResolution; /* Horizontal resolution */
54
short YResolution; /* Vertical resolution */
55
char XCharSize; /* Character cell width */
56
char YCharSize; /* Character cell height */
57
char NumberOfPlanes; /* Number of memory planes */
58
char BitsPerPixel; /* Bits per pixel */
59
char NumberOfBanks; /* Number of CGA style banks */
60
char MemoryModel; /* Memory model type */
61
char BankSize; /* Size of CGA style banks */
62
char NumberOfImagePages; /* Number of images pages */
63
char res1; /* Reserved */
64
char RedMaskSize; /* Size of direct color red mask */
65
char RedFieldPosition; /* Bit posn of lsb of red mask */
66
char GreenMaskSize; /* Size of direct color green mask */
67
char GreenFieldPosition; /* Bit posn of lsb of green mask */
68
char BlueMaskSize; /* Size of direct color blue mask */
69
char BlueFieldPosition; /* Bit posn of lsb of blue mask */
70
char RsvdMaskSize; /* Size of direct color res mask */
71
char RsvdFieldPosition; /* Bit posn of lsb of res mask */
72
char DirectColorModeInfo; /* Direct color mode attributes */
74
/* VBE 2.0 extensions */
76
long PhysBasePtr; /* Physical address for linear buf */
77
long OffScreenMemOffset; /* Pointer to start of offscreen mem*/
78
short OffScreenMemSize; /* Amount of offscreen mem in 1K's */
79
char res2[206]; /* Pad to 256 byte block size */
82
#define vbeMemPK 4 /* Packed Pixel memory model */
83
#define vbeUseLFB 0x4000 /* Enable linear framebuffer mode */
85
/* Flags for the mode attributes returned by VBE_getModeInfo. If
86
* vbeMdNonBanked is set to 1 and vbeMdLinear is also set to 1, then only
87
* the linear framebuffer mode is available.
90
#define vbeMdAvailable 0x0001 /* Video mode is available */
91
#define vbeMdColorMode 0x0008 /* Mode is a color video mode */
92
#define vbeMdGraphMode 0x0010 /* Mode is a graphics mode */
93
#define vbeMdNonBanked 0x0040 /* Banked mode is not supported */
94
#define vbeMdLinear 0x0080 /* Linear mode supported */
96
/* Structures for issuing real mode interrupts with DPMI */
99
unsigned short ax, bx, cx, dx, si, di, cflag;
103
unsigned char al, ah, bl, bh, cl, ch, dl, dh;
107
struct _RMWORDREGS x;
108
struct _RMBYTEREGS h;
118
/* Inline assembler block fill/move routines */
120
void LfbMemset(void *p,int c,int n);
121
#pragma aux LfbMemset = \
131
parm [edi] [ebx] [ecx];
133
void LfbMemcpy(void *dst,void *src,int n);
134
#pragma aux LfbMemcpy = \
137
parm [edi] [esi] [ecx];
139
/* Map a real mode pointer into address space */
141
#define LfbMapRealPointer(p) (void*)(((unsigned)((p) & 0xFFFF0000) >> 12) + ((p) & 0xFFFF))
143
/* Get the current timer tick count */
145
#define LfbGetTicks() *((long*)0x46C)
149
#endif /* __LFBPROF_H */