VESA Video Modes: Difference between revisions

Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content added Content deleted
(Consistent use of struct names (Names according to the vbe spec.))
(Sync VbeModeBlock member names across text and specification)
Line 7: Line 7:
<source lang="c">
<source lang="c">
struct VbeInfoBlock {
struct VbeInfoBlock {
char signature[4]; // == "VESA"
char VbeSignature[4]; // == "VESA"
short version; // == 0x0300 for VBE 3.0
short VbeVersion; // == 0x0300 for VBE 3.0
short oemString[2]; // isa vbeFarPtr
short OemStringPtr[2]; // isa vbeFarPtr
unsigned char capabilities[4];
unsigned char Capabilities[4];
short videomodes[2]; // isa vbeFarPtr
short VideoModePtr[2]; // isa vbeFarPtr
short totalMemory; // as # of 64KB blocks
short TotalMemory; // as # of 64KB blocks
};
};


Line 73: Line 73:
int depthdiff, bestdepthdiff = 8 >= d ? 8 - d : (d - 8) * 2;
int depthdiff, bestdepthdiff = 8 >= d ? 8 - d : (d - 8) * 2;


strncpy(ctrl->signature, "VBE2", 4);
strncpy(ctrl->VbeSignature, "VBE2", 4);
intV86(0x10, "ax,es:di", 0x4F00, 0, ctrl); // Get Controller Info
intV86(0x10, "ax,es:di", 0x4F00, 0, ctrl); // Get Controller Info
if ( (UInt16)v86.tss.eax != 0x004F ) return best;
if ( (UInt16)v86.tss.eax != 0x004F ) return best;