added u32 type
[my-code/arm.git] / betty / font2b.c
index fd88252..5ce243a 100644 (file)
@@ -21,6 +21,8 @@
 #include <fcntl.h>
 #include <unistd.h>
 
+typedef unsigned int u32;
+
 // put your font data here!
 #include "/usr/src/linux/drivers/video/console/font_pearl_8x8.c"
 
@@ -49,7 +51,7 @@ int main(int argc,char **argv) {
        }
 
        if(stat==CHAR)
-               printf("const unsigned char default_font[%d]={\n",256*8*2);
+               printf("const unsigned char default_font[%d]={\n",256*8);
 
        for(font=0;font<=0xff;font++) {
 
@@ -66,19 +68,16 @@ int main(int argc,char **argv) {
                for(col=0;col<8;col++) {
                        buf=0;
                        for(row=0;row<8;row++)
-                               buf|=(font_data[font*8+row]&(1<<(7-col)));
+                               buf|=(((font_data[font*8+row]>>(7-col))&1)<<row);
                        if(stat==CHAR) {
-                               if(!(col%4))
+                               if(col==0)
                                        printf("\t");
-                               printf("0x%02x,0x%02x",buf,buf);
+                               printf("0x%02x",buf);
                                if((font!=0xff)|(col!=7))
                                        printf(",");
-                               if(col==3)
-                                       printf("\n");
                        }
                        else {
                                write(fd,&buf,1);
-                               write(fd,&buf,1);
                        }
                }
                if(stat==CHAR)