VESA Video Modes: Difference between revisions

Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content deleted Content added
No edit summary
 
No edit summary
Line 5: Line 5:
You'll want to look in the VESA VBE docs for these functions:
You'll want to look in the VESA VBE docs for these functions:


;INT 0x10, AX=0x4F00
;__INT 0x10, AX=0x4F00__: Get Controller Info. This is the one that returns the array of all supported video modes.
: Get Controller Info. This is the one that returns the array of all supported video modes.
<verbatim>
<pre>
struct vbeControllerInfo {
struct vbeControllerInfo {
char signature[4]; // == "VESA"
char signature[4]; // == "VESA"
Line 19: Line 20:
v86_bios(0x10, {ax:0x4f00, es:SEG(vib), di:OFF(vib)},&out);
v86_bios(0x10, {ax:0x4f00, es:SEG(vib), di:OFF(vib)},&out);
if (out.ax!=0x004f) die("something wrong with VBE get info");
if (out.ax!=0x004f) die("something wrong with VBE get info");
</verbatim>
</pre>


;INT 0x10, AX=0x4F01
;__INT 0x10, AX=0x4F01__: Get Mode Info. Call this for each member of the mode array to find out the details of that mode.
: Get Mode Info. Call this for each member of the mode array to find out the details of that mode.


<pre>
<verbatim>


struct vbeModeInfo {
struct vbeModeInfo {
Line 49: Line 51:
short reserved2;
short reserved2;
};
};
</verbatim>
</pre>


;__INT 0x10, AX=0x4F02__: Set Video Mode. Call this with the mode number you decide to use.
;__INT 0x10, AX=0x4F02__: Set Video Mode. Call this with the mode number you decide to use.


!! Will it work with Bochs ?
== Will it work with Bochs ?==


For VBE to work in Bochs you need the "VGABIOS-lgpl" BIOS and have a version of Bochs that was compiled with the "--enable-vbe" option... See [Vesa Information in Bochs| Forum:6311] thread for more info
For VBE to work in Bochs you need the "VGABIOS-lgpl" BIOS and have a version of Bochs that was compiled with the "--enable-vbe" option... See [Vesa Information in Bochs| Forum:6311] thread for more info



!! How to pick the mode i wish ?
==How to pick the mode i wish ?==


Here's a sample code, assuming you have a VirtualMonitor already ... Basically, you will scan the 'modes list' referenced by the vbeInfoBlock.videomodes[] and then call 'get mode info' for each mode. You can then compare width, height and colordepth of each mode with the desired one.
Here's a sample code, assuming you have a VirtualMonitor already ... Basically, you will scan the 'modes list' referenced by the vbeInfoBlock.videomodes[] and then call 'get mode info' for each mode. You can then compare width, height and colordepth of each mode with the desired one.


<pre>
<verbatim>


UInt16 findMode(int x, int y, int d)
UInt16 findMode(int x, int y, int d)
Line 106: Line 109:
return best;
return best;
}
}
</verbatim>
</pre>

----
==See Also==
===Threads===
*[VESA, higher modes|Forum:6379] - Initial Thread, reply by Dreamsmith (aka DaidalosGuy)


[[Category:Video]]
Initial Thread: [VESA, higher modes|Forum:6379], reply by Dreamsmith (aka DaidalosGuy)