例如,我使用的是320x200x256图形(VGA(
unsigned char g_320x200x256[] =
{
/* MISC */
0x63,
/* SEQ */
0x03, 0x01, 0x0F, 0x00, 0x0E,
/* CRTC */
0x5F, 0x4F, 0x50, 0x82, 0x54, 0x80, 0xBF, 0x1F,
0x00, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x9C, 0x0E, 0x8F, 0x28, 0x40, 0x96, 0xB9, 0xA3,
0xFF,
/* GC */
0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
0xFF,
/* AC */
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
0x41, 0x00, 0x0F, 0x00, 0x00
};
WriteRegisters(g_320x200x256);
那么,如何使用其他尺寸和16M颜色的图形呢
请帮帮我。:(
EDIT
这是WriteRegister
功能
void VideoGraphicsArray::WriteRegisters(uint8_t* registers)
{
// misc
miscPort.Write(*(registers++));
// sequencer
for(uint8_t i = 0; i < 5; i++)
{
sequencerIndexPort.Write(i);
sequencerDataPort.Write(*(registers++));
}
// cathode ray tube controller
crtcIndexPort.Write(0x03);
crtcDataPort.Write(crtcDataPort.Read() | 0x80);
crtcIndexPort.Write(0x11);
crtcDataPort.Write(crtcDataPort.Read() & ~0x80);
registers[0x03] = registers[0x03] | 0x80;
registers[0x11] = registers[0x11] & ~0x80;
for(uint8_t i = 0; i < 25; i++)
{
crtcIndexPort.Write(i);
crtcDataPort.Write(*(registers++));
}
// graphics controller
for(uint8_t i = 0; i < 9; i++)
{
graphicsControllerIndexPort.Write(i);
graphicsControllerDataPort.Write(*(registers++));
}
// attribute controller
for(uint8_t i = 0; i < 21; i++)
{
attributeControllerResetPort.Read();
attributeControllerIndexPort.Write(i);
attributeControllerWritePort.Write(*(registers++));
}
attributeControllerResetPort.Read();
attributeControllerIndexPort.Write(0x20);
}
您使用的代码是VGA配置寄存器的值转储。最快的时钟发生器VGA必须提供大约28MHz的运行频率。因此,您不能每秒输出1920x1080x60=124 416 000像素,而只能每秒输出约28 000 000像素。这就是为什么您找不到配置寄存器所需的值。