| 1423 | } |
| 1424 | |
| 1425 | char *read_alpha8() |
| 1426 | { |
| 1427 | char *buf; |
| 1428 | FILE *f; |
| 1429 | int len; |
| 1430 | |
| 1431 | f=fopen("alpha8.dat","rt"); |
| 1432 | if (f==NULL) { |
| 1433 | printf("No alpha data file.\n"); |
| 1434 | return ""; |
| 1435 | } |
| 1436 | fseek(f,0,SEEK_END); |
| 1437 | len=ftell(f); |
| 1438 | rewind(f); |
| 1439 | buf=malloc(len+2048); /* safety margin */ |
| 1440 | if (buf==NULL) { printf("Insufficient memory.\n"); abandon_ship(); } |
| 1441 | len=fread(buf,1,len+2047,f); |
| 1442 | fclose(f); |
| 1443 | printf("Backup alpha data loaded.\n"); |
| 1444 | buf[len]=0; |
| 1445 | return buf; |
| 1446 | } |
| 1447 | |
| 1448 | unsigned char *bmp_to_fsh() |
| 1449 | { |
no test coverage detected