13df #define FALSE 0 #define TRUE 1 extern unsigned long egacolor[16]; struct VbeInfoBlock { unsigned char VbeSignature[4] ; unsigned int VbeVersion; char far *OemStringPtr; unsigned char Capabilities[4]; char far *VideoModePtr; unsigned int TotalMemory; unsigned int OemSoftwareRev; char far *OemVendorNamePtr; char far *OemProductNamePtr; char far *OemProductRevPtr; char Reserved[222]; char OemData[256]; }; struct ModeInfoBlock { /* Mandatory information for all VBE revisions */ unsigned int ModeAttributes; unsigned char WinAAttributes; /* window A attributes */ unsigned char WinBAttributes; /* window B attributes */ unsigned int WinGranularity; /* window granularity */ unsigned int WinSize; /* window size */ unsigned int WinASegment; /* window A start segment */ unsigned int WinBSegment; /* window B start segment */ void far *WinFuncPtr; /* pointer to window function */ unsigned int BytesPerScanLine; /* bytes per scan line */ /* Mandatory information for VBE 1.2 and above */ unsigned int XResolution; /* horizontal resolution in pixels or chars */ unsigned int YResolution; /* vertical resolution in pixels or chars */ unsigned char XCharSize; /* character cell width in pixels */ unsigned char YCharSize; /* character cell height in pixels */ unsigned char NumberOfPlanes; /* number of memory planes */ unsigned char BitsPerPixel; /* bits per pixel */ unsigned char NumberOfBanks; /* number of banks */ unsigned char MemoryModel; /* memory model type */ unsigned char BankSize; /* bank size in KB */ unsigned char NumberOfImagePages; /* number of images */ unsigned char Reserved; /* reserved for page function */ /* Direct Color fields (required for direct/6 and YUV/7 memory models) */ unsigned char RedMaskSize; /* size of direct color red mask in bits */ unsigned char RedFieldPosition; /* bit position of lsb of red mask */ unsigned char GreenMaskSize; /* size of direct color green mask in bits */ unsigned char GreenFieldPosition; /* bit position of lsb of green mask */ unsigned char BlueMaskSize; /* size of direct color blue mask in bits */ unsigned char BlueFieldPosition; /* bit position of lsb of blue mask */ unsigned char RsvdMaskSize; /* size of direct color reserved mask in bits */ unsigned char RsvdFieldPosition; /* bit position of lsb of reserved mask */ unsigned char DirectColorModeInfo; /* direct color mode attributes */ /* Mandatory information for VBE 2.0 and above */ void far *PhysBasePtr; /* physical address for flat frame buffer */ void far *OffScreenMemOffset; /* pointer to start of off screen memory */ unsigned int OffScreenMemSize; /* amount of off screen memory in 1k units */ unsigned char Reserved2[206]; /* remainder of ModeInfoBlock */ }; /* Core VBE functions */ int vbeGetInfo(struct VbeInfoBlock *vbe_info); int vbeGetModeInfo(int mode, struct ModeInfoBlock *mode_info); int vbeSetMode(int mode); int vbeSetLogicalLineLength(int length); int vbeGetLogicalLineLength(void); int vbeSetDisplayStart(int x, int y, int vbsync); int vbeGetDisplayStart(void); /* vbe_init initializes several parameters needed for the below functions */ int vbeInit(int mode, int set_mode); int vbeExit(void); void vbeSetText(void); void vbeSetGraph(void); void vbeVsync(void); void vbeChangeWindow(int window); void vbeDrawLine(int x1, int y1, int x2, int y2, unsigned long color); void vbeDrawBox(int x1, int y1, int x2, int y2, unsigned long color); void vbeDrawPoly(int numpoints, int far *polypoints, unsigned long color); void vbeClrArea(int x, int y, int w, int h, unsigned long color); void vbeClrScr(unsigned long color); void vbePutPixel(int x, int y, unsigned long color); unsigned long vbeGetPixel(int x, int y); void vbePutImage(int x, int y, int w, int h, unsigned long far *offset); void vbeGetImage(int x, int y, int w, int h, unsigned long far *offset); void vbePutSprite(int x, int y, int w, int h, unsigned long far *offset); /* Text stuff */ #define THIN_CURSOR 0 #define FAT_CURSOR 1 void vbeTxtColor(unsigned long fg, unsigned long bg); int vbeLoadFont(char *fontname); void vbeWriteChar(int x, int y, unsigned long color, int c); void vbeWriteString(int x, int y, unsigned long color, unsigned char far *string); void vbeWriteCharOpaque(int x, int y, unsigned long fgcol, unsigned long bgcol, int c); void vbeWriteStringOpaque(int x, int y, unsigned long fgcol, unsigned long bgcol, unsigned char far *string); void vbeWriteVertString(int x, int y, unsigned long color, unsigned char far *string); void vbeWriteVertStringOpaque(int x, int y, unsigned long fgcol, unsigned long bgcol, unsigned char far *string); void vbePutch(int c); void vbePrintf(char *s); void vbeEdgets(char *s, int maxlen, int mk_upper); void vbeSetCurType(int type); void vbePosCur(int x, int y); void vbeHideCur(void); void vbeShowCur(void); . 0