Mail Archives: djgpp/1996/06/20/21:53:41
> All I need is a routine to set up a graphic display,
> and a routine to plot a pixel . . .
These are simple demands.
> ... and how to set up a VESA 1.2 truecolor video mode?
VESA 1.2 does not allow linear addressing, therefore depending
on the pixel you want to put on the screen, you will have
to send bank-switching codes. I will let some-one else describe how to
do this in dos. . .
Another simpler solution is to use Linux SVGAlib. Try the following
code fragment:
#include <vga.h>
void main ( void ) {
vga_init();
vga_setmode(800x600x64K);
vga_setlinearaddressing();
graph_mem = vga_getgraphmem(); // Defined in vga.h
// The following puts a white pixel at 10,10 .
*( ( short int * ) graph_mem ) [ 10 * 800 + 10 ] = 0xffff;
// Delay loop:
for ( int i = 0; i < 100000000 ; i ++ );
vga_setmode ( 0 ); // text
}
I am writing this by heart so verify it all in vga.h, also look at README.vga.
btw, the Scitech UniVBE distribution of VESA 2.0 is kinda nasty after 21 days...
Good Luck!!
Mihai Moise
"If the fool would persist in his folly, he would become wise," William Blake.
- Raw text -