992c7150fbd2650184f92df4a9180f1fe34f4765
[h316.git] / use.c
1
2 extern char fontdata_8x16[4096];
3
4 #include <stdio.h>
5
6 signed short cb (unsigned char a, unsigned char b){
7 short result=a<<8;
8 result+=b;
9 return result;
10 }
11
12 char tw(char in){
13 char out=0;
14 int c;
15 for (c=0; c<8; c++){
16 if (in&(1<<c)) out|=0x80>>c;
17 }
18 return out;
19 }
20
21 int main (int argc, char ** argv){
22 int c;
23 int a;
24 for (c=0; c<4096; c++) fontdata_8x16[c]=tw(fontdata_8x16[c]);
25 // printf("\tSUBR\tFONT\n");
26 for (a=0; a<256; a++){
27 char * fd =fontdata_8x16 + (a<<4);
28 if (a==0) printf("FONT\t"); else printf("\t");
29 printf("DEC\t%i,%i,%i,%i\n\tDEC\t%i,%i,%i,%i\n",
30 cb(fd[0],fd[1]),cb(fd[2],fd[3]),cb(fd[4],fd[5]), cb(fd[6],fd[7]),
31 cb(fd[8],fd[9]),cb(fd[10],fd[11]),cb(fd[12],fd[13]), cb(fd[14],fd[15]));
32 }
33 printf("\tEND\n");
34 return 0;
35 }
36