vga ?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
ahmedhalawa
Member
Member
Posts: 28
Joined: Wed Jul 02, 2008 9:28 am

vga ?

Post 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 :|
Attachments
untitled.rar
(674 Bytes) Downloaded 63 times
User avatar
kmtdk
Member
Member
Posts: 263
Joined: Sat May 17, 2008 4:05 am
Location: Cyperspace, Denmark
Contact:

Re: vga ?

Post 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
well, what to say, to much to do in too little space.
when it goes up hill, increase work, when it goes straight, test yourself but when going down, slow down.
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: vga ?

Post 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.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
User avatar
ahmedhalawa
Member
Member
Posts: 28
Joined: Wed Jul 02, 2008 9:28 am

Re: vga ?

Post 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
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: vga ?

Post by Love4Boobies »

If you already used bank switching then what's the problem?
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: vga ?

Post by Combuster »

Read the specifications and consider doing something other than OS development since you don't appear to be ready for it.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
djmauretto
Member
Member
Posts: 116
Joined: Wed Oct 22, 2008 2:21 am
Location: Roma,Italy

Re: vga ?

Post 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:
User avatar
ahmedhalawa
Member
Member
Posts: 28
Joined: Wed Jul 02, 2008 9:28 am

Re: vga ?

Post by ahmedhalawa »

Hello
Mr Combuster my problem is english and i'm very good in porgraming .
thanks very much Mr djmauretto.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: vga ?

Post by Combuster »

my problem is english
I rest my case.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply