Mail Archives: djgpp/1997/09/14/23:38:58
from: csantill AT lausd DOT k12 DOT ca DOT us
Your line
\\ char *video=(char *)0xA0000;
is wrong.
Try this code:
................
#include <sys/farptr.h>
#include <sys/nearptr.h>
#include <dpmi.h>
#include <go32.h>
#include <time.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
// The includes are from my original file - circle/box/line snipped out
// I owe a big thanx to Sinan for my receipt of some actually working
VGA
// code. THAAAAAAAAAAAAAAAANNNNNNNNXXXXXXXXXXXXXXXXXXX!!!!!!!!!!!!! :]
enum GR_MODE{GR_INVALID=-1, GR_TEXT=0x03, GR_VGA=0x13};
enum GR_MODE Set_GR_Mode(enum GR_MODE mode)
{
__dpmi_regs r;
memset(&r, 0, sizeof(r));
r.x.ax=mode;
return(__dpmi_int(0x10,&r) ? GR_INVALID:mode);
}
//
************************************************************************
void Put_Pix_Far(int x, int y, char c)
{
_farpokeb(_dos_ds, 0xA0000+(y<<8)+(y<<6)+x,c);
return;
}
//
************************************************************************
void Put_Pix_Near(int x, int y, char c)
{
char *v_m=(char *)(0xA0000+__djgpp_conventional_base);
v_m[(y<<8)+(y<<6)+x] = c;
}
...............
You can modify fill screen to send to your char pointer but you
would just be including to ptr headers & adding size to your EXE.
It might be better to just malloc a buffer & double buffer from that
buffer to 0xA0000 using the farnspokew(it moves 4 bytes at a time).
On my P120/16MB/1MB video, I get 192 fill screens per sec w/all
optimizations turned on(-09 -m486).
- Raw text -