char far * font;
void setX320x240 () {
static int CRTCTable 0 =
{
0x0D06, //vertical total
0x3E07, // overflow (bit 8 of vertical counts)
0x4109, // cell height (2 to double-scan)
0xEA10, II vert sync start
0xAC11, // vert sync end and protect cr0-cr7
0xDF12, //vertical displayed
0x0014, // turn off dword mode
0xE715, //vert blank start
0x0616, //vert blank end
0xE317 // turn on byte mode
};
setVideoMode (0x13 );
pageBase = OxAOOO; bytesPerLine = 80;
writeReg ( EGA_SEQUENCER, 4, 6 ); writeReg ( EGA_CRTC, 0x17, ОхЕЗ ); writeReg ( EGA_CRTC, 0x14, 0 );
writeReg ( EGA_SEQUENCER, 0, 1 ); // synchronous reset outportb ( 0хЗС2, ОхЕЗ ); // select 25 MHz dot clock
// & 60 Hz scan rate // restart sequencer
writeReg ( EGA_SEQUENCER, 0, 3 );
writeReg ( EGA_CRTC, 0x11, ReadReg (EGA_CRTC, 0x11) & 0x7F );
for (int i = 0; i < sizeof (CRTCTable) / sizeof (int); i++ ) outport ( EGA_CRTC, CRTCTable [i]);
// clear screen
writeReg ( EGA_SEQUENCER, EGA_MAP_MASK, OxOF ); Jmemset ( MK_FP ( pageBase, 0 ), '\0\ OxFFFF );
void setX360x480 ()
i
Компьютерная графика. Полигональные модели
static int CRTCTabie [] =
{
0x6b00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05,
0x0D06, // vertical total
0x3E07, // overflow (bit 8 of vertical counts)
0x4009, // cell height (2 to double-scan)
0xEA10, //vert sync start
0xAC11, // vert sync end and protect cr0-cr7
0xDF12, // vertical displayed
0x2D13,
0x0014, // turn off dword mode 0xE715, //vert blank start 0x0616, // vert blank end 0xE317 // turn on byte mode
};
setVideoMode (0x13 );
pageBase = OxAOOO; bytesPerLine = 90;
writeReg ( EGA_SEQUENCER, 4, 6 ); writeReg ( EGA__CRTC, 0x17, 0xE3 ); writeReg ( EGA_CRTC, 0x14, 0 );
writeReg ( EGA_SEQUENCER, 0, 1 ); // synchronous reset outportb ( 0x3C2, 0xE7 ); // select 25 MHz dot clock
// & 60 Hz scan rate // restart sequencer
writeReg ( EGA_SEQUENCER, 0, 3 );
writeReg ( EGA_CRTC, 0x11, ReadReg (EGA_CRTC, 0x11) & 0x7F );
for (int i = 0; i < sizeof (CRTCTabie) / sizeof (int); i++ ) outport ( EGA_CRTC, CRTCTabie [i]);