home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GEMini Atari
/
GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso
/
files
/
bbs
/
print_sc
/
prepare.c
next >
Wrap
C/C++ Source or Header
|
1990-01-01
|
3KB
|
111 lines
#include <stdio.h>
#include <tos.h>
#define MAXCHAR 98
void ausgabe_der_zeichen(void);
int konvertierung(void);
int bitmuster_lesen(void);
void main();
void ausgabe_der_zeichen()
{ int i;
putchar(27);
putchar('E');
for (i = 0; i < MAXCHAR; i++)
{ if (i < MAXCHAR-7)
putchar(i+32);
else
switch (i)
{ case 91 : putchar('ä'); break;
case 92 : putchar('Ä'); break;
case 93 : putchar('ö'); break;
case 94 : putchar('Ö'); break;
case 95 : putchar('ü'); break;
case 96 : putchar('Ü'); break;
case 97 : putchar('ß'); break;
default : putchar(' ');
}
if (!((i+1)%64))
putchar('\n');
}
putchar('\n');
}
int bitmuster_lesen()
{ FILE *handle;
int i,j,k;
unsigned char *screen = Logbase();
if(!(handle = fopen("bitmustr.c","w+")))
{ printf("\nFehler beim Öffnen der Datei Bitmuster.c!\n");
return -1;
}
fprintf(handle,"#define MAXCHAR %d\n",MAXCHAR),
fprintf(handle,"unsigned char bit_muster[MAXCHAR][16]={");
for (i = 0; i < 4; i++)
for (j = 0; (j < 64) && ((i << 6)+ j < MAXCHAR); j++)
{
fprintf(handle,"\n {");
for (k = 0 ;k < 16; k++)
{
fprintf(handle,"%d",*(screen+j+1280*i+80*k));
if (k<15)
fprintf(handle,",");
}
fprintf(handle,"}");
if ((j<63) || (i<3)) fprintf(handle,",");
}
fprintf(handle,"\n };\n");
fclose(handle);
return 0;
}
int konvertierung()
{ FILE *handle;
int i;
if (!(handle = fopen ("konvert.c","w+")));
{ printf("\nFehler beim Öffnen der Datei KONVERT.C !\n");
}
fprintf(handle,"unsigned char konv_liste[MAXCHAR][11] ");
fprintf(handle," = {\n ");
for (i=0;i<MAXCHAR;i++)
{
switch (i)
{ case 91 : fprintf(handle,"{7,27,82,2,123,27,82,0,0,0,0}");
break;
case 92 : fprintf(handle,"{7,27,82,2, 91,27,82,0,0,0,0}");
break;
case 93 : fprintf(handle,"{7,27,82,2,124,27,82,0,0,0,0}");
break;
case 94 : fprintf(handle,"{7,27,82,2, 92,27,82,0,0,0,0}");
break;
case 95 : fprintf(handle,"{7,27,82,2,125,27,82,0,0,0,0}");
break;
case 96 : fprintf(handle,"{7,27,82,2, 93,27,82,0,0,0,0}");
break;
case 97 : fprintf(handle,"{7,27,82,2,126,27,82,0,0,0,0}");
break;
default : fprintf(handle,"{1,%u,0,0,0,0,0,0,0,0,0}",i+32);
}
if (i<MAXCHAR-1)
fprintf(handle,",\n ");
}
fprintf(handle,"\n };\n");
fclose(handle);
return 0;
}
void main()
{ ausgabe_der_zeichen();
if (!bitmuster_lesen() && !konvertierung())
printf ("\nIncludefiles erzeugt \n");
else
printf("\nErzeugung der Includefiles abgebrochen\n");
getchar();
exit(0);
}