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.
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.
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.
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 ]
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
"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 ]