Page 1 of 1

vga ?

Posted: Fri Nov 21, 2008 3:15 pm
by ahmedhalawa
Hello,every body
I want to ask question how can i draw in 800*600*16.8M not 256
exactly how can i draw in this location 500 * 200 and the end of video memory cann't arrive to this location.



SORRY FOR MY BAD ENGLIS :|

Re: vga ?

Posted: Fri Nov 21, 2008 4:38 pm
by kmtdk
well
the problem is very simple,
the standard vga can not draw 16,4 millions of colurs instantly
this means that you can only draw 256 colours at the same time.
the solution is to use VBE or VESA

reaching a pixel on 500*200 depends on the VGA; if we assume the graphic mode 0x13, it does not have such a high resolution, but it is quite simple to program for.
1 byte of countious memory = 1 pixel.
so to change line, multiply by the legnth of the resolution, and add the result to the vertical placement.
But for example, the mode 0x12 graphic has a higher resolution, but 1 byte is not only 1 pixel, it is in fact 4 pixels.

KMT dk

Re: vga ?

Posted: Fri Nov 21, 2008 6:14 pm
by Love4Boobies
As for drawing outside your "range", you can either use bank switching or linear framebuffer. Register here for free and get the VBE specs online.

Re: vga ?

Posted: Thu Nov 27, 2008 6:31 am
by ahmedhalawa
thanks very much i have used bank swithcing
now i need something else i need the way to put pxl in this location 500,400
thatis my last osder

Re: vga ?

Posted: Thu Nov 27, 2008 6:45 am
by Love4Boobies
If you already used bank switching then what's the problem?

Re: vga ?

Posted: Thu Nov 27, 2008 6:47 am
by Combuster
Read the specifications and consider doing something other than OS development since you don't appear to be ready for it.

Re: vga ?

Posted: Thu Nov 27, 2008 8:02 am
by djmauretto
Ciao,
Example to compute bank:
X Resolution = 800
Y resolution = 600
Bits per pixels 24
Bytes per Scanline = X Resolution * (Bits per Pixel/8) = 2400
Location pixel to draw x = 500 y = 400
Formula:
(y * Bytes per Scanline) + (x*(Bits per pixel/8)) = (400*2400) + (500*3)

Note that you must use 32bits Register for this
calculation,after this computation you have in bits 31:16 the bank number
and in bits 15:0 the offset :wink:

Re: vga ?

Posted: Thu Nov 27, 2008 12:54 pm
by ahmedhalawa
Hello
Mr Combuster my problem is english and i'm very good in porgraming .
thanks very much Mr djmauretto.

Re: vga ?

Posted: Thu Nov 27, 2008 5:39 pm
by Combuster
my problem is english
I rest my case.