Mail Archives: djgpp/1996/12/17/20:16:36
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, ®s);
}
...
setmode(0x0013);
Hope this helps
- Raw text -