Mail Archives: djgpp/1997/01/27/01:43:27
use it like this
#include<nearptr.h>
char *video_buffer=(char*)(0xA0000 + __djgpp_conventional_base);
video_buffer[(y<<8)+(y<<6)+x]=color;
(i think it goes like this, if i remember correctly)
DJ Delorie <dj AT delorie DOT com> wrote in article
<199701260029 DOT TAA23377 AT delorie DOT com>...
>
> > char *video_buffer = (char *)0xA0000; // 0xA0000, because it uses
32-bit
> > protected mode addresses (or something, I'm not quite sure :))
> >
> > then somewhere in your code, call:
> >
> > __djgpp_nearptr_enable(); // turns off memory protection, lets you use
> > near pointers.
> >
> > than you simply do video_buffer[y*320+x]=color; like you're normal
> > putpixel.
>
> Nope. This will definitely crash, because 0xa0000 points TO YOUR
> PROGRAM, not to video memory.
>
> When using nearptr, you MUST remember to add in the nearptr offset,
> which is the negative of your segment's base address. This is
> documented in the info files.
>
- Raw text -