www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/12/17/23:24:05

Date: Wed, 18 Dec 1996 17:10:01 +0000
From: Bill Currie <billc AT blackmagic DOT tait DOT co DOT nz>
Subject: Re: Graphics under DJGPP V2.01
To: Aaron m Clemmer <aclemmer AT juno DOT com>
Cc: djgpp AT delorie DOT com
Reply-to: billc AT blackmagic DOT tait DOT co DOT nz
Message-id: <32B82569.505C@blackmagic.tait.co.nz>
Organization: Tait Electronics NZ
MIME-version: 1.0
References: <01bbe78f$57f16cc0$LocalHost AT default>
<19961217 DOT 080544 DOT 8439 DOT 2 DOT aclemmer AT juno DOT com>

Aaron m Clemmer wrote:
> 
> On 11 Dec 1996 18:37:28 GMT "Thomas Harte" <T DOT Harte AT btinternet DOT com>
> writes:
> 
> >   for(temp=0;temp<64000;temp++)
> >     {
> >      _farpokeb(_dos_ds, 0xA0000 + temp, doublebuffer[temp]);
> >      doublebuffer[temp]=background[temp];
> >     }
> >
> >       Which faster methods can I use to copy the contents of an
> >integer into the video ram, starting at 0xA0000 ?
> 
>         If you don't want to change the code much, you could just change
> to _farpokeb() to a _farpokew() or _farpokel().  As you can probably
> guess, they move words and longs at a time.  Of course, you will have to
> change the 'temp++' to 'temp+=2' (or 4)...
>         Or you could use the movedata() functions, which are supposed to
> be one of the faster ways to this.

Better yet, recode the loop as:

  _farsetsel(_dos_ds)
  for(temp=0;temp<64000;temp++)
    {
     _farnspokeb(0xA0000 + temp, doublebuffer[temp]);
     /*  ^^ note the 'ns' */
     doublebuffer[temp]=background[temp];
    }


_farpoke* reloads the selector every time it's executed which costs 29
clocks 
(on a 386) every time. _farsetsel presets the selector for the _farns*
functions.

Bill
-- 
Leave others their otherness.

- Raw text -


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