4. Работа с основными графическими устройствам
char sign [4]; // 'VESA' signature int version; // VESA BIOS version
char far * OEM; // Original Equipment Manufacturer
long capabilities; int far * modeList; // list of supported modes int totalMemory; // total memory on board
// in 64Kb blocks
char reserved [236];
};
struct VESAModelnfo {
1 int modeAttributes; char winAAttributes; char winBAttributes; int winGranularity; int winSize; unsigned winASegment; unsigned winBSegement; void far * winFuncPtr; int bytesPerScanLine;
// optional data
int xResolution; int yResolution; char xCharSize; char yCharSize; char numberOfPlanes; char bitsPerPixel; char numberOfBanks; char memoryModel; char bankSize; char , numberOfPages; char " reserved;
// direct color fields
char redMaskSize; char redFieldPosition; char greenMaskSize; char greenFieldPosition; char blueMaskSize; char blueFieldPosition; char rsvdMaskSize; char rsvdFieldPosition; char directColorModelnfo; char resererved2 [216];
};
int findVESA ( VESAInfo& );-
int findVESAMode ( int, VESAModelnfoÄ );
int setVESAMode ( int );
int getVESAMode ();
void setVESABank ();
#endif
Компьютерная графика. Полигональные модели
Lru // File Vesa.cpp // test for VESA #include <conio.h> #include <dos.h> #include <process.h> #include <stdio.h> #include <string.h> #include "Vesa.h"
#define LOWORD(I) ((int)(l)) #define HIWORD(I) ((int)((l) »16))
static int curBank = 0;
static int granularity = 1;
static VESAModelnfo curMode;
int findVESA ( VESAInfo& vi) {
#if defined(___COMPACT__) || defined(_LARGE__) || defined(__HUGE_) asm {
push es push di
les di, dword ptr vi mov ax, 4F00h int 10h pop di pop es
}
#else
asm {
push di
mov di, word ptr vi
mov ax, 4F00h
int 10h
pop di
}
#endif
if (_AX != 0x004F ) return 0;
return Istrncmp ( vi.sign, "VESA", 4 );
}
int findVESAMode (int mode, VESAModelnfo& mi) {
#if defined(___COMPACT__) || defined(__LARGE__) || definedL_HUGE___) asm {