www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/12/17/20:16:36

To: djgpp AT delorie DOT com
Subject: Re: Graphics under DJGPP V2.01
Message-ID: <19961217.080544.8439.2.aclemmer@juno.com>
References: <01bbe78f$57f16cc0$LocalHost AT default>
From: aclemmer AT juno DOT com (Aaron m Clemmer)
Date: Tue, 17 Dec 1996 20:07:15 EST

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.

>How would I switch graphic modes (to and from mode 13h) under DJGPP ?

#include <dpmi.h>
void setmode(short mode) {
  __dpmi_regs regs;
  regs.x.ax = mode;
  __dpmi_int(0x10, &regs);
}
...
setmode(0x0013);


Hope this helps

- Raw text -


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