delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/11/02/23:36:38

Date: Sun, 2 Nov 1997 20:31:44 -0800 (PST)
Message-Id: <199711030431.UAA13665@adit.ap.net>
Mime-Version: 1.0
To: eggbrains AT aol DOT com (Egg brains), djgpp AT delorie DOT com
From: Nate Eldredge <eldredge AT ap DOT net>
Subject: Re: Direct Access vs. Far vs. Near

At 10:48  11/1/1997 GMT, Egg brains wrote:
>okay, anyway, in my program (a start of a graphics lib -- yes, i know about
> Allegro)  i draw pixles to the screen (what else).  when i directly wrote to
> the screen ie:
>
>vga = (unsigned char*)MK_FP(0xA000, 0);
>vga[where]=color;
This worked on DJGPP???? It shouldn't.
>
>i can draw about 1.6 million pixels per second, however, when using Farnspoke,
> i can draw up to 3+ million pixels per second... why is it so much faster?
Since this is predicated on your earlier example, which I hesitate to
believe works, I'm not sure how to answer it. If you are comparing _farpoke
and _farnspoke, then yes, _farnspoke will be faster. It saves the reload of
the %fs register on each use, saving quite a few cycles.
>
>would using the near access go faster yet?
Maybe. This is a frequent debate topic here. Try profiling and see!
>
>anyway, using the Far mode, how would i make selectors to sprites? would i make
> the sprites by define an array (with malloc/new etc...) and then make a
> selctor to it?  what about if I change the size/location? i will need to make
> a new selector right? an since you can't delete selectors if i re-size it
> enough will i run out of memmory?
I'm afraid this makes no sense to me. Typically, the way sprites and so
forth are dealt with is by just allocating them with malloc() and letting
them live in your usual address space. Then you use movedata() or farptr
functions to write them to video memory. 
It may be you aren't entirely clear on how to access video memory. See FAQ
section 18.4 if that's the case, then come back and ask questions in
relation to it.

Nate Eldredge
eldredge AT ap DOT net



- Raw text -


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