| 1133 | } |
| 1134 | |
| 1135 | void map_file(char *name,unsigned char **ptr,int *size) |
| 1136 | { |
| 1137 | FILE *f; |
| 1138 | f=fopen(name,"rb"); |
| 1139 | if (f==NULL) { printf("Cannot open file '%s'\n",name); abandon_ship(); } |
| 1140 | fseek(f,0,SEEK_END); |
| 1141 | *size=ftell(f); |
| 1142 | rewind(f); |
| 1143 | *ptr=malloc(*size); |
| 1144 | if (*ptr==NULL) { printf("Out of memory.\n"); abandon_ship(); } |
| 1145 | if (fread(*ptr,1,*size,f)!=(size_t)*size) |
| 1146 | { printf("File read error.\n"); abandon_ship(); } |
| 1147 | fclose(f); |
| 1148 | } |
| 1149 | |
| 1150 | void alpha8_fix_locpal(char *fname,char *alpha8,int *locpal) |
| 1151 | { |
no test coverage detected