tb1/tb1_snes/tools/dump_font.c
Vince Weaver dbaf404ec3 snes: rename tb_snes to tb1_snes
I kept typing it wrong anyway, and hey, git makes rename easy
2013-01-22 09:53:01 -05:00

37 lines
589 B
C

/* dumps a 2bpp snes tileset to ASCII asm suitable for including */
#include <stdio.h>
int main(int argc, char **argv) {
int i,j,k;
unsigned char temp;
for(i=0;i<256;i++) {
if ((i>=0x20) && (i<127))
printf("Char : 0x%x %c\n",i,i);
else
printf("Char : 0x%x\n",i);
for(j=0;j<16;j++) {
if (fread(&temp,1,1,stdin)<1) return -1;
printf("0x%02x : ",temp);
for(k=0;k<8;k++) {
if ((1<<(7-k))&temp) {
printf("#");
}
else {
printf(" ");
}
}
printf("\n");
}
}
return 0;
}