Message-ID: <3379F143.3D7F@geocities.com> Date: Wed, 14 May 1997 19:07:16 +0200 From: Magnus Byrkjeflot MIME-Version: 1.0 To: djgpp AT delorie DOT com Subject: Vesa sucks.... ?? Content-Type: multipart/mixed; boundary="----------6046256E2B50" Precedence: bulk This is a multi-part message in MIME format. ------------6046256E2B50 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Hello! I'm trying to write a VBE 2.0 library in C/djgpp, and I'm having some problems with one of my routines.... I keep getting SIGABRT messages when trying to run this routine in RHIDE.. It seems like the poke routine screws something up... When the poke thingy is run for the third time, I get this SIGABRT message. I'm using UNIVBE 5.3 and a pentium machine with a ATI mach 64 card... Here is the routine: #define MASK_LINEAR(addr) (addr & 0x000fffff) #define RM_TO_LINEAR(addr) (((addr & 0xffff0000) >> 12) + (addr & 0xffff)) #define RM_OFFSET(addr) (MASK_LINEAR(addr) & 0xffff) #define RM_SEGMENT(addr) ((MASK_LINEAR(addr) & 0xffff0000) >> 4) unsigned short vbe_getinfo(void) { unsigned short loop1 = 0 ,buffer = 0; unsigned short vidmodeofs; vbe_r.x.ax=0x4f00; vbe_r.x.es=RM_SEGMENT(__tb); vbe_r.x.di=RM_OFFSET(__tb); _go32_dpmi_simulate_int(0x10,&vbe_r); dosmemget(__tb,sizeof(VBEInfoBlock),&VBEInfoBlock); vidmodeofs = RM_TO_LINEAR(VBEInfoBlock.VideoModePtr); while (buffer != 0xffff) { buffer = _farpeekw(_dos_ds,vidmodeofs); memset(&vbe_r,0,sizeof(vbe_r)); vbe_r.x.ax=0x4f01; vbe_r.x.cx=buffer; vbe_r.x.es=RM_SEGMENT(__tb); vbe_r.x.di=RM_OFFSET(__tb); _go32_dpmi_simulate_int(0x10,&vbe_r); dosmemget(__tb,sizeof(ModeInfoBlock),&ModeInfoBlock[loop1]); ModeArray[loop1]=buffer; loop1++; vidmodeofs += 2; } } ------------6046256E2B50 Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="Vesa20.c" Content-Type: text/plain; charset=us-ascii; name="Vesa20.c" // Vesa 2.0 routines #include #include #include "vesa20.h" #define MASK_LINEAR(addr) (addr & 0x000fffff) #define RM_TO_LINEAR(addr) (((addr & 0xffff0000) >> 12) + (addr & 0xffff)) #define RM_OFFSET(addr) (MASK_LINEAR(addr) & 0xffff) #define RM_SEGMENT(addr) ((MASK_LINEAR(addr) & 0xffff0000) >> 4) unsigned short vbe_getinfo(void) { unsigned short loop1 = 0 ,buffer = 0; unsigned short vidmodeofs; vbe_r.x.ax=0x4f00; vbe_r.x.es=RM_SEGMENT(__tb); vbe_r.x.di=RM_OFFSET(__tb); _go32_dpmi_simulate_int(0x10,&vbe_r); dosmemget(__tb,sizeof(VBEInfoBlock),&VBEInfoBlock); vidmodeofs = RM_TO_LINEAR(VBEInfoBlock.VideoModePtr); // printf("%s\n\r",(char**)(RM_TO_LINEAR(VBEInfoBlock.OemProductNamePtr)); while (buffer != 0xffff) { buffer = _farpeekw(_dos_ds,vidmodeofs); memset(&vbe_r,0,sizeof(vbe_r)); vbe_r.x.ax=0x4f01; vbe_r.x.cx=buffer; vbe_r.x.es=RM_SEGMENT(__tb); vbe_r.x.di=RM_OFFSET(__tb); _go32_dpmi_simulate_int(0x10,&vbe_r); dosmemget(__tb,sizeof(ModeInfoBlock),&ModeInfoBlock[loop1]); ModeArray[loop1]=buffer; loop1++; vidmodeofs += 2; } } unsigned short vbe_setmode(unsigned short vbe_mode, char linear) { vbe_r.x.ax=0x4f02; vbe_r.x.bx=ModeArray[vbe_mode]; if (linear) vbe_r.x.bx=vbe_r.x.bx | 0x4000; _go32_dpmi_simulate_int(0x10,&vbe_r); FrameBuffer = __dpmi_allocate_ldt_descriptors(1); __dpmi_set_segment_base_address(FrameBuffer,ModeInfoBlock[vbe_mode].PhysBasePtr); __dpmi_set_segment_limit(FrameBuffer,ModeInfoBlock[vbe_mode].OffScreenMemSize*1000); return(vbe_r.x.ax); } unsigned short vbe_returncurrentmode() { vbe_r.x.ax=0x4f03; _go32_dpmi_simulate_int(0x10,&vbe_r); return(vbe_r.x.bx); } ------------6046256E2B50--