HOW PUT PIXEL IN VESA
Author Message
HOW PUT PIXEL IN VESA

I research Some Infos
How put pixel in vesa  mode (BankSwitching,Granularity,etc....)
Please give a very simple source or an algorytm method....

Sat, 26 Feb 2000 03:00:00 GMT
HOW PUT PIXEL IN VESA

Quote:

> I research Some Infos
> How put pixel in vesa  mode (BankSwitching,Granularity,etc....)
> Please give a very simple source or an algorytm method....

You could do with a book or a spec on VESA SVGAs.

On a PC in memory at 0xa0000 (typically) are either
two 32k memory apertures one for reading and one for writing or
one 64k memory aperture for reading and writing.

The appature has a granuity which you have to find from the Video BIOS
call.

Form a linear address A of the pixel (x,y) from screen width w and bytes
per pixel b:

A = (y * w + x) * b

Find the bank B and offset C for granuity g:

B = A / g
C = A % g

% is the modulus operator, if g is a power p of 2 such that:
g = 2^p where ^ is the raise to operator
then a faster version is:

B = A >> p
C = A & (g - 1)

where >> is shift right and & is bit AND operators.

Now using the set bank Video BIOS call set the bank to B and the pixel

P = D + C;

--

Rob.