Bochs VBE Extensions: Difference between revisions

Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content deleted Content added
Candy (talk | contribs)
Candy (talk | contribs)
Fixed up the misc. section to be full of content.
Line 100: Line 100:
The default palette DAC is a 3x6 bit dac; it returns a value between 0 and 63 for each color. Setting the VBE_DISPI_8BIT_DAC bit in VBE_DISPI_INDEX_ENABLE changes this to a 3x8 bit dac and converts the palette to the appropriate values. Resetting the bit moves them back again.
The default palette DAC is a 3x6 bit dac; it returns a value between 0 and 63 for each color. Setting the VBE_DISPI_8BIT_DAC bit in VBE_DISPI_INDEX_ENABLE changes this to a 3x8 bit dac and converts the palette to the appropriate values. Resetting the bit moves them back again.


=== Miscellaneous ===
=== Virtual display ===
The Bochs adapter allows a virtual display that is larger than the physical one. The video memory is normally your screen width wide and at least as high as your vertical screen size, the height. The actual video memory is larger and the remainder is seen as a vertical extension.
[TODO: check and describe VBE_DISPI_INDEX_VIRT_WIDTH/HEIGHT, VBE_DISPI_INDEX_X/Y_OFFSET]

Having this as a horizontal extension can be very useful. You can use this to make horizontal and vertical scrolling effects very cheap. You can also make a virtual display, double buffering and lots of other ideas.

The mechanism is used that the memory is a virtual display starting at location (0,0) with a size specified by the virtual width. The height is implicitly as large as it can be within the video memory. Suppose you set the virtual width to be 1024 in a 32-bpp mode (4 bytes per pixel) on a 16-meg Bochs card. That makes the vertical height 4096.

You can then specify where the video card should start reading the memory using the X and Y offset.

The variables taking care of this:
* VBE_DISPI_INDEX_VIRT_WIDTH is the virtual width.
* VBE_DISPI_INDEX_VIRT_HEIGHT is the virtual height, currently not implemented. Reasoning is above.
* VBE_DISPI_INDEX_X_OFFSET is the X offset for displaying.
* VBE_DISPI_INDEX_Y_OFFSET is the Y offset for displaying.


=== Example code ===
=== Example code ===