Mail Archives: djgpp/1998/12/20/15:55:26
> I am writing a program that uses VESA mode 10F, 320x200x16.8M.
>
Basically easiest way to use LFB (you DO use it, right?) is to
create a LDT - local descriptor - and access LFB buffer though
it, either in C by farpokeb/peekb (slow!), some function that
can copy over selectors or - the method I prefer - write own
flip-routines.
How to allocate LDT, then?
__dpmi_meminfo mi; // variable to map memory
mi.size = <memory size here>;
mi.address = <address you got from vbe>;
__dpmi_physical_address_mapping ( &mi); // map device to physical memory
selector = __dpmi_allocate_ldt_descriptors(1); // allocate 1 descriptor
__dpmi_set_segment_base_address (selector, mi.address); //address we
got from dpimi
__dpmi_set_segment_limit (selector, <what do ou need>)
As a result, you have a variable (selector) you can use to access
video memory, pretty much like you used segments to access memory in
rmode...
Of course, you can create selector called "segA000" or something,
which points to physical address 0xA0000 to access video memory just
like in real mode.
/// Toni Räsänen
/// torasane AT mail DOT student DOT oulu DOT fi
\\\ Physicians ask how. Filosofians ask why. Dragons don't care.
- Raw text -