Mail Archives: djgpp/1995/12/05/13:31:09
>What address is the VGA buffer mapped to in V2 ?
>
>I've tried writing to 0xD0000000, 0xD1000000, and 0xA0000000 - all
>the r/w video address mentioned in the docs.
>
Here's a snippet of code that uses the _farpokeb() function to plot a pixel:
#include <stdio.h>
#include <go32.h>
#include <dpmi.h>
#include <sys/farptr.h>
int main(void)
{
__dpmi_regs dr;
unsigned long offset; /* offset of video mem. */
unsigned char color; /* color of pixel to plot. */
unsigned short _d_selectr; /*dos mem selector. */
dr.x.ax = 0x0013; /*320X200X256 mode 13h*/
__dpmi_int(0x10, &dr); /*init mode 13h */
_d_selectr = _dos_ds; /*set up the dos mem selector */
offset = 0xa0000; /*point offset to start of vid mem.*/
color = 2; /*color to plot*/
_farpokeb (_d_selectr,offset,color) /*plot a pixel in u/l corner
of screen.*/
while (!kbhit()); /*allow time to view artwork.*/
dr.x.ax = 0x0003; /*init 80X25 text mode*/
__dpmi_int (0x10,&dr);
return 1; /*Bye-Bye*/
}
NOTE: please forgive any typos. :)
>The graphics do work in DPMI now, don't they ? (GRX2.0 works)
>
The routine above is DPMI compliant. I don't know about GRX2.0, I don't use it.
>Also, are the pixel routines more complex in V2 - or is a slower
>addressing method done ?
>
I don't know about that either. :)
>Lee Braiden (lee_b AT celestia DOT dnet DOT co DOT uk)
><Celestia>
>
If you want to know how to speed up the plotting of pixels and copying
buffers to the VGA screen, etc.., just drop me some e-mail.
Hope I've been of some help to ya!
Later,
Wayne
- Raw text -