From: Endlisnis Newsgroups: comp.os.msdos.djgpp Subject: Problem using int 0x10 Date: Tue, 7 Jul 1998 19:29:20 -0300 Organization: University of New Brunswick Lines: 70 Message-ID: NNTP-Posting-Host: sol-alt1.unb.ca Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk I tried to write some code to query an svga graphics card. I've done this in Borland C++ v3.1 (DOS) and it worked fine. This just calls interrupt 0x10 with AX=0x4F00 and ES:DI pointing to a 256 byte buffer to hold the data. I used __tb for this, only nothing happens during the interrupt. I ran it through the debugger, and none of the values at __tb changed. Am I doing something wrong? The value returned in AX was 73?? And the info. I has clames that if it is not 0x4F in AH, then the function is not supported, but I know the function is supported, I have an ATI 3D Xpression+ card with VESA2 support AND I've tried it in a real-mode compiler on this exact system configuration and it worked. The code appears below. If someone could tell me what I'm doing wrong, or try compiling it on your machine and see if it gives proper output, that'd be great. The SIG should read "VESA", if you have a VESA supporting card. I know that this program wouldn't print the correct version even if it did work, I'll fix that when it works. Endlisnis [I have a pyramid of wingyness] --------------------------------------------------------------------- #include #include #include #include #define pack __attribute__((packed)) typedef unsigned char byte; typedef unsigned short int word; typedef unsigned int lword; typedef unsigned short int pword pack; typedef unsigned int plword pack; struct VGAInfoBlock { char Sig[4]; pword Version; char *OEM pack; char Capabilities[4]; short *VideoModes pack; pword VRAM; char Reserved[236]; }; void GetInfoBlock(VGAInfoBlock &Fred) { __dpmi_regs regs; memset(®s, 0, sizeof regs); regs.x.ax = 0x4F00; regs.x.di = __tb & 0x0f; regs.x.es = (__tb >> 4) & 0xffff; __dpmi_int(0x10, ®s); memcpy(&Fred, (void*)__tb, sizeof(VGAInfoBlock)); } void main() { VGAInfoBlock VGA; GetInfoBlock(VGA); cout << "Sig = \"" << VGA.Sig[0] << VGA.Sig[1] << VGA.Sig[2] << VGA.Sig[3] << "\".\nVersion = " << VGA.Version << ".\nCapabilities = " << VGA.Capabilities[0] << VGA.Capabilities[1] << VGA.Capabilities[2] << VGA.Capabilities[3] << ".\nVRAM = " << VGA.VRAM; }