Mail Archives: djgpp/1996/12/17/23:24:05
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 -