home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
QBasic & Borland Pascal & C
/
Delphi5.iso
/
C
/
Samples
/
C-ASM_VI.ARJ
/
PROGC.ZIP
/
PROGC051.C
< prev
next >
Wrap
Text File
|
1988-05-15
|
2KB
|
56 lines
/************************************************************************/
/* Display 512 different characters at a time */
/************************************************************************/
print_512_chars()
{
#define MONO 5
#define VMONO 7
#define ON 1 /* Flag values */
#define OFF 0
static char buffer[256][32];/* Buffer for char gen */
int i, j;
/*--- Set default text mode */
if (get_display_type() == VMONO ||
get_display_type() == MONO) set_mode(7);
else set_mode(3);
/*--- Download a second 256 character set */
read_char_gen(buffer); /* Read old character generator */
for (i = 0; i < 255; i++) /* Create a new char set */
for (j = 0; j < 4; j++) /* from the old by 'italisizing'*/
{
buffer[i][j] = buffer[i][j] >> 1;
buffer[i][j+10] = buffer[i][j+10] << 1;
}
/* Download new char gen */
write_char_gen(buffer, 512, 256);
/*--- Enable the 512 character set generation */
enable_second_set(); /* Enable 512 char set */
/*--- Display 512 characters and attributes */
for (i = 0; i < 256; i++) /* Display chars 0 - 255 */
{
write_attribute(i/64, i%64, 0, 7);
write_char(i, i/64, i%64);
}
for (i = 0; i < 256; i++) /* Display chars 256-512 */
{
write_attribute(4 + i/64, i%64, 0,15);
write_char(i, 4 + i/64, i%64);
}
/*--- Wait for <Enter> and then disable the second character set*/
getchar();
disable_second_set();
}