Mail Archives: djgpp/1999/10/21/16:09:10
Eli Zaretskii wrote:
> On Wed, 20 Oct 1999, Tom Fjellstrom wrote:
>
> > I've been playing around with mode 13h, and the
> > only thing I've been really stuck on is my 'blit'
> > routine. Suffice it to say it is extremely slow.
> > It may have to do with '__djgpp_nearptr_enable()'ing
> > before blit and '__djgpp_nearptr_disable()'ing after,
> > for every bitmap
>
> These two functions are very slow, because they issue a DPMI function
> call. You should call them as seldom as you can. The FAQ explains what
> are the circumstances when you MUST call them.
>
> However, in general, I'd suggest to toss the idea of using nearptr hack,
> and switch to dosmemput and farptr functions instead. They are almost as
> fast as nearptr, even in tight loops, don't require an expensive call to
> __djgpp_nearptr_enable, and don't disable memory protection.
>
> The FAQ clearly recommends not to use nearptr, so why do you need to mess
> with it?
Thank you Eli,
But I can't be completely sure if the 'bitmap' i'm blitting
to or from is in video memory. If I could then it would make sense
to call the dosmemput or farptr functions only for those 'bitmaps'.
I may be wrong but I don't think 'regular' memory can (or should?) be
accessed with dosmemput or those farptr functions.
The only way I have thought of determining that a bitmap is in video memory
is too add a variable to the bitmap struct when creating it to indicate
whether
or not it is in video memory. If that is the only safe way of doing it I
guess i'll have to.
--
"An Optimist will say the glass is half full,
A Pessimist will say the glass is half empty,
A Canadian will say Waiter!"
Tom Fjellstrom
tomcf AT connect DOT ab DOT ca
- Raw text -