www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/12/20/15:55:26

Date: Sun, 20 Dec 1998 22:55:05 +0200 (EET)
From: Toni Rasanen <torasane AT mail DOT student DOT oulu DOT fi>
X-Sender: torasane AT paju DOT oulu DOT fi
To: djgpp AT delorie DOT com
Subject: Re: problems with linear frame buffer
In-Reply-To: <367cdf99.0@d2o32.telia.com>
Message-ID: <Pine.SGI.3.95.981220184040.16711A-100000@paju.oulu.fi>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

> 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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019