Bochs VBE Extensions: Difference between revisions

Jump to navigation Jump to search
m
[unchecked revision][unchecked revision]
(→‎Memory layout of video modes: Adding information)
Line 54:
=== Memory layout of video modes ===
 
In all modes the first byte represents the top left of the screen. A formula to calculate the video memory offset from a pixel coordinate is: <tt>offset = (Y * X-resolution + X) * <some-factor></tt>. The factor varies using the different bit depths. The 4 and 8 BPP modes are palette modes. Read more about programming the attribute controller and DAC palettes in [[:Category:VGA|VGA documents]]. The other modes are using the colour value directly.
 
In 4 BPP you have 16 colours. The pixel colour is used an index to the attribute controller, which again points to the DAC, which in turn gives an 18 bit colour (6 bits each for red, green and blue) that is shown. The memory is layout like this: The first byte is the colour bit 0 of pixels 0-7. The second byte is the colour bit 1 of pixels 0-7, and so forth. You can access 8 pixels at a time using longwords (32 bits).
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu