Mail Archives: djgpp/1996/08/21/12:06:52
Dean (deanph AT ibm DOT net) wrote:
> I've finally got DJGPP up and running. I can get in mode 13h
> and all that, I can write text, but what I can't do is write
> directly to memory to plot points, what with all the protected
> mode and all. Is there some other way to plot points on the
> screen, is there something I could read (not FAQ200b.zip, it was
> no help:)
I just got DJGPP installed and discovered, through this newsgroup, *one*
way to access video memory directly:
#include <sys\nearptr.h>
#include <dos.h>
#include <string.h>
main()
{
unsigned char *Screen;
union REGS Regs;
unsigned long Count;
if (__djgpp_nearptr_enable() == 0)
{
puts("Can't disable protection");
exit(1);
}
Regs.x.ax = 0x0013;
int86(0x10,&Regs,&Regs);
Screen = (unsigned char *)(__djgpp_conventional_base + 0xa0000);
for (Count = 0;Count < 5000;Count++)
memset(Screen,Count & 255,64000);
Regs.x.ax = 0x0003;
int86(0x10,&Regs,&Regs);
}
--
I support the fight against "Look and Feel" patents.
- Raw text -