delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/10/15/20:36:39

Message-ID: <326437D3.5B3F@gbrmpa.gov.au>
Date: Wed, 16 Oct 1996 09:18:12 +0800
From: Leath Muller <leathm AT gbrmpa DOT gov DOT au>
Reply-To: leathm AT gbrmpa DOT gov DOT au
Organization: Great Barrier Reef Marine Park Authority
MIME-Version: 1.0
To: "Salvador Eduardo Tropea (SET)" <salvador AT inti DOT edu DOT ar>
CC: djgpp AT delorie DOT com
Subject: Re: Another way to access VGA memory
References: <9610151516 DOT aa12417 AT ailin DOT inti DOT edu DOT ar>

> Yeap! that's the good part, you can't destroy DOS or Losse with a wrong
> calculus, and (at least for my program) is equally fast than the nearptr
> methode (that's a really HACK :-), and I don't need to make strange arithmetic
> adding the __djgpp_base... so from my point of view the load of the selector
> isn't a problem (at least isn't worst than the base addition). Even more: if
> your program have a really fast part where you don't call any of the library
> functions you can load the selector only one time and reload it only when you
> suspect that the value was loosed, I'm doing this and works OK. In the other
> hand if I use nearptrs I must add the base in tons of parts so is worst.
>   That's my opinion, I know that Eli thinks that the nearptrs are faster than
> this methode.

Hey dudes...

I started using selectors (such as %fs) but gave up after about 2 days.
Why?
Every time I want to write to a section of the graphics screen, I call
a routine - say blit. Everytime blit is called, I have to reload the
selector. Every time I exit the blit routine, I have to restore the
selector.

Using near pointers, you never have to worry about that. And I have
never
written a program where the __djgpp_conventional_base changes... could
someone explain to me a situation where it does? I have never
encountered
this when only running my application (I do just about everything under
Win95 too... :)

Just have a variable gfx_screen which points to the physical memory area
of the graphics screen, add the __djgpp_conventional_base to it, and
then
always just use that variable. Easy, no?

Leathal.

- Raw text -


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