Mail Archives: djgpp/1999/02/28/12:27:03
From: | "XtReMe" <xtreme AT x-project DOT demon DOT nl>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Linear frame buffer size
|
Date: | Sun, 28 Feb 1999 18:02:38 +0100
|
Message-ID: | <920221317.3421.0.rover.d4ee0fa5@news.demon.nl>
|
NNTP-Posting-Host: | x-project.demon.nl
|
X-NNTP-Posting-Host: | x-project.demon.nl:212.238.15.165
|
X-Trace: | news.demon.nl 920221317 rover:3421 NO-IDENT x-project.demon.nl:212.238.15.165
|
X-Complaints-To: | abuse AT demon DOT net
|
X-Newsreader: | Microsoft Outlook Express 4.72.3110.5
|
X-MimeOLE: | Produced By Microsoft MimeOLE V4.72.3110.3
|
Lines: | 46
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Reply-To: | djgpp AT delorie DOT com
|
Hi!
I have this little problem setting up the Linear Frame Buffer with VESA 2
Here's what I did:
VESAModeInfo VMI;
__dpmi_meminfo VESAPhysical;
int VESASelector;
int vesa_setlinear ()
{
VESAPhysical.address = VMI.PhysBasePtr;
VESAPhysical.size = VMI.height * VMI.bytes_per_scanline;
if (!__dpmi_physical_address_mapping (&VESAPhysical))
return 1;
if (!__dpmi_allocate_ldt_descriptors (1))
return 2;
if (!__dpmi_set_descriptor_access_rights (VESASelector, 0xC0F2))
return 3;
if (!__dpmi_set_segment_base_address (VESASelector,
VESAPhysical.address))
return 4;
if (!__dpmi_set_segment_limit (VESASelector, VESAPhysical.size))
return 5;
return 0;
}
It all works fine, except for __dpmi_set_segment_limit (). When the
frame buffer gets real big, like 640 * 480 * 24 bpp or 1024 * 786 * 16,
I get __dpmi_error 8, which is the DOS error : Not enough memory.
But I have a 4 MB video card and it sets the mode correctly without any
errors. But when I don't allocate a ldt descriptor and just access the
frame buffer directly with the selector _dos_ds starting from the returned
physical base ptr, it works! But I don't want it this way. Why does dpmi
return that there's not enough memory? Does anyone has a sollution?
Thanx
XtReMe
xtreme AT x-project DOT demon DOT nl
- Raw text -