(Look-up Table Data Register - LTDR) - 2


for(j = 0; j < 4; j++) {

for(i = 0; i < 64; i++) {

(color_table[i+j*64]).red =

(j == 0) ? i : 0;

(color_table[i+j*64]).green =

(j == 1) ? i : (j == 3) ? i : 0;

(color_table[i+j*64]).blue =

(j == 2) ? i : (j == 3) ? i : 0;

}

}


// 13h (256 )

// VGA Super VGA

SetVideoMode( 0x13 );


// color_table

ptr = (unsigned char far*) &color_table[0];

seg_table = FP_SEG(ptr);

off_table = FP_OFF(ptr);


//

SetVgaDAC(seg_table,off_table);


// ptr

ptr = (unsigned char far*) (FP_MAKE(0xA000, 0x0));


// ,

//

for(y_num = 0; y_num < 200; y_num++) {

for(x_num = 0; x_num < 320; x_num++) {

*ptr = (unsigned char) x_num;

ptr++;

}

}


//

getch();


// ,

//

for(i=0;i<320;i++){

for(iii=0;iii<256;iii++) {


(color_table[iii]).red =

((color_table[iii]).red>6) ?

color_table[iii].red-1 : 1;


(color_table[iii]).green =

((color_table[iii]).green>6) ?

color_table[iii].green-1 : 1;


(color_table[iii]).blue =