Category : C Source Code
Archive   : BFONTC11.ZIP
Filename : FONTDEMO.C

 
Output of file : FONTDEMO.C contained in archive : BFONTC11.ZIP

#include
#include
#include
#include
#include

char vset[] = {4, 5, 6, 13, 14, 16, 18, 19, 0};
unsigned char DotPat[] = {0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55};
int mode;
unsigned maxcolors;

void main(int argc, char *argv[])
{
unsigned c, x, y, z;
int gd, gm, errcode;

if(argc < 2)
{
printf("\nUsage is: FONTDEMO #\n");
printf("Where # is the graphics mode number\n");
printf(" 4. CGA 320x200 4 color 5. CGA 320x200 2 color\n");
printf(" 6. CGA 640x200 2 color 13. EGA 320x200 16 color\n");
printf("14. EGA 640x200 16 color 16. EGA 640x350 16 color\n");
printf("18. VGA 640x480 16 color 19. VGA 320x200 256 color\n");
printf("MAKE SURE YOUR VIDEO CAN HANDLE THE MODE!!!\n");
exit(1);
}
mode = atoi(argv[1]);
if(strchr(vset, mode) == NULL)
{
printf("\nBad Video Mode!\n");
exit(1);
}
switch(mode){
case 4 :
case 5 :
case 6 :
c = 1;
if(mode == 5 || mode == 6)
maxcolors = 1;
else
maxcolors = 3;
break;
case 13 :
case 14 :
case 16 :
case 18 :
c = 14;
maxcolors = 15;
break;
case 19 :
c = 35;
maxcolors = 255;
}

_AH = 0;
_AL = mode;
geninterrupt(0x10);

SetBFonts();

x = 0;
y = 0;
while(y <= 100)
{
ColorBlock(x, y, 101, 1, c);
y += 4;
}
x = 0;
y = 0;
while(x <= 100)
{
ColorBlock(x, y, 1, 100, c);
x += 4;
}
c = 0;
x = y = 2;
for(z = 1; z <= 10; z++)
{
SetBFColor(BF8x8, c);
PrintBFAt(x, y, "Background Test");
x += 2;
y += 4;
++c;
if((c) > maxcolors)
c = 0;
}
getch();
if(mode < 13)
c = maxcolors;
else
c = 15;
MoveBFCursor(162, 10);
SetBFColor(BF8x8, c);
SetBFDir(BF8x8, DDown);
PrintBF("Print Up and Down");
SetBFDir(BF8x8, DAcross);
getch();
SetBFBgColor(BF8x8, 2);
PrintBFAt(150, 100, "With Background");
getch();
SetBFBgColor(BF8x8, Transparent);
if(mode >= 13)
{
SetBFColor(BF8x8, 7);
PrintBFAt(3, 110, "ROM 8x8 Font");
SetBFFont(BF8x14);
PrintBFAt(3, 120, "ROM 8x14 Font");
}
if(mode >= 18)
{
SetBFFont(BF8x16);
PrintBFAt(3, 140, "ROM 8x16 Font");
}
getch();
_AH = 0;
_AL = 3;
geninterrupt(0x10);
}


  3 Responses to “Category : C Source Code
Archive   : BFONTC11.ZIP
Filename : FONTDEMO.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/