Mail Archives: djgpp/1997/01/25/19:41:45
> 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 -