Mail Archives: djgpp/1998/06/18/00:27:48
Jerry Lawrence wrote:
>
> Or, you could do this: (can't remember where i got the info from)
It may have been FAQ section 18.6; this hack is described there.
> 1) store a local ram buffer of the screen buffer; do all screen
> operations to this buffer.
> 2) in your graphics init function, use this right after you change
> screen mode:
> __djgpp_nearptr_enable();
> 3) in your graphics deinit function, use this:
> __djgpp_nearptr_disable();
>
> 4) when a full screen buffer is ready to be displayed:
>
> memcpy( (unsigned char *) (0xa0000+__djgpp_conventional_base),
> (buff),320*200);
>
> where "buff" is a 64k buffer (assuming 320x200x256 color)
That's all well and good, but note that it's also dangerous. When
nearptrs are enabled, you lose much of the protection normally given by
DJGPP's 32-bit environment. It is now possible for an overrun pointer
to smash the OS, corrupt buffers, damage data, etc, etc. (Back to the
bad old days of Real Mode!) Use with extreme caution!!
IMHO, this scheme should only be used if you *absolutely* *must* have
every last bit of speed, and if you've tested your program well already.
--
Nate Eldredge
nate AT cartsys DOT com
- Raw text -