Im experimenting with VGA Mode 12h. Its not using the BIOS ints so it is possible that the initial setting in a register might be at fault.. Im not sure though.
The problem comes when rendering to the display. Here is my current code. It is supposed to fill video display with a light blue color. It works fine in Bochs (tested in two versions) but not VirtualPC...which is what the problem is.
In VirtualPC, this is the result (Warning: a little straining on the eyes): Link to Image
I am new to this mode so I am not quite sure where to look for in this. Does anyone have any suggestions that might cause something like this?
Here is my current test code... Im not sure if Im doing something wrong or not...
Code: Select all
PBYTE VideoMemory = 0xa0000;
//! select graphics bit mask register
outportb (0x3ce, 8);
//! mask all planes
outportb (0x3cf, 0xff);
//! select graphics mode register
outportb (0x3ce, 5);
//! select write mode 2 (replicate bits 0-3 of data across all 4 planes)
outportb (0x3cf, 2);
//! write pixels...
for (x=0; x<(640/8) *479; x++)
VideoMemory [x] = 0x9; //! write the pixel (light blue)