/* syntax: fontdump videobiosdump.rom scans for vga fonts of size 8x8, 8x14 and 8x16 and dumps them to files which you can use in the console like this: setfont or consolechars -f 8x16.fnt gurkan@linuks.mine.nu, www.linuks.mine.nu character 0 and 255 are "\0" meaning we have to look for a pattern like this \0\0\0\0\\0\0\0\0\ + 253*8 bytes + \0\0\0\0\\0\0\0\0\ if we want a 8x8 font */ #include #define CHARA 65 char* ID_FONT8="\0\0\0\0\0\0\0\0"; char* ID_FONT14="\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; char* ID_FONT16="\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; FILE* f; unsigned char buffer[256*1024]; char filename[32]; long filesize(FILE* stream) { long ret; long savedpos=ftell(stream); fseek(stream,0L,SEEK_END); ret = ftell(stream); fseek(stream,savedpos,SEEK_SET); return ret; } long dd(long skip, long count) { fseek(f,skip,SEEK_SET); return (fread(buffer,count,1,f)); } void save(char* filename, long size, long offset) { FILE* out; out=fopen(filename,"w"); fwrite(buffer+offset,size,1,out); fclose(out); } void show(long offset, int character, int fontsize) { int x,y; int bittab[8]={1,2,4,8,16,32,64,128}; for(x=0; x