Mail Archives: djgpp/1997/01/25/19:13:00
Russ Hubbard (hubbardr AT jntf DOT osd DOT mil) wrote:
: How would I create an array for video memory in djgpp?
: Currently I have:
: char far *video_buffer = (char far)0xA0000000L;
This is off the top of my head, but it should something like this:
#include <go32.h>
#include <dpmi.h>
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.
At the end of your program, call __djgpp_nearptr_disable(); and it should
turn back on memory protection and disable nearptrs.
Anyway, check the FAQ on this, it has a section on access video memory, I
might be wrong on some things, and I MIGHT have the nearptr_disable and
enable calls mixed up :)
later,
jon
--
jon klippenstein internet: klip AT cryogen DOT com
uucp: alberta!ve6kik!dparrot!{root,klip}
ham radio: ve6klp
- Raw text -