( ) - 3


ptr_vbuf = vbuf= (VIDEOBUF _far *)

FP_MAKE(GetVideoBuf((unsigned char) vmode ),0);


// ,

//

for( background=0; background<16; background++)

{

for( foreground=0; foreground<16; foreground++)

{

char_attr =

(unsigned char)((background<<4) | foreground);


sprintf( szText, "%02X", char_attr );


// .

//

ptr_vbuf->chr =

szText[0]; ptr_vbuf->attr = char_attr;


ptr_vbuf++;


ptr_vbuf->chr =

szText[1]; ptr_vbuf->attr = char_attr;


ptr_vbuf++;

}

ptr_vbuf = vbuf = vbuf + GetColumn();

}


//

getch();


// 3

SetVideoMode(3);


return 0;

}


//======================================================

//

// (

// )

//======================================================

int GetVideoBuf(int vmode) {


unsigned vbase;

unsigned adr_CRT;

unsigned high;

unsigned low;

unsigned offs;


//

// 0xb000 0xb800

vbase = (vmode == 7) ? 0xb000 : 0xb800;


//

adr_CRT = *(unsigned _far *)(FP_MAKE(0x40,0x63));


//

outp(adr_CRT,0xc);